Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicTablesPkg: Prepare for supporting other archs #5974

Merged
merged 56 commits into from
Jul 29, 2024

Conversation

pierregondois
Copy link
Contributor

@pierregondois pierregondois commented Jul 25, 2024

The DynamicTablesPkg currently supports the Arm architecture only.
To ease the utilization of the framework by other architectures, some refactoring is necessary.

This patchset mainly sorts the structures used to generate ACPI tables in:

  • Generic structures, which can be re-used by other architectures

  • Arm specific structures

  • Breaking change?

    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?

    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?

    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Build tested for all the platforms using the DynamicTablesPkg:

  • ARM: Juno
  • ARM: FVP
  • ARM: Morello
  • ARM: N1Sdp
  • ARM-virt: KvmTool
  • NXP: LX2160aRdbPkg

Compared generated ACPI tables for:

  • ARM: Juno
  • ARM-virt: KvmTool

Integration Instructions

N/A

@pierregondois pierregondois force-pushed the pg/dynamictables-reorg branch 2 times, most recently from c4aeb0c to cb8e4fc Compare July 26, 2024 08:54
@github-actions github-actions bot added the impact:breaking-change This change breaks existing APIs impacting build or boot. label Jul 26, 2024
@pierregondois pierregondois changed the title Dummy - Pg/dynamictables reorg DynamicTablesPkg: Prepare for other archs support Jul 26, 2024
@pierregondois pierregondois changed the title DynamicTablesPkg: Prepare for other archs support DynamicTablesPkg: Prepare for supporting other archs Jul 26, 2024
@samimujawar
Copy link
Contributor

@pierregondois : The first patch in this series i.e. "Branch to reorg Dynamic Tables & support other arch" needs to be dropped.

Otherwise this patch series looks good to me.

@samimujawar
Copy link
Contributor

@leiflindholm I plan to merge this pull request on Monday.
Once this is merged the NXP platform build would need the following edk2-platforms patches for the build to succeed.
https://edk2.groups.io/g/devel/message/119548
https://edk2.groups.io/g/devel/message/119796
https://edk2.groups.io/g/devel/message/119531
https://edk2.groups.io/g/devel/message/119532
https://edk2.groups.io/g/devel/message/119533
https://edk2.groups.io/g/devel/message/119534

Is it possible to provide your r-b for the patches listed above, please?

@pierregondois pierregondois force-pushed the pg/dynamictables-reorg branch from b09f863 to 9f0b7b8 Compare July 28, 2024 19:26
samimujawar and others added 15 commits July 29, 2024 14:25
Introduce an Arch Common Namespace so that the common
architectural objects can be defined under this namespace
in the Configuration manager. Also rearrange the namespace
IDs so that the Arch Common Namespace has a value of 0x1,
the Arm Namespace ID has a value of 0x2, and the Custom/OEM
namespace ID has a value of 0xF. Also introduce a helper
macro to create configuration manager objects in the Arch
Common Namespace.

The Arch Common Namespace shall contain objects like
Serial Port, PCI Bus information etc. It must not contain
Architecture specific components e.g. GICC which is Arm
architecture specific component and therefore must be
defined in the Arm Namespace.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
…tion

The parameters of CreateAmlProcessorContainer() were not
updated in:
commit 5fb3f57 ("DynamicTablesPkg: Allow for specified CPU names")

This causes the EccCheck CI test to fail. Fix this.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
The CM_ARM_PROC_NODE_ID_INFO was dropped by the patch at
"b2bbe3df5470 DynamicTablesPkg: Remove PPTT ID structure
from ACPI 6.4 generator" and the EArmObjProcNodeIdInfo was
made EArmObjReserved29.

Since ProcNodeIdInfo is no longer used drop the CM object
parser code from EArmObjProcNodeIdInfo and specify a null
entry for EArmObjReserved29.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Add ObjectId to CM_OBJ_PARSER_ARRAY so that the code can validate
the entries in the Cm object parser array. Also introduce helper
macros to populate the Cm Object Parser Arrays.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Introduce a new header file for defining the Arch Common Namespace
objects. Also include it in the Configuration Manager Object header
file so that the required definitions are propagated.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Update the Cm Object Parser to support parsing of Arch Common
namespace objects.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Update the Token Fixer to return objects other than Arm Namespace
objects as unsupported.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Update DynamicPlatRepo to reflect the introduction of the Arch
Common namespace. Also, update the TokenFixer map to reflect the
current state of the ArmNamespace Objects and add a note in the
documentation header for the EARM_OBJECT_ID enum, that the Token
fixer map needs updating whenever the ArmObjectId space is updated.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Remove the partial listing of the Arm Namespace object IDs
from and add a reference to the enum EARM_OBJECT_ID that is
used to describe the object in the ARM Namespace.

