From 769d36d6d400b1dac2ec5e8a7b3eebd0a4751b8b Mon Sep 17 00:00:00 2001 From: Jeremy Linton Date: Fri, 7 May 2021 14:36:33 -0500 Subject: [PATCH] Plat/Raspberrypi: Update DMA constants based on SOC revision The newer BCM2711 SoC's don't have a DMA constraint on the emmc2 controller. So we don't need to do the 1M 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 ++++++++++++++++++- .../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 0fbc2a79ea1..29faa461a3a 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", 5, "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", 5, "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 86906b24388..8a69128d11c 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__ */