Skip to content

Commit 769d36d

Browse files
committed
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 <jeremy.linton@arm.com>
1 parent 1cc7051 commit 769d36d

File tree

2 files changed

+40
-1
lines changed
  • Platform/RaspberryPi/AcpiTables
  • Silicon/Broadcom/Bcm27xx/Include/IndustryStandard

2 files changed

+40
-1
lines changed

Platform/RaspberryPi/AcpiTables/Emmc.asl

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <IndustryStandard/Bcm2836SdHost.h>
1010
#include <IndustryStandard/Bcm2836Sdio.h>
11+
#include <IndustryStandard/Bcm2711.h>
1112

1213
#include "AcpiTables.h"
1314

@@ -31,7 +32,8 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4EMMC", 2)
3132
Return (^RBUF)
3233
}
3334

34-
Name (_DMA, ResourceTemplate() {
35+
// Translated DMA region for < C0
36+
Name (DMTR, ResourceTemplate() {
3537
QWordMemory (ResourceProducer,
3638
,
3739
MinFixed,
@@ -48,6 +50,41 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4EMMC", 2)
4850
)
4951
})
5052

53+
// Non translated DMA region for >= C0
54+
Name (DMNT, ResourceTemplate() {
55+
QWordMemory (ResourceProducer,
56+
,
57+
MinFixed,
58+
MaxFixed,
59+
NonCacheable,
60+
ReadWrite,
61+
0x0,
62+
0x0000000000000000, // MIN
63+
0x000000FFFFFFFFFF, // MAX
64+
0x0000000000000000, // TRA
65+
0x0000010000000000, // LEN
66+
,
67+
,
68+
)
69+
})
70+
71+
Method (_DMA, 0x0, Serialized)
72+
{
73+
OperationRegion (CHPR, SystemMemory, ID_CHIPREV, 0x4)
74+
Field (CHPR, DWordAcc, NoLock, Preserve) {
75+
SOCI, 32
76+
}
77+
78+
if ((SOCI & 0xFF) >= 0x20)
79+
{
80+
return (^DMNT);
81+
}
82+
else
83+
{
84+
return (^DMTR);
85+
}
86+
}
87+
5188
// emmc2 Host Controller. (brcm,bcm2711-emmc2)
5289
Device (SDC3)
5390
{

Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,6 @@
8888

8989
#define THERM_SENSOR 0xfd5d2200
9090

91+
#define ID_CHIPREV 0xfc404000
92+
9193
#endif /* BCM2711_H__ */

0 commit comments

Comments
 (0)