To support multiple CPU architectures and platforms, it is better to
have the flexibility for the platforms to define their Creator ID in the
ACPI tables. So, add a new field in the structure and use it while
creating the ACPI tables instead of default ARM.

Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Cc: Pierre Gondois <pierre.gond...@arm.com>
Cc: Sami Mujawar <sami.muja...@arm.com>
Signed-off-by: Sunil V L <suni...@ventanamicro.com>
---
 DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h          | 1 +
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h       | 1 +
 .../Library/Common/AmlLib/CodeGen/AmlCodeGen.c            | 3 ++-
 .../Library/Common/TableHelperLib/TableHelper.c           | 8 +++++++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 043ec3d8428f..dc1fab534030 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1061,6 +1061,7 @@ AmlCodeGenDefinitionBlock (
   IN  CONST CHAR8                 *OemId,
   IN  CONST CHAR8                 *OemTableId,
   IN        UINT32                OemRevision,
+  IN  CONST CHAR8                 *CreatorId,
   OUT       AML_ROOT_NODE_HANDLE  *NewRootNode
   );
 
diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h 
b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
index 8ec3238225ab..d894b9cbb6f9 100644
--- a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -60,6 +60,7 @@ typedef struct CmStdObjConfigurationManagerInfo {
       populate the ACPI table header information.
   */
   UINT8     OemId[6];
+  UINT8     CreatorId[4];
 } CM_STD_OBJ_CONFIGURATION_MANAGER_INFO;
 
 /** A structure used to describe the ACPI table generators to be invoked.
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index d4e3e252cbe6..e1d72ec9444e 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -95,6 +95,7 @@ AmlCodeGenDefinitionBlock (
   IN  CONST CHAR8          *OemId,
   IN  CONST CHAR8          *OemTableId,
   IN        UINT32         OemRevision,
+  IN  CONST CHAR8          *CreatorId,
   OUT       AML_ROOT_NODE  **NewRootNode
   )
 {
@@ -115,8 +116,8 @@ AmlCodeGenDefinitionBlock (
   AcpiHeader.Revision = 2;
   CopyMem (&AcpiHeader.OemId, OemId, 6);
   CopyMem (&AcpiHeader.OemTableId, OemTableId, 8);
+  CopyMem (&AcpiHeader.CreatorId, CreatorId, 4);
   AcpiHeader.OemRevision     = OemRevision;
-  AcpiHeader.CreatorId       = TABLE_GENERATOR_CREATOR_ID_ARM;
   AcpiHeader.CreatorRevision = CREATE_REVISION (1, 0);
 
   Status = AmlCreateRootNode (&AcpiHeader, NewRootNode);
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c 
b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c
index 219f94e0dbcc..a2ad480b9b3b 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c
@@ -180,7 +180,12 @@ AddAcpiHeader (
   }
 
   // UINT32  CreatorId
-  AcpiHeader->CreatorId = Generator->CreatorId;
+  AcpiHeader->CreatorId = SIGNATURE_32 (
+                            CfgMfrInfo->CreatorId[0],
+                            CfgMfrInfo->CreatorId[1],
+                            CfgMfrInfo->CreatorId[2],
+                            CfgMfrInfo->CreatorId[3]
+                            );
   // UINT32  CreatorRevision
   AcpiHeader->CreatorRevision = Generator->CreatorRevision;
 
@@ -270,6 +275,7 @@ AddSsdtAcpiHeader (
              (CONST CHAR8 *)&CfgMfrInfo->OemId,
              (CONST CHAR8 *)&OemTableId,
              OemRevision,
+             (CONST CHAR8 *)&CfgMfrInfo->CreatorId,
              RootNode
              );
   ASSERT_EFI_ERROR (Status);
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113474): https://edk2.groups.io/g/devel/message/113474
Mute This Topic: https://groups.io/mt/103622728/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to