Also document that the Arch Common namespace objects will be
described using the enum EARCH_COMMON_OBJECT_ID.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
The Arm Namespace Object ID for CPU info was not used.
Therefore, drop the EArmObjCpuInfo object ID. Also remove
- the partial listing of the Arm Namespace object IDs from
  ConfigurationManagerObject.h and add a reference to the
  location where they are defined.
- the parsing code in Configuration Manager ObjectParser.
- update the Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
The Arm Namespace Object ID Reserved29 was a reserved ID
that was never used. Therefore, drop the EArmObjReserved29
object ID also update the Dynamic Plat Repo TokenFixer map
and the Configuration Manager Object Parser.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Update the Configuration Manager for Kvmtool guest firmware
to handle ArchComm namespace objects.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move PowerManagementProfileInfo Object from Arm Namespace to the
Arch Common namespace.
The following updates are also done to reflect the changes introduced
by the move:
 - Update the FADT Generator to migrate to use the Power Management
   Profile Info object CM_ARCH_COMMON_POWER_MANAGEMENT_PROFILE_INFO
   and EArchCommonObjPowerManagementProfileInfo.
 - Update the Configuration manager object parser to parse Arch
   Common namespace objects and update the parsing of the Power
   Management Profile information object from Arm namespace to
   the Arch Common namespace.
 - Update the Dynamic Plat Repo TokenFixer map

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
The PowerManagementProfileInfo Object has been moved from the
Arm Namespace to the Arch Common namespace.

Therefore, update the Kvmtool Guest firmware configuration
manager to reflect this change.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move Serial port info objects like the generic serial port info,
Serial console port info and Serial debug port info from Arm
Namespace to the Arch Common namespace.
 i.e.
    EArmObjSerialPortInfo      -> EArchCommonObjSerialPortInfo
    EArmObjConsolePortInfo     -> EArchCommonObjConsolePortInfo
    EArmObjSerialDebugPortInfo -> EArchCommonObjSerialDebugPortInfo
    CM_ARM_SERIAL_PORT_INFO    -> CM_ARCH_COMMON_SERIAL_PORT_INFO

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - DBG2 Generator
 - SPCR Generator
 - SSDT Serial Port Fixup Lib
 - SSDT Serial Port Generator
 - FdtHwInfoParserLib/ArmSerialPortParser
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
samimujawar and others added 25 commits July 29, 2024 14:25
Move the Continuous perfformance control info object from Arm
Namespace to the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SSDT CPU topology generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move PCC structure definitions from Arm Namespace header file to
the Arch Common namespace header file.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move the PCC Subspace Type0 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move the PCC Subspace Type1 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move the PCC Subspace Type2 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move the PCC Subspace Type 3 & 4 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move the PCC Subspace Type 5 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Move the PSD info object from Arm Namespace to the Arch Common
namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SSDT CPU topology generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

Cc: Pierre Gondois <[email protected]>
Cc: Yeo Reum Yun <[email protected]>
Cc: AbdulLateef Attar <[email protected]>
Cc: Jeshua Smith <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Meenakshi Aggarwal <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Allow other architectures to reuse the AcpiFadtLib by extracting
the Arm specific part of the table generation.

Suggested-by: Sunil V L <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Allow other architectures to reuse the AcpiDbg2Lib by extracting
the Arm specific part of the table generation.

Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Remove the Arm name from the generator to show the generator
can be used by other archs.

Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Allow other architectures to reuse the AcpiSratLib by extracting
the Arm specific part of the table generation.

Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
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 <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Create an Arm directory in the FdtHwInfoParserLib as a preparation
step to support other architectures.

Suggested-by: Sunil V L <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
…rchs

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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
…utral

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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
The interrupts 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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
… cells

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 <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
Some CM objects fields are wider than the targeted field in ACPI
tables. Some assignments are also subject to data loss and
trigger the following warnings:
- '<': signed/unsigned mismatch
- '=': conversion from 'UINTxx' to 'UINTyy', possible loss of data
with xx > yy.

Add checks/cast to remove the warnings.

Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
For X64 builds, the EFIAPI is replaced by '(__attribute__((ms_abi))'.
This might lead to build error for some ACPI tablte generators
due to function prototype mismatch.

Add the EFIAPI to ACPI table generator hooks:
- ACPI_TABLE_GENERATOR_BUILD_TABLEEX
- ACPI_TABLE_GENERATOR_FREE_TABLEEX

Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
@samimujawar samimujawar force-pushed the pg/dynamictables-reorg branch from 9f0b7b8 to dec4e3a Compare July 29, 2024 13:25
@github-actions github-actions bot requested a review from ardbiesheuvel July 29, 2024 13:26
@samimujawar samimujawar added the push Auto push patch series in PR if all checks pass label Jul 29, 2024
@mergify mergify bot merged commit be1d408 into tianocore:master Jul 29, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:breaking-change This change breaks existing APIs impacting build or boot. push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants