public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeff Brasen" <jbrasen@nvidia.com>
To: <devel@edk2.groups.io>
Cc: <Pierre.Gondois@arm.com>, <Sami.Mujawar@arm.com>,
	<Alexei.Fedorov@arm.com>, Jeff Brasen <jbrasen@nvidia.com>
Subject: [PATCH 3/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Support UID > 0xF
Date: Thu, 30 Jun 2022 09:48:50 -0600	[thread overview]
Message-ID: <bc37ed0501b704066ca88f56dfa5142c9667b7a3.1656603839.git.jbrasen@nvidia.com> (raw)
In-Reply-To: <cover.1656603839.git.jbrasen@nvidia.com>

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@nvidia.com>
---
 .../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


  parent reply	other threads:[~2022-06-30 15:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 15:48 [PATCH 0/4] DynamicTablesPkg: Pcie generation updates Jeff Brasen
2022-06-30 15:48 ` [PATCH 1/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Correct translation value Jeff Brasen
2022-07-01 12:40   ` PierreGondois
2022-07-01 15:48     ` Jeff Brasen
2022-06-30 15:48 ` [PATCH 2/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Allow use of segment number as UID Jeff Brasen
2022-07-01 12:42   ` PierreGondois
2022-07-01 15:54     ` Jeff Brasen
2022-07-04  8:37       ` PierreGondois
2022-07-08 15:24         ` Jeff Brasen
2022-06-30 15:48 ` Jeff Brasen [this message]
2022-06-30 15:48 ` [PATCH 4/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Add support for override protocol Jeff Brasen
2022-07-01 12:39   ` PierreGondois
2022-07-01 15:52     ` Jeff Brasen
2022-07-04  8:47       ` PierreGondois
2022-07-08 15:36         ` Jeff Brasen
2022-07-11 15:01           ` PierreGondois
2022-07-11 15:32             ` Jeff Brasen
2022-07-11 17:14               ` PierreGondois
2022-07-11 17:56                 ` Jeff Brasen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc37ed0501b704066ca88f56dfa5142c9667b7a3.1656603839.git.jbrasen@nvidia.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox