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.4281.1620772915177083806 for ; Tue, 11 May 2021 15:41:55 -0700 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 BF940D6E; Tue, 11 May 2021 15:41:54 -0700 (PDT) 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 ACE703F718; Tue, 11 May 2021 15:41:54 -0700 (PDT) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, pete@akeo.ie, samer.el-haj-mahmoud@arm.com, awarkentin@vmware.com, Jeremy Linton Subject: [PATCH 1/2] Platform/Raspberrypi: Update DMA constants based on SOC revision Date: Tue, 11 May 2021 17:41:48 -0500 Message-Id: <20210511224149.864718-2-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210511224149.864718-1-jeremy.linton@arm.com> References: <20210511224149.864718-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit The newer BCM2711 SoC's don't have a DMA constraint on the emmc2 controller. So we don't need to do the 1G translation. Lets allow the AML to detect the SoC revision and return a different _DMA resource. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/AcpiTables/Emmc.asl | 39 +++++++++++++++++++++- .../Bcm27xx/Include/IndustryStandard/Bcm2711.h | 2 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl b/Platform/RaspberryPi/AcpiTables/Emmc.asl index 23febe37b4..c6691e81dc 100644 --- a/Platform/RaspberryPi/AcpiTables/Emmc.asl +++ b/Platform/RaspberryPi/AcpiTables/Emmc.asl @@ -8,6 +8,7 @@ #include #include +#include #include "AcpiTables.h" @@ -31,7 +32,8 @@ DefinitionBlock (__FILE__, "SSDT", 2, "RPIFDN", "RPI4EMMC", 2) Return (^RBUF) } - Name (_DMA, ResourceTemplate() { + // Translated DMA region for < C0 + Name (DMTR, ResourceTemplate() { QWordMemory (ResourceProducer, , MinFixed, @@ -48,6 +50,41 @@ DefinitionBlock (__FILE__, "SSDT", 2, "RPIFDN", "RPI4EMMC", 2) ) }) + // Non translated DMA region for >= C0 + Name (DMNT, ResourceTemplate() { + QWordMemory (ResourceProducer, + , + MinFixed, + MaxFixed, + NonCacheable, + ReadWrite, + 0x0, + 0x0000000000000000, // MIN + 0x000000FFFFFFFFFF, // MAX + 0x0000000000000000, // TRA + 0x0000010000000000, // LEN + , + , + ) + }) + + Method (_DMA, 0x0, Serialized) + { + OperationRegion (CHPR, SystemMemory, ID_CHIPREV, 0x4) + Field (CHPR, DWordAcc, NoLock, Preserve) { + SOCI, 32 + } + + if ((SOCI & 0xFF) >= 0x20) + { + return (^DMNT); + } + else + { + return (^DMTR); + } + } + // emmc2 Host Controller. (brcm,bcm2711-emmc2) Device (SDC3) { diff --git a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h b/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h index 86906b2438..8a69128d11 100644 --- a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h +++ b/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h @@ -88,4 +88,6 @@ #define THERM_SENSOR 0xfd5d2200 +#define ID_CHIPREV 0xfc404000 + #endif /* BCM2711_H__ */ -- 2.13.7