Files
nix-config/packages/edk2/patches/platforms/0024-Through-Feb-21.patch
2026-01-07 21:28:20 -06:00

115 lines
5.8 KiB
Diff

From 6440aeda3459edd32adf5015a7fcfc7989c7bfbd Mon Sep 17 00:00:00 2001
From: mattp <svidasultaresurge@gmail.com>
Date: Tue, 8 Jul 2025 16:50:27 -0400
Subject: [PATCH 24/29] Through Feb 21
---
.../RPi5/Library/PlatformLib/PlatformLib.inf | 4 +---
.../RPi5/Library/PlatformLib/RaspberryPiMem.c | 13 +++----------
Platform/RaspberryPi/RPi5/RPi5.dsc | 8 +-------
Platform/RaspberryPi/RPi5/RPi5.fdf | 2 +-
4 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/Platform/RaspberryPi/RPi5/Library/PlatformLib/PlatformLib.inf b/Platform/RaspberryPi/RPi5/Library/PlatformLib/PlatformLib.inf
index 765a5807..24ef8368 100644
--- a/Platform/RaspberryPi/RPi5/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/RaspberryPi/RPi5/Library/PlatformLib/PlatformLib.inf
@@ -56,9 +56,7 @@
gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize
gRaspberryPiTokenSpaceGuid.PcdNvStorageEventLogSize
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+ gRaspberryPiTokenSpaceGuid.PcdNvStorageVariableBase
gRaspberryPiTokenSpaceGuid.PcdFwMailboxBaseAddress
[Ppis]
diff --git a/Platform/RaspberryPi/RPi5/Library/PlatformLib/RaspberryPiMem.c b/Platform/RaspberryPi/RPi5/Library/PlatformLib/RaspberryPiMem.c
index 98575625..c0632fb2 100644
--- a/Platform/RaspberryPi/RPi5/Library/PlatformLib/RaspberryPiMem.c
+++ b/Platform/RaspberryPi/RPi5/Library/PlatformLib/RaspberryPiMem.c
@@ -27,14 +27,7 @@ extern UINT64 mSystemMemoryEnd;
STATIC BOOLEAN VirtualMemoryInfoInitialized = FALSE;
STATIC RPI_MEMORY_REGION_INFO VirtualMemoryInfo[MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS];
-#define VariablesSize (FixedPcdGet32(PcdFlashNvStorageVariableSize) + \
- FixedPcdGet32(PcdFlashNvStorageFtwWorkingSize) + \
- FixedPcdGet32(PcdFlashNvStorageFtwSpareSize) + \
- FixedPcdGet32(PcdNvStorageEventLogSize))
-
-#define VariablesBase (FixedPcdGet64(PcdFdBaseAddress) + \
- FixedPcdGet32(PcdFdSize) - \
- VariablesSize)
+#define VariablesBase (FixedPcdGet32(PcdNvStorageVariableBase))
/**
Return the Virtual Memory Map of your platform
@@ -93,7 +86,7 @@ ArmPlatformGetVirtualMemoryMap (
// Firmware Volume
VirtualMemoryTable[Index].PhysicalBase = FixedPcdGet64 (PcdFdBaseAddress);
VirtualMemoryTable[Index].VirtualBase = VirtualMemoryTable[Index].PhysicalBase;
- VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdFdSize) - VariablesSize;
+ VirtualMemoryTable[Index].Length = VariablesBase - VirtualMemoryTable[Index].PhysicalBase;
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
VirtualMemoryInfo[Index].Type = RPI_MEM_RESERVED_REGION;
VirtualMemoryInfo[Index++].Name = L"FD";
@@ -101,7 +94,7 @@ ArmPlatformGetVirtualMemoryMap (
// Variable Volume
VirtualMemoryTable[Index].PhysicalBase = VariablesBase;
VirtualMemoryTable[Index].VirtualBase = VirtualMemoryTable[Index].PhysicalBase;
- VirtualMemoryTable[Index].Length = VariablesSize;
+ VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdFdtBaseAddress) - VariablesBase;
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
VirtualMemoryInfo[Index].Type = RPI_MEM_RUNTIME_REGION;
VirtualMemoryInfo[Index++].Name = L"FD Variables";
diff --git a/Platform/RaspberryPi/RPi5/RPi5.dsc b/Platform/RaspberryPi/RPi5/RPi5.dsc
index 8ab4f15a..fae154bc 100644
--- a/Platform/RaspberryPi/RPi5/RPi5.dsc
+++ b/Platform/RaspberryPi/RPi5/RPi5.dsc
@@ -124,9 +124,6 @@
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
CpuExceptionHandlerLib|ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.inf
- ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
- ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
- ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
@@ -271,9 +268,6 @@
################################################################################
[PcdsFeatureFlag.common]
- # Use the Vector Table location in CpuDxe. We will not copy the Vector Table at PcdCpuVectorBaseAddress
- gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
-
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
@@ -573,7 +567,7 @@
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
+ ArmPkg/Drivers/ArmGicDxe/ArmGicV2Dxe.inf
Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf
Platform/RaspberryPi/RPi5/Drivers/RpiPlatformDxe/RpiPlatformDxe.inf
Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf
diff --git a/Platform/RaspberryPi/RPi5/RPi5.fdf b/Platform/RaspberryPi/RPi5/RPi5.fdf
index 125d5fee..23c37e26 100644
--- a/Platform/RaspberryPi/RPi5/RPi5.fdf
+++ b/Platform/RaspberryPi/RPi5/RPi5.fdf
@@ -212,7 +212,7 @@ READ_LOCK_STATUS = TRUE
INF Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.inf
INF EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.inf
- INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
+ INF ArmPkg/Drivers/ArmGicDxe/ArmGicV2Dxe.inf
INF Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf
INF Platform/RaspberryPi/RPi5/Drivers/RpiPlatformDxe/RpiPlatformDxe.inf
INF Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf
--
2.51.2