From 54c2cdb241a19223b4a56df5f55618a97d655bf3 Mon Sep 17 00:00:00 2001 From: Chao Li Date: Fri, 17 Nov 2023 11:37:28 +0800 Subject: ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg Moved PcdDeviceTreeInitialBaseAddress and PcdDeviceTreeAllocationPadding to OvmfPkg for easier use by other architectures. Build-tested only (with "ArmVirtQemu.dsc"). BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 Cc: Ard Biesheuvel Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Signed-off-by: Chao Li Acked-by: Gerd Hoffmann Reviewed-by: Sami Mujawar Reviewed-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- ArmVirtPkg/ArmVirtPkg.dec | 14 -------------- ArmVirtPkg/ArmVirtQemu.dsc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- ArmVirtPkg/ArmVirtXen.dsc | 2 +- .../ArmVirtPsciResetSystemPeiLib.inf | 3 ++- .../CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf | 3 ++- .../DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf | 3 ++- .../EarlyFdt16550SerialPortHookLib.inf | 3 ++- .../FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf | 3 ++- .../KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf | 5 +++-- ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf | 10 +++++----- .../Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf | 3 ++- ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 ++- 15 files changed, 27 insertions(+), 33 deletions(-) (limited to 'ArmVirtPkg') diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc index 2cb89ce10c..76c0d28544 100644 --- a/ArmVirtPkg/ArmVirtCloudHv.dsc +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc @@ -129,7 +129,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # initial location of the device tree blob passed by Cloud Hypervisor -- base of DRAM - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index f50d53bf15..cac4fe06d3 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -179,7 +179,7 @@ # We are booting from RAM using the Linux kernel boot protocol, # x0 will point to the DTB image in memory. # - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0 + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0 gArmTokenSpaceGuid.PcdFdBaseAddress|0x0 gArmTokenSpaceGuid.PcdFvBaseAddress|0x0 diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index 313aebda90..05d2d36c1d 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -42,20 +42,6 @@ gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|FALSE|BOOLEAN|0x00000004 [PcdsFixedAtBuild, PcdsPatchableInModule] - # - # This is the physical address where the device tree is expected to be stored - # upon first entry into UEFI. This needs to be a FixedAtBuild PCD, so that we - # can do a first pass over the device tree in the SEC phase to discover the - # UART base address. - # - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0|UINT64|0x00000001 - - # - # Padding in bytes to add to the device tree allocation, so that the DTB can - # be modified in place (default: 256 bytes) - # - gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x00000002 - # # Binary representation of the GUID that determines the terminal type. The # size must be exactly 16 bytes. The default value corresponds to diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 30e3cfc8b9..cf306cac08 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -201,7 +201,7 @@ gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 # initial location of the device tree blob passed by QEMU -- base of DRAM - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index b50f8e84a3..c0d079e28d 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -198,7 +198,7 @@ # Define a default initial address for the device tree. # Ignored if x0 != 0 at entry. # - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 gArmTokenSpaceGuid.PcdFdBaseAddress|0x0 gArmTokenSpaceGuid.PcdFvBaseAddress|0x0 diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index f0d15b823b..5809832e66 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -115,7 +115,7 @@ # gArmTokenSpaceGuid.PcdSystemMemoryBase|0x0 gArmTokenSpaceGuid.PcdSystemMemorySize|0x0 - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0 + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0 gArmTokenSpaceGuid.PcdFdBaseAddress|0x0 gArmTokenSpaceGuid.PcdFvBaseAddress|0x0 diff --git a/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf b/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf index 3a65706e8d..79217d296d 100644 --- a/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf +++ b/ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf @@ -26,6 +26,7 @@ EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] ArmSmcLib @@ -36,4 +37,4 @@ HobLib [Pcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress diff --git a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf index 666b5d9711..6df26ccd64 100644 --- a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf +++ b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf @@ -26,6 +26,7 @@ EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] ArmLib @@ -44,4 +45,4 @@ [FixedPcd] gArmTokenSpaceGuid.PcdFdSize gArmTokenSpaceGuid.PcdFvSize - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress diff --git a/ArmVirtPkg/Library/DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf b/ArmVirtPkg/Library/DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf index 7870ca2ae4..f35a0913f0 100644 --- a/ArmVirtPkg/Library/DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf +++ b/ArmVirtPkg/Library/DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf @@ -30,6 +30,7 @@ ArmPlatformPkg/ArmPlatformPkg.dec ArmVirtPkg/ArmVirtPkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] BaseLib @@ -41,7 +42,7 @@ PrintLib [Pcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress # Flash.c + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress # Flash.c gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel diff --git a/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf b/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf index 22aba53d9b..3e2303b7f4 100644 --- a/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf +++ b/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf @@ -29,7 +29,8 @@ ArmVirtPkg/ArmVirtPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec [Pcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf index f47692f06a..e677f1d9e7 100644 --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/EarlyFdtPL011SerialPortLib.inf @@ -28,9 +28,10 @@ MdePkg/MdePkg.dec ArmPlatformPkg/ArmPlatformPkg.dec ArmVirtPkg/ArmVirtPkg.dec + OvmfPkg/OvmfPkg.dec [Pcd] - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress [FixedPcd] gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate diff --git a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf index f201aee50c..77c0b923bd 100644 --- a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf +++ b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf @@ -24,6 +24,7 @@ EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] DebugLib @@ -34,12 +35,12 @@ [FixedPcd] gArmTokenSpaceGuid.PcdFvSize - gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeAllocationPadding [Pcd] gArmTokenSpaceGuid.PcdFvBaseAddress - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress [Guids] gFdtHobGuid diff --git a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf index b867d8bb89..e9a34b6e2e 100644 --- a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf +++ b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf @@ -41,16 +41,16 @@ [FixedPcd] gArmTokenSpaceGuid.PcdFvSize - gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeAllocationPadding [Pcd] gArmTokenSpaceGuid.PcdFvBaseAddress - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress - gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## SOMETIMES_PRODUCES + gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## SOMETIMES_PRODUCES + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress [Ppis] - gOvmfTpmDiscoveredPpiGuid ## SOMETIMES_PRODUCES - gPeiTpmInitializationDonePpiGuid ## SOMETIMES_PRODUCES + gOvmfTpmDiscoveredPpiGuid ## SOMETIMES_PRODUCES + gPeiTpmInitializationDonePpiGuid ## SOMETIMES_PRODUCES [Guids] gEarlyPL011BaseAddressGuid diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf index f045e39a41..76c3c5d3c8 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf @@ -26,6 +26,7 @@ EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] ArmLib @@ -44,4 +45,4 @@ gArmTokenSpaceGuid.PcdSystemMemorySize gArmTokenSpaceGuid.PcdFdSize gArmTokenSpaceGuid.PcdFvSize - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index 7edf501808..6b9244bd1a 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -35,6 +35,7 @@ ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec ArmVirtPkg/ArmVirtPkg.dec + OvmfPkg/OvmfPkg.dec [LibraryClasses] BaseLib @@ -93,6 +94,6 @@ [Pcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize - gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gArmTokenSpaceGuid.PcdFdBaseAddress gArmTokenSpaceGuid.PcdFvBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress -- cgit v1.2.3