public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
@ 2024-06-19 22:06 PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 01/15] DynamicTablesPkg: Acpi: Move generic libraries to common folder PierreGondois
                   ` (15 more replies)
  0 siblings, 16 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

The DynamicTables framework has mainly been developed/tested against Arm
architecture. While still trying to have re-usable libraries, opening the
framework to other architectures implies some re-organization.

The libraries that are generic enough to be directly re-used are moved
to a Common/ directory. For some libraries, additional arch-specific hooks
have been added to allow architectures specific modifications.

---

Changes can be seen at:
  https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg

---

References:
1. Staging branch creation:
   URL: https://edk2.groups.io/g/devel/message/114790

2. edk2-staging Repo
   URL: https://github.com/tianocore/edk2-staging.git
   Branch Name: dynamictables-reorg

3. edk2-platforms Repo
   URL: https://github.com/tianocore/edk2-platforms.git
   Branch Name: devel-dynamictables-reorg

---

Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com>
Cc: Girish Mahadevan <gmahadevan@nvidia.com>
Cc: Jeff Brasen <jbrasen@nvidia.com>
Cc: Jeshua Smith <jeshuas@nvidia.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Yeo Reum Yun <YeoReum.Yun@arm.com>

Pierre Gondois (15):
  DynamicTablesPkg: Acpi: Move generic libraries to common folder
  DynamicTablesPkg: Acpi: Prepare common libraries to support other
    archs
  DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
  DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
  DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
  DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
  DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
  DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
  DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm
    directory
  DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other
    archs
  DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
  DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch
    neutral
  DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
  DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
  DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr
    cells

 .../Arm/ArmDynamicTableManagerDxe.c           |  63 +++
 .../Common/CommonDynamicTableManagerDxe.c     |  58 +++
 .../DynamicTableManagerDxe.c                  |  70 +--
 .../DynamicTableManagerDxe.h                  |  63 +++
 .../DynamicTableManagerDxe.inf                |   7 +
 DynamicTablesPkg/DynamicTables.dsc.inc        |  64 +--
 .../SsdtCpuTopologyGenerator.h                | 147 -------
 .../AcpiDbg2Lib/AcpiDbg2Lib.inf}              |  22 +-
 .../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c |  67 +++
 .../AcpiDbg2Lib/Common/CommonDbg2Generator.c  |  59 +++
 .../AcpiDbg2Lib}/Dbg2Generator.c              |  24 +-
 .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h   |  56 +++
 .../AcpiFadtLib/AcpiFadtLib.inf}              |  16 +-
 .../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++
 .../AcpiFadtLib/Common/CommonFadtGenerator.c  |  46 ++
 .../AcpiFadtLib}/FadtGenerator.c              |  86 +---
 .../Acpi/Common/AcpiFadtLib/FadtGenerator.h   |  35 ++
 .../AcpiMcfgLib/AcpiMcfgLib.inf}              |   9 +-
 .../AcpiMcfgLib}/McfgGenerator.c              |   0
 .../AcpiPcctLib/AcpiPcctLib.inf}              |   2 +-
 .../AcpiPcctLib}/PcctGenerator.c              |   0
 .../AcpiPcctLib}/PcctGenerator.h              |   0
 .../AcpiPpttLib/AcpiPpttLib.inf}              |   2 +-
 .../AcpiPpttLib}/PpttGenerator.c              |   0
 .../AcpiPpttLib}/PpttGenerator.h              |   0
 .../AcpiRawLib/AcpiRawLib.inf}                |   9 +-
 .../AcpiRawLib}/RawGenerator.c                |   0
 .../AcpiSpcrLib/AcpiSpcrLib.inf}              |   9 +-
 .../AcpiSpcrLib}/SpcrGenerator.c              |   2 +-
 .../AcpiSratLib/AcpiSratLib.inf}              |   9 +-
 .../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 +++++++++++
 .../AcpiSratLib/Common/CommonSratGenerator.c  |  77 ++++
 .../AcpiSratLib}/SratGenerator.c              | 214 +--------
 .../Acpi/Common/AcpiSratLib/SratGenerator.h   |  59 +++
 .../Arm/ArmSsdtCpuTopologyGenerator.c         | 408 ++++++++++++++++++
 .../SsdtCpuTopologyGenerator.c                | 341 ++-------------
 .../SsdtCpuTopologyGenerator.h                | 343 +++++++++++++++
 .../SsdtCpuTopologyLib.inf}                   |   9 +-
 .../AcpiSsdtPcieLib}/SsdtPcieGenerator.c      |   2 +-
 .../AcpiSsdtPcieLib}/SsdtPcieGenerator.h      |   0
 .../AcpiSsdtPcieLib/SsdtPcieLib.inf}          |   2 +-
 .../SsdtSerialPortGenerator.c                 |   0
 .../SsdtSerialPortLib.inf}                    |   6 +-
 .../Arm/ArmFdtHwInfoParser.c                  |  83 ++++
 .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c    | 118 +++++
 .../{ => Arm}/BootArch/ArmBootArchParser.c    |   2 +-
 .../{ => Arm}/BootArch/ArmBootArchParser.h    |   0
 .../GenericTimer/ArmGenericTimerParser.c      |   4 +-
 .../GenericTimer/ArmGenericTimerParser.h      |   0
 .../{ => Arm}/Gic/ArmGicCParser.c             |   5 +-
 .../{ => Arm}/Gic/ArmGicCParser.h             |   0
 .../{ => Arm}/Gic/ArmGicDParser.c             |   4 +-
 .../{ => Arm}/Gic/ArmGicDParser.h             |   0
 .../{ => Arm}/Gic/ArmGicDispatcher.c          |  12 +-
 .../{ => Arm}/Gic/ArmGicDispatcher.h          |   0
 .../{ => Arm}/Gic/ArmGicItsParser.c           |   4 +-
 .../{ => Arm}/Gic/ArmGicItsParser.h           |   0
 .../{ => Arm}/Gic/ArmGicMsiFrameParser.c      |   4 +-
 .../{ => Arm}/Gic/ArmGicMsiFrameParser.h      |   0
 .../{ => Arm}/Gic/ArmGicRParser.c             |   4 +-
 .../{ => Arm}/Gic/ArmGicRParser.h             |   0
 .../FdtHwInfoParserLib/FdtHwInfoParser.c      |  78 +---
 .../FdtHwInfoParserLib/FdtHwInfoParser.h      |  27 ++
 .../FdtHwInfoParserInclude.h                  |   1 -
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf |  48 ++-
 .../Library/FdtHwInfoParserLib/FdtUtility.c   |  71 ---
 .../Library/FdtHwInfoParserLib/FdtUtility.h   |  30 ++
 ...igSpaceParser.c => PciConfigSpaceParser.c} |  19 +-
 ...igSpaceParser.h => PciConfigSpaceParser.h} |  10 +-
 ...mSerialPortParser.c => SerialPortParser.c} |  16 +-
 ...mSerialPortParser.h => SerialPortParser.h} |   8 +-
 71 files changed, 2248 insertions(+), 1074 deletions(-)
 create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
 create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
 create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
 delete mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (75%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (93%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (75%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (87%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (85%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (90%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (90%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (85%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (86%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (96%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (74%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (75%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (79%)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (80%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (96%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (91%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (87%)
 create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
 create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119632): https://edk2.groups.io/g/devel/message/119632
Mute This Topic: https://groups.io/mt/106770151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 01/15] DynamicTablesPkg: Acpi: Move generic libraries to common folder
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 02/15] DynamicTablesPkg: Acpi: Prepare common libraries to support other archs PierreGondois
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Some of the ACPI table generators are generic enough to be re-used
by other architectures. Move the following generators to a
'Common' folder:
- AcpiDbg2Lib
- AcpiFadtLib
- AcpiMcfgLib
- AcpiPcctLib
- AcpiPpttLib
- AcpiRawLib
- AcpiSpcrLib
- AcpiSratLib
- SsdtSerialPortLib
- SsdtCpuTopologyLib
- SsdtPcieLib
and update DynamicTables.dsc.inc accordingly.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/DynamicTables.dsc.inc        | 64 +++++++++++--------
 .../AcpiDbg2Lib/AcpiDbg2Lib.inf}              |  0
 .../AcpiDbg2Lib}/Dbg2Generator.c              |  0
 .../AcpiFadtLib/AcpiFadtLib.inf}              |  0
 .../AcpiFadtLib}/FadtGenerator.c              |  0
 .../AcpiMcfgLib/AcpiMcfgLib.inf}              |  0
 .../AcpiMcfgLib}/McfgGenerator.c              |  0
 .../AcpiPcctLib/AcpiPcctLib.inf}              |  0
 .../AcpiPcctLib}/PcctGenerator.c              |  0
 .../AcpiPcctLib}/PcctGenerator.h              |  0
 .../AcpiPpttLib/AcpiPpttLib.inf}              |  0
 .../AcpiPpttLib}/PpttGenerator.c              |  0
 .../AcpiPpttLib}/PpttGenerator.h              |  0
 .../AcpiRawLib/AcpiRawLib.inf}                |  0
 .../AcpiRawLib}/RawGenerator.c                |  0
 .../AcpiSpcrLib/AcpiSpcrLib.inf}              |  0
 .../AcpiSpcrLib}/SpcrGenerator.c              |  0
 .../AcpiSratLib/AcpiSratLib.inf}              |  0
 .../AcpiSratLib}/SratGenerator.c              |  0
 .../SsdtCpuTopologyGenerator.c                |  0
 .../SsdtCpuTopologyGenerator.h                |  0
 .../SsdtCpuTopologyLib.inf}                   |  0
 .../AcpiSsdtPcieLib}/SsdtPcieGenerator.c      |  0
 .../AcpiSsdtPcieLib}/SsdtPcieGenerator.h      |  0
 .../AcpiSsdtPcieLib/SsdtPcieLib.inf}          |  0
 .../SsdtSerialPortGenerator.c                 |  0
 .../SsdtSerialPortLib.inf}                    |  0
 27 files changed, 38 insertions(+), 26 deletions(-)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
 rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (100%)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/DynamicTables.dsc.inc
index 19ca62d6a85c..fa68b63ab12d 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -25,6 +25,25 @@ [LibraryClasses.AARCH64]
   DynamicTablesScmiInfoLib|DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
 
 [Components.common]
+  #
+  # Generators (Common)
+  #
+  DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
+
+  # AML Fixup (Common)
+  DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
+
+  # AML Codegen (Common)
+  DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
+  DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
+
   #
   # Dynamic Tables Manager Dxe
   #
@@ -38,51 +57,44 @@ [Components.IA32, Components.X64]
 
 [Components.ARM, Components.AARCH64]
   #
-  # Generators
+  # Generators (Arm specific)
   #
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
   DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
 
-  # AML Fixup
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
+  # AML Fixup (Arm specific)
   DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
 
-  # AML Codegen
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
-  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf
-
   #
   # Dynamic Table Factory Dxe
   #
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
     <LibraryClasses>
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
+      # Generators
+      #   Common
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
+      #   Arm specific
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
 
       # AML Fixup
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
+      #  Common
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
+      #  Arm specific
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
 
       # AML Codegen
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
-      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf
+      #  Common
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
   }
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/McfgGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.h
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.h
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.h
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/PpttGenerator.h
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/RawGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/RawGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.h
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.h
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortGenerator.c
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortGenerator.c
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
similarity index 100%
rename from DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
rename to DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119633): https://edk2.groups.io/g/devel/message/119633
Mute This Topic: https://groups.io/mt/106770152/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 02/15] DynamicTablesPkg: Acpi: Prepare common libraries to support other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 01/15] DynamicTablesPkg: Acpi: Move generic libraries to common folder PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 03/15] DynamicTablesPkg: AcpiFadtLib: Prepare " PierreGondois
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Allow other architectures to reuse ACPI common libraries by:
- Removing the Arm prefix from the BASE_NAME
- Moving Arm specific libraries/packages to ARM/AARCH64
  specific sections in the .inf files
Also remove the empty .inf sections.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf       | 15 +++++++--------
 .../Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf       |  9 +--------
 .../Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf       |  9 +--------
 .../Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf       |  2 +-
 .../Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf       |  2 +-
 .../Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf |  9 +--------
 .../Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf       |  9 +--------
 .../Acpi/Common/AcpiSratLib/AcpiSratLib.inf       |  2 +-
 .../AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf |  6 ++++--
 .../Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf   |  2 +-
 .../AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf   |  6 ++++--
 11 files changed, 23 insertions(+), 48 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
index f7b7c1c025a6..32dcd20c082b 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x00010019
-  BASE_NAME      = AcpiDbg2LibArm
+  BASE_NAME      = AcpiDbg2Lib
   FILE_GUID      = A17BA4F0-3DEB-4FE5-BD27-EC008E541B22
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -19,16 +19,20 @@ [Defines]
 [Sources]
   Dbg2Generator.c
 
+[Packages.ARM, Packages.AARCH64]
+  ArmPlatformPkg/ArmPlatformPkg.dec
+
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
   DynamicTablesPkg/DynamicTablesPkg.dec
 
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  PL011UartLib
+
 [LibraryClasses]
   BaseLib
-  PL011UartLib
   SsdtSerialPortFixupLib
 
 [FixedPcd]
@@ -36,8 +40,3 @@ [FixedPcd]
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
-
-[Protocols]
-
-[Guids]
-
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
index 8fe34013d420..c9cd850faac0 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x00010019
-  BASE_NAME      = AcpiFadtLibArm
+  BASE_NAME      = AcpiFadtLib
   FILE_GUID      = 686FE5FE-B944-485F-8B1C-7D60E0056487
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -27,10 +27,3 @@ [Packages]
 
 [LibraryClasses]
   BaseLib
-
-[Pcd]
-
-[Protocols]
-
-[Guids]
-
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
index 1c7f085274e6..36c343d3875a 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x00010019
-  BASE_NAME      = AcpiMcfgLibArm
+  BASE_NAME      = AcpiMcfgLib
   FILE_GUID      = 8C9BDCB2-72D4-4F30-A12D-1145C3807FF7
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -27,10 +27,3 @@ [Packages]
 
 [LibraryClasses]
   BaseLib
-
-[Pcd]
-
-[Protocols]
-
-[Guids]
-
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
index da54585c2dd9..666bdcab2225 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/AcpiPcctLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x0001001B
-  BASE_NAME      = AcpiPcctLibArm
+  BASE_NAME      = AcpiPcctLib
   FILE_GUID      = 38FE945C-D6ED-4CD6-8D20-FCEF3260D15A
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
index 2c7d19513d6c..a1c91a6eab74 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPpttLib/AcpiPpttLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x0001001B
-  BASE_NAME      = AcpiPpttLibArm
+  BASE_NAME      = AcpiPpttLib
   FILE_GUID      = FA102D52-5A92-4F95-A097-1D53F9CF5959
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
index f2ab1b7111fb..8b461ea05b86 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiRawLib/AcpiRawLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x00010019
-  BASE_NAME      = AcpiRawLibArm
+  BASE_NAME      = AcpiRawLib
   FILE_GUID      = 20F31568-D687-49BA-B326-CCD9D38EDE16
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -27,10 +27,3 @@ [Packages]
 
 [LibraryClasses]
   BaseLib
-
-[Pcd]
-
-[Protocols]
-
-[Guids]
-
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
index e11f878ec83e..80a61022da48 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x00010019
-  BASE_NAME      = AcpiSpcrLibArm
+  BASE_NAME      = AcpiSpcrLib
   FILE_GUID      = 55088136-7B78-4974-B1EE-F630150D0DE7
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -28,10 +28,3 @@ [Packages]
 [LibraryClasses]
   BaseLib
   SsdtSerialPortFixupLib
-
-[Pcd]
-
-[Protocols]
-
-[Guids]
-
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
index 5891dc4d1c7c..2f23f4e668e5 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x0001001B
-  BASE_NAME      = AcpiSratLibArm
+  BASE_NAME      = AcpiSratLib
   FILE_GUID      = 2CE21E0A-A39C-4B26-BC0E-526178036ACD
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
index 3e2d15474980..2d38fb30fb09 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x0001001B
-  BASE_NAME      = SsdtCpuTopologyLibArm
+  BASE_NAME      = SsdtCpuTopologyLib
   FILE_GUID      = F2835EB6-4B05-48D4-A475-147DA0F3755C
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -20,11 +20,13 @@ [Sources]
   SsdtCpuTopologyGenerator.c
   SsdtCpuTopologyGenerator.h
 
+[Packages.ARM, Packages.AARCH64]
+  ArmPlatformPkg/ArmPlatformPkg.dec
+
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
   DynamicTablesPkg/DynamicTablesPkg.dec
 
 [LibraryClasses]
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
index c2a1acb57066..440b0d721214 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x0001001B
-  BASE_NAME      = SsdtPcieLibArm
+  BASE_NAME      = SsdtPcieLib
   FILE_GUID      = E431D7FD-26BF-4E3D-9064-5B13B0439057
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
index 36e61ea9b132..24d7db5645c1 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf
@@ -8,7 +8,7 @@
 
 [Defines]
   INF_VERSION    = 0x0001001B
-  BASE_NAME      = SsdtSerialPortLibArm
+  BASE_NAME      = SsdtSerialPortLib
   FILE_GUID      = D1F92325-2DFB-435C-9B4C-A6B864F19230
   VERSION_STRING = 1.0
   MODULE_TYPE    = DXE_DRIVER
@@ -19,11 +19,13 @@ [Defines]
 [Sources]
   SsdtSerialPortGenerator.c
 
+[Packages.ARM, Packages.AARCH64]
+  ArmPlatformPkg/ArmPlatformPkg.dec
+
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
   DynamicTablesPkg/DynamicTablesPkg.dec
 
 [LibraryClasses]
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119634): https://edk2.groups.io/g/devel/message/119634
Mute This Topic: https://groups.io/mt/106770153/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 03/15] DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 01/15] DynamicTablesPkg: Acpi: Move generic libraries to common folder PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 02/15] DynamicTablesPkg: Acpi: Prepare common libraries to support other archs PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 04/15] DynamicTablesPkg: AcpiDbg2Lib: " PierreGondois
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Allow other architectures to reuse the AcpiFadtLib by extracting
the Arm specific part of the table generation.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf   |   7 +
 .../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++++++++++++++
 .../AcpiFadtLib/Common/CommonFadtGenerator.c  |  46 +++++++
 .../Acpi/Common/AcpiFadtLib/FadtGenerator.c   |  86 ++----------
 .../Acpi/Common/AcpiFadtLib/FadtGenerator.h   |  35 +++++
 5 files changed, 224 insertions(+), 76 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
index c9cd850faac0..be2af0cfd53a 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
@@ -18,6 +18,13 @@ [Defines]
 
 [Sources]
   FadtGenerator.c
+  FadtGenerator.h
+
+[Sources.ARM, Sources.AARCH64]
+  Arm/ArmFadtGenerator.c
+
+[Sources.IA32, Sources.X64]
+  Common/CommonFadtGenerator.c
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
new file mode 100644
index 000000000000..2d2afe98ab1f
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
@@ -0,0 +1,126 @@
+/** @file
+  ARM FADT Table Helpers
+
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.5 Specification, Aug 29, 2022
+
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/DebugLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+#include "FadtGenerator.h"
+
+/** ARM Standard FADT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjBootArchInfo
+*/
+
+/** This macro expands to a function that retrieves the Boot
+    Architecture Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjBootArchInfo,
+  CM_ARM_BOOT_ARCH_INFO
+  );
+
+/** This macro defines the FADT flag options for ARM Platforms.
+*/
+#define FADT_FLAGS  (EFI_ACPI_6_5_HW_REDUCED_ACPI |          \
+                     EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE)
+
+/** Updates the Architecture specific information in the FADT Table.
+
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+                              Protocol Interface.
+  @param [in, out] Fadt       Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS           Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object was not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+ArmFadtBootArchInfoUpdate (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN   OUT EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE      *Fadt
+  )
+{
+  EFI_STATUS             Status;
+  CM_ARM_BOOT_ARCH_INFO  *BootArchInfo;
+
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (Fadt != NULL);
+
+  // Get the Boot Architecture flags from the Platform Configuration Manager
+  Status = GetEArmObjBootArchInfo (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &BootArchInfo,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: FADT: Failed to get Boot Architecture flags. Status = %r\n",
+      Status
+      ));
+    return Status;
+  }
+
+  DEBUG ((
+    DEBUG_INFO,
+    "FADT BootArchFlag = 0x%x\n",
+    BootArchInfo->BootArchFlags
+    ));
+
+  Fadt->ArmBootArch = BootArchInfo->BootArchFlags;
+
+  return Status;
+}
+
+/** Updates the Architecture specific information in the FADT Table.
+
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+                              Protocol Interface.
+  @param [in, out] Fadt       Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS           Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object was not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+EFI_STATUS
+EFIAPI
+FadtArchUpdate (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN   OUT EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE      *Fadt
+  )
+{
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (Fadt != NULL);
+
+  Fadt->Flags = FADT_FLAGS;
+
+  return ArmFadtBootArchInfoUpdate (CfgMgrProtocol, Fadt);
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
new file mode 100644
index 000000000000..d3e908358b7b
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
@@ -0,0 +1,46 @@
+/** @file
+  Common FADT Table Helpers
+
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.5 Specification, Aug 29, 2022
+
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/DebugLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+#include "FadtGenerator.h"
+
+/** Updates the Architecture specific information in the FADT Table.
+
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+                              Protocol Interface.
+  @param [in, out] Fadt       Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS           Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object was not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+EFI_STATUS
+EFIAPI
+FadtArchUpdate (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN   OUT EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE      *Fadt
+  )
+{
+  // Nothing to do.
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.c
index 470f1acfd11f..c2140ef414d2 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.c
@@ -19,22 +19,17 @@
 #include <ConfigurationManagerHelper.h>
 #include <Library/TableHelperLib.h>
 #include <Protocol/ConfigurationManagerProtocol.h>
+#include "FadtGenerator.h"
 
-/** ARM standard FADT Generator
+/** Standard FADT Generator
 
 Requirements:
   The following Configuration Manager Object(s) are required by
   this Generator:
   - EArchCommonObjPowerManagementProfileInfo
-  - EArmObjBootArchInfo
   - EArchCommonObjHypervisorVendorIdentity (OPTIONAL)
 */
 
-/** This macro defines the FADT flag options for ARM Platforms.
-*/
-#define FADT_FLAGS  (EFI_ACPI_6_5_HW_REDUCED_ACPI |          \
-                     EFI_ACPI_6_5_LOW_POWER_S0_IDLE_CAPABLE)
-
 /** This macro defines the valid mask for the FADT flag option
     if HW_REDUCED_ACPI flag in the table is set.
 
@@ -159,13 +154,13 @@ EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE  AcpiFadt = {
   // UINT8      Reserved1
   0,
   // UINT32     Flags
-  FADT_FLAGS,
+  0,
   // EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE  ResetReg
   NULL_GAS,
   // UINT8      ResetValue
   0,
   // UINT16     ArmBootArch
-  EFI_ACPI_6_5_ARM_PSCI_COMPLIANT,  // {Template}: ARM Boot Architecture Flags
+  0,  // {Template}: ARM Boot Architecture Flags
   // UINT8      MinorRevision
   EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template}
   // UINT64     XFirmwareCtrl
@@ -207,15 +202,6 @@ GET_OBJECT_LIST (
   CM_ARCH_COMMON_POWER_MANAGEMENT_PROFILE_INFO
   );
 
-/** This macro expands to a function that retrieves the Boot
-    Architecture Information from the Configuration Manager.
-*/
-GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjBootArchInfo,
-  CM_ARM_BOOT_ARCH_INFO
-  );
-
 /** This macro expands to a function that retrieves the Hypervisor
     Vendor ID from the Configuration Manager.
 */
@@ -287,58 +273,6 @@ error_handler:
   return Status;
 }
 
-/** Updates the Boot Architecture information in the FADT Table.
-
-  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
-                              Protocol Interface.
-
-  @retval EFI_SUCCESS           Success.
-  @retval EFI_INVALID_PARAMETER A parameter is invalid.
-  @retval EFI_NOT_FOUND         The required object was not found.
-  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
-                                Manager is less than the Object size for the
-                                requested object.
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-FadtAddBootArchInfo (
-  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol
-  )
-{
-  EFI_STATUS             Status;
-  CM_ARM_BOOT_ARCH_INFO  *BootArchInfo;
-
-  ASSERT (CfgMgrProtocol != NULL);
-
-  // Get the Boot Architecture flags from the Platform Configuration Manager
-  Status = GetEArmObjBootArchInfo (
-             CfgMgrProtocol,
-             CM_NULL_TOKEN,
-             &BootArchInfo,
-             NULL
-             );
-  if (EFI_ERROR (Status)) {
-    DEBUG ((
-      DEBUG_ERROR,
-      "ERROR: FADT: Failed to get Boot Architecture flags. Status = %r\n",
-      Status
-      ));
-    goto error_handler;
-  }
-
-  DEBUG ((
-    DEBUG_INFO,
-    "FADT BootArchFlag = 0x%x\n",
-    BootArchInfo->BootArchFlags
-    ));
-
-  AcpiFadt.ArmBootArch = BootArchInfo->BootArchFlags;
-
-error_handler:
-  return Status;
-}
-
 /** Update the Hypervisor Vendor ID in the FADT Table.
 
   @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
@@ -577,12 +511,6 @@ BuildFadtTable (
     goto error_handler;
   }
 
-  // Update BootArch Info
-  Status = FadtAddBootArchInfo (CfgMgrProtocol);
-  if (EFI_ERROR (Status)) {
-    goto error_handler;
-  }
-
   // Add the Hypervisor Vendor Id if present
   // Note if no hypervisor is present the zero bytes
   // will be placed in this field.
@@ -623,6 +551,12 @@ BuildFadtTable (
     }
   }
 
+  // Update Arch specific Info
+  Status = FadtArchUpdate (CfgMgrProtocol, &AcpiFadt);
+  if (EFI_ERROR (Status)) {
+    goto error_handler;
+  }
+
   *Table = (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiFadt;
 error_handler:
   return Status;
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
new file mode 100644
index 000000000000..08ac59e00684
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
@@ -0,0 +1,35 @@
+/** @file
+  FADT Table Generator
+
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.5 Specification, Aug 29, 2022
+
+**/
+
+#ifndef FADT_GENERATOR_H_
+#define FADT_GENERATOR_H_
+
+/** Updates the Architecture specific information in the FADT Table.
+
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+                              Protocol Interface.
+  @param [in, out] Fadt       Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS           Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object was not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+EFI_STATUS
+EFIAPI
+FadtArchUpdate (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN   OUT EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE      *Fadt
+  );
+
+#endif // FADT_GENERATOR_H_
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119635): https://edk2.groups.io/g/devel/message/119635
Mute This Topic: https://groups.io/mt/106770154/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 04/15] DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (2 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 03/15] DynamicTablesPkg: AcpiFadtLib: Prepare " PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 05/15] DynamicTablesPkg: AcpiSpcrLib: " PierreGondois
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Allow other architectures to reuse the AcpiDbg2Lib by extracting
the Arm specific part of the table generation.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf   |  7 ++
 .../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c | 67 +++++++++++++++++++
 .../AcpiDbg2Lib/Common/CommonDbg2Generator.c  | 59 ++++++++++++++++
 .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c   | 24 +++++--
 .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h   | 56 ++++++++++++++++
 5 files changed, 206 insertions(+), 7 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
index 32dcd20c082b..1e0ce347c0fa 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf
@@ -18,6 +18,13 @@ [Defines]
 
 [Sources]
   Dbg2Generator.c
+  Dbg2Generator.h
+
+[Sources.ARM, Sources.AARCH64]
+  Arm/ArmDbg2Generator.c
+
+[Sources.IA32, Sources.X86]
+  Common/CommonDbg2Generator.c
 
 [Packages.ARM, Packages.AARCH64]
   ArmPlatformPkg/ArmPlatformPkg.dec
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
new file mode 100644
index 000000000000..a063f49829e5
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
@@ -0,0 +1,67 @@
+/** @file
+  Arm DBG2 Table Generator
+
+  Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
+**/
+
+#include <ConfigurationManagerObject.h>
+#include <Library/PL011UartLib.h>
+#include <Protocol/SerialIo.h>
+#include "Dbg2Generator.h"
+
+/**
+  Initialise the serial port to the specified settings.
+  The serial port is re-configured only if the specified settings
+  are different from the current settings.
+  All unspecified settings will be set to the default values.
+
+  @param  SerialPortInfo          CM_ARCH_COMMON_SERIAL_PORT_INFO object describing
+                                  the serial port.
+  @param  BaudRate                The baud rate of the serial device. If the
+                                  baud rate is not supported, the speed will be
+                                  reduced to the nearest supported one and the
+                                  variable's value will be updated accordingly.
+  @param  ReceiveFifoDepth        The number of characters the device will
+                                  buffer on input.  Value of 0 will use the
+                                  device's default FIFO depth.
+  @param  Parity                  If applicable, this is the EFI_PARITY_TYPE
+                                  that is computed or checked as each character
+                                  is transmitted or received. If the device
+                                  does not support parity, the value is the
+                                  default parity value.
+  @param  DataBits                The number of data bits in each character.
+  @param  StopBits                If applicable, the EFI_STOP_BITS_TYPE number
+                                  of stop bits per character.
+                                  If the device does not support stop bits, the
+                                  value is the default stop bit value.
+
+  @retval RETURN_SUCCESS            All attributes were set correctly on the
+                                    serial device.
+  @retval RETURN_INVALID_PARAMETER  One or more of the attributes has an
+                                    unsupported value.
+**/
+RETURN_STATUS
+EFIAPI
+Dbg2InitializePort (
+  IN  CONST CM_ARCH_COMMON_SERIAL_PORT_INFO  *SerialPortInfo,
+  IN OUT UINT64                              *BaudRate,
+  IN OUT UINT32                              *ReceiveFifoDepth,
+  IN OUT EFI_PARITY_TYPE                     *Parity,
+  IN OUT UINT8                               *DataBits,
+  IN OUT EFI_STOP_BITS_TYPE                  *StopBits
+  )
+{
+  return PL011UartInitializePort (
+           (UINTN)SerialPortInfo->BaseAddress,
+           SerialPortInfo->Clock,
+           BaudRate,
+           ReceiveFifoDepth,
+           Parity,
+           DataBits,
+           StopBits
+           );
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
new file mode 100644
index 000000000000..936f3ca46604
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
@@ -0,0 +1,59 @@
+/** @file
+  Common DBG2 Table Generator
+
+  Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
+**/
+
+#include <ConfigurationManagerObject.h>
+#include <Protocol/SerialIo.h>
+#include "Dbg2Generator.h"
+
+/**
+  Initialise the serial port to the specified settings.
+  The serial port is re-configured only if the specified settings
+  are different from the current settings.
+  All unspecified settings will be set to the default values.
+
+  @param  SerialPortInfo          CM_ARCH_COMMON_SERIAL_PORT_INFO object describing
+                                  the serial port.
+  @param  BaudRate                The baud rate of the serial device. If the
+                                  baud rate is not supported, the speed will be
+                                  reduced to the nearest supported one and the
+                                  variable's value will be updated accordingly.
+  @param  ReceiveFifoDepth        The number of characters the device will
+                                  buffer on input.  Value of 0 will use the
+                                  device's default FIFO depth.
+  @param  Parity                  If applicable, this is the EFI_PARITY_TYPE
+                                  that is computed or checked as each character
+                                  is transmitted or received. If the device
+                                  does not support parity, the value is the
+                                  default parity value.
+  @param  DataBits                The number of data bits in each character.
+  @param  StopBits                If applicable, the EFI_STOP_BITS_TYPE number
+                                  of stop bits per character.
+                                  If the device does not support stop bits, the
+                                  value is the default stop bit value.
+
+  @retval RETURN_SUCCESS            All attributes were set correctly on the
+                                    serial device.
+  @retval RETURN_INVALID_PARAMETER  One or more of the attributes has an
+                                    unsupported value.
+**/
+RETURN_STATUS
+EFIAPI
+Dbg2InitializePort (
+  IN  CONST CM_ARCH_COMMON_SERIAL_PORT_INFO  *SerialPortInfo,
+  IN OUT UINT64                              *BaudRate,
+  IN OUT UINT32                              *ReceiveFifoDepth,
+  IN OUT EFI_PARITY_TYPE                     *Parity,
+  IN OUT UINT8                               *DataBits,
+  IN OUT EFI_STOP_BITS_TYPE                  *StopBits
+  )
+{
+  // Nothing to do.
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c
index fbf2ba37331d..6f49e6a27053 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.c
@@ -14,7 +14,6 @@
 #include <Library/AcpiLib.h>
 #include <Library/DebugLib.h>
 #include <Library/MemoryAllocationLib.h>
-#include <Library/PL011UartLib.h>
 #include <Protocol/AcpiTable.h>
 #include <Protocol/SerialIo.h>
 
@@ -26,9 +25,11 @@
 #include <Library/TableHelperLib.h>
 #include <Protocol/ConfigurationManagerProtocol.h>
 
+#include "Dbg2Generator.h"
+
 /** ARM standard DBG2 Table Generator
 
-  Constructs the DBG2 table for PL011 or SBSA UART peripherals.
+  Constructs the DBG2 table for corresponding DBG2 peripheral.
 
 Requirements:
   The following Configuration Manager Object(s) are required by
@@ -169,7 +170,7 @@ DBG2_TABLE  AcpiDbg2 = {
     DBG2_DEBUG_PORT_DDI (
       0,                    // {Template}: Serial Port Subtype
       0,                    // {Template}: Serial Port Base Address
-      PL011_UART_LENGTH,
+      0,                    // {Template}: Serial Port Base Address Size
       NAMESPACE_STR_DBG_PORT0
       )
   }
@@ -186,7 +187,7 @@ GET_OBJECT_LIST (
   CM_ARCH_COMMON_SERIAL_PORT_INFO
   );
 
-/** Initialize the PL011/SBSA UART with the parameters obtained from
+/** Initialize the DBG2 UART with the parameters obtained from
     the Configuration Manager.
 
   @param [in]  SerialPortInfo Pointer to the Serial Port Information.
@@ -218,9 +219,8 @@ SetupDebugUart (
   StopBits         = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);
 
   BaudRate = SerialPortInfo->BaudRate;
-  Status   = PL011UartInitializePort (
-               (UINTN)SerialPortInfo->BaseAddress,
-               SerialPortInfo->Clock,
+  Status   = Dbg2InitializePort (
+               SerialPortInfo,
                &BaudRate,
                &ReceiveFifoDepth,
                &Parity,
@@ -460,6 +460,9 @@ BuildDbg2TableEx (
       (SerialPortInfo->PortSubtype ==
        EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART))
   {
+    // Setup the PL011 length.
+    AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].AddressSize = PL011_UART_LENGTH;
+
     // Initialize the serial port
     Status = SetupDebugUart (SerialPortInfo);
     if (EFI_ERROR (Status)) {
@@ -470,6 +473,13 @@ BuildDbg2TableEx (
         ));
       goto error_handler;
     }
+  } else if ((SerialPortInfo->PortSubtype ==
+              EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_16550_WITH_GAS))
+  {
+    AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].AddressSize = SIZE_4KB;
+  } else {
+    // Try to catch other serial ports, but don't return an error.
+    ASSERT (0);
   }
 
   TableList[0] = (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiDbg2;
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
new file mode 100644
index 000000000000..5424be47b8ec
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
@@ -0,0 +1,56 @@
+/** @file
+  DBG2 Table Generator
+
+  Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
+**/
+
+#ifndef DBG2_GENERATOR_H_
+#define DBG2_GENERATOR_H_
+
+/**
+  Initialise the serial port to the specified settings.
+  The serial port is re-configured only if the specified settings
+  are different from the current settings.
+  All unspecified settings will be set to the default values.
+
+  @param  SerialPortInfo          CM_ARCH_COMMON_SERIAL_PORT_INFO object describing
+                                  the serial port.
+  @param  BaudRate                The baud rate of the serial device. If the
+                                  baud rate is not supported, the speed will be
+                                  reduced to the nearest supported one and the
+                                  variable's value will be updated accordingly.
+  @param  ReceiveFifoDepth        The number of characters the device will
+                                  buffer on input.  Value of 0 will use the
+                                  device's default FIFO depth.
+  @param  Parity                  If applicable, this is the EFI_PARITY_TYPE
+                                  that is computed or checked as each character
+                                  is transmitted or received. If the device
+                                  does not support parity, the value is the
+                                  default parity value.
+  @param  DataBits                The number of data bits in each character.
+  @param  StopBits                If applicable, the EFI_STOP_BITS_TYPE number
+                                  of stop bits per character.
+                                  If the device does not support stop bits, the
+                                  value is the default stop bit value.
+
+  @retval RETURN_SUCCESS            All attributes were set correctly on the
+                                    serial device.
+  @retval RETURN_INVALID_PARAMETER  One or more of the attributes has an
+                                    unsupported value.
+**/
+RETURN_STATUS
+EFIAPI
+Dbg2InitializePort (
+  IN  CONST CM_ARCH_COMMON_SERIAL_PORT_INFO  *SerialPortInfo,
+  IN OUT UINT64                              *BaudRate,
+  IN OUT UINT32                              *ReceiveFifoDepth,
+  IN OUT EFI_PARITY_TYPE                     *Parity,
+  IN OUT UINT8                               *DataBits,
+  IN OUT EFI_STOP_BITS_TYPE                  *StopBits
+  );
+
+#endif // DBG2_GENERATOR_H_
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119636): https://edk2.groups.io/g/devel/message/119636
Mute This Topic: https://groups.io/mt/106770155/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 05/15] DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (3 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 04/15] DynamicTablesPkg: AcpiDbg2Lib: " PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 06/15] DynamicTablesPkg: AcpiSratLib: " PierreGondois
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Remove the Arm name from the generator to show the generator
can be used by other archs.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c
index 6f027f3bf941..065729d7eecf 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/SpcrGenerator.c
@@ -26,7 +26,7 @@
 #include <Library/TableHelperLib.h>
 #include <Protocol/ConfigurationManagerProtocol.h>
 
-/** ARM standard SPCR Table Generator
+/** Standard SPCR Table Generator
 
   Constructs the SPCR table for PL011 or SBSA UART peripherals.
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119637): https://edk2.groups.io/g/devel/message/119637
Mute This Topic: https://groups.io/mt/106770156/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 06/15] DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (4 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 05/15] DynamicTablesPkg: AcpiSpcrLib: " PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 07/15] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC PierreGondois
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun, Pierre Gondois

Allow other architectures to reuse the AcpiSratLib by extracting
the Arm specific part of the table generation.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Acpi/Common/AcpiSratLib/AcpiSratLib.inf   |   7 +
 .../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 ++++++++++++++++++
 .../AcpiSratLib/Common/CommonSratGenerator.c  |  77 +++++
 .../Acpi/Common/AcpiSratLib/SratGenerator.c   | 214 ++------------
 .../Acpi/Common/AcpiSratLib/SratGenerator.h   |  59 ++++
 5 files changed, 422 insertions(+), 197 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
index 2f23f4e668e5..c2f24a23ccd8 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/AcpiSratLib.inf
@@ -18,6 +18,13 @@ [Defines]
 
 [Sources]
   SratGenerator.c
+  SratGenerator.h
+
+[Sources.ARM, Sources.AARCH64]
+  Arm/ArmSratGenerator.c
+
+[Sources.IA32, Sources.X64]
+  Common/CommonSratGenerator.c
 
 [Packages]
   EmbeddedPkg/EmbeddedPkg.dec
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
new file mode 100644
index 000000000000..3d36b25e1840
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
@@ -0,0 +1,262 @@
+/** @file
+  Arm SRAT Table Generator
+
+  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.3 Specification, January 2019
+
+  @par Glossary:
+  - Cm or CM   - Configuration Manager
+  - Obj or OBJ - Object
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+
+#include "SratGenerator.h"
+
+/**
+  ARM standard SRAT Generator
+
+  Requirements:
+    The following Configuration Manager Object(s) are used by this Generator:
+    - EArmObjGicCInfo (REQUIRED)
+    - EArmObjGicItsInfo (OPTIONAL)
+*/
+
+/** This macro expands to a function that retrieves the GIC
+    CPU interface Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicCInfo,
+  CM_ARM_GICC_INFO
+  );
+
+/** This macro expands to a function that retrieves the GIC
+    Interrupt Translation Service Information from the
+    Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicItsInfo,
+  CM_ARM_GIC_ITS_INFO
+  );
+
+/** Enum of the Arm specific CM objects required to
+    build the arch specific information of the SRAT table.
+*/
+typedef enum ArmSratSubTableType {
+  EArmGicCSubTableType,
+  EArmGicItsSubTableType,
+  EArmSubTableTypeMax,
+} EARM_SRAT_SUB_TABLE_TYPE;
+
+typedef struct SratSubTable {
+  /// Start offset of the arch specific sub-table.
+  UINT32    Offset;
+
+  /// Count
+  UINT32    Count;
+
+  /// Array of CmInfo objects of the relevant type.
+  VOID      *CmInfo;
+} SRAT_SUB_TABLE;
+
+STATIC SRAT_SUB_TABLE  mSratSubTable[EArmSubTableTypeMax];
+
+/** Reserve arch sub-tables space.
+
+  @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
+  @param [in, out] ArchOffset  On input, contains the offset where arch specific
+                               sub-tables can be written. It is expected that
+                               there enough space to write all the arch specific
+                               sub-tables from this offset onward.
+                               On ouput, contains the ending offset of the arch
+                               specific sub-tables.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+EFI_STATUS
+EFIAPI
+ArchReserveOffsets (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN OUT UINT32                                           *ArchOffset
+  )
+{
+  EFI_STATUS  Status;
+
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (ArchOffset != NULL);
+
+  Status = GetEArmObjGicCInfo (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             (CM_ARM_GICC_INFO **)&mSratSubTable[EArmGicCSubTableType].CmInfo,
+             &mSratSubTable[EArmGicCSubTableType].Count
+             );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: SRAT: Failed to get GICC Info. Status = %r\n",
+      Status
+      ));
+    return Status;
+  }
+
+  if (mSratSubTable[EArmGicCSubTableType].Count == 0) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: SRAT: GIC CPU Interface information not provided.\n"
+      ));
+    ASSERT (0);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Status = GetEArmObjGicItsInfo (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             (CM_ARM_GIC_ITS_INFO **)&mSratSubTable[EArmGicItsSubTableType].CmInfo,
+             &mSratSubTable[EArmGicItsSubTableType].Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: SRAT: Failed to get GIC ITS Info. Status = %r\n",
+      Status
+      ));
+    return Status;
+  }
+
+  mSratSubTable[EArmGicCSubTableType].Offset = *ArchOffset;
+  *ArchOffset                               += (sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE) *
+                                                mSratSubTable[EArmGicCSubTableType].Count);
+
+  if (mSratSubTable[EArmGicItsSubTableType].Count != 0) {
+    mSratSubTable[EArmGicItsSubTableType].Offset = *ArchOffset;
+    *ArchOffset                                 += (sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE) *
+                                                    mSratSubTable[EArmGicItsSubTableType].Count);
+  }
+
+  return EFI_SUCCESS;
+}
+
+/** Add the GICC Affinity Structures in the SRAT Table.
+
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+                                Protocol Interface.
+  @param [in]  Srat             Pointer to the SRAT Table.
+**/
+STATIC
+VOID
+EFIAPI
+AddGICCAffinity (
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
+  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat
+  )
+{
+  EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE  *GicCAff;
+  CM_ARM_GICC_INFO                      *GicCInfo;
+
+  GicCInfo = mSratSubTable[EArmGicCSubTableType].CmInfo;
+  GicCAff  = (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
+                                                      mSratSubTable[EArmGicCSubTableType].Offset);
+
+  while (mSratSubTable[EArmGicCSubTableType].Count-- != 0) {
+    DEBUG ((DEBUG_INFO, "SRAT: GicCAff = 0x%p\n", GicCAff));
+
+    GicCAff->Type             = EFI_ACPI_6_3_GICC_AFFINITY;
+    GicCAff->Length           = sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE);
+    GicCAff->ProximityDomain  = GicCInfo->ProximityDomain;
+    GicCAff->AcpiProcessorUid = GicCInfo->AcpiProcessorUid;
+    GicCAff->Flags            = GicCInfo->AffinityFlags;
+    GicCAff->ClockDomain      = GicCInfo->ClockDomain;
+
+    // Next
+    GicCAff++;
+    GicCInfo++;
+  }// while
+}
+
+/** Add the GIC ITS Affinity Structures in the SRAT Table.
+
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+                                Protocol Interface.
+  @param [in]  Srat             Pointer to the SRAT Table.
+**/
+STATIC
+VOID
+EFIAPI
+AddGICItsAffinity (
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
+  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat
+  )
+{
+  EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE  *GicItsAff;
+  CM_ARM_GIC_ITS_INFO                      *GicItsInfo;
+
+  GicItsInfo = mSratSubTable[EArmGicItsSubTableType].CmInfo;
+  GicItsAff  = (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
+                                                           mSratSubTable[EArmGicItsSubTableType].Offset);
+
+  while (mSratSubTable[EArmGicItsSubTableType].Count-- != 0) {
+    DEBUG ((DEBUG_INFO, "SRAT: GicItsAff = 0x%p\n", GicItsAff));
+
+    GicItsAff->Type            = EFI_ACPI_6_3_GIC_ITS_AFFINITY;
+    GicItsAff->Length          = sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE);
+    GicItsAff->ProximityDomain = GicItsInfo->ProximityDomain;
+    GicItsAff->Reserved[0]     = EFI_ACPI_RESERVED_BYTE;
+    GicItsAff->Reserved[1]     = EFI_ACPI_RESERVED_BYTE;
+    GicItsAff->ItsId           = GicItsInfo->GicItsId;
+
+    // Next
+    GicItsAff++;
+    GicItsInfo++;
+  }// while
+}
+
+/** Add the arch specific sub-tables to the SRAT table.
+
+  These sub-tables are written in the space reserved beforehand.
+
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+                                Protocol Interface.
+  @param [in]  Srat             Pointer to the SRAT Table.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+**/
+EFI_STATUS
+EFIAPI
+AddArchObjects (
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
+  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat
+  )
+{
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (Srat != NULL);
+
+  AddGICCAffinity (CfgMgrProtocol, Srat);
+
+  if (mSratSubTable[EArmGicCSubTableType].Count != 0) {
+    AddGICItsAffinity (CfgMgrProtocol, Srat);
+  }
+
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
new file mode 100644
index 000000000000..bc69fbf7f3bb
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
@@ -0,0 +1,77 @@
+/** @file
+  Common SRAT Table Generator
+
+  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.3 Specification, January 2019
+
+  @par Glossary:
+  - Cm or CM   - Configuration Manager
+  - Obj or OBJ - Object
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+
+#include "SratGenerator.h"
+
+/** Reserve arch sub-tables space.
+
+  @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
+  @param [in, out] ArchOffset  On input, contains the offset where arch specific
+                               sub-tables can be written. It is expected that
+                               there enough space to write all the arch specific
+                               sub-tables from this offset onward.
+                               On ouput, contains the ending offset of the arch
+                               specific sub-tables.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+EFI_STATUS
+EFIAPI
+ArchReserveOffsets (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN OUT UINT32                                           *ArchOffset
+  )
+{
+  // Nothing to do.
+  return EFI_SUCCESS;
+}
+
+/** Add the arch specific sub-tables to the SRAT table.
+
+  These sub-tables are written in the space reserved beforehand.
+
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+                                Protocol Interface.
+  @param [in]  Srat             Pointer to the SRAT Table.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+**/
+EFI_STATUS
+EFIAPI
+AddArchObjects (
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
+  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat
+  )
+{
+  // Nothing to do.
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
index 48c9970a7151..dcdacc4e966e 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.c
@@ -25,38 +25,19 @@
 #include <Library/TableHelperLib.h>
 #include <Protocol/ConfigurationManagerProtocol.h>
 
+#include "SratGenerator.h"
+
 /**
-  ARM standard SRAT Generator
+  Standard SRAT Generator
 
   Requirements:
     The following Configuration Manager Object(s) are used by this Generator:
-    - EArmObjGicCInfo (REQUIRED)
-    - EArmObjGicItsInfo (OPTIONAL)
     - EArchCommonObjMemoryAffinityInfo (OPTIONAL)
     - EArchCommonObjGenericInitiatorAffinityInfo (OPTIONAL)
     - EArchCommonObjDeviceHandleAcpi (OPTIONAL)
     - EArchCommonObjDeviceHandlePci (OPTIONAL)
 */
 
-/** This macro expands to a function that retrieves the GIC
-    CPU interface Information from the Configuration Manager.
-*/
-GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjGicCInfo,
-  CM_ARM_GICC_INFO
-  );
-
-/** This macro expands to a function that retrieves the GIC
-    Interrupt Translation Service Information from the
-    Configuration Manager.
-*/
-GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjGicItsInfo,
-  CM_ARM_GIC_ITS_INFO
-  );
-
 /**
   This macro expands to a function that retrieves the Memory Affinity
   information from the Configuration Manager.
@@ -121,102 +102,6 @@ GetBdf (
   return Bdf;
 }
 
-/** Add the GICC Affinity Structures in the SRAT Table.
-
-  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
-                                Protocol Interface.
-  @param [in]  Srat             Pointer to the SRAT Table.
-  @param [in]  GicCAffOffset    Offset of the GICC Affinity
-                                information in the SRAT Table.
-  @param [in]  GicCInfo         Pointer to the GIC CPU Information list.
-  @param [in]  GicCCount        Count of GIC CPU Interfaces.
-
-  @retval EFI_SUCCESS           Table generated successfully.
-**/
-STATIC
-EFI_STATUS
-AddGICCAffinity (
-  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
-  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat,
-  IN CONST UINT32                                               GicCAffOffset,
-  IN CONST CM_ARM_GICC_INFO                                     *GicCInfo,
-  IN       UINT32                                               GicCCount
-  )
-{
-  EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE  *GicCAff;
-
-  ASSERT (Srat != NULL);
-  ASSERT (GicCInfo != NULL);
-
-  GicCAff = (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
-                                                     GicCAffOffset);
-
-  while (GicCCount-- != 0) {
-    DEBUG ((DEBUG_INFO, "SRAT: GicCAff = 0x%p\n", GicCAff));
-
-    GicCAff->Type             = EFI_ACPI_6_3_GICC_AFFINITY;
-    GicCAff->Length           = sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE);
-    GicCAff->ProximityDomain  = GicCInfo->ProximityDomain;
-    GicCAff->AcpiProcessorUid = GicCInfo->AcpiProcessorUid;
-    GicCAff->Flags            = GicCInfo->AffinityFlags;
-    GicCAff->ClockDomain      = GicCInfo->ClockDomain;
-
-    // Next
-    GicCAff++;
-    GicCInfo++;
-  }// while
-
-  return EFI_SUCCESS;
-}
-
-/** Add the GIC ITS Affinity Structures in the SRAT Table.
-
-  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
-                                Protocol Interface.
-  @param [in]  Srat             Pointer to the SRAT Table.
-  @param [in]  GicItsAffOffset  Offset of the GIC ITS Affinity
-                                information in the SRAT Table.
-  @param [in]  GicItsInfo       Pointer to the GIC ITS Information list.
-  @param [in]  GicItsCount      Count of GIC ITS.
-
-  @retval EFI_SUCCESS           Table generated successfully.
-**/
-STATIC
-EFI_STATUS
-AddGICItsAffinity (
-  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
-  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat,
-  IN CONST UINT32                                               GicItsAffOffset,
-  IN CONST CM_ARM_GIC_ITS_INFO                                  *GicItsInfo,
-  IN       UINT32                                               GicItsCount
-  )
-{
-  EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE  *GicItsAff;
-
-  ASSERT (Srat != NULL);
-  ASSERT (GicItsInfo != NULL);
-
-  GicItsAff = (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
-                                                          GicItsAffOffset);
-
-  while (GicItsCount-- != 0) {
-    DEBUG ((DEBUG_INFO, "SRAT: GicItsAff = 0x%p\n", GicItsAff));
-
-    GicItsAff->Type            = EFI_ACPI_6_3_GIC_ITS_AFFINITY;
-    GicItsAff->Length          = sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE);
-    GicItsAff->ProximityDomain = GicItsInfo->ProximityDomain;
-    GicItsAff->Reserved[0]     = EFI_ACPI_RESERVED_BYTE;
-    GicItsAff->Reserved[1]     = EFI_ACPI_RESERVED_BYTE;
-    GicItsAff->ItsId           = GicItsInfo->GicItsId;
-
-    // Next
-    GicItsAff++;
-    GicItsInfo++;
-  }// while
-
-  return EFI_SUCCESS;
-}
-
 /** Add the Memory Affinity Structures in the SRAT Table.
 
   @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
@@ -455,18 +340,12 @@ BuildSratTable (
 {
   EFI_STATUS  Status;
   UINT32      TableSize;
-  UINT32      GicCCount;
-  UINT32      GicItsCount;
   UINT32      MemAffCount;
   UINT32      GenInitiatorAffCount;
 
-  UINT32  GicCAffOffset;
-  UINT32  GicItsAffOffset;
   UINT32  MemAffOffset;
   UINT32  GenInitiatorAffOffset;
 
-  CM_ARM_GICC_INFO                                *GicCInfo;
-  CM_ARM_GIC_ITS_INFO                             *GicItsInfo;
   CM_ARCH_COMMON_MEMORY_AFFINITY_INFO             *MemAffInfo;
   CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO  *GenInitiatorAffInfo;
 
@@ -497,46 +376,6 @@ BuildSratTable (
 
   *Table = NULL;
 
-  Status = GetEArmObjGicCInfo (
-             CfgMgrProtocol,
-             CM_NULL_TOKEN,
-             &GicCInfo,
-             &GicCCount
-             );
-  if (EFI_ERROR (Status)) {
-    DEBUG ((
-      DEBUG_ERROR,
-      "ERROR: SRAT: Failed to get GICC Info. Status = %r\n",
-      Status
-      ));
-    goto error_handler;
-  }
-
-  if (GicCCount == 0) {
-    DEBUG ((
-      DEBUG_ERROR,
-      "ERROR: SRAT: GIC CPU Interface information not provided.\n"
-      ));
-    ASSERT (0);
-    Status = EFI_INVALID_PARAMETER;
-    goto error_handler;
-  }
-
-  Status = GetEArmObjGicItsInfo (
-             CfgMgrProtocol,
-             CM_NULL_TOKEN,
-             &GicItsInfo,
-             &GicItsCount
-             );
-  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
-    DEBUG ((
-      DEBUG_ERROR,
-      "ERROR: SRAT: Failed to get GIC ITS Info. Status = %r\n",
-      Status
-      ));
-    goto error_handler;
-  }
-
   Status = GetEArchCommonObjMemoryAffinityInfo (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
@@ -571,13 +410,18 @@ BuildSratTable (
   // Calculate the size of the SRAT table
   TableSize = sizeof (EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER);
 
-  GicCAffOffset = TableSize;
-  TableSize    += (sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE) * GicCCount);
-
-  if (GicItsCount != 0) {
-    GicItsAffOffset = TableSize;
-    TableSize      += (sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE) *
-                       GicItsCount);
+  // Place the Arch specific subtables/structures first and
+  // reserve the offsets. The common subtables/structures
+  // are placed next.
+  Status = ArchReserveOffsets (CfgMgrProtocol, &TableSize);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: SRAT: Failed to reserve arch offsets."
+      " Status = %r\n",
+      Status
+      ));
+    goto error_handler;
   }
 
   if (MemAffCount != 0) {
@@ -636,40 +480,16 @@ BuildSratTable (
   Srat->Reserved1 = 1;
   Srat->Reserved2 = EFI_ACPI_RESERVED_QWORD;
 
-  Status = AddGICCAffinity (
-             CfgMgrProtocol,
-             Srat,
-             GicCAffOffset,
-             GicCInfo,
-             GicCCount
-             );
+  Status = AddArchObjects (CfgMgrProtocol, Srat);
   if (EFI_ERROR (Status)) {
     DEBUG ((
       DEBUG_ERROR,
-      "ERROR: SRAT: Failed to add GICC Affinity structures. Status = %r\n",
+      "ERROR: SRAT: Failed to add arch objects header. Status = %r\n",
       Status
       ));
     goto error_handler;
   }
 
-  if (GicItsCount != 0) {
-    Status = AddGICItsAffinity (
-               CfgMgrProtocol,
-               Srat,
-               GicItsAffOffset,
-               GicItsInfo,
-               GicItsCount
-               );
-    if (EFI_ERROR (Status)) {
-      DEBUG ((
-        DEBUG_ERROR,
-        "ERROR: SRAT: Failed to add GIC ITS Affinity structures. Status = %r\n",
-        Status
-        ));
-      goto error_handler;
-    }
-  }
-
   if (MemAffCount != 0) {
     Status = AddMemoryAffinity (
                CfgMgrProtocol,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
new file mode 100644
index 000000000000..106d0084947e
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
@@ -0,0 +1,59 @@
+/** @file
+  SRAT Table Generator
+
+  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.3 Specification, January 2019
+
+  @par Glossary:
+  - Cm or CM   - Configuration Manager
+  - Obj or OBJ - Object
+**/
+
+#ifndef SRAT_GENERATOR_H_
+#define SRAT_GENERATOR_H_
+
+/** Reserve arch sub-tables space.
+
+  @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
+  @param [in, out] ArchOffset  On input, contains the offset where arch specific
+                               sub-tables can be written. It is expected that
+                               there enough space to write all the arch specific
+                               sub-tables from this offset onward.
+                               On ouput, contains the ending offset of the arch
+                               specific sub-tables.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+**/
+EFI_STATUS
+EFIAPI
+ArchReserveOffsets (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN OUT UINT32                                           *ArchOffset
+  );
+
+/** Add the arch specific sub-tables to the SRAT table.
+
+  These sub-tables are written in the space reserved beforehand.
+
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+                                Protocol Interface.
+  @param [in]  Srat             Pointer to the SRAT Table.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+**/
+EFI_STATUS
+EFIAPI
+AddArchObjects (
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
+  IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat
+  );
+
+#endif // SRAT_GENERATOR_H_
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119638): https://edk2.groups.io/g/devel/message/119638
Mute This Topic: https://groups.io/mt/106770159/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 07/15] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (5 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 06/15] DynamicTablesPkg: AcpiSratLib: " PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 08/15] DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray PierreGondois
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

The GICC is an ARM specific structure. Other architectures have different
local interrupt controller structures from which CPU topology can be
created. Avoid the GICC reference in common code by:
- creating a wrapper CreateTopologyFromIntC() instead of
  CreateTopologyFromGicC() so that different archs can implement
  it differently.
- implementing arch specific functions to get the AcpiProcessorUid,
  CpcToken, EtToken and use them instead of using the GicC CM object
  directly.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Arm/ArmSsdtCpuTopologyGenerator.c         | 408 ++++++++++++++++++
 .../SsdtCpuTopologyGenerator.c                | 341 ++-------------
 .../SsdtCpuTopologyGenerator.h                | 196 +++++++++
 .../SsdtCpuTopologyLib.inf                    |   3 +
 4 files changed, 647 insertions(+), 301 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
new file mode 100644
index 000000000000..140a2e491116
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
@@ -0,0 +1,408 @@
+/** @file
+  ARM SSDT Cpu Topology Table Generator Helpers.
+
+  Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+    - ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors
+    - ACPI for CoreSight version 1.2 Platform Design Document
+      (https://developer.arm.com/documentation/den0067/a/?lang=en)
+
+  @par Glossary:
+    - ETE - Embedded Trace Extension.
+    - ETM - Embedded Trace Macrocell.
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/AcpiHelperLib.h>
+#include <Library/TableHelperLib.h>
+#include <Library/AmlLib/AmlLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+
+#include "SsdtCpuTopologyGenerator.h"
+
+/** ARM SSDT Cpu Topology Table Generator.
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjGicCInfo
+  - EArmObjEtInfo (OPTIONAL)
+*/
+
+/** This macro expands to a function that retrieves the GIC
+    CPU interface Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicCInfo,
+  CM_ARM_GICC_INFO
+  );
+
+/**
+  This macro expands to a function that retrieves the ET device
+  information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjEtInfo,
+  CM_ARM_ET_INFO
+  );
+
+/** Create an embedded trace device and add it to the Cpu Node in the
+    AML namespace.
+
+  This generates the following ASL code:
+  Device (E002)
+  {
+      Name (_UID, 2)
+      Name (_HID, "ARMHC500")
+  }
+
+  Note: Currently we only support generating ETE nodes. Unlike ETM,
+  ETE has a system register interface and therefore does not need
+  the MMIO range to be described.
+
+  @param [in]  Generator            The SSDT Cpu Topology generator.
+  @param [in]  ParentNode           Parent node to attach the Cpu node to.
+  @param [in]  AcpiProcessorUid     ACPI Processor UID of the CPU.
+  @param [in]  CpuName              Value used to generate the node name.
+  @param [out] EtNodePtr            If not NULL, return the created Cpu node.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+CreateAmlEtd (
+  IN   ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,
+  IN   AML_NODE_HANDLE              ParentNode,
+  IN   UINT32                       AcpiProcessorUid,
+  IN   UINT32                       CpuName,
+  OUT  AML_OBJECT_NODE_HANDLE       *EtNodePtr OPTIONAL
+  )
+{
+  EFI_STATUS              Status;
+  AML_OBJECT_NODE_HANDLE  EtNode;
+  CHAR8                   AslName[AML_NAME_SEG_SIZE + 1];
+
+  ASSERT (Generator != NULL);
+  ASSERT (ParentNode != NULL);
+
+  Status = WriteAslName ('E', CpuName, AslName);
+  if (EFI_ERROR (Status)) {
+    ASSERT (0);
+    return Status;
+  }
+
+  Status = AmlCodeGenDevice (AslName, ParentNode, &EtNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT (0);
+    return Status;
+  }
+
+  Status = AmlCodeGenNameInteger (
+             "_UID",
+             AcpiProcessorUid,
+             EtNode,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT (0);
+    return Status;
+  }
+
+  Status = AmlCodeGenNameString (
+             "_HID",
+             ACPI_HID_ET_DEVICE,
+             EtNode,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT (0);
+    return Status;
+  }
+
+  // If requested, return the handle to the EtNode.
+  if (EtNodePtr != NULL) {
+    *EtNodePtr = EtNode;
+  }
+
+  return Status;
+}
+
+/** Create and add an Embedded trace device to the Cpu Node.
+
+  @param [in]  Generator              The SSDT Cpu Topology generator.
+  @param [in]  CfgMgrProtocol         Pointer to the Configuration Manager
+                                      Protocol Interface.
+  @param [in]  AcpiProcessorUid       ACPI processor Uid of the local intc (gicc, other)
+                                      describing the Cpu.
+  @param [in]  EtToken                Embedded Trace Token of the CPU.
+  @param [in]  CpuName                Value used to generate the CPU node name.
+  @param [in]  CpuNode                CPU Node to which the ET device node is
+                                      attached.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_UNSUPPORTED         Feature Unsupported.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+CreateAmlEtNode (
+  IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  UINT32                                              AcpiProcessorUid,
+  IN  CM_OBJECT_TOKEN                                     EtToken,
+  IN  UINT32                                              CpuName,
+  IN  AML_OBJECT_NODE_HANDLE                              *CpuNode
+  )
+{
+  EFI_STATUS      Status;
+  CM_ARM_ET_INFO  *EtInfo;
+
+  Status = GetEArmObjEtInfo (
+             CfgMgrProtocol,
+             EtToken,
+             &EtInfo,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT (0);
+    return Status;
+  }
+
+  // Currently we only support creation of a ETE Node.
+  if (EtInfo->EtType != ArmEtTypeEte) {
+    return EFI_UNSUPPORTED;
+  }
+
+  Status = CreateAmlEtd (
+             Generator,
+             CpuNode,
+             AcpiProcessorUid,
+             CpuName,
+             NULL
+             );
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
+/** Create the processor hierarchy AML tree from arch specific CM objects.
+
+  The Arm architecture will use the CM_ARM_GICC_INFO CM objects for instance.
+  A processor container is by extension any non-leave device in the cpu topology.
+
+  @param [in] Generator        The SSDT Cpu Topology generator.
+  @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
+                               Protocol Interface.
+  @param [in] ScopeNode        Scope node handle ('\_SB' scope).
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+CreateTopologyFromIntC (
+  IN        ACPI_CPU_TOPOLOGY_GENERATOR                   *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN        AML_OBJECT_NODE_HANDLE                        ScopeNode
+  )
+{
+  EFI_STATUS              Status;
+  CM_ARM_GICC_INFO        *GicCInfo;
+  UINT32                  GicCInfoCount;
+  UINT32                  Index;
+  AML_OBJECT_NODE_HANDLE  CpuNode;
+
+  ASSERT (Generator != NULL);
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (ScopeNode != NULL);
+
+  Status = GetEArmObjGicCInfo (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &GicCInfo,
+             &GicCInfoCount
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT (0);
+    return Status;
+  }
+
+  // For each CM_ARM_GICC_INFO object, create an AML node.
+  for (Index = 0; Index < GicCInfoCount; Index++) {
+    Status = CreateAmlCpu (
+               Generator,
+               ScopeNode,
+               GicCInfo[Index].AcpiProcessorUid,
+               Index,
+               &CpuNode
+               );
+    if (EFI_ERROR (Status)) {
+      ASSERT (0);
+      break;
+    }
+
+    // If a CPC info is associated with the
+    // GicCinfo, create an _CPC method returning them.
+    if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) {
+      Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo[Index].CpcToken, CpuNode);
+      if (EFI_ERROR (Status)) {
+        ASSERT_EFI_ERROR (Status);
+        break;
+      }
+    }
+
+    if (GicCInfo[Index].EtToken != CM_NULL_TOKEN) {
+      Status = CreateAmlEtNode (
+                 Generator,
+                 CfgMgrProtocol,
+                 GicCInfo[Index].AcpiProcessorUid,
+                 GicCInfo[Index].EtToken,
+                 Index,
+                 CpuNode
+                 );
+      if (EFI_ERROR (Status)) {
+        ASSERT_EFI_ERROR (Status);
+        return Status;
+      }
+    }
+  } // for
+
+  return Status;
+}
+
+/** Get generic interrupt information from arch specific CM objects.
+
+  The AcpiProcessorUid, CpcToken, etc. are held in arch specific CM objects,
+  in the CM_ARM_GICC_INFO CM object for Arm for instance.
+  This wrapper allows to get this information from each arch object.
+
+  @param [in]  CfgMgrProtocol     Pointer to the Configuration Manager
+                                  Protocol Interface.
+  @param [in]  AcpiIdObjectToken  AcpiIdObjectToken identifying the CPU to fetch the
+                                  other fields from.
+  @param [out] AcpiProcessorUid   AcpiProcessorUid of the CPU identified by
+                                  the AcpiIdObjectToken.
+  @param [out] CpcToken           CpcToken of the CPU identified by
+                                  the AcpiIdObjectToken.
+  @param [out] PsdToken           PsdToken of the CPU identified by
+                                  the AcpiIdObjectToken.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not found.
+**/
+EFI_STATUS
+EFIAPI
+GetIntCInfo (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  CM_OBJECT_TOKEN                                     AcpiIdObjectToken,
+  OUT UINT32                                              *AcpiProcessorUid,
+  OUT CM_OBJECT_TOKEN                                     *CpcToken,
+  OUT CM_OBJECT_TOKEN                                     *PsdToken
+  )
+{
+  EFI_STATUS        Status;
+  CM_ARM_GICC_INFO  *GicCInfo;
+
+  Status = GetEArmObjGicCInfo (
+             CfgMgrProtocol,
+             AcpiIdObjectToken,
+             &GicCInfo,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  if (AcpiProcessorUid != NULL) {
+    *AcpiProcessorUid = GicCInfo->AcpiProcessorUid;
+  }
+
+  if (CpcToken != NULL) {
+    *CpcToken = GicCInfo->CpcToken;
+  }
+
+  if (PsdToken != NULL) {
+    *PsdToken = GicCInfo->PsdToken;
+  }
+
+  return Status;
+}
+
+/** Add arch specific information to a CPU node in the asl description.
+
+  @param [in]  Generator          The SSDT Cpu Topology generator.
+  @param [in]  CfgMgrProtocol     Pointer to the Configuration Manager
+                                  Protocol Interface.
+  @param [in]  AcpiIdObjectToken  AcpiIdObjectToken identifying the CPU to fetch the
+                                  other fields from.
+  @param [in]  CpuName            Value used to generate the CPU node name.
+  @param [out] CpuNode            CPU Node to which the ET device node is
+                                  attached.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not found.
+  @retval EFI_UNSUPPORTED         Feature Unsupported.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AddArchAmlCpuInfo (
+  IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  CM_OBJECT_TOKEN                                     AcpiIdObjectToken,
+  IN  UINT32                                              CpuName,
+  OUT  AML_OBJECT_NODE_HANDLE                             *CpuNode
+  )
+{
+  EFI_STATUS        Status;
+  CM_ARM_GICC_INFO  *GicCInfo;
+
+  Status = GetEArmObjGicCInfo (
+             CfgMgrProtocol,
+             AcpiIdObjectToken,
+             &GicCInfo,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  // Add an Embedded Trace node if present.
+  if (GicCInfo->EtToken != CM_NULL_TOKEN) {
+    Status = CreateAmlEtNode (
+               Generator,
+               CfgMgrProtocol,
+               GicCInfo->AcpiProcessorUid,
+               GicCInfo->EtToken,
+               CpuName,
+               CpuNode
+               );
+    if (EFI_ERROR (Status)) {
+      ASSERT_EFI_ERROR (Status);
+      return Status;
+    }
+  }
+
+  return Status;
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
index 2deaa4640c5c..74595131935c 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c
@@ -32,28 +32,17 @@
 
 #include "SsdtCpuTopologyGenerator.h"
 
-/** ARM standard SSDT Cpu Topology Table Generator.
+/** SSDT Cpu Topology Table Generator.
 
 Requirements:
   The following Configuration Manager Object(s) are required by
   this Generator:
-  - EArmObjGicCInfo
   - EArchCommonObjProcHierarchyInfo (OPTIONAL) along with
   - EArchCommonObjCmRef (OPTIONAL)
   - EArchCommonObjLpiInfo (OPTIONAL)
-  - GetEArmObjEtInfo (OPTIONAL)
   - EArchCommonObjPsdInfo (OPTIONAL)
 */
 
-/** This macro expands to a function that retrieves the GIC
-    CPU interface Information from the Configuration Manager.
-*/
-GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjGicCInfo,
-  CM_ARM_GICC_INFO
-  );
-
 /**
   This macro expands to a function that retrieves the Processor Hierarchy
   information from the Configuration Manager.
@@ -94,16 +83,6 @@ GET_OBJECT_LIST (
   CM_ARCH_COMMON_CPC_INFO
   );
 
-/**
-  This macro expands to a function that retrieves the ET device
-  information from the Configuration Manager.
-*/
-GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjEtInfo,
-  CM_ARM_ET_INFO
-  );
-
 /**
   This macro expands to a function that retrieves the PSD
   information from the Configuration Manager.
@@ -238,7 +217,6 @@ TokenTableAdd (
   @retval EFI_SUCCESS               Success.
   @retval EFI_INVALID_PARAMETER     Invalid parameter.
 **/
-STATIC
 EFI_STATUS
 EFIAPI
 WriteAslName (
@@ -294,8 +272,7 @@ WriteAslName (
   @param [in]  Generator              The SSDT Cpu Topology generator.
   @param [in]  CfgMgrProtocol         Pointer to the Configuration Manager
                                       Protocol Interface.
-  @param [in]  GicCInfo               Pointer to the CM_ARM_GICC_INFO object
-                                      describing the Cpu.
+  @param [in]  PsdToken               Token to identify the Psd information.
   @param [in]  Node                   CPU Node to which the _CPC node is
                                       attached.
 
@@ -309,7 +286,7 @@ EFIAPI
 CreateAmlPsdNode (
   IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
-  IN  CM_ARM_GICC_INFO                                    *GicCInfo,
+  IN  CM_OBJECT_TOKEN                                     PsdToken,
   IN  AML_OBJECT_NODE_HANDLE                              *Node
   )
 {
@@ -318,7 +295,7 @@ CreateAmlPsdNode (
 
   Status = GetEArchCommonObjPsdInfo (
              CfgMgrProtocol,
-             GicCInfo->PsdToken,
+             PsdToken,
              &PsdInfo,
              NULL
              );
@@ -381,7 +358,7 @@ CreateAmlPsdNode (
   @param [in]  Generator              The SSDT Cpu Topology generator.
   @param [in]  CfgMgrProtocol         Pointer to the Configuration Manager
                                       Protocol Interface.
-  @param [in]  GicCInfo               Pointer to the CM_ARM_GICC_INFO object
+  @param [in]  CpcToken               CPC token of the INTC info
                                       describing the Cpu.
   @param [in]  Node                   CPU Node to which the _CPC node is
                                       attached.
@@ -390,13 +367,12 @@ CreateAmlPsdNode (
   @retval EFI_INVALID_PARAMETER   Invalid parameter.
   @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
 **/
-STATIC
 EFI_STATUS
 EFIAPI
 CreateAmlCpcNode (
   IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
-  IN  CM_ARM_GICC_INFO                                    *GicCInfo,
+  IN  CM_OBJECT_TOKEN                                     CpcToken,
   IN  AML_OBJECT_NODE_HANDLE                              *Node
   )
 {
@@ -405,7 +381,7 @@ CreateAmlCpcNode (
 
   Status = GetEArchCommonObjCpcInfo (
              CfgMgrProtocol,
-             GicCInfo->CpcToken,
+             CpcToken,
              &CpcInfo,
              NULL
              );
@@ -423,147 +399,6 @@ CreateAmlCpcNode (
   return Status;
 }
 
-/** Create an embedded trace device and add it to the Cpu Node in the
-    AML namespace.
-
-  This generates the following ASL code:
-  Device (E002)
-  {
-      Name (_UID, 2)
-      Name (_HID, "ARMHC500")
-  }
-
-  Note: Currently we only support generating ETE nodes. Unlike ETM,
-  ETE has a system register interface and therefore does not need
-  the MMIO range to be described.
-
-  @param [in]  Generator    The SSDT Cpu Topology generator.
-  @param [in]  ParentNode   Parent node to attach the Cpu node to.
-  @param [in]  GicCInfo     CM_ARM_GICC_INFO object used to create the node.
-  @param [in]  CpuName      Value used to generate the node name.
-  @param [out] EtNodePtr   If not NULL, return the created Cpu node.
-
-  @retval EFI_SUCCESS             Success.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-CreateAmlEtd (
-  IN   ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,
-  IN   AML_NODE_HANDLE              ParentNode,
-  IN   CM_ARM_GICC_INFO             *GicCInfo,
-  IN   UINT32                       CpuName,
-  OUT  AML_OBJECT_NODE_HANDLE       *EtNodePtr OPTIONAL
-  )
-{
-  EFI_STATUS              Status;
-  AML_OBJECT_NODE_HANDLE  EtNode;
-  CHAR8                   AslName[AML_NAME_SEG_SIZE + 1];
-
-  ASSERT (Generator != NULL);
-  ASSERT (ParentNode != NULL);
-
-  Status = WriteAslName ('E', CpuName, AslName);
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
-  Status = AmlCodeGenDevice (AslName, ParentNode, &EtNode);
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
-  Status = AmlCodeGenNameInteger (
-             "_UID",
-             GicCInfo->AcpiProcessorUid,
-             EtNode,
-             NULL
-             );
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
-  Status = AmlCodeGenNameString (
-             "_HID",
-             ACPI_HID_ET_DEVICE,
-             EtNode,
-             NULL
-             );
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
-  // If requested, return the handle to the EtNode.
-  if (EtNodePtr != NULL) {
-    *EtNodePtr = EtNode;
-  }
-
-  return Status;
-}
-
-/** Create and add an Embedded trace device to the Cpu Node.
-
-  @param [in]  Generator              The SSDT Cpu Topology generator.
-  @param [in]  CfgMgrProtocol         Pointer to the Configuration Manager
-                                      Protocol Interface.
-  @param [in]  GicCInfo               Pointer to the CM_ARM_GICC_INFO object
-                                      describing the Cpu.
-  @param [in]  CpuName                Value used to generate the CPU node name.
-  @param [in]  Node                   CPU Node to which the ET device node is
-                                      attached.
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_UNSUPPORTED         Feature Unsupported.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-CreateAmlEtNode (
-  IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
-  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
-  IN  CM_ARM_GICC_INFO                                    *GicCInfo,
-  IN        UINT32                                        CpuName,
-  IN  AML_OBJECT_NODE_HANDLE                              *Node
-  )
-{
-  EFI_STATUS      Status;
-  CM_ARM_ET_INFO  *EtInfo;
-
-  Status = GetEArmObjEtInfo (
-             CfgMgrProtocol,
-             GicCInfo->EtToken,
-             &EtInfo,
-             NULL
-             );
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
-  // Currently we only support creation of a ETE Node.
-  if (EtInfo->EtType != ArmEtTypeEte) {
-    return EFI_UNSUPPORTED;
-  }
-
-  Status = CreateAmlEtd (
-             Generator,
-             Node,
-             GicCInfo,
-             CpuName,
-             NULL
-             );
-  ASSERT_EFI_ERROR (Status);
-  return Status;
-}
-
 /** Create and add an _LPI method to Cpu/Cluster Node.
 
   For instance, transform an AML node from:
@@ -789,23 +624,22 @@ GenerateLpiStates (
       Name (_HID, "ACPI0007")
   }
 
-  @param [in]  Generator    The SSDT Cpu Topology generator.
-  @param [in]  ParentNode   Parent node to attach the Cpu node to.
-  @param [in]  GicCInfo     CM_ARM_GICC_INFO object used to create the node.
-  @param [in]  CpuName      Value used to generate the node name.
-  @param [out] CpuNodePtr   If not NULL, return the created Cpu node.
+  @param [in]  Generator         The SSDT Cpu Topology generator.
+  @param [in]  ParentNode        Parent node to attach the Cpu node to.
+  @param [in]  AcpiProcessorUid  ACPI processor UID of the CPU.
+  @param [in]  CpuName           Value used to generate the node name.
+  @param [out] CpuNodePtr        If not NULL, return the created Cpu node.
 
   @retval EFI_SUCCESS             Success.
   @retval EFI_INVALID_PARAMETER   Invalid parameter.
   @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
 **/
-STATIC
 EFI_STATUS
 EFIAPI
 CreateAmlCpu (
   IN   ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,
   IN   AML_NODE_HANDLE              ParentNode,
-  IN   CM_ARM_GICC_INFO             *GicCInfo,
+  IN   UINT32                       AcpiProcessorUid,
   IN   UINT32                       CpuName,
   OUT  AML_OBJECT_NODE_HANDLE       *CpuNodePtr OPTIONAL
   )
@@ -816,7 +650,6 @@ CreateAmlCpu (
 
   ASSERT (Generator != NULL);
   ASSERT (ParentNode != NULL);
-  ASSERT (GicCInfo != NULL);
 
   Status = WriteAslName ('C', CpuName, AslName);
   if (EFI_ERROR (Status)) {
@@ -832,7 +665,7 @@ CreateAmlCpu (
 
   Status = AmlCodeGenNameInteger (
              "_UID",
-             GicCInfo->AcpiProcessorUid,
+             AcpiProcessorUid,
              CpuNode,
              NULL
              );
@@ -887,8 +720,10 @@ CreateAmlCpuFromProcHierarchy (
   )
 {
   EFI_STATUS              Status;
-  CM_ARM_GICC_INFO        *GicCInfo;
   AML_OBJECT_NODE_HANDLE  CpuNode;
+  UINT32                  AcpiProcessorUid;
+  CM_OBJECT_TOKEN         CpcToken;
+  CM_OBJECT_TOKEN         PsdToken;
 
   ASSERT (Generator != NULL);
   ASSERT (CfgMgrProtocol != NULL);
@@ -896,18 +731,19 @@ CreateAmlCpuFromProcHierarchy (
   ASSERT (ProcHierarchyNodeInfo != NULL);
   ASSERT (ProcHierarchyNodeInfo->AcpiIdObjectToken != CM_NULL_TOKEN);
 
-  Status = GetEArmObjGicCInfo (
+  Status = GetIntCInfo (
              CfgMgrProtocol,
              ProcHierarchyNodeInfo->AcpiIdObjectToken,
-             &GicCInfo,
-             NULL
+             &AcpiProcessorUid,
+             &CpcToken,
+             &PsdToken
              );
   if (EFI_ERROR (Status)) {
     ASSERT (0);
     return Status;
   }
 
-  Status = CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuName, &CpuNode);
+  Status = CreateAmlCpu (Generator, ParentNode, AcpiProcessorUid, CpuName, &CpuNode);
   if (EFI_ERROR (Status)) {
     ASSERT (0);
     return Status;
@@ -923,8 +759,8 @@ CreateAmlCpuFromProcHierarchy (
     }
   }
 
-  if (GicCInfo->PsdToken != CM_NULL_TOKEN) {
-    Status = CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode);
+  if (PsdToken != CM_NULL_TOKEN) {
+    Status = CreateAmlPsdNode (Generator, CfgMgrProtocol, PsdToken, CpuNode);
     if (EFI_ERROR (Status)) {
       ASSERT_EFI_ERROR (Status);
       return Status;
@@ -932,28 +768,26 @@ CreateAmlCpuFromProcHierarchy (
   }
 
   // If a CPC info is associated with the
-  // GicCinfo, create an _CPC method returning them.
-  if (GicCInfo->CpcToken != CM_NULL_TOKEN) {
-    Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode);
+  // IntcInfo, create an _CPC method returning them.
+  if (CpcToken != CM_NULL_TOKEN) {
+    Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, CpcToken, CpuNode);
     if (EFI_ERROR (Status)) {
       ASSERT_EFI_ERROR (Status);
       return Status;
     }
   }
 
-  // Add an Embedded Trace node if present.
-  if (GicCInfo->EtToken != CM_NULL_TOKEN) {
-    Status = CreateAmlEtNode (
-               Generator,
-               CfgMgrProtocol,
-               GicCInfo,
-               CpuName,
-               CpuNode
-               );
-    if (EFI_ERROR (Status)) {
-      ASSERT_EFI_ERROR (Status);
-      return Status;
-    }
+  // Add arch specific information if necessary.
+  Status = AddArchAmlCpuInfo (
+             Generator,
+             CfgMgrProtocol,
+             ProcHierarchyNodeInfo->AcpiIdObjectToken,
+             CpuName,
+             CpuNode
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    return Status;
   }
 
   return Status;
@@ -1342,100 +1176,6 @@ exit_handler:
   return Status;
 }
 
-/** Create the processor hierarchy AML tree from CM_ARM_GICC_INFO
-    CM objects.
-
-  A processor container is by extension any non-leave device in the cpu topology.
-
-  @param [in] Generator        The SSDT Cpu Topology generator.
-  @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
-                               Protocol Interface.
-  @param [in] ScopeNode        Scope node handle ('\_SB' scope).
-
-  @retval EFI_SUCCESS             Success.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-CreateTopologyFromGicC (
-  IN        ACPI_CPU_TOPOLOGY_GENERATOR                   *Generator,
-  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
-  IN        AML_OBJECT_NODE_HANDLE                        ScopeNode
-  )
-{
-  EFI_STATUS              Status;
-  CM_ARM_GICC_INFO        *GicCInfo;
-  UINT32                  GicCInfoCount;
-  UINT32                  Index;
-  AML_OBJECT_NODE_HANDLE  CpuNode;
-
-  ASSERT (Generator != NULL);
-  ASSERT (CfgMgrProtocol != NULL);
-  ASSERT (ScopeNode != NULL);
-
-  Status = GetEArmObjGicCInfo (
-             CfgMgrProtocol,
-             CM_NULL_TOKEN,
-             &GicCInfo,
-             &GicCInfoCount
-             );
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
-  // For each CM_ARM_GICC_INFO object, create an AML node.
-  for (Index = 0; Index < GicCInfoCount; Index++) {
-    Status = CreateAmlCpu (
-               Generator,
-               ScopeNode,
-               &GicCInfo[Index],
-               Index,
-               &CpuNode
-               );
-    if (EFI_ERROR (Status)) {
-      ASSERT (0);
-      break;
-    }
-
-    if (GicCInfo->PsdToken != CM_NULL_TOKEN) {
-      Status = CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode);
-      if (EFI_ERROR (Status)) {
-        ASSERT_EFI_ERROR (Status);
-        return Status;
-      }
-    }
-
-    // If a CPC info is associated with the
-    // GicCinfo, create an _CPC method returning them.
-    if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) {
-      Status = CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[Index], CpuNode);
-      if (EFI_ERROR (Status)) {
-        ASSERT_EFI_ERROR (Status);
-        break;
-      }
-    }
-
-    if (GicCInfo[Index].EtToken != CM_NULL_TOKEN) {
-      Status = CreateAmlEtNode (
-                 Generator,
-                 CfgMgrProtocol,
-                 &GicCInfo[Index],
-                 Index,
-                 CpuNode
-                 );
-      if (EFI_ERROR (Status)) {
-        ASSERT_EFI_ERROR (Status);
-        return Status;
-      }
-    }
-  } // for
-
-  return Status;
-}
-
 /** Construct the SSDT Cpu Topology ACPI table.
 
   This function invokes the Configuration Manager protocol interface
@@ -1514,9 +1254,8 @@ BuildSsdtCpuTopologyTable (
   }
 
   if (Status == EFI_NOT_FOUND) {
-    // If hierarchy information is not found generate a flat topology
-    // using CM_ARM_GICC_INFO objects.
-    Status = CreateTopologyFromGicC (
+    // If hierarchy information is not found generate a flat topology.
+    Status = CreateTopologyFromIntC (
                Generator,
                CfgMgrProtocol,
                ScopeNode
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
index 6fb44c7e5887..a5d80177f2fc 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
@@ -144,4 +144,200 @@ typedef struct AcpiCpuTopologyGenerator {
 
 #pragma pack()
 
+/** Write a string 'Xxxx\0' in AslName (5 bytes long),
+  with 'X' being the leading char of the name, and
+  with 'xxx' being Value in hexadecimal.
+
+  As 'xxx' in hexadecimal represents a number on 12 bits,
+  we have Value < (1 << 12).
+
+  @param [in]       LeadChar  Leading char of the name.
+  @param [in]       Value     Hex value of the name.
+                              Must be lower than (2 << 12).
+  @param [in, out]  AslName   Pointer to write the 'Xxxx' string to.
+                              Must be at least 5 bytes long.
+
+  @retval EFI_SUCCESS               Success.
+  @retval EFI_INVALID_PARAMETER     Invalid parameter.
+**/
+EFI_STATUS
+EFIAPI
+WriteAslName (
+  IN      CHAR8   LeadChar,
+  IN      UINT32  Value,
+  IN OUT  CHAR8   *AslName
+  );
+
+/** Get generic interrupt information from arch specific CM objects.
+
+  The AcpiProcessorUid, CpcToken, etc. are held in arch specific CM objects,
+  in the CM_ARM_GICC_INFO CM object for Arm for instance.
+  This wrapper allows to get this information from each arch object.
+
+  @param [in]  CfgMgrProtocol     Pointer to the Configuration Manager
+                                  Protocol Interface.
+  @param [in]  AcpiProcessorUid       ACPI processor Uid of the local intc (gicc, other)
+                                  other fields from.
+  @param [out] AcpiProcessorUid   AcpiProcessorUid of the CPU identified by
+                                  the AcpiIdObjectToken.
+  @param [out] CpcToken           CpcToken of the CPU identified by
+                                  the AcpiIdObjectToken.
+  @param [out] PsdToken           PsdToken of the CPU identified by
+                                  the AcpiIdObjectToken.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not found.
+**/
+EFI_STATUS
+EFIAPI
+GetIntCInfo (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  CM_OBJECT_TOKEN                                     AcpiIdObjectToken,
+  OUT UINT32                                              *AcpiProcessorUid,
+  OUT CM_OBJECT_TOKEN                                     *CpcToken,
+  OUT CM_OBJECT_TOKEN                                     *PsdToken
+  );
+
+/** Create and add an _CPC Node to Cpu Node.
+
+  For instance, transform an AML node from:
+  Device (C002)
+  {
+      Name (_UID, 2)
+      Name (_HID, "ACPI0007")
+  }
+
+  To:
+  Device (C002)
+  {
+      Name (_UID, 2)
+      Name (_HID, "ACPI0007")
+      Name(_CPC, Package()
+      {
+        NumEntries,                              // Integer
+        Revision,                                // Integer
+        HighestPerformance,                      // Integer or Buffer (Resource Descriptor)
+        NominalPerformance,                      // Integer or Buffer (Resource Descriptor)
+        LowestNonlinearPerformance,              // Integer or Buffer (Resource Descriptor)
+        LowestPerformance,                       // Integer or Buffer (Resource Descriptor)
+        GuaranteedPerformanceRegister,           // Buffer (Resource Descriptor)
+        DesiredPerformanceRegister ,             // Buffer (Resource Descriptor)
+        MinimumPerformanceRegister ,             // Buffer (Resource Descriptor)
+        MaximumPerformanceRegister ,             // Buffer (Resource Descriptor)
+        PerformanceReductionToleranceRegister,   // Buffer (Resource Descriptor)
+        TimeWindowRegister,                      // Buffer (Resource Descriptor)
+        CounterWraparoundTime,                   // Integer or Buffer (Resource Descriptor)
+        ReferencePerformanceCounterRegister,     // Buffer (Resource Descriptor)
+        DeliveredPerformanceCounterRegister,     // Buffer (Resource Descriptor)
+        PerformanceLimitedRegister,              // Buffer (Resource Descriptor)
+        CPPCEnableRegister                       // Buffer (Resource Descriptor)
+        AutonomousSelectionEnable,               // Integer or Buffer (Resource Descriptor)
+        AutonomousActivityWindowRegister,        // Buffer (Resource Descriptor)
+        EnergyPerformancePreferenceRegister,     // Buffer (Resource Descriptor)
+        ReferencePerformance                     // Integer or Buffer (Resource Descriptor)
+        LowestFrequency,                         // Integer or Buffer (Resource Descriptor)
+        NominalFrequency                         // Integer or Buffer (Resource Descriptor)
+      })
+  }
+
+  @param [in]  Generator              The SSDT Cpu Topology generator.
+  @param [in]  CfgMgrProtocol         Pointer to the Configuration Manager
+                                      Protocol Interface.
+  @param [in]  CpcToken               CPC token of the INTC info
+                                      describing the Cpu.
+  @param [in]  Node                   CPU Node to which the _CPC node is
+                                      attached.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+CreateAmlCpcNode (
+  IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  CM_OBJECT_TOKEN                                     CpcToken,
+  IN  AML_OBJECT_NODE_HANDLE                              *Node
+  );
+
+/** Create a Cpu in the AML namespace.
+
+  This generates the following ASL code:
+  Device (C002)
+  {
+      Name (_UID, 2)
+      Name (_HID, "ACPI0007")
+  }
+
+  @param [in]  Generator         The SSDT Cpu Topology generator.
+  @param [in]  ParentNode        Parent node to attach the Cpu node to.
+  @param [in]  AcpiProcessorUid  ACPI processor UID of the CPU.
+  @param [in]  CpuName           Value used to generate the node name.
+  @param [out] CpuNodePtr        If not NULL, return the created Cpu node.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+CreateAmlCpu (
+  IN   ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,
+  IN   AML_NODE_HANDLE              ParentNode,
+  IN   UINT32                       AcpiProcessorUid,
+  IN   UINT32                       CpuName,
+  OUT  AML_OBJECT_NODE_HANDLE       *CpuNodePtr OPTIONAL
+  );
+
+/** Create the processor hierarchy AML tree from arch specific CM objects.
+
+  The Arm architecture will use the CM_ARM_GICC_INFO CM objects for instance.
+  A processor container is by extension any non-leave device in the cpu topology.
+
+  @param [in] Generator        The SSDT Cpu Topology generator.
+  @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
+                               Protocol Interface.
+  @param [in] ScopeNode        Scope node handle ('\_SB' scope).
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+CreateTopologyFromIntC (
+  IN        ACPI_CPU_TOPOLOGY_GENERATOR                   *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN        AML_OBJECT_NODE_HANDLE                        ScopeNode
+  );
+
+/** Add arch specific information to a CPU node in the asl description.
+
+  @param [in]  Generator          The SSDT Cpu Topology generator.
+  @param [in]  CfgMgrProtocol     Pointer to the Configuration Manager
+                                  Protocol Interface.
+  @param [in]  AcpiIdObjectToken  AcpiIdObjectToken identifying the CPU to fetch the
+                                  other fields from.
+  @param [in]  CpuName            Value used to generate the CPU node name.
+  @param [out] CpuNode            CPU Node to which the ET device node is
+                                  attached.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not found.
+  @retval EFI_UNSUPPORTED         Feature Unsupported.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AddArchAmlCpuInfo (
+  IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  CM_OBJECT_TOKEN                                     AcpiIdObjectToken,
+  IN  UINT32                                              CpuName,
+  OUT  AML_OBJECT_NODE_HANDLE                             *CpuNode
+  );
+
 #endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
index 2d38fb30fb09..93ede691cdf9 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf
@@ -20,6 +20,9 @@ [Sources]
   SsdtCpuTopologyGenerator.c
   SsdtCpuTopologyGenerator.h
 
+[Sources.ARM, Sources.AARCH64]
+  Arm/ArmSsdtCpuTopologyGenerator.c
+
 [Packages.ARM, Packages.AARCH64]
   ArmPlatformPkg/ArmPlatformPkg.dec
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119639): https://edk2.groups.io/g/devel/message/119639
Mute This Topic: https://groups.io/mt/106770160/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 08/15] DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (6 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 07/15] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 09/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm directory PierreGondois
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun, Pierre Gondois

Mandatory ACPI tables depend on the architectures.
Different architectures might also want to check other tables.

Move mAcpiVerifyTables containing the list of ACPI tables to check
to an arch specific file and introduce GetAcpiTablePresenceInfo()
to get get the relevant information from the array.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Arm/ArmDynamicTableManagerDxe.c           | 63 +++++++++++++++++
 .../Common/CommonDynamicTableManagerDxe.c     | 58 +++++++++++++++
 .../DynamicTableManagerDxe.c                  | 70 ++++++-------------
 .../DynamicTableManagerDxe.h                  | 63 +++++++++++++++++
 .../DynamicTableManagerDxe.inf                |  7 ++
 5 files changed, 211 insertions(+), 50 deletions(-)
 create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
 create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
 create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h

diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
new file mode 100644
index 000000000000..4874fe883f95
--- /dev/null
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
@@ -0,0 +1,63 @@
+/** @file
+  ARM Dynamic Table Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Protocol/AcpiSystemDescriptionTable.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <DeviceTreeTableGenerator.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+#include <Protocol/DynamicTableFactoryProtocol.h>
+#include "DynamicTableManagerDxe.h"
+
+///
+/// Array containing the ACPI tables to check.
+/// We require the FADT, MADT, GTDT and the DSDT tables to boot.
+/// This list also include optional ACPI tables: DBG2, SPCR.
+/// The FADT table must be placed at index 0.
+///
+STATIC ACPI_TABLE_PRESENCE_INFO  mAcpiVerifyTables[] = {
+  { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,            "FADT", TRUE,  0 },
+  { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,         "MADT", TRUE,  0 },
+  { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,         "GTDT", TRUE,  0 },
+  { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, "DSDT", TRUE,  0 },
+  { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE,                      "DBG2", FALSE, 0 },
+  { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,   "SPCR", FALSE, 0 },
+};
+
+/** Get the arch specific ACPI table presence information.
+
+  @param [out] PresenceArray      Array containing the ACPI tables to check.
+  @param [out] PresenceArrayCount Count of elements in the PresenceArray.
+  @param [out] FadtIndex          Index of the FADT table in the PresenceArray.
+                                  -1 if absent.
+
+  @retval EFI_SUCCESS           Success.
+**/
+EFI_STATUS
+EFIAPI
+GetAcpiTablePresenceInfo (
+  OUT ACPI_TABLE_PRESENCE_INFO  **PresenceArray,
+  OUT UINT32                    *PresenceArrayCount,
+  OUT INT32                     *FadtIndex
+  )
+{
+  *PresenceArray      = mAcpiVerifyTables;
+  *PresenceArrayCount = ARRAY_SIZE (mAcpiVerifyTables);
+  *FadtIndex          = ACPI_TABLE_VERIFY_FADT;
+
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
new file mode 100644
index 000000000000..cb6bf72f31ab
--- /dev/null
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
@@ -0,0 +1,58 @@
+/** @file
+  Common Dynamic Table Manager Dxe
+
+  Copyright (c) 2024, Arm Limited. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Protocol/AcpiSystemDescriptionTable.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <DeviceTreeTableGenerator.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+#include <Protocol/DynamicTableFactoryProtocol.h>
+#include "DynamicTableManagerDxe.h"
+
+///
+/// Array containing the ACPI tables to check.
+/// This is a dummy list only existing for build purpose.
+/// The FADT table must be placed at index 0.
+///
+ACPI_TABLE_PRESENCE_INFO  mAcpiVerifyTables[] = {
+  { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, "FADT", TRUE, 0 },
+};
+
+/** Get the arch specific ACPI table presence information.
+
+  @param [out] PresenceArray      Array containing the ACPI tables to check.
+  @param [out] PresenceArrayCount Count of elements in the PresenceArray.
+  @param [out] FadtIndex          Index of the FADT table in the PresenceArray.
+                                  -1 if absent.
+
+  @retval EFI_SUCCESS           Success.
+**/
+EFI_STATUS
+EFIAPI
+GetAcpiTablePresenceInfo (
+  OUT ACPI_TABLE_PRESENCE_INFO  **PresenceArray,
+  OUT UINT32                    *PresenceArrayCount,
+  OUT INT32                     *FadtIndex
+  )
+{
+  // Dummy function.
+  *PresenceArray      = mAcpiVerifyTables;
+  *PresenceArrayCount = ARRAY_SIZE (mAcpiVerifyTables);
+  *FadtIndex          = ACPI_TABLE_VERIFY_FADT;
+
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
index 1e9b811c4017..dfccccb83954 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
@@ -23,57 +23,15 @@
 #include <Protocol/DynamicTableFactoryProtocol.h>
 #include <SmbiosTableGenerator.h>
 
-///
-/// Bit definitions for acceptable ACPI table presence formats.
-/// Currently only ACPI tables present in the ACPI info list and
-/// already installed will count towards "Table Present" during
-/// verification routine.
-///
-#define ACPI_TABLE_PRESENT_INFO_LIST  BIT0
-#define ACPI_TABLE_PRESENT_INSTALLED  BIT1
-
-///
-/// Order of ACPI table being verified during presence inspection.
-///
-#define ACPI_TABLE_VERIFY_FADT   0
-#define ACPI_TABLE_VERIFY_MADT   1
-#define ACPI_TABLE_VERIFY_GTDT   2
-#define ACPI_TABLE_VERIFY_DSDT   3
-#define ACPI_TABLE_VERIFY_DBG2   4
-#define ACPI_TABLE_VERIFY_SPCR   5
-#define ACPI_TABLE_VERIFY_COUNT  6
-
-///
-/// Private data structure to verify the presence of mandatory
-/// or optional ACPI tables.
-///
-typedef struct {
-  /// ESTD ID for the ACPI table of interest.
-  ESTD_ACPI_TABLE_ID    EstdTableId;
-  /// Standard UINT32 ACPI signature.
-  UINT32                AcpiTableSignature;
-  /// 4 character ACPI table name (the 5th char8 is for null terminator).
-  CHAR8                 AcpiTableName[sizeof (UINT32) + 1];
-  /// Indicator on whether the ACPI table is required.
-  BOOLEAN               IsMandatory;
-  /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_*
-  /// This field should be initialized to 0 and will be populated during
-  /// verification routine.
-  UINT16                Presence;
-} ACPI_TABLE_PRESENCE_INFO;
+#include "DynamicTableManagerDxe.h"
 
 ///
 /// We require the FADT, MADT, GTDT and the DSDT tables to boot.
 /// This list also include optional ACPI tables: DBG2, SPCR.
 ///
-ACPI_TABLE_PRESENCE_INFO  mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] = {
-  { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,            "FADT", TRUE,  0 },
-  { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,         "MADT", TRUE,  0 },
-  { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,         "GTDT", TRUE,  0 },
-  { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, "DSDT", TRUE,  0 },
-  { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE,                      "DBG2", FALSE, 0 },
-  { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,   "SPCR", FALSE, 0 },
-};
+STATIC ACPI_TABLE_PRESENCE_INFO  *mAcpiVerifyTables;
+STATIC UINT32                    mAcpiVerifyTablesCount;
+STATIC INT32                     mAcpiVerifyTablesFadtIndex;
 
 /** This macro expands to a function that retrieves the ACPI Table
     List from the Configuration Manager.
@@ -472,7 +430,7 @@ VerifyMandatoryTablesArePresent (
 
   // Check against the statically initialized ACPI tables to see if they are in ACPI info list
   while (AcpiTableCount-- != 0) {
-    for (Index = 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) {
+    for (Index = 0; Index < mAcpiVerifyTablesCount; Index++) {
       if (AcpiTableInfo[AcpiTableCount].AcpiTableSignature == mAcpiVerifyTables[Index].AcpiTableSignature) {
         mAcpiVerifyTables[Index].Presence |= ACPI_TABLE_PRESENT_INFO_LIST;
         // Found this table, skip the rest.
@@ -491,7 +449,7 @@ VerifyMandatoryTablesArePresent (
       return Status;
     }
 
-    for (Index = 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) {
+    for (Index = 0; Index < mAcpiVerifyTablesCount; Index++) {
       Handle              = 0;
       InstalledTableIndex = 0;
       do {
@@ -511,7 +469,7 @@ VerifyMandatoryTablesArePresent (
 
   // Reset the return Status value to EFI_SUCCESS. We do not fully care if the table look up has failed.
   Status = EFI_SUCCESS;
-  for (Index = 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) {
+  for (Index = 0; Index < mAcpiVerifyTablesCount; Index++) {
     if (mAcpiVerifyTables[Index].Presence == 0) {
       if (mAcpiVerifyTables[Index].IsMandatory) {
         DEBUG ((DEBUG_ERROR, "ERROR: %a Table not found.\n", mAcpiVerifyTables[Index].AcpiTableName));
@@ -623,7 +581,9 @@ ProcessAcpiTables (
   }
 
   // Add the FADT Table first.
-  if ((mAcpiVerifyTables[ACPI_TABLE_VERIFY_FADT].Presence & ACPI_TABLE_PRESENT_INSTALLED) == 0) {
+  if ((mAcpiVerifyTablesFadtIndex >= 0) &&
+      ((mAcpiVerifyTables[mAcpiVerifyTablesFadtIndex].Presence & ACPI_TABLE_PRESENT_INSTALLED) == 0))
+  {
     // FADT is not yet installed
     for (Idx = 0; Idx < AcpiTableCount; Idx++) {
       if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) ==
@@ -785,6 +745,16 @@ DynamicTableManagerDxeInitialize (
     CfgMfrInfo->OemId[5]
     ));
 
+  Status = GetAcpiTablePresenceInfo (
+             &mAcpiVerifyTables,
+             &mAcpiVerifyTablesCount,
+             &mAcpiVerifyTablesFadtIndex
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
+
   Status = ProcessAcpiTables (TableFactoryProtocol, CfgMgrProtocol);
   if (EFI_ERROR (Status)) {
     DEBUG ((
diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
new file mode 100644
index 000000000000..a12a775af132
--- /dev/null
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
@@ -0,0 +1,63 @@
+/** @file
+  Dynamic Table Manager Dxe
+
+  Copyright (c) 2017 - 2024, ARM Limited. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef DYNAMIC_TABLE_MANAGER_DXE_H_
+#define DYNAMIC_TABLE_MANAGER_DXE_H_
+
+#include <AcpiTableGenerator.h>
+
+///
+/// Bit definitions for acceptable ACPI table presence formats.
+/// Currently only ACPI tables present in the ACPI info list and
+/// already installed will count towards "Table Present" during
+/// verification routine.
+///
+#define ACPI_TABLE_PRESENT_INFO_LIST  BIT0
+#define ACPI_TABLE_PRESENT_INSTALLED  BIT1
+
+/// The FADT table must be placed at index 0 in mAcpiVerifyTables.
+#define ACPI_TABLE_VERIFY_FADT  0
+
+///
+/// Private data structure to verify the presence of mandatory
+/// or optional ACPI tables.
+///
+typedef struct {
+  /// ESTD ID for the ACPI table of interest.
+  ESTD_ACPI_TABLE_ID    EstdTableId;
+  /// Standard UINT32 ACPI signature.
+  UINT32                AcpiTableSignature;
+  /// 4 character ACPI table name (the 5th char8 is for null terminator).
+  CHAR8                 AcpiTableName[sizeof (UINT32) + 1];
+  /// Indicator on whether the ACPI table is required.
+  BOOLEAN               IsMandatory;
+  /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_*
+  /// This field should be initialized to 0 and will be populated during
+  /// verification routine.
+  UINT16                Presence;
+} ACPI_TABLE_PRESENCE_INFO;
+
+/** Get the arch specific ACPI table presence information.
+
+  @param [out] PresenceArray      Array containing the ACPI tables to check.
+  @param [out] PresenceArrayCount Count of elements in the PresenceArray.
+  @param [out] FadtIndex          Index of the FADT table in the PresenceArray.
+                                  -1 if absent.
+
+  @retval EFI_SUCCESS           Success.
+**/
+EFI_STATUS
+EFIAPI
+GetAcpiTablePresenceInfo (
+  OUT ACPI_TABLE_PRESENCE_INFO  **PresenceArray,
+  OUT UINT32                    *PresenceArrayCount,
+  OUT INT32                     *FadtIndex
+  );
+
+#endif // DYNAMIC_TABLE_MANAGER_DXE_H_
diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
index ad8b3d037c16..1b0b06d774de 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
@@ -22,6 +22,13 @@ [Defines]
 
 [Sources]
   DynamicTableManagerDxe.c
+  DynamicTableManagerDxe.h
+
+[Sources.ARM, Sources.AARCH64]
+  Arm/ArmDynamicTableManagerDxe.c
+
+[Sources.IA32, Sources.X64]
+  Common/CommonDynamicTableManagerDxe.c
 
 [Packages]
   MdePkg/MdePkg.dec
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119640): https://edk2.groups.io/g/devel/message/119640
Mute This Topic: https://groups.io/mt/106770163/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 09/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm directory
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (7 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 08/15] DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 10/15] DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other archs PierreGondois
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Create an Arm directory in the FdtHwInfoParserLib as a preparation
step to support other architectures.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../{ => Arm}/BootArch/ArmBootArchParser.c    |  2 +-
 .../{ => Arm}/BootArch/ArmBootArchParser.h    |  0
 .../GenericTimer/ArmGenericTimerParser.c      |  4 +--
 .../GenericTimer/ArmGenericTimerParser.h      |  0
 .../{ => Arm}/Gic/ArmGicCParser.c             |  4 +--
 .../{ => Arm}/Gic/ArmGicCParser.h             |  0
 .../{ => Arm}/Gic/ArmGicDParser.c             |  4 +--
 .../{ => Arm}/Gic/ArmGicDParser.h             |  0
 .../{ => Arm}/Gic/ArmGicDispatcher.c          | 12 +++----
 .../{ => Arm}/Gic/ArmGicDispatcher.h          |  0
 .../{ => Arm}/Gic/ArmGicItsParser.c           |  4 +--
 .../{ => Arm}/Gic/ArmGicItsParser.h           |  0
 .../{ => Arm}/Gic/ArmGicMsiFrameParser.c      |  4 +--
 .../{ => Arm}/Gic/ArmGicMsiFrameParser.h      |  0
 .../{ => Arm}/Gic/ArmGicRParser.c             |  4 +--
 .../{ => Arm}/Gic/ArmGicRParser.h             |  0
 .../FdtHwInfoParserLib/FdtHwInfoParser.c      |  6 ++--
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 32 +++++++++----------
 .../Pci/ArmPciConfigSpaceParser.c             |  2 +-
 19 files changed, 39 insertions(+), 39 deletions(-)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/BootArch/ArmBootArchParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/BootArch/ArmBootArchParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/BootArch/ArmBootArchParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/BootArch/ArmBootArchParser.c
index b07b6b8b666a..d217e33424b1 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/BootArch/ArmBootArchParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/BootArch/ArmBootArchParser.c
@@ -10,7 +10,7 @@
 
 #include "FdtHwInfoParser.h"
 #include "CmObjectDescUtility.h"
-#include "BootArch/ArmBootArchParser.h"
+#include "Arm/BootArch/ArmBootArchParser.h"
 
 /** List of "compatible" property values for Psci nodes.
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/BootArch/ArmBootArchParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/BootArch/ArmBootArchParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/BootArch/ArmBootArchParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/BootArch/ArmBootArchParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/GenericTimer/ArmGenericTimerParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/GenericTimer/ArmGenericTimerParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/GenericTimer/ArmGenericTimerParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/GenericTimer/ArmGenericTimerParser.c
index 988a81221dab..6488399ed812 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/GenericTimer/ArmGenericTimerParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/GenericTimer/ArmGenericTimerParser.c
@@ -10,8 +10,8 @@
 
 #include "FdtHwInfoParser.h"
 #include "CmObjectDescUtility.h"
-#include "GenericTimer/ArmGenericTimerParser.h"
-#include "Gic/ArmGicDispatcher.h"
+#include "Arm/GenericTimer/ArmGenericTimerParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
 
 /** List of "compatible" property values for timer nodes.
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/GenericTimer/ArmGenericTimerParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/GenericTimer/ArmGenericTimerParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/GenericTimer/ArmGenericTimerParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/GenericTimer/ArmGenericTimerParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c
similarity index 96%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c
index ee82f7a0b461..cf577b47242e 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c
@@ -13,8 +13,8 @@
 
 #include "FdtHwInfoParser.h"
 #include "CmObjectDescUtility.h"
-#include "Gic/ArmGicCParser.h"
-#include "Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicCParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
 
 /** List of "compatible" property values for CPU nodes.
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDParser.c
index b7f569672980..906ef8b8585e 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDParser.c
@@ -11,8 +11,8 @@
 
 #include "CmObjectDescUtility.h"
 #include "FdtHwInfoParser.h"
-#include "Gic/ArmGicDispatcher.h"
-#include "Gic/ArmGicDParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicDParser.h"
 
 /** Parse a Gic compatible interrupt-controller node,
     extracting GicD information.
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDispatcher.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDispatcher.c
similarity index 92%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDispatcher.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDispatcher.c
index 1f3af1f968a9..ca34d24a78d9 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDispatcher.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDispatcher.c
@@ -10,12 +10,12 @@
 **/
 
 #include "FdtHwInfoParser.h"
-#include "Gic/ArmGicCParser.h"
-#include "Gic/ArmGicDispatcher.h"
-#include "Gic/ArmGicDParser.h"
-#include "Gic/ArmGicItsParser.h"
-#include "Gic/ArmGicMsiFrameParser.h"
-#include "Gic/ArmGicRParser.h"
+#include "Arm/Gic/ArmGicCParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicDParser.h"
+#include "Arm/Gic/ArmGicItsParser.h"
+#include "Arm/Gic/ArmGicMsiFrameParser.h"
+#include "Arm/Gic/ArmGicRParser.h"
 
 /** List of "compatible" property values for GicV2 interrupt nodes.
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDispatcher.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDispatcher.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicDispatcher.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicDispatcher.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicItsParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicItsParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.c
index f23818fbd047..6d4bde6a141a 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicItsParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.c
@@ -10,8 +10,8 @@
 
 #include "CmObjectDescUtility.h"
 #include "FdtHwInfoParser.h"
-#include "Gic/ArmGicDispatcher.h"
-#include "Gic/ArmGicItsParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicItsParser.h"
 
 /** Parse a Gic compatible interrupt-controller node,
     extracting GicIts information.
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicItsParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicItsParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicMsiFrameParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicMsiFrameParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicMsiFrameParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicMsiFrameParser.c
index c474cb25fe6f..dff5beff91be 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicMsiFrameParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicMsiFrameParser.c
@@ -11,8 +11,8 @@
 
 #include "CmObjectDescUtility.h"
 #include "FdtHwInfoParser.h"
-#include "Gic/ArmGicDispatcher.h"
-#include "Gic/ArmGicMsiFrameParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicMsiFrameParser.h"
 
 /** List of "compatible" property values for Msi-frame nodes.
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicMsiFrameParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicMsiFrameParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicMsiFrameParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicMsiFrameParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicRParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicRParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicRParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicRParser.c
index 0f9c7bb3fea2..de2e1dd1f1e3 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicRParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicRParser.c
@@ -10,8 +10,8 @@
 
 #include "CmObjectDescUtility.h"
 #include "FdtHwInfoParser.h"
-#include "Gic/ArmGicDispatcher.h"
-#include "Gic/ArmGicRParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicRParser.h"
 
 /** Parse a Gic compatible interrupt-controller node,
     extracting GicR information.
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicRParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicRParser.h
similarity index 100%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicRParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicRParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c
index 376de078bcb1..78bf9c9efae4 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c
@@ -6,9 +6,9 @@
 **/
 
 #include "FdtHwInfoParser.h"
-#include "BootArch/ArmBootArchParser.h"
-#include "GenericTimer/ArmGenericTimerParser.h"
-#include "Gic/ArmGicDispatcher.h"
+#include "Arm/BootArch/ArmBootArchParser.h"
+#include "Arm/GenericTimer/ArmGenericTimerParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
 #include "Pci/ArmPciConfigSpaceParser.h"
 #include "Serial/ArmSerialPortParser.h"
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
index d2c171accaa5..fa768cf664df 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
@@ -22,22 +22,22 @@ [Sources]
   FdtHwInfoParser.h
   FdtUtility.c
   FdtUtility.h
-  BootArch/ArmBootArchParser.c
-  BootArch/ArmBootArchParser.h
-  GenericTimer/ArmGenericTimerParser.c
-  GenericTimer/ArmGenericTimerParser.h
-  Gic/ArmGicCParser.c
-  Gic/ArmGicCParser.h
-  Gic/ArmGicDispatcher.c
-  Gic/ArmGicDispatcher.h
-  Gic/ArmGicDParser.c
-  Gic/ArmGicDParser.h
-  Gic/ArmGicItsParser.c
-  Gic/ArmGicItsParser.h
-  Gic/ArmGicMsiFrameParser.c
-  Gic/ArmGicMsiFrameParser.h
-  Gic/ArmGicRParser.c
-  Gic/ArmGicRParser.h
+  Arm/BootArch/ArmBootArchParser.c
+  Arm/BootArch/ArmBootArchParser.h
+  Arm/GenericTimer/ArmGenericTimerParser.c
+  Arm/GenericTimer/ArmGenericTimerParser.h
+  Arm/Gic/ArmGicCParser.c
+  Arm/Gic/ArmGicCParser.h
+  Arm/Gic/ArmGicDispatcher.c
+  Arm/Gic/ArmGicDispatcher.h
+  Arm/Gic/ArmGicDParser.c
+  Arm/Gic/ArmGicDParser.h
+  Arm/Gic/ArmGicItsParser.c
+  Arm/Gic/ArmGicItsParser.h
+  Arm/Gic/ArmGicMsiFrameParser.c
+  Arm/Gic/ArmGicMsiFrameParser.h
+  Arm/Gic/ArmGicRParser.c
+  Arm/Gic/ArmGicRParser.h
   Pci/ArmPciConfigSpaceParser.c
   Pci/ArmPciConfigSpaceParser.h
   Serial/ArmSerialPortParser.c
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
index b064e62c17bc..5d11863dfe0a 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
@@ -17,7 +17,7 @@
 
 #include "FdtHwInfoParser.h"
 #include "Pci/ArmPciConfigSpaceParser.h"
-#include "Gic/ArmGicDispatcher.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
 
 /** List of "compatible" property values for host PCIe bridges nodes.
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119641): https://edk2.groups.io/g/devel/message/119641
Mute This Topic: https://groups.io/mt/106770166/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 10/15] DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (8 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 09/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm directory PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 11/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral PierreGondois
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

To allow other architectures to potentially re-use the serial port
parser and make the code arch neutral, make the MainDispatcher()
function arch specific.

Other architectures can choose which parse/dispatcher are desired
to be called through the configuration of the HwInfoParserTable.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Arm/ArmFdtHwInfoParser.c                  | 83 +++++++++++++++++++
 .../FdtHwInfoParserLib/FdtHwInfoParser.c      | 78 +----------------
 .../FdtHwInfoParserLib/FdtHwInfoParser.h      | 27 ++++++
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 15 ++--
 4 files changed, 121 insertions(+), 82 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
new file mode 100644
index 000000000000..403402731add
--- /dev/null
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
@@ -0,0 +1,83 @@
+/** @file
+  Arm Flattened Device Tree parser library for KvmTool.
+
+  Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "FdtHwInfoParser.h"
+#include "Arm/BootArch/ArmBootArchParser.h"
+#include "Arm/GenericTimer/ArmGenericTimerParser.h"
+#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Pci/ArmPciConfigSpaceParser.h"
+#include "Serial/ArmSerialPortParser.h"
+
+/** Ordered table of parsers/dispatchers.
+
+  A parser parses a Device Tree to populate a specific CmObj type. None,
+  one or many CmObj can be created by the parser.
+  The created CmObj are then handed to the parser's caller through the
+  HW_INFO_ADD_OBJECT interface.
+  This can also be a dispatcher. I.e. a function that not parsing a
+  Device Tree but calling other parsers.
+*/
+STATIC CONST FDT_HW_INFO_PARSER_FUNC  HwInfoParserTable[] = {
+  ArmBootArchInfoParser,
+  ArmGenericTimerInfoParser,
+  ArmGicDispatcher,
+  ArmPciConfigInfoParser,
+  SerialPortDispatcher
+};
+
+/** Main dispatcher: sequentially call the parsers/dispatchers
+    of the HwInfoParserTable.
+
+  A parser parses a Device Tree to populate a specific CmObj type. None,
+  one or many CmObj can be created by the parser.
+  The created CmObj are then handed to the parser's caller through the
+  HW_INFO_ADD_OBJECT interface.
+  This can also be a dispatcher. I.e. a function that not parsing a
+  Device Tree but calling other parsers.
+
+  @param [in]  FdtParserHandle A handle to the parser instance.
+  @param [in]  FdtBranch       When searching for DT node name, restrict
+                               the search to this Device Tree branch.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_ABORTED             An error occurred.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not found.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+EFI_STATUS
+EFIAPI
+ArchFdtHwInfoMainDispatcher (
+  IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
+  IN        INT32                      FdtBranch
+  )
+{
+  EFI_STATUS  Status;
+  UINT32      Index;
+
+  if (fdt_check_header (FdtParserHandle->Fdt) < 0) {
+    ASSERT (0);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  for (Index = 0; Index < ARRAY_SIZE (HwInfoParserTable); Index++) {
+    Status = HwInfoParserTable[Index](
+                                      FdtParserHandle,
+                                      FdtBranch
+                                      );
+    if (EFI_ERROR (Status)  &&
+        (Status != EFI_NOT_FOUND))
+    {
+      // If EFI_NOT_FOUND, the parser didn't find information in the DT.
+      // Don't trigger an error.
+      ASSERT (0);
+      return Status;
+    }
+  } // for
+
+  return EFI_SUCCESS;
+}
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c
index 78bf9c9efae4..8e980dabe373 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.c
@@ -6,82 +6,6 @@
 **/
 
 #include "FdtHwInfoParser.h"
-#include "Arm/BootArch/ArmBootArchParser.h"
-#include "Arm/GenericTimer/ArmGenericTimerParser.h"
-#include "Arm/Gic/ArmGicDispatcher.h"
-#include "Pci/ArmPciConfigSpaceParser.h"
-#include "Serial/ArmSerialPortParser.h"
-
-/** Ordered table of parsers/dispatchers.
-
-  A parser parses a Device Tree to populate a specific CmObj type. None,
-  one or many CmObj can be created by the parser.
-  The created CmObj are then handed to the parser's caller through the
-  HW_INFO_ADD_OBJECT interface.
-  This can also be a dispatcher. I.e. a function that not parsing a
-  Device Tree but calling other parsers.
-*/
-STATIC CONST FDT_HW_INFO_PARSER_FUNC  HwInfoParserTable[] = {
-  ArmBootArchInfoParser,
-  ArmGenericTimerInfoParser,
-  ArmGicDispatcher,
-  ArmPciConfigInfoParser,
-  SerialPortDispatcher
-};
-
-/** Main dispatcher: sequentially call the parsers/dispatchers
-    of the HwInfoParserTable.
-
-  A parser parses a Device Tree to populate a specific CmObj type. None,
-  one or many CmObj can be created by the parser.
-  The created CmObj are then handed to the parser's caller through the
-  HW_INFO_ADD_OBJECT interface.
-  This can also be a dispatcher. I.e. a function that not parsing a
-  Device Tree but calling other parsers.
-
-  @param [in]  FdtParserHandle A handle to the parser instance.
-  @param [in]  FdtBranch       When searching for DT node name, restrict
-                               the search to this Device Tree branch.
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_ABORTED             An error occurred.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-  @retval EFI_NOT_FOUND           Not found.
-  @retval EFI_UNSUPPORTED         Unsupported.
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-MainDispatcher (
-  IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
-  IN        INT32                      FdtBranch
-  )
-{
-  EFI_STATUS  Status;
-  UINT32      Index;
-
-  if (fdt_check_header (FdtParserHandle->Fdt) < 0) {
-    ASSERT (0);
-    return EFI_INVALID_PARAMETER;
-  }
-
-  for (Index = 0; Index < ARRAY_SIZE (HwInfoParserTable); Index++) {
-    Status = HwInfoParserTable[Index](
-                                      FdtParserHandle,
-                                      FdtBranch
-                                      );
-    if (EFI_ERROR (Status)  &&
-        (Status != EFI_NOT_FOUND))
-    {
-      // If EFI_NOT_FOUND, the parser didn't find information in the DT.
-      // Don't trigger an error.
-      ASSERT (0);
-      return Status;
-    }
-  } // for
-
-  return EFI_SUCCESS;
-}
 
 /** Initialise the HwInfoParser.
 
@@ -159,7 +83,7 @@ HwInfoParse (
   }
 
   // Call all the parsers from the root node (-1).
-  Status = MainDispatcher (
+  Status = ArchFdtHwInfoMainDispatcher (
              (FDT_HW_INFO_PARSER_HANDLE)ParserHandle,
              -1
              );
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.h
index 8a8cf38581e0..90850b356a8c 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParser.h
@@ -60,4 +60,31 @@ EFI_STATUS
   IN        INT32                     FdtBranch
   );
 
+/** Main dispatcher: sequentially call the parsers/dispatchers
+    of the HwInfoParserTable.
+
+  A parser parses a Device Tree to populate a specific CmObj type. None,
+  one or many CmObj can be created by the parser.
+  The created CmObj are then handed to the parser's caller through the
+  HW_INFO_ADD_OBJECT interface.
+  This can also be a dispatcher. I.e. a function that not parsing a
+  Device Tree but calling other parsers.
+
+  @param [in]  FdtParserHandle A handle to the parser instance.
+  @param [in]  FdtBranch       When searching for DT node name, restrict
+                               the search to this Device Tree branch.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_ABORTED             An error occurred.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not found.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+EFI_STATUS
+EFIAPI
+ArchFdtHwInfoMainDispatcher (
+  IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
+  IN        INT32                      FdtBranch
+  );
+
 #endif // FDT_HW_INFO_PARSER_H_
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
index fa768cf664df..3abc6a0fd274 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
@@ -22,6 +22,13 @@ [Sources]
   FdtHwInfoParser.h
   FdtUtility.c
   FdtUtility.h
+  Pci/ArmPciConfigSpaceParser.c
+  Pci/ArmPciConfigSpaceParser.h
+  Serial/ArmSerialPortParser.c
+  Serial/ArmSerialPortParser.h
+
+[Sources.ARM, Sources.AARCH64]
+  Arm/ArmFdtHwInfoParser.c
   Arm/BootArch/ArmBootArchParser.c
   Arm/BootArch/ArmBootArchParser.h
   Arm/GenericTimer/ArmGenericTimerParser.c
@@ -38,13 +45,11 @@ [Sources]
   Arm/Gic/ArmGicMsiFrameParser.h
   Arm/Gic/ArmGicRParser.c
   Arm/Gic/ArmGicRParser.h
-  Pci/ArmPciConfigSpaceParser.c
-  Pci/ArmPciConfigSpaceParser.h
-  Serial/ArmSerialPortParser.c
-  Serial/ArmSerialPortParser.h
 
-[Packages]
+[Packages.ARM, Packages.AARCH64]
   ArmPkg/ArmPkg.dec
+
+[Packages]
   DynamicTablesPkg/DynamicTablesPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119642): https://edk2.groups.io/g/devel/message/119642
Mute This Topic: https://groups.io/mt/106770174/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 11/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (9 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 10/15] DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other archs PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 12/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port " PierreGondois
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

To allow other architectures to potentially re-use the serial port
parser and make the code arch neutral, remove the Arm prefixes.
Also remove the check searching for a GIC version.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c |  4 ++--
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf   |  4 ++--
 ...nfigSpaceParser.c => PciConfigSpaceParser.c} | 17 ++++-------------
 ...nfigSpaceParser.h => PciConfigSpaceParser.h} | 10 +++++-----
 4 files changed, 13 insertions(+), 22 deletions(-)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
index 403402731add..49a7636dad0a 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
@@ -9,7 +9,7 @@
 #include "Arm/BootArch/ArmBootArchParser.h"
 #include "Arm/GenericTimer/ArmGenericTimerParser.h"
 #include "Arm/Gic/ArmGicDispatcher.h"
-#include "Pci/ArmPciConfigSpaceParser.h"
+#include "Pci/PciConfigSpaceParser.h"
 #include "Serial/ArmSerialPortParser.h"
 
 /** Ordered table of parsers/dispatchers.
@@ -25,7 +25,7 @@ STATIC CONST FDT_HW_INFO_PARSER_FUNC  HwInfoParserTable[] = {
   ArmBootArchInfoParser,
   ArmGenericTimerInfoParser,
   ArmGicDispatcher,
-  ArmPciConfigInfoParser,
+  PciConfigInfoParser,
   SerialPortDispatcher
 };
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
index 3abc6a0fd274..55ec7d97fa18 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
@@ -22,8 +22,8 @@ [Sources]
   FdtHwInfoParser.h
   FdtUtility.c
   FdtUtility.h
-  Pci/ArmPciConfigSpaceParser.c
-  Pci/ArmPciConfigSpaceParser.h
+  Pci/PciConfigSpaceParser.c
+  Pci/PciConfigSpaceParser.h
   Serial/ArmSerialPortParser.c
   Serial/ArmSerialPortParser.h
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c
index 5d11863dfe0a..76f9efdf64d5 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c
@@ -1,5 +1,5 @@
 /** @file
-  Arm PCI Configuration Space Parser.
+  PCI Configuration Space Parser.
 
   Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -16,8 +16,7 @@
 #include <Library/DebugLib.h>
 
 #include "FdtHwInfoParser.h"
-#include "Pci/ArmPciConfigSpaceParser.h"
-#include "Arm/Gic/ArmGicDispatcher.h"
+#include "Pci/PciConfigSpaceParser.h"
 
 /** List of "compatible" property values for host PCIe bridges nodes.
 
@@ -306,8 +305,7 @@ ParseIrqMap (
   CONST UINT8  *IrqMapMask;
   INT32        IrqMapMaskSize;
 
-  INT32   PHandleOffset;
-  UINT32  GicVersion;
+  INT32  PHandleOffset;
 
   UINT32  PciAddressAttr;
 
@@ -366,13 +364,6 @@ ParseIrqMap (
     return EFI_ABORTED;
   }
 
-  // Only support Gic(s) for now.
-  Status = GetGicVersion (Fdt, IntcNode, &GicVersion);
-  if (EFI_ERROR (Status)) {
-    ASSERT (0);
-    return Status;
-  }
-
   // Get the "address-cells" property of the IntcNode.
   Status = FdtGetAddressInfo (Fdt, IntcNode, &IntcAddressCells, NULL);
   if (EFI_ERROR (Status)) {
@@ -727,7 +718,7 @@ FreeParserTable (
 **/
 EFI_STATUS
 EFIAPI
-ArmPciConfigInfoParser (
+PciConfigInfoParser (
   IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
   IN        INT32                      FdtBranch
   )
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h
similarity index 93%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h
index e68013838515..aeffe7ac3501 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.h
@@ -1,5 +1,5 @@
 /** @file
-  Arm PCI Configuration Space Parser.
+  PCI Configuration Space Parser.
 
   Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -12,8 +12,8 @@
   - linux kernel code
 **/
 
-#ifndef ARM_PCI_CONFIG_SPACE_PARSER_H_
-#define ARM_PCI_CONFIG_SPACE_PARSER_H_
+#ifndef PCI_CONFIG_SPACE_PARSER_H_
+#define PCI_CONFIG_SPACE_PARSER_H_
 
 /** Read LEN bits at OFF offsets bits of the ADDR.
 
@@ -135,9 +135,9 @@ typedef struct PciParserTable {
 **/
 EFI_STATUS
 EFIAPI
-ArmPciConfigInfoParser (
+PciConfigInfoParser (
   IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
   IN        INT32                      FdtBranch
   );
 
-#endif // ARM_PCI_CONFIG_SPACE_PARSER_H_
+#endif // PCI_CONFIG_SPACE_PARSER_H_
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119643): https://edk2.groups.io/g/devel/message/119643
Mute This Topic: https://groups.io/mt/106770176/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 12/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch neutral
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (10 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 11/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 13/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c PierreGondois
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

To allow other architectures to potentially re-use the serial port
parser and make the code arch neutral, remove the Arm prefixes.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c  |  2 +-
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf    |  4 ++--
 ...{ArmSerialPortParser.c => SerialPortParser.c} | 16 ++++++++--------
 ...{ArmSerialPortParser.h => SerialPortParser.h} |  8 ++++----
 4 files changed, 15 insertions(+), 15 deletions(-)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
 rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
index 49a7636dad0a..2c9105ed1023 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
@@ -10,7 +10,7 @@
 #include "Arm/GenericTimer/ArmGenericTimerParser.h"
 #include "Arm/Gic/ArmGicDispatcher.h"
 #include "Pci/PciConfigSpaceParser.h"
-#include "Serial/ArmSerialPortParser.h"
+#include "Serial/SerialPortParser.h"
 
 /** Ordered table of parsers/dispatchers.
 
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
index 55ec7d97fa18..d3010af527c1 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
@@ -24,8 +24,8 @@ [Sources]
   FdtUtility.h
   Pci/PciConfigSpaceParser.c
   Pci/PciConfigSpaceParser.h
-  Serial/ArmSerialPortParser.c
-  Serial/ArmSerialPortParser.h
+  Serial/SerialPortParser.c
+  Serial/SerialPortParser.h
 
 [Sources.ARM, Sources.AARCH64]
   Arm/ArmFdtHwInfoParser.c
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/SerialPortParser.c
similarity index 95%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/SerialPortParser.c
index f17ad2e842e2..2d0dccea3d3a 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/SerialPortParser.c
@@ -1,5 +1,5 @@
 /** @file
-  Arm Serial Port Parser.
+  Serial Port Parser.
 
   Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -15,7 +15,7 @@
 
 #include "CmObjectDescUtility.h"
 #include "FdtHwInfoParser.h"
-#include "Serial/ArmSerialPortParser.h"
+#include "Serial/SerialPortParser.h"
 
 /** List of "compatible" property values for serial port nodes.
 
@@ -329,7 +329,7 @@ GetSerialConsoleNode (
 STATIC
 EFI_STATUS
 EFIAPI
-ArmSerialPortInfoDispatch (
+SerialPortInfoDispatch (
   IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
   IN  CM_ARCH_COMMON_SERIAL_PORT_INFO  *GenericSerialInfo,
   IN  INT32                            NodeCount,
@@ -408,7 +408,7 @@ ArmSerialPortInfoDispatch (
 STATIC
 EFI_STATUS
 EFIAPI
-ArmSerialPortInfoParser (
+SerialPortInfoParser (
   IN  CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
   IN        INT32                      FdtBranch,
   IN        EARCH_COMMON_OBJECT_ID     SerialObjectId
@@ -436,7 +436,7 @@ ArmSerialPortInfoParser (
     return Status;
   }
 
-  Status = ArmSerialPortInfoDispatch (
+  Status = SerialPortInfoDispatch (
              FdtParserHandle,
              &SerialInfo,
              1,
@@ -529,7 +529,7 @@ SerialPortDispatcher (
     return Status;
   } else {
     // Parse the console serial-port.
-    Status = ArmSerialPortInfoParser (
+    Status = SerialPortInfoParser (
                FdtParserHandle,
                SerialConsoleNode,
                EArchCommonObjConsolePortInfo
@@ -587,7 +587,7 @@ SerialPortDispatcher (
       // The first serial-port node, not being the console serial-port,
       // will be the debug serial-port.
       SerialDebugNode = SerialNode;
-      Status          = ArmSerialPortInfoParser (
+      Status          = SerialPortInfoParser (
                           FdtParserHandle,
                           SerialDebugNode,
                           EArchCommonObjSerialDebugPortInfo
@@ -617,7 +617,7 @@ SerialPortDispatcher (
   } // for
 
   if (GenericSerialIndex > 0) {
-    Status = ArmSerialPortInfoDispatch (
+    Status = SerialPortInfoDispatch (
                FdtParserHandle,
                GenericSerialInfo,
                GenericSerialIndex,
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/SerialPortParser.h
similarity index 89%
rename from DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.h
rename to DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/SerialPortParser.h
index 037c409d450a..22c686d5d4ad 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/SerialPortParser.h
@@ -1,5 +1,5 @@
 /** @file
-  Arm Serial Port Parser.
+  Serial Port Parser.
 
   Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -9,8 +9,8 @@
   - linux/Documentation/devicetree/bindings/serial/8250.txt
 **/
 
-#ifndef ARM_SERIAL_PORT_PARSER_H_
-#define ARM_SERIAL_PORT_PARSER_H_
+#ifndef SERIAL_PORT_PARSER_H_
+#define SERIAL_PORT_PARSER_H_
 
 /** SerialPort dispatcher.
 
@@ -44,4 +44,4 @@ SerialPortDispatcher (
   IN        INT32                      FdtBranch
   );
 
-#endif // ARM_SERIAL_PORT_PARSER_H_
+#endif // SERIAL_PORT_PARSER_H_
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119644): https://edk2.groups.io/g/devel/message/119644
Mute This Topic: https://groups.io/mt/106770179/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 13/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (11 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 12/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port " PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder PierreGondois
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

ArmLib.h is required only for building GIC in ARM. So, move it to ARM
specific file. Otherwise, FdtHwInfoParserInclude.h being a common header
across architectures will have issue on other architectures.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c           | 1 +
 .../Library/FdtHwInfoParserLib/FdtHwInfoParserInclude.h          | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c
index cf577b47242e..395521914671 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicCParser.c
@@ -11,6 +11,7 @@
   - linux/Documentation/devicetree/bindings/arm/pmu.yaml
 **/
 
+#include <Library/ArmLib.h>
 #include "FdtHwInfoParser.h"
 #include "CmObjectDescUtility.h"
 #include "Arm/Gic/ArmGicCParser.h"
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserInclude.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserInclude.h
index 583f290095d9..60f671eccc3f 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserInclude.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserInclude.h
@@ -10,7 +10,6 @@
 
 #include <Base.h>
 #include <libfdt.h>
-#include <Library/ArmLib.h>
 #include <Library/DebugLib.h>
 #include <Library/MemoryAllocationLib.h>
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119645): https://edk2.groups.io/g/devel/message/119645
Mute This Topic: https://groups.io/mt/106770181/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (12 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 13/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-07-03  6:20   ` Sunil V L
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells PierreGondois
  2024-07-03  9:08 ` [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs Sami Mujawar
  15 siblings, 1 reply; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

The interrupts-extended property in DT is arch specific.
Move the current implementation and the way to decode the property
to the Arm folder to prepare for other architecture support.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c    | 85 +++++++++++++++++++
 .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf |  1 +
 .../Library/FdtHwInfoParserLib/FdtUtility.c   | 71 ----------------
 3 files changed, 86 insertions(+), 71 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
new file mode 100644
index 000000000000..21b1306e577d
--- /dev/null
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
@@ -0,0 +1,85 @@
+/** @file
+  Flattened device tree utility.
+
+  Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - Device tree Specification - Release v0.3
+  - linux/Documentation/devicetree/bindings/interrupt-controller/arm%2Cgic.yaml
+  - linux//Documentation/devicetree/bindings/interrupt-controller/arm%2Cgic.yaml
+**/
+
+#include <FdtHwInfoParserInclude.h>
+#include "FdtUtility.h"
+
+/** Get the interrupt Id of an interrupt described in a fdt.
+
+  Data must describe a GIC interrupt. A GIC interrupt is on at least
+  3 UINT32 cells.
+  This function DOES NOT SUPPORT extended SPI range and extended PPI range.
+
+  @param [in]  Data   Pointer to the first cell of an "interrupts" property.
+
+  @retval  The interrupt id.
+**/
+UINT32
+EFIAPI
+FdtGetInterruptId (
+  UINT32 CONST  *Data
+  )
+{
+  UINT32  IrqType;
+  UINT32  IrqId;
+
+  ASSERT (Data != NULL);
+
+  IrqType = fdt32_to_cpu (Data[IRQ_TYPE_OFFSET]);
+  IrqId   = fdt32_to_cpu (Data[IRQ_NUMBER_OFFSET]);
+
+  switch (IrqType) {
+    case DT_SPI_IRQ:
+      IrqId += SPI_OFFSET;
+      break;
+
+    case DT_PPI_IRQ:
+      IrqId += PPI_OFFSET;
+      break;
+
+    default:
+      ASSERT (0);
+      IrqId = 0;
+  }
+
+  return IrqId;
+}
+
+/** Get the ACPI interrupt flags of an interrupt described in a fdt.
+
+  Data must describe a GIC interrupt. A GIC interrupt is on at least
+  3 UINT32 cells.
+
+  PPI interrupt cpu mask on bits [15:8] are ignored.
+
+  @param [in]  Data   Pointer to the first cell of an "interrupts" property.
+
+  @retval  The interrupt flags (for ACPI).
+**/
+UINT32
+EFIAPI
+FdtGetInterruptFlags (
+  UINT32 CONST  *Data
+  )
+{
+  UINT32  IrqFlags;
+  UINT32  AcpiIrqFlags;
+
+  ASSERT (Data != NULL);
+
+  IrqFlags = fdt32_to_cpu (Data[IRQ_FLAGS_OFFSET]);
+
+  AcpiIrqFlags  = DT_IRQ_IS_EDGE_TRIGGERED (IrqFlags) ? BIT0 : 0;
+  AcpiIrqFlags |= DT_IRQ_IS_ACTIVE_LOW (IrqFlags) ? BIT1 : 0;
+
+  return AcpiIrqFlags;
+}
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
index d3010af527c1..8e1ea100bd34 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
@@ -28,6 +28,7 @@ [Sources]
   Serial/SerialPortParser.h
 
 [Sources.ARM, Sources.AARCH64]
+  Arm/ArmFdtUtility.c
   Arm/ArmFdtHwInfoParser.c
   Arm/BootArch/ArmBootArchParser.c
   Arm/BootArch/ArmBootArchParser.h
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.c
index 5314cf3808c2..bab228575938 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.c
@@ -13,77 +13,6 @@
 #include <FdtHwInfoParserInclude.h>
 #include "FdtUtility.h"
 
-/** Get the interrupt Id of an interrupt described in a fdt.
-
-  Data must describe a GIC interrupt. A GIC interrupt is on at least
-  3 UINT32 cells.
-  This function DOES NOT SUPPORT extended SPI range and extended PPI range.
-
-  @param [in]  Data   Pointer to the first cell of an "interrupts" property.
-
-  @retval  The interrupt id.
-**/
-UINT32
-EFIAPI
-FdtGetInterruptId (
-  UINT32 CONST  *Data
-  )
-{
-  UINT32  IrqType;
-  UINT32  IrqId;
-
-  ASSERT (Data != NULL);
-
-  IrqType = fdt32_to_cpu (Data[IRQ_TYPE_OFFSET]);
-  IrqId   = fdt32_to_cpu (Data[IRQ_NUMBER_OFFSET]);
-
-  switch (IrqType) {
-    case DT_SPI_IRQ:
-      IrqId += SPI_OFFSET;
-      break;
-
-    case DT_PPI_IRQ:
-      IrqId += PPI_OFFSET;
-      break;
-
-    default:
-      ASSERT (0);
-      IrqId = 0;
-  }
-
-  return IrqId;
-}
-
-/** Get the ACPI interrupt flags of an interrupt described in a fdt.
-
-  Data must describe a GIC interrupt. A GIC interrupt is on at least
-  3 UINT32 cells.
-
-  PPI interrupt cpu mask on bits [15:8] are ignored.
-
-  @param [in]  Data   Pointer to the first cell of an "interrupts" property.
-
-  @retval  The interrupt flags (for ACPI).
-**/
-UINT32
-EFIAPI
-FdtGetInterruptFlags (
-  UINT32 CONST  *Data
-  )
-{
-  UINT32  IrqFlags;
-  UINT32  AcpiIrqFlags;
-
-  ASSERT (Data != NULL);
-
-  IrqFlags = fdt32_to_cpu (Data[IRQ_FLAGS_OFFSET]);
-
-  AcpiIrqFlags  = DT_IRQ_IS_EDGE_TRIGGERED (IrqFlags) ? BIT0 : 0;
-  AcpiIrqFlags |= DT_IRQ_IS_ACTIVE_LOW (IrqFlags) ? BIT1 : 0;
-
-  return AcpiIrqFlags;
-}
-
 /** Check whether a node has the input name.
 
   @param [in]  Fdt          Pointer to a Flattened Device Tree.
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119646): https://edk2.groups.io/g/devel/message/119646
Mute This Topic: https://groups.io/mt/106770184/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (13 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder PierreGondois
@ 2024-06-19 22:06 ` PierreGondois
  2024-07-03  6:50   ` Sunil V L
  2024-07-03  9:08 ` [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs Sami Mujawar
  15 siblings, 1 reply; 24+ messages in thread
From: PierreGondois @ 2024-06-19 22:06 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Sunil V L, Yeo Reum Yun

Parent interrupt controller's address cells is arch specific. So,
create a wrapper function which can be implemented differently for
different archs. Move current implementation to ARM specific file.

Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../AcpiSsdtPcieLib/SsdtPcieGenerator.c       |  2 +-
 .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c    | 33 +++++++++++++++++++
 .../Library/FdtHwInfoParserLib/FdtUtility.h   | 30 +++++++++++++++++
 .../Pci/PciConfigSpaceParser.c                |  2 +-
 4 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
index 2b488016e545..5b6d5515622b 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
@@ -974,7 +974,7 @@ BuildSsdtPciTableEx (
   EFI_STATUS                            Status;
   CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO  *PciInfo;
   UINT32                                PciCount;
-  UINTN                                 Index;
+  UINT32                                Index;
   EFI_ACPI_DESCRIPTION_HEADER           **TableList;
   ACPI_PCI_GENERATOR                    *Generator;
   UINT32                                Uid;
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
index 21b1306e577d..71774fae7113 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
@@ -83,3 +83,36 @@ FdtGetInterruptFlags (
 
   return AcpiIrqFlags;
 }
+
+/** For relevant architectures, get the "#address-cells" and/or "#size-cells"
+    property of the node.
+
+  According to the Device Tree specification, s2.3.5 "#address-cells and
+  #size-cells":
+  "If missing, a client program should assume a default value of 2 for
+  #address-cells, and a value of 1 for #size-cells."
+
+  @param [in]  Fdt              Pointer to a Flattened Device Tree.
+  @param [in]  Node             Offset of the node having to get the
+                                "#address-cells" and "#size-cells"
+                                properties from.
+  @param [out] AddressCells     If success, number of address-cells.
+                                If the property is not available,
+                                default value is 2.
+  @param [out] SizeCells        If success, number of size-cells.
+                                If the property is not available,
+                                default value is 1.
+
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+**/
+EFI_STATUS
+EFIAPI
+FdtGetIntcAddressCells (
+  IN  CONST VOID *Fdt,
+  IN        INT32 Node,
+  OUT       INT32 *AddressCells, OPTIONAL
+  OUT       INT32     *SizeCells       OPTIONAL
+  )
+{
+  return FdtGetAddressInfo (Fdt, Node, AddressCells, SizeCells);
+}
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h
index 3f5d131d9ae5..2d7048753b9f 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h
@@ -455,4 +455,34 @@ FdtGetParentAddressInfo (
   OUT       INT32     *SizeCells       OPTIONAL
   );
 
+/** For relevant architectures, get the "#address-cells" and/or "#size-cells"
+    property of the node.
+
+  According to the Device Tree specification, s2.3.5 "#address-cells and
+  #size-cells":
+  "If missing, a client program should assume a default value of 2 for
+  #address-cells, and a value of 1 for #size-cells."
+
+  @param [in]  Fdt              Pointer to a Flattened Device Tree.
+  @param [in]  Node             Offset of the node having to get the
+                                "#address-cells" and "#size-cells"
+                                properties from.
+  @param [out] AddressCells     If success, number of address-cells.
+                                If the property is not available,
+                                default value is 2.
+  @param [out] SizeCells        If success, number of size-cells.
+                                If the property is not available,
+                                default value is 1.
+
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+**/
+EFI_STATUS
+EFIAPI
+FdtGetIntcAddressCells (
+  IN  CONST VOID *Fdt,
+  IN        INT32 Node,
+  OUT       INT32 *AddressCells, OPTIONAL
+  OUT       INT32     *SizeCells       OPTIONAL
+  );
+
 #endif // FDT_UTILITY_H_
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c
index 76f9efdf64d5..7f536c0ac63e 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/PciConfigSpaceParser.c
@@ -365,7 +365,7 @@ ParseIrqMap (
   }
 
   // Get the "address-cells" property of the IntcNode.
-  Status = FdtGetAddressInfo (Fdt, IntcNode, &IntcAddressCells, NULL);
+  Status = FdtGetIntcAddressCells (Fdt, IntcNode, &IntcAddressCells, NULL);
   if (EFI_ERROR (Status)) {
     ASSERT (0);
     return Status;
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119647): https://edk2.groups.io/g/devel/message/119647
Mute This Topic: https://groups.io/mt/106770185/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder PierreGondois
@ 2024-07-03  6:20   ` Sunil V L
  0 siblings, 0 replies; 24+ messages in thread
From: Sunil V L @ 2024-07-03  6:20 UTC (permalink / raw)
  To: Pierre Gondois
  Cc: devel, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Yeo Reum Yun

Hi Pierre,

On Thu, Jun 20, 2024 at 12:06:28AM +0200, Pierre Gondois wrote:
> The interrupts-extended property in DT is arch specific.

This should be "interrupts" property. Otherwise the patch LGTM.

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks,
Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119770): https://edk2.groups.io/g/devel/message/119770
Mute This Topic: https://groups.io/mt/106770184/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells PierreGondois
@ 2024-07-03  6:50   ` Sunil V L
  2024-07-03  7:36     ` Sami Mujawar
  0 siblings, 1 reply; 24+ messages in thread
From: Sunil V L @ 2024-07-03  6:50 UTC (permalink / raw)
  To: Pierre Gondois
  Cc: devel, AbdulLateef Attar, Girish Mahadevan, Jeff Brasen,
	Jeshua Smith, Leif Lindholm, Meenakshi Aggarwal, Sami Mujawar,
	Yeo Reum Yun

On Thu, Jun 20, 2024 at 12:06:29AM +0200, Pierre Gondois wrote:
> Parent interrupt controller's address cells is arch specific. So,
> create a wrapper function which can be implemented differently for
> different archs. Move current implementation to ARM specific file.
> 
> Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>  .../AcpiSsdtPcieLib/SsdtPcieGenerator.c       |  2 +-
>  .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c    | 33 +++++++++++++++++++
>  .../Library/FdtHwInfoParserLib/FdtUtility.h   | 30 +++++++++++++++++
>  .../Pci/PciConfigSpaceParser.c                |  2 +-
>  4 files changed, 65 insertions(+), 2 deletions(-)
> 
> diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
> index 2b488016e545..5b6d5515622b 100644
> --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c
> @@ -974,7 +974,7 @@ BuildSsdtPciTableEx (
>    EFI_STATUS                            Status;
>    CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO  *PciInfo;
>    UINT32                                PciCount;
> -  UINTN                                 Index;
> +  UINT32                                Index;
>    EFI_ACPI_DESCRIPTION_HEADER           **TableList;
>    ACPI_PCI_GENERATOR                    *Generator;
>    UINT32                                Uid;
> diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> index 21b1306e577d..71774fae7113 100644
> --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> @@ -83,3 +83,36 @@ FdtGetInterruptFlags (
>  
>    return AcpiIrqFlags;
>  }
> +
> +/** For relevant architectures, get the "#address-cells" and/or "#size-cells"
> +    property of the node.
> +
> +  According to the Device Tree specification, s2.3.5 "#address-cells and
> +  #size-cells":
> +  "If missing, a client program should assume a default value of 2 for
> +  #address-cells, and a value of 1 for #size-cells."
> +
> +  @param [in]  Fdt              Pointer to a Flattened Device Tree.
> +  @param [in]  Node             Offset of the node having to get the
> +                                "#address-cells" and "#size-cells"
> +                                properties from.
> +  @param [out] AddressCells     If success, number of address-cells.
> +                                If the property is not available,
> +                                default value is 2.
> +  @param [out] SizeCells        If success, number of size-cells.
> +                                If the property is not available,
> +                                default value is 1.
> +
> +  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> +**/
> +EFI_STATUS
> +EFIAPI
> +FdtGetIntcAddressCells (
> +  IN  CONST VOID *Fdt,
> +  IN        INT32 Node,
> +  OUT       INT32 *AddressCells, OPTIONAL
> +  OUT       INT32     *SizeCells       OPTIONAL
> +  )
> +{
> +  return FdtGetAddressInfo (Fdt, Node, AddressCells, SizeCells);
> +}
> diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h
> index 3f5d131d9ae5..2d7048753b9f 100644
> --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h
> +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtUtility.h
> @@ -455,4 +455,34 @@ FdtGetParentAddressInfo (
>    OUT       INT32     *SizeCells       OPTIONAL
>    );
>  
> +/** For relevant architectures, get the "#address-cells" and/or "#size-cells"
> +    property of the node.
> +
> +  According to the Device Tree specification, s2.3.5 "#address-cells and
> +  #size-cells":
> +  "If missing, a client program should assume a default value of 2 for
> +  #address-cells, and a value of 1 for #size-cells."
> +
> +  @param [in]  Fdt              Pointer to a Flattened Device Tree.
> +  @param [in]  Node             Offset of the node having to get the
> +                                "#address-cells" and "#size-cells"
> +                                properties from.
> +  @param [out] AddressCells     If success, number of address-cells.
> +                                If the property is not available,
> +                                default value is 2.
> +  @param [out] SizeCells        If success, number of size-cells.
> +                                If the property is not available,
> +                                default value is 1.
> +
> +  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> +**/
> +EFI_STATUS
> +EFIAPI
> +FdtGetIntcAddressCells (
> +  IN  CONST VOID *Fdt,
> +  IN        INT32 Node,
> +  OUT       INT32 *AddressCells, OPTIONAL
> +  OUT       INT32     *SizeCells       OPTIONAL
NIT: I might be wrong but alignment doesn't look correct.

Otherwise, LGTM.

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks!
Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119771): https://edk2.groups.io/g/devel/message/119771
Mute This Topic: https://groups.io/mt/106770185/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells
  2024-07-03  6:50   ` Sunil V L
@ 2024-07-03  7:36     ` Sami Mujawar
  0 siblings, 0 replies; 24+ messages in thread
From: Sami Mujawar @ 2024-07-03  7:36 UTC (permalink / raw)
  To: devel@edk2.groups.io, sunilvl@ventanamicro.com, Pierre Gondois
  Cc: AbdulLateef Attar, Girish Mahadevan,
	Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith, Leif Lindholm,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com), Yeo Reum Yun, nd

Hi Sunil,

Thank you for the review.

> +EFI_STATUS
> +EFIAPI
> +FdtGetIntcAddressCells (
> + IN CONST VOID *Fdt,
> + IN INT32 Node,
> + OUT INT32 *AddressCells, OPTIONAL
> + OUT INT32 *SizeCells OPTIONAL
NIT: I might be wrong but alignment doesn't look correct.
[SAMI] I wonder if this is an artifact of the email client. The alignment looks ok to me in visual studio code. 
That being said, I may have run uncrustify on Pierre's patch series as I am planning to get it merged soon.
In either case I will get it addressed, thank you for the feedback.
[/SAMI]

Otherwise, LGTM.


Reviewed-by: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>


Thanks!
Sunil














-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119772): https://edk2.groups.io/g/devel/message/119772
Mute This Topic: https://groups.io/mt/106770185/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
  2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
                   ` (14 preceding siblings ...)
  2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells PierreGondois
@ 2024-07-03  9:08 ` Sami Mujawar
  2024-07-03  9:36   ` Sunil V L
  2024-07-03  9:55   ` PierreGondois
  15 siblings, 2 replies; 24+ messages in thread
From: Sami Mujawar @ 2024-07-03  9:08 UTC (permalink / raw)
  To: Pierre Gondois, devel@edk2.groups.io
  Cc: AbdulLateef Attar, Girish Mahadevan,
	Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith, Leif Lindholm,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com), Sunil V L,
	Yeo Reum Yun, nd

Hi Pierre,

Overall, this patch series looks good to me.

I have some minor comments regarding the return value for the Arch hook functions their placement in Common folder.
e.g. in Patch "DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs"
The file DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
provides an empty stub for the arch specific implementation for the FadtArchUpdate () and returns
success. I think this function should return EFI_UNSUPPORTED to indicate that this function is not
implemented and that the architecture needs to provide an implementation.

Also, the file name AcpiFadtLib/Common/CommonFadtGenerator.c should be changed to
AcpiFadtLib/FadtGeneratorNull.c to clarify that the implementation does not exist.

Similar changes are required for other patches as well.

Apart from the above, in patch " DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder"
I think the file DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c should be renamed to 
DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtInterrupt.c

If you agree with the above, I will make the necessary changes before merging.

With that,

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar


On 19/06/2024, 23:06, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


The DynamicTables framework has mainly been developed/tested against Arm
architecture. While still trying to have re-usable libraries, opening the
framework to other architectures implies some re-organization.


The libraries that are generic enough to be directly re-used are moved
to a Common/ directory. For some libraries, additional arch-specific hooks
have been added to allow architectures specific modifications.


---


Changes can be seen at:
https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg>


---


References:
1. Staging branch creation:
URL: https://edk2.groups.io/g/devel/message/114790 <https://edk2.groups.io/g/devel/message/114790>


2. edk2-staging Repo
URL: https://github.com/tianocore/edk2-staging.git <https://github.com/tianocore/edk2-staging.git>
Branch Name: dynamictables-reorg


3. edk2-platforms Repo
URL: https://github.com/tianocore/edk2-platforms.git <https://github.com/tianocore/edk2-platforms.git>
Branch Name: devel-dynamictables-reorg


---


Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com>>
Cc: Girish Mahadevan <gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com>>
Cc: Jeff Brasen <jbrasen@nvidia.com <mailto:jbrasen@nvidia.com>>
Cc: Jeshua Smith <jeshuas@nvidia.com <mailto:jeshuas@nvidia.com>>
Cc: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>
Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com>>
Cc: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
Cc: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>
Cc: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>
Cc: Yeo Reum Yun <YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com>>


Pierre Gondois (15):
DynamicTablesPkg: Acpi: Move generic libraries to common folder
DynamicTablesPkg: Acpi: Prepare common libraries to support other
archs
DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm
directory
DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other
archs
DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch
neutral
DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr
cells


.../Arm/ArmDynamicTableManagerDxe.c | 63 +++
.../Common/CommonDynamicTableManagerDxe.c | 58 +++
.../DynamicTableManagerDxe.c | 70 +--
.../DynamicTableManagerDxe.h | 63 +++
.../DynamicTableManagerDxe.inf | 7 +
DynamicTablesPkg/DynamicTables.dsc.inc | 64 +--
.../SsdtCpuTopologyGenerator.h | 147 -------
.../AcpiDbg2Lib/AcpiDbg2Lib.inf} | 22 +-
.../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c | 67 +++
.../AcpiDbg2Lib/Common/CommonDbg2Generator.c | 59 +++
.../AcpiDbg2Lib}/Dbg2Generator.c | 24 +-
.../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h | 56 +++
.../AcpiFadtLib/AcpiFadtLib.inf} | 16 +-
.../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++
.../AcpiFadtLib/Common/CommonFadtGenerator.c | 46 ++
.../AcpiFadtLib}/FadtGenerator.c | 86 +---
.../Acpi/Common/AcpiFadtLib/FadtGenerator.h | 35 ++
.../AcpiMcfgLib/AcpiMcfgLib.inf} | 9 +-
.../AcpiMcfgLib}/McfgGenerator.c | 0
.../AcpiPcctLib/AcpiPcctLib.inf} | 2 +-
.../AcpiPcctLib}/PcctGenerator.c | 0
.../AcpiPcctLib}/PcctGenerator.h | 0
.../AcpiPpttLib/AcpiPpttLib.inf} | 2 +-
.../AcpiPpttLib}/PpttGenerator.c | 0
.../AcpiPpttLib}/PpttGenerator.h | 0
.../AcpiRawLib/AcpiRawLib.inf} | 9 +-
.../AcpiRawLib}/RawGenerator.c | 0
.../AcpiSpcrLib/AcpiSpcrLib.inf} | 9 +-
.../AcpiSpcrLib}/SpcrGenerator.c | 2 +-
.../AcpiSratLib/AcpiSratLib.inf} | 9 +-
.../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 +++++++++++
.../AcpiSratLib/Common/CommonSratGenerator.c | 77 ++++
.../AcpiSratLib}/SratGenerator.c | 214 +--------
.../Acpi/Common/AcpiSratLib/SratGenerator.h | 59 +++
.../Arm/ArmSsdtCpuTopologyGenerator.c | 408 ++++++++++++++++++
.../SsdtCpuTopologyGenerator.c | 341 ++-------------
.../SsdtCpuTopologyGenerator.h | 343 +++++++++++++++
.../SsdtCpuTopologyLib.inf} | 9 +-
.../AcpiSsdtPcieLib}/SsdtPcieGenerator.c | 2 +-
.../AcpiSsdtPcieLib}/SsdtPcieGenerator.h | 0
.../AcpiSsdtPcieLib/SsdtPcieLib.inf} | 2 +-
.../SsdtSerialPortGenerator.c | 0
.../SsdtSerialPortLib.inf} | 6 +-
.../Arm/ArmFdtHwInfoParser.c | 83 ++++
.../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 118 +++++
.../{ => Arm}/BootArch/ArmBootArchParser.c | 2 +-
.../{ => Arm}/BootArch/ArmBootArchParser.h | 0
.../GenericTimer/ArmGenericTimerParser.c | 4 +-
.../GenericTimer/ArmGenericTimerParser.h | 0
.../{ => Arm}/Gic/ArmGicCParser.c | 5 +-
.../{ => Arm}/Gic/ArmGicCParser.h | 0
.../{ => Arm}/Gic/ArmGicDParser.c | 4 +-
.../{ => Arm}/Gic/ArmGicDParser.h | 0
.../{ => Arm}/Gic/ArmGicDispatcher.c | 12 +-
.../{ => Arm}/Gic/ArmGicDispatcher.h | 0
.../{ => Arm}/Gic/ArmGicItsParser.c | 4 +-
.../{ => Arm}/Gic/ArmGicItsParser.h | 0
.../{ => Arm}/Gic/ArmGicMsiFrameParser.c | 4 +-
.../{ => Arm}/Gic/ArmGicMsiFrameParser.h | 0
.../{ => Arm}/Gic/ArmGicRParser.c | 4 +-
.../{ => Arm}/Gic/ArmGicRParser.h | 0
.../FdtHwInfoParserLib/FdtHwInfoParser.c | 78 +---
.../FdtHwInfoParserLib/FdtHwInfoParser.h | 27 ++
.../FdtHwInfoParserInclude.h | 1 -
.../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 48 ++-
.../Library/FdtHwInfoParserLib/FdtUtility.c | 71 ---
.../Library/FdtHwInfoParserLib/FdtUtility.h | 30 ++
...igSpaceParser.c => PciConfigSpaceParser.c} | 19 +-
...igSpaceParser.h => PciConfigSpaceParser.h} | 10 +-
...mSerialPortParser.c => SerialPortParser.c} | 16 +-
...mSerialPortParser.h => SerialPortParser.h} | 8 +-
71 files changed, 2248 insertions(+), 1074 deletions(-)
create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
delete mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (75%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (93%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (75%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (87%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (85%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (90%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (90%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (85%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (86%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (96%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (74%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (75%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (79%)
create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (80%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (96%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (91%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (87%)
create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)


-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119773): https://edk2.groups.io/g/devel/message/119773
Mute This Topic: https://groups.io/mt/106770151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
  2024-07-03  9:08 ` [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs Sami Mujawar
@ 2024-07-03  9:36   ` Sunil V L
  2024-07-03  9:39     ` Sami Mujawar
  2024-07-03  9:55   ` PierreGondois
  1 sibling, 1 reply; 24+ messages in thread
From: Sunil V L @ 2024-07-03  9:36 UTC (permalink / raw)
  To: Sami Mujawar
  Cc: Pierre Gondois, devel@edk2.groups.io, AbdulLateef Attar,
	Girish Mahadevan, Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith,
	Leif Lindholm, Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Yeo Reum Yun, nd

Hi Pierre, Sami,

Thanks a lot again for this work!.

The series looks good to me as well. I agree with Sami's suggestions.

However, I have a request for an additional change. The common ACPI
tables still use ARMH/ARMLTD as the CREATOR_ID/OEM_ID. Can they be made
architecture specific?

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

Thanks!
Sunil
On Wed, Jul 03, 2024 at 09:08:08AM +0000, Sami Mujawar wrote:
> Hi Pierre,
> 
> Overall, this patch series looks good to me.
> 
> I have some minor comments regarding the return value for the Arch hook functions their placement in Common folder.
> e.g. in Patch "DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs"
> The file DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> provides an empty stub for the arch specific implementation for the FadtArchUpdate () and returns
> success. I think this function should return EFI_UNSUPPORTED to indicate that this function is not
> implemented and that the architecture needs to provide an implementation.
> 
> Also, the file name AcpiFadtLib/Common/CommonFadtGenerator.c should be changed to
> AcpiFadtLib/FadtGeneratorNull.c to clarify that the implementation does not exist.
> 
> Similar changes are required for other patches as well.
> 
> Apart from the above, in patch " DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder"
> I think the file DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c should be renamed to 
> DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtInterrupt.c
> 
> If you agree with the above, I will make the necessary changes before merging.
> 
> With that,
> 
> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
> 
> Regards,
> 
> Sami Mujawar
> 
> 
> On 19/06/2024, 23:06, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:
> 
> 
> The DynamicTables framework has mainly been developed/tested against Arm
> architecture. While still trying to have re-usable libraries, opening the
> framework to other architectures implies some re-organization.
> 
> 
> The libraries that are generic enough to be directly re-used are moved
> to a Common/ directory. For some libraries, additional arch-specific hooks
> have been added to allow architectures specific modifications.
> 
> 
> ---
> 
> 
> Changes can be seen at:
> https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg>
> 
> 
> ---
> 
> 
> References:
> 1. Staging branch creation:
> URL: https://edk2.groups.io/g/devel/message/114790 <https://edk2.groups.io/g/devel/message/114790>
> 
> 
> 2. edk2-staging Repo
> URL: https://github.com/tianocore/edk2-staging.git <https://github.com/tianocore/edk2-staging.git>
> Branch Name: dynamictables-reorg
> 
> 
> 3. edk2-platforms Repo
> URL: https://github.com/tianocore/edk2-platforms.git <https://github.com/tianocore/edk2-platforms.git>
> Branch Name: devel-dynamictables-reorg
> 
> 
> ---
> 
> 
> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com>>
> Cc: Girish Mahadevan <gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com>>
> Cc: Jeff Brasen <jbrasen@nvidia.com <mailto:jbrasen@nvidia.com>>
> Cc: Jeshua Smith <jeshuas@nvidia.com <mailto:jeshuas@nvidia.com>>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com>>
> Cc: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
> Cc: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>
> Cc: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>
> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com>>
> 
> 
> Pierre Gondois (15):
> DynamicTablesPkg: Acpi: Move generic libraries to common folder
> DynamicTablesPkg: Acpi: Prepare common libraries to support other
> archs
> DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
> DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
> DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
> DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
> DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
> DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
> DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm
> directory
> DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other
> archs
> DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
> DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch
> neutral
> DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
> DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
> DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr
> cells
> 
> 
> .../Arm/ArmDynamicTableManagerDxe.c | 63 +++
> .../Common/CommonDynamicTableManagerDxe.c | 58 +++
> .../DynamicTableManagerDxe.c | 70 +--
> .../DynamicTableManagerDxe.h | 63 +++
> .../DynamicTableManagerDxe.inf | 7 +
> DynamicTablesPkg/DynamicTables.dsc.inc | 64 +--
> .../SsdtCpuTopologyGenerator.h | 147 -------
> .../AcpiDbg2Lib/AcpiDbg2Lib.inf} | 22 +-
> .../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c | 67 +++
> .../AcpiDbg2Lib/Common/CommonDbg2Generator.c | 59 +++
> .../AcpiDbg2Lib}/Dbg2Generator.c | 24 +-
> .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h | 56 +++
> .../AcpiFadtLib/AcpiFadtLib.inf} | 16 +-
> .../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++
> .../AcpiFadtLib/Common/CommonFadtGenerator.c | 46 ++
> .../AcpiFadtLib}/FadtGenerator.c | 86 +---
> .../Acpi/Common/AcpiFadtLib/FadtGenerator.h | 35 ++
> .../AcpiMcfgLib/AcpiMcfgLib.inf} | 9 +-
> .../AcpiMcfgLib}/McfgGenerator.c | 0
> .../AcpiPcctLib/AcpiPcctLib.inf} | 2 +-
> .../AcpiPcctLib}/PcctGenerator.c | 0
> .../AcpiPcctLib}/PcctGenerator.h | 0
> .../AcpiPpttLib/AcpiPpttLib.inf} | 2 +-
> .../AcpiPpttLib}/PpttGenerator.c | 0
> .../AcpiPpttLib}/PpttGenerator.h | 0
> .../AcpiRawLib/AcpiRawLib.inf} | 9 +-
> .../AcpiRawLib}/RawGenerator.c | 0
> .../AcpiSpcrLib/AcpiSpcrLib.inf} | 9 +-
> .../AcpiSpcrLib}/SpcrGenerator.c | 2 +-
> .../AcpiSratLib/AcpiSratLib.inf} | 9 +-
> .../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 +++++++++++
> .../AcpiSratLib/Common/CommonSratGenerator.c | 77 ++++
> .../AcpiSratLib}/SratGenerator.c | 214 +--------
> .../Acpi/Common/AcpiSratLib/SratGenerator.h | 59 +++
> .../Arm/ArmSsdtCpuTopologyGenerator.c | 408 ++++++++++++++++++
> .../SsdtCpuTopologyGenerator.c | 341 ++-------------
> .../SsdtCpuTopologyGenerator.h | 343 +++++++++++++++
> .../SsdtCpuTopologyLib.inf} | 9 +-
> .../AcpiSsdtPcieLib}/SsdtPcieGenerator.c | 2 +-
> .../AcpiSsdtPcieLib}/SsdtPcieGenerator.h | 0
> .../AcpiSsdtPcieLib/SsdtPcieLib.inf} | 2 +-
> .../SsdtSerialPortGenerator.c | 0
> .../SsdtSerialPortLib.inf} | 6 +-
> .../Arm/ArmFdtHwInfoParser.c | 83 ++++
> .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 118 +++++
> .../{ => Arm}/BootArch/ArmBootArchParser.c | 2 +-
> .../{ => Arm}/BootArch/ArmBootArchParser.h | 0
> .../GenericTimer/ArmGenericTimerParser.c | 4 +-
> .../GenericTimer/ArmGenericTimerParser.h | 0
> .../{ => Arm}/Gic/ArmGicCParser.c | 5 +-
> .../{ => Arm}/Gic/ArmGicCParser.h | 0
> .../{ => Arm}/Gic/ArmGicDParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicDParser.h | 0
> .../{ => Arm}/Gic/ArmGicDispatcher.c | 12 +-
> .../{ => Arm}/Gic/ArmGicDispatcher.h | 0
> .../{ => Arm}/Gic/ArmGicItsParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicItsParser.h | 0
> .../{ => Arm}/Gic/ArmGicMsiFrameParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicMsiFrameParser.h | 0
> .../{ => Arm}/Gic/ArmGicRParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicRParser.h | 0
> .../FdtHwInfoParserLib/FdtHwInfoParser.c | 78 +---
> .../FdtHwInfoParserLib/FdtHwInfoParser.h | 27 ++
> .../FdtHwInfoParserInclude.h | 1 -
> .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 48 ++-
> .../Library/FdtHwInfoParserLib/FdtUtility.c | 71 ---
> .../Library/FdtHwInfoParserLib/FdtUtility.h | 30 ++
> ...igSpaceParser.c => PciConfigSpaceParser.c} | 19 +-
> ...igSpaceParser.h => PciConfigSpaceParser.h} | 10 +-
> ...mSerialPortParser.c => SerialPortParser.c} | 16 +-
> ...mSerialPortParser.h => SerialPortParser.h} | 8 +-
> 71 files changed, 2248 insertions(+), 1074 deletions(-)
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
> delete mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (93%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (87%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (85%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (90%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (90%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (85%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (86%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (96%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (74%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (79%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (80%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (96%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (91%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (87%)
> create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
> create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)
> 
> 
> -- 
> 2.25.1
> 
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119774): https://edk2.groups.io/g/devel/message/119774
Mute This Topic: https://groups.io/mt/106770151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
  2024-07-03  9:36   ` Sunil V L
@ 2024-07-03  9:39     ` Sami Mujawar
  2024-07-03  9:43       ` Sunil V L
  0 siblings, 1 reply; 24+ messages in thread
From: Sami Mujawar @ 2024-07-03  9:39 UTC (permalink / raw)
  To: Sunil V L
  Cc: Pierre Gondois, devel@edk2.groups.io, AbdulLateef Attar,
	Girish Mahadevan, Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith,
	Leif Lindholm, Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Yeo Reum Yun, nd

Hi Sunil,

I think we can look into that. My initial thoughts are that this can be solved using a Pcd. However, we need a bit of investigation.
Is it ok if we address that in a separate patch?

Regards,

Sami Mujawar

On 03/07/2024, 10:37, "Sunil V L" <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>> wrote:


Hi Pierre, Sami,


Thanks a lot again for this work!.


The series looks good to me as well. I agree with Sami's suggestions.


However, I have a request for an additional change. The common ACPI
tables still use ARMH/ARMLTD as the CREATOR_ID/OEM_ID. Can they be made
architecture specific?


Reviewed-by: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>


Thanks!
Sunil
On Wed, Jul 03, 2024 at 09:08:08AM +0000, Sami Mujawar wrote:
> Hi Pierre,
> 
> Overall, this patch series looks good to me.
> 
> I have some minor comments regarding the return value for the Arch hook functions their placement in Common folder.
> e.g. in Patch "DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs"
> The file DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> provides an empty stub for the arch specific implementation for the FadtArchUpdate () and returns
> success. I think this function should return EFI_UNSUPPORTED to indicate that this function is not
> implemented and that the architecture needs to provide an implementation.
> 
> Also, the file name AcpiFadtLib/Common/CommonFadtGenerator.c should be changed to
> AcpiFadtLib/FadtGeneratorNull.c to clarify that the implementation does not exist.
> 
> Similar changes are required for other patches as well.
> 
> Apart from the above, in patch " DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder"
> I think the file DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c should be renamed to 
> DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtInterrupt.c
> 
> If you agree with the above, I will make the necessary changes before merging.
> 
> With that,
> 
> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>
> 
> Regards,
> 
> Sami Mujawar
> 
> 
> On 19/06/2024, 23:06, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com> <mailto:pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>> wrote:
> 
> 
> The DynamicTables framework has mainly been developed/tested against Arm
> architecture. While still trying to have re-usable libraries, opening the
> framework to other architectures implies some re-organization.
> 
> 
> The libraries that are generic enough to be directly re-used are moved
> to a Common/ directory. For some libraries, additional arch-specific hooks
> have been added to allow architectures specific modifications.
> 
> 
> ---
> 
> 
> Changes can be seen at:
> https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg> <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg> <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg&gt;>
> 
> 
> ---
> 
> 
> References:
> 1. Staging branch creation:
> URL: https://edk2.groups.io/g/devel/message/114790 <https://edk2.groups.io/g/devel/message/114790> <https://edk2.groups.io/g/devel/message/114790> <https://edk2.groups.io/g/devel/message/114790&gt;>
> 
> 
> 2. edk2-staging Repo
> URL: https://github.com/tianocore/edk2-staging.git <https://github.com/tianocore/edk2-staging.git> <https://github.com/tianocore/edk2-staging.git> <https://github.com/tianocore/edk2-staging.git&gt;>
> Branch Name: dynamictables-reorg
> 
> 
> 3. edk2-platforms Repo
> URL: https://github.com/tianocore/edk2-platforms.git <https://github.com/tianocore/edk2-platforms.git> <https://github.com/tianocore/edk2-platforms.git> <https://github.com/tianocore/edk2-platforms.git&gt;>
> Branch Name: devel-dynamictables-reorg
> 
> 
> ---
> 
> 
> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com> <mailto:AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com>>>
> Cc: Girish Mahadevan <gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com> <mailto:gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com>>>
> Cc: Jeff Brasen <jbrasen@nvidia.com <mailto:jbrasen@nvidia.com> <mailto:jbrasen@nvidia.com <mailto:jbrasen@nvidia.com>>>
> Cc: Jeshua Smith <jeshuas@nvidia.com <mailto:jeshuas@nvidia.com> <mailto:jeshuas@nvidia.com <mailto:jeshuas@nvidia.com>>>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com> <mailto:quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>>
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com> <mailto:meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com>>>
> Cc: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com> <mailto:pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>>
> Cc: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com> <mailto:sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>>
> Cc: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com> <mailto:sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>>
> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com> <mailto:YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com>>>
> 
> 
> Pierre Gondois (15):
> DynamicTablesPkg: Acpi: Move generic libraries to common folder
> DynamicTablesPkg: Acpi: Prepare common libraries to support other
> archs
> DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
> DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
> DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
> DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
> DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
> DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
> DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm
> directory
> DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other
> archs
> DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
> DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch
> neutral
> DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
> DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
> DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr
> cells
> 
> 
> .../Arm/ArmDynamicTableManagerDxe.c | 63 +++
> .../Common/CommonDynamicTableManagerDxe.c | 58 +++
> .../DynamicTableManagerDxe.c | 70 +--
> .../DynamicTableManagerDxe.h | 63 +++
> .../DynamicTableManagerDxe.inf | 7 +
> DynamicTablesPkg/DynamicTables.dsc.inc | 64 +--
> .../SsdtCpuTopologyGenerator.h | 147 -------
> .../AcpiDbg2Lib/AcpiDbg2Lib.inf} | 22 +-
> .../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c | 67 +++
> .../AcpiDbg2Lib/Common/CommonDbg2Generator.c | 59 +++
> .../AcpiDbg2Lib}/Dbg2Generator.c | 24 +-
> .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h | 56 +++
> .../AcpiFadtLib/AcpiFadtLib.inf} | 16 +-
> .../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++
> .../AcpiFadtLib/Common/CommonFadtGenerator.c | 46 ++
> .../AcpiFadtLib}/FadtGenerator.c | 86 +---
> .../Acpi/Common/AcpiFadtLib/FadtGenerator.h | 35 ++
> .../AcpiMcfgLib/AcpiMcfgLib.inf} | 9 +-
> .../AcpiMcfgLib}/McfgGenerator.c | 0
> .../AcpiPcctLib/AcpiPcctLib.inf} | 2 +-
> .../AcpiPcctLib}/PcctGenerator.c | 0
> .../AcpiPcctLib}/PcctGenerator.h | 0
> .../AcpiPpttLib/AcpiPpttLib.inf} | 2 +-
> .../AcpiPpttLib}/PpttGenerator.c | 0
> .../AcpiPpttLib}/PpttGenerator.h | 0
> .../AcpiRawLib/AcpiRawLib.inf} | 9 +-
> .../AcpiRawLib}/RawGenerator.c | 0
> .../AcpiSpcrLib/AcpiSpcrLib.inf} | 9 +-
> .../AcpiSpcrLib}/SpcrGenerator.c | 2 +-
> .../AcpiSratLib/AcpiSratLib.inf} | 9 +-
> .../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 +++++++++++
> .../AcpiSratLib/Common/CommonSratGenerator.c | 77 ++++
> .../AcpiSratLib}/SratGenerator.c | 214 +--------
> .../Acpi/Common/AcpiSratLib/SratGenerator.h | 59 +++
> .../Arm/ArmSsdtCpuTopologyGenerator.c | 408 ++++++++++++++++++
> .../SsdtCpuTopologyGenerator.c | 341 ++-------------
> .../SsdtCpuTopologyGenerator.h | 343 +++++++++++++++
> .../SsdtCpuTopologyLib.inf} | 9 +-
> .../AcpiSsdtPcieLib}/SsdtPcieGenerator.c | 2 +-
> .../AcpiSsdtPcieLib}/SsdtPcieGenerator.h | 0
> .../AcpiSsdtPcieLib/SsdtPcieLib.inf} | 2 +-
> .../SsdtSerialPortGenerator.c | 0
> .../SsdtSerialPortLib.inf} | 6 +-
> .../Arm/ArmFdtHwInfoParser.c | 83 ++++
> .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 118 +++++
> .../{ => Arm}/BootArch/ArmBootArchParser.c | 2 +-
> .../{ => Arm}/BootArch/ArmBootArchParser.h | 0
> .../GenericTimer/ArmGenericTimerParser.c | 4 +-
> .../GenericTimer/ArmGenericTimerParser.h | 0
> .../{ => Arm}/Gic/ArmGicCParser.c | 5 +-
> .../{ => Arm}/Gic/ArmGicCParser.h | 0
> .../{ => Arm}/Gic/ArmGicDParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicDParser.h | 0
> .../{ => Arm}/Gic/ArmGicDispatcher.c | 12 +-
> .../{ => Arm}/Gic/ArmGicDispatcher.h | 0
> .../{ => Arm}/Gic/ArmGicItsParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicItsParser.h | 0
> .../{ => Arm}/Gic/ArmGicMsiFrameParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicMsiFrameParser.h | 0
> .../{ => Arm}/Gic/ArmGicRParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicRParser.h | 0
> .../FdtHwInfoParserLib/FdtHwInfoParser.c | 78 +---
> .../FdtHwInfoParserLib/FdtHwInfoParser.h | 27 ++
> .../FdtHwInfoParserInclude.h | 1 -
> .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 48 ++-
> .../Library/FdtHwInfoParserLib/FdtUtility.c | 71 ---
> .../Library/FdtHwInfoParserLib/FdtUtility.h | 30 ++
> ...igSpaceParser.c => PciConfigSpaceParser.c} | 19 +-
> ...igSpaceParser.h => PciConfigSpaceParser.h} | 10 +-
> ...mSerialPortParser.c => SerialPortParser.c} | 16 +-
> ...mSerialPortParser.h => SerialPortParser.h} | 8 +-
> 71 files changed, 2248 insertions(+), 1074 deletions(-)
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
> delete mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (93%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (87%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (85%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (90%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (90%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (85%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (86%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (96%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (74%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (79%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (80%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (96%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (91%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (87%)
> create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
> create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)
> 
> 
> -- 
> 2.25.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119775): https://edk2.groups.io/g/devel/message/119775
Mute This Topic: https://groups.io/mt/106770151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
  2024-07-03  9:39     ` Sami Mujawar
@ 2024-07-03  9:43       ` Sunil V L
  0 siblings, 0 replies; 24+ messages in thread
From: Sunil V L @ 2024-07-03  9:43 UTC (permalink / raw)
  To: Sami Mujawar
  Cc: Pierre Gondois, devel@edk2.groups.io, AbdulLateef Attar,
	Girish Mahadevan, Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith,
	Leif Lindholm, Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com),
	Yeo Reum Yun, nd

On Wed, Jul 03, 2024 at 09:39:22AM +0000, Sami Mujawar wrote:
> Hi Sunil,
> 
> I think we can look into that. My initial thoughts are that this can be solved using a Pcd. However, we need a bit of investigation.
> Is it ok if we address that in a separate patch?
> 
Sure!.

Thanks,
Sunil
> Regards,
> 
> Sami Mujawar
> 
> On 03/07/2024, 10:37, "Sunil V L" <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>> wrote:
> 
> 
> Hi Pierre, Sami,
> 
> 
> Thanks a lot again for this work!.
> 
> 
> The series looks good to me as well. I agree with Sami's suggestions.
> 
> 
> However, I have a request for an additional change. The common ACPI
> tables still use ARMH/ARMLTD as the CREATOR_ID/OEM_ID. Can they be made
> architecture specific?
> 
> 
> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>
> 
> 
> Thanks!
> Sunil
> On Wed, Jul 03, 2024 at 09:08:08AM +0000, Sami Mujawar wrote:
> > Hi Pierre,
> > 
> > Overall, this patch series looks good to me.
> > 
> > I have some minor comments regarding the return value for the Arch hook functions their placement in Common folder.
> > e.g. in Patch "DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs"
> > The file DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> > provides an empty stub for the arch specific implementation for the FadtArchUpdate () and returns
> > success. I think this function should return EFI_UNSUPPORTED to indicate that this function is not
> > implemented and that the architecture needs to provide an implementation.
> > 
> > Also, the file name AcpiFadtLib/Common/CommonFadtGenerator.c should be changed to
> > AcpiFadtLib/FadtGeneratorNull.c to clarify that the implementation does not exist.
> > 
> > Similar changes are required for other patches as well.
> > 
> > Apart from the above, in patch " DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder"
> > I think the file DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c should be renamed to 
> > DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtInterrupt.c
> > 
> > If you agree with the above, I will make the necessary changes before merging.
> > 
> > With that,
> > 
> > Reviewed-by: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>
> > 
> > Regards,
> > 
> > Sami Mujawar
> > 
> > 
> > On 19/06/2024, 23:06, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com> <mailto:pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>> wrote:
> > 
> > 
> > The DynamicTables framework has mainly been developed/tested against Arm
> > architecture. While still trying to have re-usable libraries, opening the
> > framework to other architectures implies some re-organization.
> > 
> > 
> > The libraries that are generic enough to be directly re-used are moved
> > to a Common/ directory. For some libraries, additional arch-specific hooks
> > have been added to allow architectures specific modifications.
> > 
> > 
> > ---
> > 
> > 
> > Changes can be seen at:
> > https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg> <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg> <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg&gt;>
> > 
> > 
> > ---
> > 
> > 
> > References:
> > 1. Staging branch creation:
> > URL: https://edk2.groups.io/g/devel/message/114790 <https://edk2.groups.io/g/devel/message/114790> <https://edk2.groups.io/g/devel/message/114790> <https://edk2.groups.io/g/devel/message/114790&gt;>
> > 
> > 
> > 2. edk2-staging Repo
> > URL: https://github.com/tianocore/edk2-staging.git <https://github.com/tianocore/edk2-staging.git> <https://github.com/tianocore/edk2-staging.git> <https://github.com/tianocore/edk2-staging.git&gt;>
> > Branch Name: dynamictables-reorg
> > 
> > 
> > 3. edk2-platforms Repo
> > URL: https://github.com/tianocore/edk2-platforms.git <https://github.com/tianocore/edk2-platforms.git> <https://github.com/tianocore/edk2-platforms.git> <https://github.com/tianocore/edk2-platforms.git&gt;>
> > Branch Name: devel-dynamictables-reorg
> > 
> > 
> > ---
> > 
> > 
> > Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com> <mailto:AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com>>>
> > Cc: Girish Mahadevan <gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com> <mailto:gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com>>>
> > Cc: Jeff Brasen <jbrasen@nvidia.com <mailto:jbrasen@nvidia.com> <mailto:jbrasen@nvidia.com <mailto:jbrasen@nvidia.com>>>
> > Cc: Jeshua Smith <jeshuas@nvidia.com <mailto:jeshuas@nvidia.com> <mailto:jeshuas@nvidia.com <mailto:jeshuas@nvidia.com>>>
> > Cc: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com> <mailto:quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>>
> > Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com> <mailto:meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com>>>
> > Cc: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com> <mailto:pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>>
> > Cc: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com> <mailto:sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>>
> > Cc: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com> <mailto:sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>>
> > Cc: Yeo Reum Yun <YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com> <mailto:YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com>>>
> > 
> > 
> > Pierre Gondois (15):
> > DynamicTablesPkg: Acpi: Move generic libraries to common folder
> > DynamicTablesPkg: Acpi: Prepare common libraries to support other
> > archs
> > DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
> > DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
> > DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
> > DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
> > DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
> > DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
> > DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm
> > directory
> > DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other
> > archs
> > DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
> > DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch
> > neutral
> > DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
> > DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
> > DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr
> > cells
> > 
> > 
> > .../Arm/ArmDynamicTableManagerDxe.c | 63 +++
> > .../Common/CommonDynamicTableManagerDxe.c | 58 +++
> > .../DynamicTableManagerDxe.c | 70 +--
> > .../DynamicTableManagerDxe.h | 63 +++
> > .../DynamicTableManagerDxe.inf | 7 +
> > DynamicTablesPkg/DynamicTables.dsc.inc | 64 +--
> > .../SsdtCpuTopologyGenerator.h | 147 -------
> > .../AcpiDbg2Lib/AcpiDbg2Lib.inf} | 22 +-
> > .../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c | 67 +++
> > .../AcpiDbg2Lib/Common/CommonDbg2Generator.c | 59 +++
> > .../AcpiDbg2Lib}/Dbg2Generator.c | 24 +-
> > .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h | 56 +++
> > .../AcpiFadtLib/AcpiFadtLib.inf} | 16 +-
> > .../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++
> > .../AcpiFadtLib/Common/CommonFadtGenerator.c | 46 ++
> > .../AcpiFadtLib}/FadtGenerator.c | 86 +---
> > .../Acpi/Common/AcpiFadtLib/FadtGenerator.h | 35 ++
> > .../AcpiMcfgLib/AcpiMcfgLib.inf} | 9 +-
> > .../AcpiMcfgLib}/McfgGenerator.c | 0
> > .../AcpiPcctLib/AcpiPcctLib.inf} | 2 +-
> > .../AcpiPcctLib}/PcctGenerator.c | 0
> > .../AcpiPcctLib}/PcctGenerator.h | 0
> > .../AcpiPpttLib/AcpiPpttLib.inf} | 2 +-
> > .../AcpiPpttLib}/PpttGenerator.c | 0
> > .../AcpiPpttLib}/PpttGenerator.h | 0
> > .../AcpiRawLib/AcpiRawLib.inf} | 9 +-
> > .../AcpiRawLib}/RawGenerator.c | 0
> > .../AcpiSpcrLib/AcpiSpcrLib.inf} | 9 +-
> > .../AcpiSpcrLib}/SpcrGenerator.c | 2 +-
> > .../AcpiSratLib/AcpiSratLib.inf} | 9 +-
> > .../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 +++++++++++
> > .../AcpiSratLib/Common/CommonSratGenerator.c | 77 ++++
> > .../AcpiSratLib}/SratGenerator.c | 214 +--------
> > .../Acpi/Common/AcpiSratLib/SratGenerator.h | 59 +++
> > .../Arm/ArmSsdtCpuTopologyGenerator.c | 408 ++++++++++++++++++
> > .../SsdtCpuTopologyGenerator.c | 341 ++-------------
> > .../SsdtCpuTopologyGenerator.h | 343 +++++++++++++++
> > .../SsdtCpuTopologyLib.inf} | 9 +-
> > .../AcpiSsdtPcieLib}/SsdtPcieGenerator.c | 2 +-
> > .../AcpiSsdtPcieLib}/SsdtPcieGenerator.h | 0
> > .../AcpiSsdtPcieLib/SsdtPcieLib.inf} | 2 +-
> > .../SsdtSerialPortGenerator.c | 0
> > .../SsdtSerialPortLib.inf} | 6 +-
> > .../Arm/ArmFdtHwInfoParser.c | 83 ++++
> > .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 118 +++++
> > .../{ => Arm}/BootArch/ArmBootArchParser.c | 2 +-
> > .../{ => Arm}/BootArch/ArmBootArchParser.h | 0
> > .../GenericTimer/ArmGenericTimerParser.c | 4 +-
> > .../GenericTimer/ArmGenericTimerParser.h | 0
> > .../{ => Arm}/Gic/ArmGicCParser.c | 5 +-
> > .../{ => Arm}/Gic/ArmGicCParser.h | 0
> > .../{ => Arm}/Gic/ArmGicDParser.c | 4 +-
> > .../{ => Arm}/Gic/ArmGicDParser.h | 0
> > .../{ => Arm}/Gic/ArmGicDispatcher.c | 12 +-
> > .../{ => Arm}/Gic/ArmGicDispatcher.h | 0
> > .../{ => Arm}/Gic/ArmGicItsParser.c | 4 +-
> > .../{ => Arm}/Gic/ArmGicItsParser.h | 0
> > .../{ => Arm}/Gic/ArmGicMsiFrameParser.c | 4 +-
> > .../{ => Arm}/Gic/ArmGicMsiFrameParser.h | 0
> > .../{ => Arm}/Gic/ArmGicRParser.c | 4 +-
> > .../{ => Arm}/Gic/ArmGicRParser.h | 0
> > .../FdtHwInfoParserLib/FdtHwInfoParser.c | 78 +---
> > .../FdtHwInfoParserLib/FdtHwInfoParser.h | 27 ++
> > .../FdtHwInfoParserInclude.h | 1 -
> > .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 48 ++-
> > .../Library/FdtHwInfoParserLib/FdtUtility.c | 71 ---
> > .../Library/FdtHwInfoParserLib/FdtUtility.h | 30 ++
> > ...igSpaceParser.c => PciConfigSpaceParser.c} | 19 +-
> > ...igSpaceParser.h => PciConfigSpaceParser.h} | 10 +-
> > ...mSerialPortParser.c => SerialPortParser.c} | 16 +-
> > ...mSerialPortParser.h => SerialPortParser.h} | 8 +-
> > 71 files changed, 2248 insertions(+), 1074 deletions(-)
> > create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
> > create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
> > create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
> > delete mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (75%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (93%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (75%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (87%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (85%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (90%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (90%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (85%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (86%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (96%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (74%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (75%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (79%)
> > create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (80%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (96%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (91%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
> > rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (87%)
> > create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
> > create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
> > rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)
> > 
> > 
> > -- 
> > 2.25.1
> > 
> > 
> > 
> > 
> > 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119776): https://edk2.groups.io/g/devel/message/119776
Mute This Topic: https://groups.io/mt/106770151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs
  2024-07-03  9:08 ` [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs Sami Mujawar
  2024-07-03  9:36   ` Sunil V L
@ 2024-07-03  9:55   ` PierreGondois
  1 sibling, 0 replies; 24+ messages in thread
From: PierreGondois @ 2024-07-03  9:55 UTC (permalink / raw)
  To: Sami Mujawar, devel@edk2.groups.io
  Cc: AbdulLateef Attar, Girish Mahadevan,
	Jeff Brasen (jbrasen@nvidia.com), Jeshua Smith, Leif Lindholm,
	Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com), Sunil V L,
	Yeo Reum Yun, nd

Hello Sami,

On 7/3/24 11:08, Sami Mujawar wrote:
> Hi Pierre,
> 
> Overall, this patch series looks good to me.
> 
> I have some minor comments regarding the return value for the Arch hook functions their placement in Common folder.
> e.g. in Patch "DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs"
> The file DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> provides an empty stub for the arch specific implementation for the FadtArchUpdate () and returns
> success. I think this function should return EFI_UNSUPPORTED to indicate that this function is not
> implemented and that the architecture needs to provide an implementation.
> 
> Also, the file name AcpiFadtLib/Common/CommonFadtGenerator.c should be changed to
> AcpiFadtLib/FadtGeneratorNull.c to clarify that the implementation does not exist.
> 
> Similar changes are required for other patches as well.
> 
> Apart from the above, in patch " DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder"
> I think the file DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c should be renamed to
> DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtInterrupt.c
> 
> If you agree with the above, I will make the necessary changes before merging.

Yes sure, thanks a lot.
You might also need the following 2 patches to pass the CI tests:
   https://edk2.groups.io/g/devel/message/119777

Regards,
Pierre

> 
> With that,
> 
> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
> 
> Regards,
> 
> Sami Mujawar
> 
> 
> On 19/06/2024, 23:06, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:
> 
> 
> The DynamicTables framework has mainly been developed/tested against Arm
> architecture. While still trying to have re-usable libraries, opening the
> framework to other architectures implies some re-organization.
> 
> 
> The libraries that are generic enough to be directly re-used are moved
> to a Common/ directory. For some libraries, additional arch-specific hooks
> have been added to allow architectures specific modifications.
> 
> 
> ---
> 
> 
> Changes can be seen at:
> https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg <https://github.com/pierregondois/edk2/tree/pg/dyntables_libraries_reorg>
> 
> 
> ---
> 
> 
> References:
> 1. Staging branch creation:
> URL: https://edk2.groups.io/g/devel/message/114790 <https://edk2.groups.io/g/devel/message/114790>
> 
> 
> 2. edk2-staging Repo
> URL: https://github.com/tianocore/edk2-staging.git <https://github.com/tianocore/edk2-staging.git>
> Branch Name: dynamictables-reorg
> 
> 
> 3. edk2-platforms Repo
> URL: https://github.com/tianocore/edk2-platforms.git <https://github.com/tianocore/edk2-platforms.git>
> Branch Name: devel-dynamictables-reorg
> 
> 
> ---
> 
> 
> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com <mailto:AbdulLateef.Attar@amd.com>>
> Cc: Girish Mahadevan <gmahadevan@nvidia.com <mailto:gmahadevan@nvidia.com>>
> Cc: Jeff Brasen <jbrasen@nvidia.com <mailto:jbrasen@nvidia.com>>
> Cc: Jeshua Smith <jeshuas@nvidia.com <mailto:jeshuas@nvidia.com>>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com <mailto:meenakshi.aggarwal@nxp.com>>
> Cc: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
> Cc: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>
> Cc: Sunil V L <sunilvl@ventanamicro.com <mailto:sunilvl@ventanamicro.com>>
> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com <mailto:YeoReum.Yun@arm.com>>
> 
> 
> Pierre Gondois (15):
> DynamicTablesPkg: Acpi: Move generic libraries to common folder
> DynamicTablesPkg: Acpi: Prepare common libraries to support other
> archs
> DynamicTablesPkg: AcpiFadtLib: Prepare to support other archs
> DynamicTablesPkg: AcpiDbg2Lib: Prepare to support other archs
> DynamicTablesPkg: AcpiSpcrLib: Prepare to support other archs
> DynamicTablesPkg: AcpiSratLib: Prepare to support other archs
> DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC
> DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray
> DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm
> directory
> DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other
> archs
> DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral
> DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port parser arch
> neutral
> DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c
> DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder
> DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr
> cells
> 
> 
> .../Arm/ArmDynamicTableManagerDxe.c | 63 +++
> .../Common/CommonDynamicTableManagerDxe.c | 58 +++
> .../DynamicTableManagerDxe.c | 70 +--
> .../DynamicTableManagerDxe.h | 63 +++
> .../DynamicTableManagerDxe.inf | 7 +
> DynamicTablesPkg/DynamicTables.dsc.inc | 64 +--
> .../SsdtCpuTopologyGenerator.h | 147 -------
> .../AcpiDbg2Lib/AcpiDbg2Lib.inf} | 22 +-
> .../Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c | 67 +++
> .../AcpiDbg2Lib/Common/CommonDbg2Generator.c | 59 +++
> .../AcpiDbg2Lib}/Dbg2Generator.c | 24 +-
> .../Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h | 56 +++
> .../AcpiFadtLib/AcpiFadtLib.inf} | 16 +-
> .../Common/AcpiFadtLib/Arm/ArmFadtGenerator.c | 126 ++++++
> .../AcpiFadtLib/Common/CommonFadtGenerator.c | 46 ++
> .../AcpiFadtLib}/FadtGenerator.c | 86 +---
> .../Acpi/Common/AcpiFadtLib/FadtGenerator.h | 35 ++
> .../AcpiMcfgLib/AcpiMcfgLib.inf} | 9 +-
> .../AcpiMcfgLib}/McfgGenerator.c | 0
> .../AcpiPcctLib/AcpiPcctLib.inf} | 2 +-
> .../AcpiPcctLib}/PcctGenerator.c | 0
> .../AcpiPcctLib}/PcctGenerator.h | 0
> .../AcpiPpttLib/AcpiPpttLib.inf} | 2 +-
> .../AcpiPpttLib}/PpttGenerator.c | 0
> .../AcpiPpttLib}/PpttGenerator.h | 0
> .../AcpiRawLib/AcpiRawLib.inf} | 9 +-
> .../AcpiRawLib}/RawGenerator.c | 0
> .../AcpiSpcrLib/AcpiSpcrLib.inf} | 9 +-
> .../AcpiSpcrLib}/SpcrGenerator.c | 2 +-
> .../AcpiSratLib/AcpiSratLib.inf} | 9 +-
> .../Common/AcpiSratLib/Arm/ArmSratGenerator.c | 262 +++++++++++
> .../AcpiSratLib/Common/CommonSratGenerator.c | 77 ++++
> .../AcpiSratLib}/SratGenerator.c | 214 +--------
> .../Acpi/Common/AcpiSratLib/SratGenerator.h | 59 +++
> .../Arm/ArmSsdtCpuTopologyGenerator.c | 408 ++++++++++++++++++
> .../SsdtCpuTopologyGenerator.c | 341 ++-------------
> .../SsdtCpuTopologyGenerator.h | 343 +++++++++++++++
> .../SsdtCpuTopologyLib.inf} | 9 +-
> .../AcpiSsdtPcieLib}/SsdtPcieGenerator.c | 2 +-
> .../AcpiSsdtPcieLib}/SsdtPcieGenerator.h | 0
> .../AcpiSsdtPcieLib/SsdtPcieLib.inf} | 2 +-
> .../SsdtSerialPortGenerator.c | 0
> .../SsdtSerialPortLib.inf} | 6 +-
> .../Arm/ArmFdtHwInfoParser.c | 83 ++++
> .../FdtHwInfoParserLib/Arm/ArmFdtUtility.c | 118 +++++
> .../{ => Arm}/BootArch/ArmBootArchParser.c | 2 +-
> .../{ => Arm}/BootArch/ArmBootArchParser.h | 0
> .../GenericTimer/ArmGenericTimerParser.c | 4 +-
> .../GenericTimer/ArmGenericTimerParser.h | 0
> .../{ => Arm}/Gic/ArmGicCParser.c | 5 +-
> .../{ => Arm}/Gic/ArmGicCParser.h | 0
> .../{ => Arm}/Gic/ArmGicDParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicDParser.h | 0
> .../{ => Arm}/Gic/ArmGicDispatcher.c | 12 +-
> .../{ => Arm}/Gic/ArmGicDispatcher.h | 0
> .../{ => Arm}/Gic/ArmGicItsParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicItsParser.h | 0
> .../{ => Arm}/Gic/ArmGicMsiFrameParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicMsiFrameParser.h | 0
> .../{ => Arm}/Gic/ArmGicRParser.c | 4 +-
> .../{ => Arm}/Gic/ArmGicRParser.h | 0
> .../FdtHwInfoParserLib/FdtHwInfoParser.c | 78 +---
> .../FdtHwInfoParserLib/FdtHwInfoParser.h | 27 ++
> .../FdtHwInfoParserInclude.h | 1 -
> .../FdtHwInfoParserLib/FdtHwInfoParserLib.inf | 48 ++-
> .../Library/FdtHwInfoParserLib/FdtUtility.c | 71 ---
> .../Library/FdtHwInfoParserLib/FdtUtility.h | 30 ++
> ...igSpaceParser.c => PciConfigSpaceParser.c} | 19 +-
> ...igSpaceParser.h => PciConfigSpaceParser.h} | 10 +-
> ...mSerialPortParser.c => SerialPortParser.c} | 16 +-
> ...mSerialPortParser.h => SerialPortParser.h} | 8 +-
> 71 files changed, 2248 insertions(+), 1074 deletions(-)
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Arm/ArmDynamicTableManagerDxe.c
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/Common/CommonDynamicTableManagerDxe.c
> create mode 100644 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.h
> delete mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf => Common/AcpiDbg2Lib/AcpiDbg2Lib.inf} (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Arm/ArmDbg2Generator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Common/CommonDbg2Generator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiDbg2LibArm => Common/AcpiDbg2Lib}/Dbg2Generator.c (93%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/Dbg2Generator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf => Common/AcpiFadtLib/AcpiFadtLib.inf} (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Arm/ArmFadtGenerator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/Common/CommonFadtGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiFadtLibArm => Common/AcpiFadtLib}/FadtGenerator.c (87%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/FadtGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf => Common/AcpiMcfgLib/AcpiMcfgLib.inf} (85%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiMcfgLibArm => Common/AcpiMcfgLib}/McfgGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf => Common/AcpiPcctLib/AcpiPcctLib.inf} (90%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPcctLibArm => Common/AcpiPcctLib}/PcctGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf => Common/AcpiPpttLib/AcpiPpttLib.inf} (90%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiPpttLibArm => Common/AcpiPpttLib}/PpttGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm/AcpiRawLibArm.inf => Common/AcpiRawLib/AcpiRawLib.inf} (85%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiRawLibArm => Common/AcpiRawLib}/RawGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf => Common/AcpiSpcrLib/AcpiSpcrLib.inf} (86%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSpcrLibArm => Common/AcpiSpcrLib}/SpcrGenerator.c (96%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm/AcpiSratLibArm.inf => Common/AcpiSratLib/AcpiSratLib.inf} (74%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Arm/ArmSratGenerator.c
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/Common/CommonSratGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSratLibArm => Common/AcpiSratLib}/SratGenerator.c (75%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSratLib/SratGenerator.h
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/Arm/ArmSsdtCpuTopologyGenerator.c
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm => Common/AcpiSsdtCpuTopologyLib}/SsdtCpuTopologyGenerator.c (79%)
> create mode 100644 DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.h
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf => Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf} (80%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.c (96%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm => Common/AcpiSsdtPcieLib}/SsdtPcieGenerator.h (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtPcieLibArm/SsdtPcieLibArm.inf => Common/AcpiSsdtPcieLib/SsdtPcieLib.inf} (91%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm => Common/AcpiSsdtSerialPortLib}/SsdtSerialPortGenerator.c (100%)
> rename DynamicTablesPkg/Library/Acpi/{Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf => Common/AcpiSsdtSerialPortLib/SsdtSerialPortLib.inf} (87%)
> create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtHwInfoParser.c
> create mode 100644 DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/ArmFdtUtility.c
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/BootArch/ArmBootArchParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/GenericTimer/ArmGenericTimerParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.c (96%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicCParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.c (92%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicDispatcher.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicItsParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicMsiFrameParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.c (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/{ => Arm}/Gic/ArmGicRParser.h (100%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.c => PciConfigSpaceParser.c} (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/{ArmPciConfigSpaceParser.h => PciConfigSpaceParser.h} (93%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.c => SerialPortParser.c} (95%)
> rename DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/{ArmSerialPortParser.h => SerialPortParser.h} (89%)
> 
> 
> --
> 2.25.1
> 
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119780): https://edk2.groups.io/g/devel/message/119780
Mute This Topic: https://groups.io/mt/106770151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-07-03  9:55 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 22:06 [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 01/15] DynamicTablesPkg: Acpi: Move generic libraries to common folder PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 02/15] DynamicTablesPkg: Acpi: Prepare common libraries to support other archs PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 03/15] DynamicTablesPkg: AcpiFadtLib: Prepare " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 04/15] DynamicTablesPkg: AcpiDbg2Lib: " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 05/15] DynamicTablesPkg: AcpiSpcrLib: " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 06/15] DynamicTablesPkg: AcpiSratLib: " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 07/15] DynamicTablesPkg: AcpiSsdtCpuTopologyLib: Avoid dependency on GICC PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 08/15] DynamicTablesPkg: DynamicTableManagerDxe: Refactor PresenceArray PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 09/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ARM parsers to Arm directory PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 10/15] DynamicTablesPkg: FdtHwInfoParserLib: Refactor to prepare for other archs PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 11/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Pci parser arch neutral PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 12/15] DynamicTablesPkg: FdtHwInfoParserLib: Make Serial Port " PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 13/15] DynamicTablesPkg: FdtHwInfoParserLib: Move ArmLib.h to ArmGicCParser.c PierreGondois
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 14/15] DynamicTablesPkg: FdtHwInfoParserLib: Move IRQ map to arch folder PierreGondois
2024-07-03  6:20   ` Sunil V L
2024-06-19 22:06 ` [edk2-devel] [staging/dynamictables-reorg PATCH 15/15] DynamicTablesPkg: FdtHwInfoParserLib: Create wrapper to get INTC addr cells PierreGondois
2024-07-03  6:50   ` Sunil V L
2024-07-03  7:36     ` Sami Mujawar
2024-07-03  9:08 ` [edk2-devel] [staging/dynamictables-reorg PATCH 00/15] Prepare libraries to support other archs Sami Mujawar
2024-07-03  9:36   ` Sunil V L
2024-07-03  9:39     ` Sami Mujawar
2024-07-03  9:43       ` Sunil V L
2024-07-03  9:55   ` PierreGondois

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox