summaryrefslogtreecommitdiff
path: root/Platform
diff options
context:
space:
mode:
authorAndrei Warkentin <awarkentin@vmware.com>2020-03-04 22:31:11 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2020-03-05 14:53:17 +0100
commit28d2f4ecd87da769f8ab4328d047c6a7aae69b67 (patch)
tree37d3206d6b698fddd33b6180aa91b2ed81f73e8d /Platform
parentd1406c6411ef92d33f6eeb4b98e14242c2ad5061 (diff)
Platform/RaspberryPi/Drivers/PlatformSmbiosDxe: improve UX with 3GB limit
Right now there was no way to tell you're booting with RAM limited to 3GB, since the setup front page still listed 4096 MB. Fix this by honoring PcdRamLimitTo3GB in PlatformSmbiosDxe. Tested on 2GB and 4GB boards (with limiting and without) Signed-off-by: Andrei Warkentin <awarkentin@vmware.com> Reviewed-by: Pete Batard <pete@akeo.ie>
Diffstat (limited to 'Platform')
-rw-r--r--Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c7
-rw-r--r--Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf2
2 files changed, 8 insertions, 1 deletions
diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
index 5585cb84..3351fea2 100644
--- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
+++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
@@ -882,7 +882,12 @@ MemArrMapInfoUpdateSmbiosType19 (
if (Status != EFI_SUCCESS) {
DEBUG ((DEBUG_WARN, "Couldn't get the board memory size - defaulting to 256 MB: %r\n", Status));
} else {
- mMemArrMapInfoType19.EndingAddress = InstalledMB * 1024;
+ if (PcdGet32 (PcdRamMoreThan3GB) && PcdGet32 (PcdRamLimitTo3GB)) {
+ ASSERT (InstalledMB > 3 * 1024);
+ mMemArrMapInfoType19.EndingAddress = 3 * 1024 * 1024;
+ } else {
+ mMemArrMapInfoType19.EndingAddress = InstalledMB * 1024;
+ }
}
mMemArrMapInfoType19.EndingAddress -= 1;
diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
index 9554c2e9..1ed6338c 100644
--- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
+++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
@@ -52,3 +52,5 @@
gArmTokenSpaceGuid.PcdSystemMemorySize
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+ gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB
+ gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB