On 2020.03.04 22:31, Andrei Warkentin wrote:
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 <awarken...@vmware.com>
---
Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 7
++++++-
Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
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
Reviewed-by: Pete Batard <p...@akeo.ie>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#55462): https://edk2.groups.io/g/devel/message/55462
Mute This Topic: https://groups.io/mt/71737119/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-