From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.17355.1610490433518303311 for ; Tue, 12 Jan 2021 14:27:13 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jeremy.linton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 37CFE11D4; Tue, 12 Jan 2021 14:27:13 -0800 (PST) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2F3983F719; Tue, 12 Jan 2021 14:27:13 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: pete@akeo.ie, awarkentin@vmware.com, samer.el-haj-mahmoud@arm.com, leif@nuviainc.com, ard.biesheuvel@arm.com, Jeremy Linton Subject: [RFC 2/3] rpi4/acpi/dsdt: break XHCI into its own SSDT Date: Tue, 12 Jan 2021 16:27:07 -0600 Message-Id: <20210112222708.1757044-3-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112222708.1757044-1-jeremy.linton@arm.com> References: <20210112222708.1757044-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lets prepare to switch between XHCI and PCI by moving the XHCI definition into its own SSDT. That way we can select it based on the menu settings. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/AcpiTables/AcpiTables.inf | 1 + Platform/RaspberryPi/AcpiTables/Dsdt.asl | 4 +-- Platform/RaspberryPi/AcpiTables/Xhci.asl | 33 ++++++++++++++----= ---- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 5 ++++ 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/Rasp= berryPi/AcpiTables/AcpiTables.inf index 2867c83b71..17dee581a0 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf @@ -36,6 +36,7 @@ Pptt.aslc=0D Pcct.aslc=0D SsdtThermal.asl=0D + Xhci.asl=0D =0D [Packages]=0D ArmPkg/ArmPkg.dec=0D diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index ae3bd129d6..5a665d7dd1 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -63,9 +63,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", = 2) Scope (\_SB_)=0D {=0D include ("Pep.asl")=0D -#if (RPI_MODEL =3D=3D 4)=0D - include ("Xhci.asl")=0D -#endif=0D +=0D Method (_OSC, 4, Serialized) { // _OSC: Operating System Capabilities= =0D CreateDWordField (Arg3, 0x00, STS0)=0D CreateDWordField (Arg3, 0x04, CAP0)=0D diff --git a/Platform/RaspberryPi/AcpiTables/Xhci.asl b/Platform/RaspberryP= i/AcpiTables/Xhci.asl index bc3fea60f9..6d18adf590 100644 --- a/Platform/RaspberryPi/AcpiTables/Xhci.asl +++ b/Platform/RaspberryPi/AcpiTables/Xhci.asl @@ -9,6 +9,8 @@ =0D #include =0D =0D +#include "AcpiTables.h"=0D +=0D /*=0D * The following can be used to remove parenthesis from=0D * defined macros that the compiler complains about.=0D @@ -24,12 +26,17 @@ */=0D #define XHCI_REG_LENGTH 0x1000=0D =0D -Device (SCB0) {=0D - Name (_HID, "ACPI0004")=0D - Name (_UID, 0x0)=0D - Name (_CCA, 0x0)=0D +DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4XHCI", 2)=0D +{=0D + Scope (\_SB_)=0D + {=0D +=0D + Device (SCB0) {=0D + Name (_HID, "ACPI0004")=0D + Name (_UID, 0x0)=0D + Name (_CCA, 0x0)=0D =0D - Method (_CRS, 0, Serialized) { // _CRS: Current Resource Settings=0D + Method (_CRS, 0, Serialized) { // _CRS: Current Resource Settings=0D /*=0D * Container devices with _DMA must have _CRS, meaning SCB0=0D * to provide all resources that XHC0 consumes (except=0D @@ -57,9 +64,9 @@ Device (SCB0) { Add (MMBE, XHCI_REG_LENGTH - 1, MMBE)=0D Add (MMLE, XHCI_REG_LENGTH - 1, MMLE)=0D Return (RBUF)=0D - }=0D + }=0D =0D - Name (_DMA, ResourceTemplate() {=0D + Name (_DMA, ResourceTemplate() {=0D /*=0D * XHC0 is limited to DMA to first 3GB. Note this=0D * only applies to PCIe, not GENET or other devices=0D @@ -79,10 +86,10 @@ Device (SCB0) { ,=0D ,=0D )=0D - })=0D + })=0D =0D - Device (XHC0)=0D - {=0D + Device (XHC0)=0D + {=0D Name (_HID, "PNP0D10") // _HID: Hardware ID=0D Name (_UID, 0x0) // _UID: Unique ID=0D Name (_CCA, 0x0) // _CCA: Cache Coherency Attribute=0D @@ -131,5 +138,7 @@ Device (SCB0) { Debug =3D "xHCI enable"=0D Store (0x6, CMND)=0D }=0D - }=0D -}=0D + } // end XHC0=0D + } //end SCB0=0D + } //end scope sb=0D +} //end definition block=0D diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 7a3b8e9068..f13abd67c0 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -755,6 +755,11 @@ STATIC CONST NAMESPACE_TABLES SdtTables[] =3D { SsdtNameOpReplace=0D },=0D {=0D + SIGNATURE_64 ('R', 'P', 'I', '4', 'X', 'H', 'C', 'I'),=0D + PcdToken(PcdXhci),=0D + NULL=0D + },=0D + {=0D SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0),=0D 0,=0D NULL=0D --=20 2.13.7