public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chris Jones" <christopher.jones@arm.com>
To: <devel@edk2.groups.io>
Cc: <ray.ni@intel.com>, <zhichao.gao@intel.com>,
	<Alexei.Fedorov@arm.com>, <Sami.Mujawar@arm.com>,
	<Ben.Adderson@arm.com>, <Akanksha.Jain2@arm.com>,
	<Matteo.Carlini@arm.com>, <nd@arm.com>
Subject: [PATCH v1 1/2] DynamicTablesPkg: Rename SBSA generic watchdog
Date: Mon, 16 Aug 2021 15:52:17 +0100	[thread overview]
Message-ID: <20210816145218.14140-2-christopher.jones@arm.com> (raw)
In-Reply-To: <20210816145218.14140-1-christopher.jones@arm.com>

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>
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h                   |  8 +--
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 60 ++++++++++----------
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 19dcae13b2191e5f0b03ea85edec1191d2a406bf..2244eafaf00939ba36a3fdf021515fcb1e152764 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -395,21 +395,21 @@ typedef struct CmArmGTBlockInfo {
 } CM_ARM_GTBLOCK_INFO;
 
 /** A structure that describes the
-    SBSA Generic Watchdog information for the Platform.
+    Arm Generic Watchdog information for the Platform.
 
     ID: EArmObjPlatformGenericWatchdogInfo
 */
 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;
 
-  /// The physical base address of the SBSA Watchdog refresh frame
+  /// The physical base address of the Arm Watchdog refresh frame
   UINT64  RefreshFrameAddress;
 
   /// The watchdog interrupt
   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.
   */
   UINT32  Flags;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
index c109f2ac207311646e5a4ad3aa465b1c2883e465..06a23876aea8e55d6e4c8be4471ff5aca2514f66 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
@@ -1,11 +1,11 @@
 /** @file
   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
 
   @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
   );
 
-/** 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.
 */
 GET_OBJECT_LIST (
@@ -91,7 +91,7 @@ EFI_STATUS
 EFIAPI
 AddGenericTimerInfo (
   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                                               AcpiTableRevision
 )
@@ -133,7 +133,7 @@ AddGenericTimerInfo (
     GenericTimerInfo->CounterReadBaseAddress;
   Gtdt->PlatformTimerCount = PlatformTimerCount;
   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) {
     Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
@@ -143,7 +143,7 @@ AddGenericTimerInfo (
   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]  WatchdogOffset   Offset to the watchdog information in the
@@ -154,26 +154,26 @@ AddGenericTimerInfo (
 STATIC
 VOID
 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 CM_ARM_GENERIC_WATCHDOG_INFO            *       WatchdogInfoList,
   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 (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);
 
   while (WatchdogCount-- != 0) {
     // Add watchdog entry
     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 =
-      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->RefreshFramePhysicalAddress =
       WatchdogInfoList->RefreshFrameAddress;
@@ -249,7 +249,7 @@ IsGtFrameNumberEqual (
 STATIC
 EFI_STATUS
 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       UINT32                                             GTBlockFrameCount
 )
@@ -329,15 +329,15 @@ STATIC
 EFI_STATUS
 AddGTBlockList (
   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 CM_ARM_GTBLOCK_INFO                       *       GTBlockInfo,
   IN       UINT32                                            BlockTimerCount
 )
 {
   EFI_STATUS                                    Status;
-  EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE        * GTBlock;
-  EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE  * GtBlockFrame;
+  EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE        * GTBlock;
+  EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE  * GtBlockFrame;
   CM_ARM_GTBLOCK_TIMER_FRAME_INFO             * GTBlockTimerFrameList;
   UINT32                                        GTBlockTimerFrameCount;
   UINTN                                         Length;
@@ -345,7 +345,7 @@ AddGTBlockList (
   ASSERT (Gtdt != 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);
 
   while (BlockTimerCount-- != 0) {
@@ -367,8 +367,8 @@ AddGTBlockList (
       return Status;
     }
 
-    Length = sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) +
-               (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
+    Length = sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) +
+               (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
                 GTBlockInfo->GTBlockTimerFrameCount);
 
     // Check that the length of the GT block does not
@@ -386,15 +386,15 @@ AddGTBlockList (
       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->Reserved = EFI_ACPI_RESERVED_BYTE;
     GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
     GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
     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);
 
     // Add GT Block Timer frames
@@ -413,7 +413,7 @@ AddGTBlockList (
     }
 
     // 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);
     GTBlockInfo++;
   }// for
@@ -460,7 +460,7 @@ BuildGtdtTable (
   UINT32                                          BlockTimerCount;
   CM_ARM_GENERIC_WATCHDOG_INFO                  * WatchdogInfoList;
   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                                          GTBlockOffset;
   UINT32                                          WatchdogOffset;
@@ -527,11 +527,11 @@ BuildGtdtTable (
 
   // Calculate the GTDT Table Size
   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) {
     GTBlockOffset = TableSize;
     PlatformTimerCount += BlockTimerCount;
-    TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) *
+    TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) *
                   BlockTimerCount);
 
     for (Idx = 0; Idx < BlockTimerCount; Idx++) {
@@ -546,7 +546,7 @@ BuildGtdtTable (
           ));
         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);
     }
 
@@ -562,7 +562,7 @@ BuildGtdtTable (
   if (WatchdogCount != 0) {
     WatchdogOffset = TableSize;
     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);
     DEBUG ((
       DEBUG_INFO,
@@ -585,7 +585,7 @@ BuildGtdtTable (
     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_INFO,
     "GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
@@ -712,9 +712,9 @@ ACPI_TABLE_GENERATOR GtdtGenerator = {
   // Generator Description
   L"ACPI.STD.GTDT.GENERATOR",
   // 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
-  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
   EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
   // Creator ID
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")


  reply	other threads:[~2021-08-16 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 14:52 [PATCH v1 0/2] ACPI 6.4 SBSA generic watchdog renaming Chris Jones
2021-08-16 14:52 ` Chris Jones [this message]
2021-08-16 14:52 ` [PATCH v1 2/2] ShellPkg: Update Acpiview GTDT parser to ACPI 6.4 Chris Jones
2021-08-18  9:57 ` [PATCH v1 0/2] ACPI 6.4 SBSA generic watchdog renaming Sami Mujawar
2021-09-08 14:25   ` Chris Jones
2021-09-09  2:03   ` Gao, Zhichao
2021-09-23  8:36     ` [edk2-devel] " Sami Mujawar
2021-09-24  0:56       ` Gao, Zhichao
2021-10-05 16:08 ` Sami Mujawar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210816145218.14140-2-christopher.jones@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox