Hello Abdul,
some comments on the patch:

On 4/29/24 08:03, Abdul Lateef Attar wrote:
Adds generic ACPI SSDT HPET table generator library.
Register/Deregister HPET table.
Adds ACPI namespace object for HPET device.
Adds Address space for HPET device.

Cc: Sami Mujawar <sami.muja...@arm.com>
Cc: Pierre Gondois <pierre.gond...@arm.com>
Signed-off-by: Abdul Lateef Attar <abdullateef.at...@amd.com>
---
  DynamicTablesPkg/DynamicTables.dsc.inc        |   2 +
  DynamicTablesPkg/Include/AcpiTableGenerator.h |   2 +
  .../Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf  |  32 ++
  .../Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c  | 295 ++++++++++++++++++
  4 files changed, 331 insertions(+)
  create mode 100644 
DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
  create mode 100644 
DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 477dc6b6a9..fc2ac5962e 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -36,6 +36,7 @@
    DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
    DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
    DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
+  DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf

Same comment as in:
    [PATCH v4 2/5] DynamicTablesPkg: Adds ACPI HPET Table generator
about:
    [Components.IA32, Components.X64]
also if the table is Intel specific, maybe the generator should be placed under:
   DynamicTablesPkg/Library/Acpi/X64/
   (or a better folder name)
also I think the CmObject should be moved to:
   X64NameSpaceObjects.h

[Components.IA32, Components.X64]
    #
@@ -46,6 +47,7 @@
        NULL|DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
        NULL|DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
        NULL|DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
    }
[Components.ARM, Components.AARCH64]
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h 
b/DynamicTablesPkg/Include/AcpiTableGenerator.h

[snip]

+
+  Status = AmlCodeGenNameInteger ("_HID", EisaId, HpetNode, NULL);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto exit_handler;
+  }
+
+  Status = AmlCodeGenNameInteger ("_UID", 0x00, HpetNode, NULL);

In case there as multiple HPET,
I think this should be set to HpetBaseAddress->HpetNumber

+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto exit_handler;
+  }
+
+  Status = AmlCodeGenNameResourceTemplate ("_CRS", HpetNode, &CrsNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto exit_handler;
+  }
+
+  Status = AmlCodeGenRdMemory32Fixed (FALSE, 
(UINT32)HpetBaseAddress->BaseAddress, SIZE_1KB, CrsNode, NULL);

Will this always be readonly ? Or could it be a ReadWrite parameter ?
If unsure, this shouldn't be too hard to patch in the future.

+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto exit_handler;
+  }
+

[snip]


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


Reply via email to