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 <ardb+tianocore@kernel.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Chao Li 2023-11-17 11:37:28 +08:00 committed by Liming Gao
parent 3db49a6ca8
commit 54c2cdb241
16 changed files with 42 additions and 33 deletions

View File

@ -129,7 +129,7 @@
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000
# initial location of the device tree blob passed by Cloud Hypervisor -- base of DRAM # initial location of the device tree blob passed by Cloud Hypervisor -- base of DRAM
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000
gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }

View File

@ -179,7 +179,7 @@
# We are booting from RAM using the Linux kernel boot protocol, # We are booting from RAM using the Linux kernel boot protocol,
# x0 will point to the DTB image in memory. # x0 will point to the DTB image in memory.
# #
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0 gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFvBaseAddress|0x0 gArmTokenSpaceGuid.PcdFvBaseAddress|0x0

View File

@ -42,20 +42,6 @@
gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|FALSE|BOOLEAN|0x00000004 gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|FALSE|BOOLEAN|0x00000004
[PcdsFixedAtBuild, PcdsPatchableInModule] [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 # Binary representation of the GUID that determines the terminal type. The
# size must be exactly 16 bytes. The default value corresponds to # size must be exactly 16 bytes. The default value corresponds to

View File

@ -201,7 +201,7 @@
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000 gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000
# initial location of the device tree blob passed by QEMU -- base of DRAM # initial location of the device tree blob passed by QEMU -- base of DRAM
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000
gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }

View File

@ -198,7 +198,7 @@
# Define a default initial address for the device tree. # Define a default initial address for the device tree.
# Ignored if x0 != 0 at entry. # Ignored if x0 != 0 at entry.
# #
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000 gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0 gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFvBaseAddress|0x0 gArmTokenSpaceGuid.PcdFvBaseAddress|0x0

View File

@ -115,7 +115,7 @@
# #
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x0 gArmTokenSpaceGuid.PcdSystemMemoryBase|0x0
gArmTokenSpaceGuid.PcdSystemMemorySize|0x0 gArmTokenSpaceGuid.PcdSystemMemorySize|0x0
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0 gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFvBaseAddress|0x0 gArmTokenSpaceGuid.PcdFvBaseAddress|0x0

View File

@ -26,6 +26,7 @@
EmbeddedPkg/EmbeddedPkg.dec EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
ArmSmcLib ArmSmcLib
@ -36,4 +37,4 @@
HobLib HobLib
[Pcd] [Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

View File

@ -26,6 +26,7 @@
EmbeddedPkg/EmbeddedPkg.dec EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
ArmLib ArmLib
@ -44,4 +45,4 @@
[FixedPcd] [FixedPcd]
gArmTokenSpaceGuid.PcdFdSize gArmTokenSpaceGuid.PcdFdSize
gArmTokenSpaceGuid.PcdFvSize gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

View File

@ -30,6 +30,7 @@
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
BaseLib BaseLib
@ -41,7 +42,7 @@
PrintLib PrintLib
[Pcd] [Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress # Flash.c gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress # Flash.c
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask
gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel

View File

@ -29,7 +29,8 @@
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[Pcd] [Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase

View File

@ -28,9 +28,10 @@
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
OvmfPkg/OvmfPkg.dec
[Pcd] [Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
[FixedPcd] [FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate

View File

@ -24,6 +24,7 @@
EmbeddedPkg/EmbeddedPkg.dec EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
DebugLib DebugLib
@ -34,12 +35,12 @@
[FixedPcd] [FixedPcd]
gArmTokenSpaceGuid.PcdFvSize gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeAllocationPadding
[Pcd] [Pcd]
gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvBaseAddress
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
[Guids] [Guids]
gFdtHobGuid gFdtHobGuid

View File

@ -41,16 +41,16 @@
[FixedPcd] [FixedPcd]
gArmTokenSpaceGuid.PcdFvSize gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeAllocationPadding
[Pcd] [Pcd]
gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvBaseAddress
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## SOMETIMES_PRODUCES
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## SOMETIMES_PRODUCES gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
[Ppis] [Ppis]
gOvmfTpmDiscoveredPpiGuid ## SOMETIMES_PRODUCES gOvmfTpmDiscoveredPpiGuid ## SOMETIMES_PRODUCES
gPeiTpmInitializationDonePpiGuid ## SOMETIMES_PRODUCES gPeiTpmInitializationDonePpiGuid ## SOMETIMES_PRODUCES
[Guids] [Guids]
gEarlyPL011BaseAddressGuid gEarlyPL011BaseAddressGuid

View File

@ -26,6 +26,7 @@
EmbeddedPkg/EmbeddedPkg.dec EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
ArmLib ArmLib
@ -44,4 +45,4 @@
gArmTokenSpaceGuid.PcdSystemMemorySize gArmTokenSpaceGuid.PcdSystemMemorySize
gArmTokenSpaceGuid.PcdFdSize gArmTokenSpaceGuid.PcdFdSize
gArmTokenSpaceGuid.PcdFvSize gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

View File

@ -35,6 +35,7 @@
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
BaseLib BaseLib
@ -93,6 +94,6 @@
[Pcd] [Pcd]
gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize gArmTokenSpaceGuid.PcdSystemMemorySize
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gArmTokenSpaceGuid.PcdFdBaseAddress gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

View File

@ -386,6 +386,21 @@
# #
gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi|0x0|BOOLEAN|0x69 gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi|0x0|BOOLEAN|0x69
[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.
#
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0|UINT64|0x6e
#
# Padding in bytes to add to the device tree allocation, so that the DTB can
# be modified in place (default: 256 bytes)
#
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x6f
[PcdsFeatureFlag] [PcdsFeatureFlag]
gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE|BOOLEAN|0x1c gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE|BOOLEAN|0x1c
gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|FALSE|BOOLEAN|0x1d gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|FALSE|BOOLEAN|0x1d