mirror of https://github.com/acidanthera/audk.git
DynamicTablesPkg: Rename SBSA generic watchdog
Buzilla: 3565 (https://bugzilla.tianocore.org/show_bug.cgi?id=3565) As part of the updates to ACPI 6.4 the "SBSA Generic Watchdog" was renamed to the "Arm Generic Watchdog". This patch implements that change by updating the GTDT generator to use Acpi64.h and renames any occurence of "SBSA Generic Watchdog" to "Arm Generic Watchdog". Signed-off-by: Chris Jones <christopher.jones@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
parent
06a326caf1
commit
f09dbf20b9
|
@ -395,21 +395,21 @@ typedef struct CmArmGTBlockInfo {
|
||||||
} CM_ARM_GTBLOCK_INFO;
|
} CM_ARM_GTBLOCK_INFO;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
SBSA Generic Watchdog information for the Platform.
|
Arm Generic Watchdog information for the Platform.
|
||||||
|
|
||||||
ID: EArmObjPlatformGenericWatchdogInfo
|
ID: EArmObjPlatformGenericWatchdogInfo
|
||||||
*/
|
*/
|
||||||
typedef struct CmArmGenericWatchdogInfo {
|
typedef struct CmArmGenericWatchdogInfo {
|
||||||
/// The physical base address of the SBSA Watchdog control frame
|
/// The physical base address of the Arm Watchdog control frame
|
||||||
UINT64 ControlFrameAddress;
|
UINT64 ControlFrameAddress;
|
||||||
|
|
||||||
/// The physical base address of the SBSA Watchdog refresh frame
|
/// The physical base address of the Arm Watchdog refresh frame
|
||||||
UINT64 RefreshFrameAddress;
|
UINT64 RefreshFrameAddress;
|
||||||
|
|
||||||
/// The watchdog interrupt
|
/// The watchdog interrupt
|
||||||
UINT32 TimerGSIV;
|
UINT32 TimerGSIV;
|
||||||
|
|
||||||
/** The flags for the watchdog as described by the SBSA watchdog
|
/** The flags for the watchdog as described by the Arm watchdog
|
||||||
structure in the ACPI specification.
|
structure in the ACPI specification.
|
||||||
*/
|
*/
|
||||||
UINT32 Flags;
|
UINT32 Flags;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/** @file
|
/** @file
|
||||||
GTDT Table Generator
|
GTDT Table Generator
|
||||||
|
|
||||||
Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
|
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@par Reference(s):
|
@par Reference(s):
|
||||||
- ACPI 6.3 Specification - January 2019
|
- ACPI 6.4 Specification - January 2021
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ GET_OBJECT_LIST (
|
||||||
CM_ARM_GENERIC_TIMER_INFO
|
CM_ARM_GENERIC_TIMER_INFO
|
||||||
);
|
);
|
||||||
|
|
||||||
/** This macro expands to a function that retrieves the SBSA Generic
|
/** This macro expands to a function that retrieves the Arm Generic
|
||||||
Watchdog Timer Information from the Configuration Manager.
|
Watchdog Timer Information from the Configuration Manager.
|
||||||
*/
|
*/
|
||||||
GET_OBJECT_LIST (
|
GET_OBJECT_LIST (
|
||||||
|
@ -91,7 +91,7 @@ EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
AddGenericTimerInfo (
|
AddGenericTimerInfo (
|
||||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||||
IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||||
IN CONST UINT32 PlatformTimerCount,
|
IN CONST UINT32 PlatformTimerCount,
|
||||||
IN CONST UINT32 AcpiTableRevision
|
IN CONST UINT32 AcpiTableRevision
|
||||||
)
|
)
|
||||||
|
@ -133,7 +133,7 @@ AddGenericTimerInfo (
|
||||||
GenericTimerInfo->CounterReadBaseAddress;
|
GenericTimerInfo->CounterReadBaseAddress;
|
||||||
Gtdt->PlatformTimerCount = PlatformTimerCount;
|
Gtdt->PlatformTimerCount = PlatformTimerCount;
|
||||||
Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
|
Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
|
||||||
sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
|
sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
|
||||||
|
|
||||||
if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
|
if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
|
||||||
Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
|
Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
|
||||||
|
@ -143,7 +143,7 @@ AddGenericTimerInfo (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add the SBSA Generic Watchdog Timers to the GTDT table.
|
/** Add the Arm Generic Watchdog Timers to the GTDT table.
|
||||||
|
|
||||||
@param [in] Gtdt Pointer to the GTDT Table.
|
@param [in] Gtdt Pointer to the GTDT Table.
|
||||||
@param [in] WatchdogOffset Offset to the watchdog information in the
|
@param [in] WatchdogOffset Offset to the watchdog information in the
|
||||||
|
@ -154,26 +154,26 @@ AddGenericTimerInfo (
|
||||||
STATIC
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
AddGenericWatchdogList (
|
AddGenericWatchdogList (
|
||||||
IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||||
IN CONST UINT32 WatchdogOffset,
|
IN CONST UINT32 WatchdogOffset,
|
||||||
IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList,
|
IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList,
|
||||||
IN UINT32 WatchdogCount
|
IN UINT32 WatchdogCount
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE * Watchdog;
|
EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE * Watchdog;
|
||||||
|
|
||||||
ASSERT (Gtdt != NULL);
|
ASSERT (Gtdt != NULL);
|
||||||
ASSERT (WatchdogInfoList != NULL);
|
ASSERT (WatchdogInfoList != NULL);
|
||||||
|
|
||||||
Watchdog = (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE *)
|
Watchdog = (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE *)
|
||||||
((UINT8*)Gtdt + WatchdogOffset);
|
((UINT8*)Gtdt + WatchdogOffset);
|
||||||
|
|
||||||
while (WatchdogCount-- != 0) {
|
while (WatchdogCount-- != 0) {
|
||||||
// Add watchdog entry
|
// Add watchdog entry
|
||||||
DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
|
DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
|
||||||
Watchdog->Type = EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG;
|
Watchdog->Type = EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG;
|
||||||
Watchdog->Length =
|
Watchdog->Length =
|
||||||
sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE);
|
sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE);
|
||||||
Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
|
Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
|
||||||
Watchdog->RefreshFramePhysicalAddress =
|
Watchdog->RefreshFramePhysicalAddress =
|
||||||
WatchdogInfoList->RefreshFrameAddress;
|
WatchdogInfoList->RefreshFrameAddress;
|
||||||
|
@ -249,7 +249,7 @@ IsGtFrameNumberEqual (
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
AddGTBlockTimerFrames (
|
AddGTBlockTimerFrames (
|
||||||
IN EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame,
|
IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame,
|
||||||
IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList,
|
IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList,
|
||||||
IN UINT32 GTBlockFrameCount
|
IN UINT32 GTBlockFrameCount
|
||||||
)
|
)
|
||||||
|
@ -329,15 +329,15 @@ STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
AddGTBlockList (
|
AddGTBlockList (
|
||||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||||
IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||||
IN CONST UINT32 GTBlockOffset,
|
IN CONST UINT32 GTBlockOffset,
|
||||||
IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo,
|
IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo,
|
||||||
IN UINT32 BlockTimerCount
|
IN UINT32 BlockTimerCount
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE * GTBlock;
|
EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE * GTBlock;
|
||||||
EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame;
|
EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame;
|
||||||
CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList;
|
CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList;
|
||||||
UINT32 GTBlockTimerFrameCount;
|
UINT32 GTBlockTimerFrameCount;
|
||||||
UINTN Length;
|
UINTN Length;
|
||||||
|
@ -345,7 +345,7 @@ AddGTBlockList (
|
||||||
ASSERT (Gtdt != NULL);
|
ASSERT (Gtdt != NULL);
|
||||||
ASSERT (GTBlockInfo != NULL);
|
ASSERT (GTBlockInfo != NULL);
|
||||||
|
|
||||||
GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
|
GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
|
||||||
GTBlockOffset);
|
GTBlockOffset);
|
||||||
|
|
||||||
while (BlockTimerCount-- != 0) {
|
while (BlockTimerCount-- != 0) {
|
||||||
|
@ -367,8 +367,8 @@ AddGTBlockList (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Length = sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) +
|
Length = sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) +
|
||||||
(sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
(sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
||||||
GTBlockInfo->GTBlockTimerFrameCount);
|
GTBlockInfo->GTBlockTimerFrameCount);
|
||||||
|
|
||||||
// Check that the length of the GT block does not
|
// Check that the length of the GT block does not
|
||||||
|
@ -386,15 +386,15 @@ AddGTBlockList (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
GTBlock->Type = EFI_ACPI_6_3_GTDT_GT_BLOCK;
|
GTBlock->Type = EFI_ACPI_6_4_GTDT_GT_BLOCK;
|
||||||
GTBlock->Length = (UINT16)Length;
|
GTBlock->Length = (UINT16)Length;
|
||||||
GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
|
GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
|
||||||
GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
|
GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
|
||||||
GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
|
GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
|
||||||
GTBlock->GTBlockTimerOffset =
|
GTBlock->GTBlockTimerOffset =
|
||||||
sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE);
|
sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE);
|
||||||
|
|
||||||
GtBlockFrame = (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
|
GtBlockFrame = (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
|
||||||
((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
|
((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
|
||||||
|
|
||||||
// Add GT Block Timer frames
|
// Add GT Block Timer frames
|
||||||
|
@ -413,7 +413,7 @@ AddGTBlockList (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next GTBlock
|
// Next GTBlock
|
||||||
GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
|
GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
|
||||||
GTBlock->Length);
|
GTBlock->Length);
|
||||||
GTBlockInfo++;
|
GTBlockInfo++;
|
||||||
}// for
|
}// for
|
||||||
|
@ -460,7 +460,7 @@ BuildGtdtTable (
|
||||||
UINT32 BlockTimerCount;
|
UINT32 BlockTimerCount;
|
||||||
CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList;
|
CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList;
|
||||||
CM_ARM_GTBLOCK_INFO * GTBlockInfo;
|
CM_ARM_GTBLOCK_INFO * GTBlockInfo;
|
||||||
EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt;
|
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt;
|
||||||
UINT32 Idx;
|
UINT32 Idx;
|
||||||
UINT32 GTBlockOffset;
|
UINT32 GTBlockOffset;
|
||||||
UINT32 WatchdogOffset;
|
UINT32 WatchdogOffset;
|
||||||
|
@ -527,11 +527,11 @@ BuildGtdtTable (
|
||||||
|
|
||||||
// Calculate the GTDT Table Size
|
// Calculate the GTDT Table Size
|
||||||
PlatformTimerCount = 0;
|
PlatformTimerCount = 0;
|
||||||
TableSize = sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
|
TableSize = sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
|
||||||
if (BlockTimerCount != 0) {
|
if (BlockTimerCount != 0) {
|
||||||
GTBlockOffset = TableSize;
|
GTBlockOffset = TableSize;
|
||||||
PlatformTimerCount += BlockTimerCount;
|
PlatformTimerCount += BlockTimerCount;
|
||||||
TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) *
|
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) *
|
||||||
BlockTimerCount);
|
BlockTimerCount);
|
||||||
|
|
||||||
for (Idx = 0; Idx < BlockTimerCount; Idx++) {
|
for (Idx = 0; Idx < BlockTimerCount; Idx++) {
|
||||||
|
@ -546,7 +546,7 @@ BuildGtdtTable (
|
||||||
));
|
));
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
||||||
GTBlockInfo[Idx].GTBlockTimerFrameCount);
|
GTBlockInfo[Idx].GTBlockTimerFrameCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ BuildGtdtTable (
|
||||||
if (WatchdogCount != 0) {
|
if (WatchdogCount != 0) {
|
||||||
WatchdogOffset = TableSize;
|
WatchdogOffset = TableSize;
|
||||||
PlatformTimerCount += WatchdogCount;
|
PlatformTimerCount += WatchdogCount;
|
||||||
TableSize += (sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE) *
|
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE) *
|
||||||
WatchdogCount);
|
WatchdogCount);
|
||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_INFO,
|
DEBUG_INFO,
|
||||||
|
@ -585,7 +585,7 @@ BuildGtdtTable (
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtdt = (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
|
Gtdt = (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
|
||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_INFO,
|
DEBUG_INFO,
|
||||||
"GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
|
"GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
|
||||||
|
@ -712,9 +712,9 @@ ACPI_TABLE_GENERATOR GtdtGenerator = {
|
||||||
// Generator Description
|
// Generator Description
|
||||||
L"ACPI.STD.GTDT.GENERATOR",
|
L"ACPI.STD.GTDT.GENERATOR",
|
||||||
// ACPI Table Signature
|
// ACPI Table Signature
|
||||||
EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
|
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
|
||||||
// ACPI Table Revision supported by this Generator
|
// ACPI Table Revision supported by this Generator
|
||||||
EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
||||||
// Minimum ACPI Table Revision supported by this Generator
|
// Minimum ACPI Table Revision supported by this Generator
|
||||||
EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
||||||
// Creator ID
|
// Creator ID
|
||||||
|
|
Loading…
Reference in New Issue