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.404.1610086596493421280 for ; Thu, 07 Jan 2021 22:16:36 -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 270DC113E; Thu, 7 Jan 2021 22:16:34 -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 D68E53F66E; Thu, 7 Jan 2021 22:16:34 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, samer.el-haj-mahmoud@arm.com, awarkentin@vmware.com, philmd@redhat.com, Jeremy Linton Subject: [PATCH 2/3] Platform/RaspberryPi/Acpitables: Add eMMC2 device and tweak Arasan Date: Fri, 8 Jan 2021 00:16:22 -0600 Message-Id: <20210108061623.1721817-3-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210108061623.1721817-1-jeremy.linton@arm.com> References: <20210108061623.1721817-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The primarly problem with the rpi Arasan controller working with a default SDHCI driver is the lack of a meaningful capabilities register. As such if we add a _DSD entry to provide that information, we can then bind it to the linux sdhci_iproc driver which already hardcodes the remaining controller bugs. Further we have gotten BRCME88C approved as the HID for the newer eMMC2 controller. So lets define an ACPI object to describe it. Of course both devices are sharing an interrupt so we should also indicate that in the table as well. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 2 + Platform/RaspberryPi/AcpiTables/Sdhc.asl | 86 ++++++++++++++++++++++++++++= +++- 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index d116f965e1..cca08c0539 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -150,6 +150,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI"= , 2) QWORDMEMORYBUF(23)=0D QWORDMEMORYBUF(24)=0D QWORDMEMORYBUF(25)=0D + QWORDMEMORYBUF(26)=0D })=0D =0D // USB=0D @@ -196,6 +197,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI"= , 2) // SDC=0D QWORDMEMORYSET(24, MMCHS1_OFFSET, MMCHS1_LENGTH)=0D QWORDMEMORYSET(25, SDHOST_OFFSET, SDHOST_LENGTH)=0D + QWORDMEMORYSET(26, MMCHS2_OFFSET, MMCHS2_LENGTH)=0D =0D Return (RBUF)=0D }=0D diff --git a/Platform/RaspberryPi/AcpiTables/Sdhc.asl b/Platform/RaspberryP= i/AcpiTables/Sdhc.asl index 0ab1ba27f2..a7ac831066 100644 --- a/Platform/RaspberryPi/AcpiTables/Sdhc.asl +++ b/Platform/RaspberryPi/AcpiTables/Sdhc.asl @@ -19,7 +19,7 @@ // Note: UEFI can use either SDHost or Arasan. We expose both to the OS.=0D //=0D =0D -// ArasanSD 3.0 SD Host Controller.=0D +// ArasanSD 3.0 SD Host Controller. (brcm,bcm2835-sdhci)=0D Device (SDC1)=0D {=0D Name (_HID, "BCM2847")=0D @@ -37,7 +37,7 @@ Device (SDC1) Name (RBUF, ResourceTemplate ()=0D {=0D MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM)=0D - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_M= MCHS1_INTERRUPT }=0D + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MMCH= S1_INTERRUPT }=0D })=0D Method (_CRS, 0x0, Serialized)=0D {=0D @@ -45,6 +45,86 @@ Device (SDC1) Return (^RBUF)=0D }=0D =0D + // The standard CAPs registers on this controller=0D + // appear to be 0, lets set some minimal defaults=0D + // Since this cap doesn't indicate DMA capability=0D + // we don't need a _DMA()=0D + Name (_DSD, Package () {=0D + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),=0D + Package () {=0D + Package () { "sdhci-caps", 0x0100fa81 },=0D + }=0D + })=0D +=0D +=0D + //=0D + // A child device that represents the=0D + // sd card, which is marked as non-removable.=0D + //=0D + Device (SDMM)=0D + {=0D + Method (_ADR)=0D + {=0D + Return (0)=0D + }=0D + Method (_RMV) // Is removable=0D + {=0D + Return (0) // 0 - fixed=0D + }=0D + }=0D +}=0D +=0D +#if (RPI_MODEL =3D=3D 4)=0D +// emmc2 Host Controller. (brcm,bcm2711-emmc2)=0D +Device (SDC3)=0D +{=0D + Name (_HID, "BRCME88C")=0D + Name (_UID, 0x1)=0D + Name (_CCA, 0x0)=0D + Name (_S1D, 0x1)=0D + Name (_S2D, 0x1)=0D + Name (_S3D, 0x1)=0D + Name (_S4D, 0x1)=0D + Method (_STA)=0D + {=0D + Return(0xf)=0D + }=0D + Name (RBUF, ResourceTemplate ()=0D + {=0D + MEMORY32FIXED (ReadWrite, 0, MMCHS2_LENGTH, RMEM)=0D + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MMCH= S1_INTERRUPT }=0D + })=0D + Method (_CRS, 0x0, Serialized)=0D + {=0D + MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS2_OFFSET)=0D + Return (^RBUF)=0D + }=0D +=0D + // forceably limit to 1G=0D + Name (_DMA, ResourceTemplate() {=0D + QWordMemory (ResourceConsumer,=0D + ,=0D + MinFixed,=0D + MaxFixed,=0D + NonCacheable,=0D + ReadWrite,=0D + 0x0,=0D + 0x0, // MIN=0D + 0x3fffffff, // MAX=0D + 0x0, // TRA=0D + 0x40000000, // LEN=0D + ,=0D + ,=0D + )=0D + })=0D +=0D + Name (_DSD, Package () {=0D + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),=0D + Package () {=0D + Package () { "sdhci-caps-mask", 0x0000000000080000 },=0D + }=0D + })=0D +=0D //=0D // A child device that represents the=0D // sd card, which is marked as non-removable.=0D @@ -62,6 +142,7 @@ Device (SDC1) }=0D }=0D =0D +#else // !RPI4=0D =0D // Broadcom SDHost 2.0 SD Host Controller=0D Device (SDC2)=0D @@ -105,3 +186,4 @@ Device (SDC2) }=0D }=0D }=0D +#endif // !RPI4=0D --=20 2.13.7