From: Evan Lloyd evan.lloyd@arm.com
The aim of this patch set is to fix the GTDT description of the WatchDog interrupt mode. An extra patch is included that merely tidies the code format before the real fix is applied. The resultant code is available for examination at: https://github.com/EvanLloyd/OpenPlatformPkg/tree/645_gtdt_v1
Evan Lloyd (1): Platforms/Arm/Juno: Tidy GTDT code before change.
Girish Pathak (1): Platforms/ARM/Juno: Fix Watchdog Timer interrupt mode
Platforms/ARM/Juno/AcpiTables/Gtdt.aslc | 116 ++++++++++---------- 1 file changed, 61 insertions(+), 55 deletions(-)
From: Evan Lloyd evan.lloyd@arm.com
There is no funtional modification in this change. As preparation for a change, the code formatting is tidied up. This is to prevent mixing formatting changes with functional ones. Note: This also enables indent to be used to format the new code.
Change-Id: Ief57ea912c3a8cd106daf273970fee0d565b1609 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Evan Lloyd evan.lloyd@arm.com --- Platforms/ARM/Juno/AcpiTables/Gtdt.aslc | 115 ++++++++++---------- 1 file changed, 60 insertions(+), 55 deletions(-)
diff --git a/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc b/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc index 5e2daf9abb8344ff121dace4fa827838b10ac287..afffd4ac8e92888a554f60dda926c64132976229 100644 --- a/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc +++ b/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc @@ -25,10 +25,12 @@
// Note: We could have a build flag that switches between memory mapped/non-memory mapped timer #ifdef SYSTEM_TIMER_BASE_ADDRESS - #define GTDT_GLOBAL_FLAGS (GTDT_GLOBAL_FLAGS_MAPPED | GTDT_GLOBAL_FLAGS_LEVEL) +# define GTDT_GLOBAL_FLAGS (GTDT_GLOBAL_FLAGS_MAPPED \ + | GTDT_GLOBAL_FLAGS_LEVEL) #else - #define GTDT_GLOBAL_FLAGS (GTDT_GLOBAL_FLAGS_NOT_MAPPED | GTDT_GLOBAL_FLAGS_LEVEL) - #define SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF +# define GTDT_GLOBAL_FLAGS (GTDT_GLOBAL_FLAGS_NOT_MAPPED \ + | GTDT_GLOBAL_FLAGS_LEVEL) +# define SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF #endif
#define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE @@ -39,63 +41,66 @@ #define GTDT_GTIMER_FLAGS (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
#ifdef ARM_JUNO_ACPI_5_0 - EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { - ARM_ACPI_HEADER( - EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, - EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE, - EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION - ), - SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress - GTDT_GLOBAL_FLAGS, // UINT32 GlobalFlags - 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 - }; +EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { + ARM_ACPI_HEADER (EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE, + EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION), + SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress + GTDT_GLOBAL_FLAGS, // UINT32 GlobalFlags + 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 +}; #else - #pragma pack (1) +# pragma pack (1)
- typedef struct { - EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; -#if (JUNO_WATCHDOG_COUNT != 0) - EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE Watchdogs[JUNO_WATCHDOG_COUNT]; -#endif - } GENERIC_TIMER_DESCRIPTION_TABLE; +typedef struct { + EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; +# if (JUNO_WATCHDOG_COUNT != 0) + EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE + Watchdogs[JUNO_WATCHDOG_COUNT]; +# endif +} GENERIC_TIMER_DESCRIPTION_TABLE;
- #pragma pack () +# pragma pack ()
- GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { - { - ARM_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 - JUNO_WATCHDOG_COUNT, // UINT32 PlatformTimerCount - sizeof (EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 PlatfromTimerOffset - }, +GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { + { + ARM_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 + JUNO_WATCHDOG_COUNT, // UINT32 PlatformTimerCount + sizeof (EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 PlatfromTimerOffset + }, #if (JUNO_WATCHDOG_COUNT != 0) - { - EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( - FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 93, 0), - EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( - FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 94, EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER) - } + { + EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( + FixedPcdGet32 (PcdGenericWatchdogRefreshBase), + FixedPcdGet32 (PcdGenericWatchdogControlBase), + 93, + 0), + EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( + FixedPcdGet32 (PcdGenericWatchdogRefreshBase), + FixedPcdGet32 (PcdGenericWatchdogControlBase), + 94, + EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER) + } #endif }; #endif
From: Girish Pathak girish.pathak@arm.com
The SBSA Generic Watchog Timer interrupt is edge triggered. However the interrupt setting in the GTDT ACPI table was not specified, defaulting to a level trigger interrupt. This patch configures the ACPI interrupt description as edge triggered.
Change-Id: Id6767d318519da7e141a55b7bacd5ef291f0a9c9 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Girish Pathak girish.pathak@arm.com Signed-off-by: Evan Lloyd evan.lloyd@arm.com --- Platforms/ARM/Juno/AcpiTables/Gtdt.aslc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc b/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc index afffd4ac8e92888a554f60dda926c64132976229..79675d37462b3827212eb66b700b00ac0e107665 100644 --- a/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc +++ b/Platforms/ARM/Juno/AcpiTables/Gtdt.aslc @@ -94,12 +94,13 @@ GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = { FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 93, - 0), + EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE), EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), 94, - EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER) + (EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER + | EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE)) } #endif };
On Wed, Nov 16, 2016 at 09:43:09PM +0000, evan.lloyd@arm.com wrote:
From: Evan Lloyd evan.lloyd@arm.com
The aim of this patch set is to fix the GTDT description of the WatchDog interrupt mode. An extra patch is included that merely tidies the code format before the real fix is applied. The resultant code is available for examination at: https://github.com/EvanLloyd/OpenPlatformPkg/tree/645_gtdt_v1
Series looks good to me
Reviewed-by: Graeme Gregory graeme.gregory@linaro.org
Evan Lloyd (1): Platforms/Arm/Juno: Tidy GTDT code before change.
Girish Pathak (1): Platforms/ARM/Juno: Fix Watchdog Timer interrupt mode
Platforms/ARM/Juno/AcpiTables/Gtdt.aslc | 116 ++++++++++---------- 1 file changed, 61 insertions(+), 55 deletions(-)
-- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
Linaro-uefi mailing list Linaro-uefi@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-uefi