[PATCH 3/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Support UID > 0xF


Jeff Brasen
 

Add support for PCIe devices with UID > 0xF.
This is done by using the next value in the name so
PCI5, PC26, etc

Signed-off-by: Jeff Brasen <jbrasen@...>
---
.../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 11 +++++++----
.../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h | 2 +-
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 85782af380..c5b23d91d0 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -818,7 +818,10 @@ GeneratePciDevice (

// Write the name of the PCI device.
CopyMem (AslName, "PCIx", AML_NAME_SEG_SIZE + 1);
- AslName[AML_NAME_SEG_SIZE - 1] = AsciiFromHex (Uid);
+ AslName[AML_NAME_SEG_SIZE - 1] = AsciiFromHex (Uid & 0xF);
+ if (Uid > 0xF) {
+ AslName[AML_NAME_SEG_SIZE - 2] = AsciiFromHex ((Uid >> 4) & 0xF);
+ }

// ASL: Device (PCIx) {}
Status = AmlCodeGenDevice (AslName, ScopeNode, &PciNode);
@@ -1054,13 +1057,13 @@ BuildSsdtPciTableEx (
for (Index = 0; Index < PciCount; Index++) {
if (PcdGetBool (PcdPciUseSegmentAsUid)) {
Uid = PciInfo[Index].PciSegmentGroupNumber;
- if (Uid > MAX_PCI_ROOT_COMPLEXES_SUPPORTED) {
+ if (Uid >= MAX_PCI_ROOT_COMPLEXES_SUPPORTED) {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-PCI: Pci root complexes segment number: %d."
- " Greater than maximum number of Pci root complexes supported = %d.\n",
+ " Greater than maximum supported value = %d.\n",
Uid,
- MAX_PCI_ROOT_COMPLEXES_SUPPORTED
+ MAX_PCI_ROOT_COMPLEXES_SUPPORTED - 1
));
return EFI_INVALID_PARAMETER;
}
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h
index 59a0d601a3..515a3e1785 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.h
@@ -31,7 +31,7 @@
Corresponding changes would be needed to support the Name and
UID fields describing the Pci root complexes.
*/
-#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 16
+#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 256

// _SB scope of the AML namespace.
#define SB_SCOPE "\\_SB_"
--
2.25.1