From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web11.38224.1602501662130028720 for ; Mon, 12 Oct 2020 04:21:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=Gn6x7lTp; spf=pass (domain: nuviainc.com, ip: 209.85.128.68, mailfrom: graeme@nuviainc.com) Received: by mail-wm1-f68.google.com with SMTP id d81so16848148wmc.1 for ; Mon, 12 Oct 2020 04:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oDCcc7oStriAIFlyeZTIBbtcIrm5CwQ5NJ/QSQ+VDqw=; b=Gn6x7lTpyBLjsPnnFAcUjMYCVoMH/nOTL6DQ8h3mz3tuz74CpGFS2v6MILT+5zxlh+ Mttcnc735TFjUfbUGIVLI6/jCdG+5Lljx92oexDxCO2iNYJ5XwBpbofB9geHxjyvG2KU FBE/dplUzvmAaW1/ZDn3v2+FgQulUttM5zj/5HH7cS0vL+w/1LGtF5qTvddviwRvOn2s zkT6M1UeUIIpG9LmI8hvggEqATzwD7BBb/9FLljUYHb0uVSZj5goa4HW75ZWCpHj/75g q5S0Z9+ihRW3p9JKt9UbCBMJKhENN9AbpYLJdf3elrn4UB31pLT5nPNTTZ9lct8iDU9/ zotA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oDCcc7oStriAIFlyeZTIBbtcIrm5CwQ5NJ/QSQ+VDqw=; b=Kf2rj0PQTKprZ7FbdmveKGou0bRc8IHLGX4Uli6X8mrmPhPhhizQQbzMvom4GyANtD qbk95LuQrOp32QRzZClq4D8DxW8WPiPmJkSjaQSkkUPLh5g6Nit4GhtKw3EEof61mx9y iJFl20L+C84/gvaprcl3bdes12u/dwZ25IgJgrh5hrJMqm5AeC7o8VUnpT/4Ivgx5m80 aED+iAfoLom5jKCCTqIy+BTYMzPfcSJgB8sZefyeyZKhcIy49H+eSzgJhXD2/ADvFGFR Bn2xiG3N6j78a2p2ukdolfhf2uMnlozeVZoOgzDFfVp4jiK906TbYMNL6L7ZuEWptGIc BLVg== X-Gm-Message-State: AOAM530jDLJu4ZI1niXOWJ2lm7ZIpYO8TVFjum6BLwYg3FCygEyycEq7 YbD98Bl7RIjkNgW3RdtP4Akt2A== X-Google-Smtp-Source: ABdhPJz3B94UHAbOM+ej5MBUekZU8pQv+iev9nm5ZIfchDHkf5yFYwx06y7vueWVv+bB0cl1ung0Nw== X-Received: by 2002:a1c:770e:: with SMTP id t14mr10354832wmi.34.1602501660502; Mon, 12 Oct 2020 04:21:00 -0700 (PDT) Return-Path: Received: from xora-monster ([2a02:8010:64d6::1d89]) by smtp.gmail.com with ESMTPSA id n66sm22763130wmb.35.2020.10.12.04.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 04:20:59 -0700 (PDT) Date: Mon, 12 Oct 2020 12:20:58 +0100 From: "Graeme Gregory" To: Shashi Mallela Cc: leif@nuviainc.com, ard.biesheuvel@arm.com, devel@edk2.groups.io Subject: Re: [PATCH v1 1/1] Silicon/Qemu/Sbsa: Add SBSA-wdt entry to GTDT Message-ID: <20201012112058.pszafzo3qaxmg256@xora-monster> References: <20201008203136.94393-1-shashi.mallela@linaro.org> <20201008203136.94393-2-shashi.mallela@linaro.org> MIME-Version: 1.0 In-Reply-To: <20201008203136.94393-2-shashi.mallela@linaro.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 08, 2020 at 04:31:36PM -0400, Shashi Mallela wrote: > SBSA generic watchdog timer structure entry has been added > to GTDT table as per BSAv0.9. > This enables acpi detection of wdt in qemu sbsa platform > > Signed-off-by: Shashi Mallela > --- > Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc | 87 ++++++++++++++------ > 1 file changed, 62 insertions(+), 25 deletions(-) > > diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc > index d16778e01a5c..e26047173744 100644 > --- a/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc > +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Gtdt.aslc > @@ -24,42 +24,79 @@ > #define SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF > #endif > > -#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE > +#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE > #define GTDT_TIMER_LEVEL_TRIGGERED 0 > -#define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY > +#define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY > #define GTDT_TIMER_ACTIVE_HIGH 0 > > #define GTDT_GTIMER_FLAGS (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED) > > +#define SBSA_PLATFORM_WATCHDOG_COUNT 1 > +#define SBSA_PLATFORM_TIMER_COUNT (SBSA_PLATFORM_WATCHDOG_COUNT) > + > +#define SBSAQEMU_WDT_REFRESH_FRAME_BASE 0x50010000 > +#define SBSAQEMU_WDT_CONTROL_FRAME_BASE 0x50011000 > +#define SBSAQEMU_WDT_IRQ 44 > + > +#define GTDT_WDTIMER_EDGE_TRIGGERED EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE > +#define GTDT_WDTIMER_LEVEL_TRIGGERED 0 > +#define GTDT_WDTIMER_ACTIVE_LOW EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POLARITY > +#define GTDT_WDTIMER_ACTIVE_HIGH 0 > + > +#define GTDT_WDTIMER_FLAGS (GTDT_WDTIMER_ACTIVE_HIGH | GTDT_WDTIMER_LEVEL_TRIGGERED) > + > +#define EFI_ACPI_6_3_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( \ > + RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \ > + WatchdogTimerGSIV, WatchdogTimerFlags) \ > + { \ > + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG, \ > + sizeof(EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \ > + EFI_ACPI_RESERVED_WORD, \ > + RefreshFramePhysicalAddress, \ > + ControlFramePhysicalAddress, \ > + WatchdogTimerGSIV, \ > + WatchdogTimerFlags \ > + } > + > #pragma pack (1) > > typedef struct { > - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; > - } GENERIC_TIMER_DESCRIPTION_TABLE; > + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; > + EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE Gwdt; > + } GENERIC_TIMER_DESCRIPTION_TABLES; > > #pragma pack () > > - GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { > - { > - SBSAQEMU_ACPI_HEADER( > - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, > - GENERIC_TIMER_DESCRIPTION_TABLE, > - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION > - ), > - SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress > - 0, // UINT32 Reserved > - FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1TimerGSIV > - GTDT_GTIMER_FLAGS, // UINT32 SecurePL1TimerFlags > - FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1TimerGSIV > - GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1TimerFlags > - FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerGSIV > - GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerFlags > - FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2TimerGSIV > - GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags > - 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePhysicalAddress > - 0, // UINT32 PlatformTimerCount > - 0 > - }, > + GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = { > + { > + SBSAQEMU_ACPI_HEADER( > + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, > + GENERIC_TIMER_DESCRIPTION_TABLES, > + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION > + ), > + SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress > + 0, // UINT32 Reserved > + FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1TimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 SecurePL1TimerFlags > + FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1TimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1TimerFlags > + FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerFlags > + FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2TimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags > + 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePhysicalAddress > + SBSA_PLATFORM_TIMER_COUNT, // UINT32 PlatformTimerCount > + sizeof(EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE), > + // UINT32 PlatformTimerOffset > + 0, // UINT32 VirtualPL2TimerGSIV > + 0 // UINT32 VirtualPL2TimerFlags > + }, > + EFI_ACPI_6_3_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( > + SBSAQEMU_WDT_REFRESH_FRAME_BASE, > + SBSAQEMU_WDT_CONTROL_FRAME_BASE, > + SBSAQEMU_WDT_IRQ, > + GTDT_WDTIMER_FLAGS > + ) > }; > Seems to be a lot of unneccessary changes here because the indentation was changed? Can you minimise the patch please. Thanks Graeme > // Reference the table being generated to prevent the optimizer from removing the > -- > 2.18.4 >