From 800db242bd4247c4726307752335ede9e4e4d712 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 23 Feb 2026 17:50:12 +0100 Subject: [PATCH] {soc,sb}/intel: Drop named object from ASL `GPLD` method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creation of named objects within a method is highly inefficient, as per IASL's remarks during DSDT compilation. But it is possible to use local variables instead of named objects to store a package. Update the `GPLD` method to use a local variable, instead of creating a named object. While at it, unify cosmetics of the several copies of the method across the codebase. TEST: Build coreboot for the ASRock Z97 Extreme6 (Lynx Point) and run: - acpiexec -b "Evaluate _SB.PCI0.XHCI.HUB7.GPLD 0" build/dsdt.aml - acpiexec -b "Evaluate _SB.PCI0.XHCI.HUB7.GPLD 1" build/dsdt.aml Observe return value is the same before and after this change. Change-Id: Id66322150c90309f42f574584728c6b1db353c0c Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/91390 Reviewed-by: Jérémy Compostella Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/soc/intel/baytrail/acpi/xhci.asl | 14 +++---- src/soc/intel/broadwell/pch/acpi/xhci.asl | 10 ++--- src/soc/intel/skylake/acpi/xhci.asl | 20 ++++------ src/southbridge/intel/bd82x6x/acpi/usb.asl | 40 ++++++++----------- src/southbridge/intel/lynxpoint/acpi/xhci.asl | 10 ++--- 5 files changed, 41 insertions(+), 53 deletions(-) diff --git a/src/soc/intel/baytrail/acpi/xhci.asl b/src/soc/intel/baytrail/acpi/xhci.asl index 368f34faad..4e1be831b9 100644 --- a/src/soc/intel/baytrail/acpi/xhci.asl +++ b/src/soc/intel/baytrail/acpi/xhci.asl @@ -12,18 +12,18 @@ Device (XHCI) // GPLD: Generate Port Location Data (PLD) Method (GPLD, 1, Serialized) { - Name (PCKG, Package (0x01) { + Local0 = Package () { Buffer (0x10) {} - }) + } - // REV: Revision 0x02 for ACPI 5.0 - CreateField (DerefOf (PCKG[0]), 0, 0x07, REV) - REV = 0x02 + // REV: Revision 2 for ACPI 5.0 + CreateField (DerefOf (Local0[0]), 0, 7, REV) + REV = 2 // VISI: Port visibility to user per port - CreateField (DerefOf (PCKG[0]), 0x40, 1, VISI) + CreateField (DerefOf (Local0[0]), 0x40, 1, VISI) VISI = Arg0 - Return (PCKG) + Return (Local0) } Device (PRT1) { Name (_ADR, 1) } diff --git a/src/soc/intel/broadwell/pch/acpi/xhci.asl b/src/soc/intel/broadwell/pch/acpi/xhci.asl index 0656a6cf2a..e98bd42637 100644 --- a/src/soc/intel/broadwell/pch/acpi/xhci.asl +++ b/src/soc/intel/broadwell/pch/acpi/xhci.asl @@ -330,18 +330,18 @@ Device (XHCI) // GPLD: Generate Port Location Data (PLD) Method (GPLD, 1, Serialized) { - Name (PCKG, Package () { + Local0 = Package () { Buffer (0x10) {} - }) + } // REV: Revision 2 for ACPI 5.0 - CreateField (DerefOf (PCKG [0]), 0, 7, REV) + CreateField (DerefOf (Local0[0]), 0, 7, REV) REV = 2 // VISI: Port visibility to user per port - CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI) + CreateField (DerefOf (Local0[0]), 0x40, 1, VISI) VISI = Arg0 - Return (PCKG) + Return (Local0) } Device (PRT1) { Name (_ADR, 1) } // USB Port 0 diff --git a/src/soc/intel/skylake/acpi/xhci.asl b/src/soc/intel/skylake/acpi/xhci.asl index bfe6c6df77..5ce7b0d809 100644 --- a/src/soc/intel/skylake/acpi/xhci.asl +++ b/src/soc/intel/skylake/acpi/xhci.asl @@ -159,23 +159,19 @@ Device (XHCI) Name (_ADR, 0) // GPLD: Generate Port Location Data (PLD) - Method (GPLD, 1, Serialized) - { - - Name (PCKG, Package (0x01) - { + Method (GPLD, 1, Serialized) { + Local0 = Package () { Buffer (0x10) {} - }) + } - // REV: Revision 0x02 for ACPI 5.0 - CreateField (DerefOf (PCKG[0]), 0, 0x07, REV) - REV = 0x02 + // REV: Revision 2 for ACPI 5.0 + CreateField (DerefOf (Local0[0]), 0, 7, REV) + REV = 2 // VISI: Port visibility to user per port - CreateField (DerefOf (PCKG[0]), 0x40, 1, VISI) + CreateField (DerefOf (Local0[0]), 0x40, 1, VISI) VISI = Arg0 - - Return (PCKG) + Return (Local0) } /* USB2 */ diff --git a/src/southbridge/intel/bd82x6x/acpi/usb.asl b/src/southbridge/intel/bd82x6x/acpi/usb.asl index 3e2ba78db4..4d80c40e1b 100644 --- a/src/southbridge/intel/bd82x6x/acpi/usb.asl +++ b/src/southbridge/intel/bd82x6x/acpi/usb.asl @@ -26,25 +26,20 @@ Device (EHC1) { Name (_ADR, 0x00000000) - // GPLD: Generate Port Location Data (PLD) - Method (GPLD, 1, Serialized) - { - - Name (PCKG, Package (0x01) - { + Method (GPLD, 1, Serialized) { + Local0 = Package () { Buffer (0x10) {} - }) + } - // REV: Revision 0x02 for ACPI 5.0 - CreateField (DerefOf (PCKG [0]), 0, 0x07, REV) - REV = 0x02 + // REV: Revision 2 for ACPI 5.0 + CreateField (DerefOf (Local0[0]), 0, 7, REV) + REV = 2 // VISI: Port visibility to user per port - CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI) + CreateField (DerefOf (Local0[0]), 0x40, 1, VISI) VISI = Arg0 - - Return (PCKG) + Return (Local0) } // How many are there? @@ -82,22 +77,19 @@ Device (EHC2) Name (_ADR, 0x00000000) // GPLD: Generate Port Location Data (PLD) - Method (GPLD, 1, Serialized) - { - Name (PCKG, Package (0x01) - { + Method (GPLD, 1, Serialized) { + Local0 = Package () { Buffer (0x10) {} - }) + } - // REV: Revision 0x02 for ACPI 5.0 - CreateField (DerefOf (PCKG [0]), 0, 0x07, REV) - REV = 0x02 + // REV: Revision 2 for ACPI 5.0 + CreateField (DerefOf (Local0[0]), 0, 7, REV) + REV = 2 // VISI: Port visibility to user per port - CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI) + CreateField (DerefOf (Local0[0]), 0x40, 1, VISI) VISI = Arg0 - - Return (PCKG) + Return (Local0) } // How many are there? diff --git a/src/southbridge/intel/lynxpoint/acpi/xhci.asl b/src/southbridge/intel/lynxpoint/acpi/xhci.asl index c7b0c181ed..d059e08815 100644 --- a/src/southbridge/intel/lynxpoint/acpi/xhci.asl +++ b/src/southbridge/intel/lynxpoint/acpi/xhci.asl @@ -364,18 +364,18 @@ Device (XHCI) // GPLD: Generate Port Location Data (PLD) Method (GPLD, 1, Serialized) { - Name (PCKG, Package () { + Local0 = Package () { Buffer (0x10) {} - }) + } // REV: Revision 2 for ACPI 5.0 - CreateField (DerefOf (PCKG [0]), 0, 7, REV) + CreateField (DerefOf (Local0[0]), 0, 7, REV) REV = 2 // VISI: Port visibility to user per port - CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI) + CreateField (DerefOf (Local0[0]), 0x40, 1, VISI) VISI = Arg0 - Return (PCKG) + Return (Local0) } Device (PRT1) { Name (_ADR, 1) } // USB Port 0