Skip to content

Commit 810662b

Browse files
committed
Rock 5B: Add bad memory ranges from upstream u-boot
On 16GB Rock 5Bs, memory ranges 0x3FC000000-0x3FC500000 and 0x3FFF00000-0x400000000 cause a SError when accessed. Enabling full 16GB support exposed this issue. TODO: Figure out why BSP u-boot is not affected by this (is it already blacklisting these ranges?)
1 parent 32417bc commit 810662b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

  • edk2-platforms/Platform/Radxa/ROCK5B/Library/PlatformLib

edk2-platforms/Platform/Radxa/ROCK5B/Library/PlatformLib/Rk3588Mem.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ ArmPlatformGetVirtualMemoryMap (
113113
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;
114114
VirtualMemoryInfo[Index].Type = RK3588_MEM_RESERVED_REGION;
115115
VirtualMemoryInfo[Index++].Name = L"SCMI";
116+
117+
if (mSystemMemoryBase + mSystemMemorySize > 0x3fc000000UL) {
118+
// Bad memory range 1
119+
VirtualMemoryTable[Index].PhysicalBase = 0x3fc000000;
120+
VirtualMemoryTable[Index].VirtualBase = VirtualMemoryTable[Index].PhysicalBase;
121+
VirtualMemoryTable[Index].Length = 0x500000;
122+
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;
123+
VirtualMemoryInfo[Index].Type = RK3588_MEM_RESERVED_REGION;
124+
VirtualMemoryInfo[Index++].Name = L"BAD1";
125+
126+
// Bad memory range 2
127+
VirtualMemoryTable[Index].PhysicalBase = 0x3fff00000;
128+
VirtualMemoryTable[Index].VirtualBase = VirtualMemoryTable[Index].PhysicalBase;
129+
VirtualMemoryTable[Index].Length = 0x100000;
130+
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;
131+
VirtualMemoryInfo[Index].Type = RK3588_MEM_RESERVED_REGION;
132+
VirtualMemoryInfo[Index++].Name = L"BAD2";
133+
}
116134

117135
// Firmware Volume
118136
// VirtualMemoryTable[Index].PhysicalBase = FixedPcdGet64 (PcdFdBaseAddress);

0 commit comments

Comments
 (0)