Skip to content

Commit

Permalink
ArmVirtPkg: Move PCD of FDT base address and FDT padding to OvmfPkg
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Jordan Justen <[email protected]>
Signed-off-by: Chao Li <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Sami Mujawar <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
  • Loading branch information
kilaterlee authored and lgao4 committed Feb 6, 2024
1 parent 3db49a6 commit 54c2cdb
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ArmVirtPkg/ArmVirtCloudHv.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion ArmVirtPkg/ArmVirtKvmTool.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions ArmVirtPkg/ArmVirtPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ArmVirtPkg/ArmVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion ArmVirtPkg/ArmVirtQemuKernel.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ArmVirtPkg/ArmVirtXen.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
#
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x0
gArmTokenSpaceGuid.PcdSystemMemorySize|0x0
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0

gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFvBaseAddress|0x0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec

[LibraryClasses]
ArmSmcLib
Expand All @@ -36,4 +37,4 @@
HobLib

[Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec

[LibraryClasses]
ArmLib
Expand All @@ -44,4 +45,4 @@
[FixedPcd]
gArmTokenSpaceGuid.PcdFdSize
gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec

[LibraryClasses]
BaseLib
Expand All @@ -41,7 +42,7 @@
PrintLib

[Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress # Flash.c
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress # Flash.c
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask
gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
ArmVirtPkg/ArmVirtPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec

[Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
MdePkg/MdePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
OvmfPkg/OvmfPkg.dec

[Pcd]
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec

[LibraryClasses]
DebugLib
Expand All @@ -34,12 +35,12 @@

[FixedPcd]
gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeAllocationPadding

[Pcd]
gArmTokenSpaceGuid.PcdFvBaseAddress
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

[Guids]
gFdtHobGuid
Expand Down
10 changes: 5 additions & 5 deletions ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec

[LibraryClasses]
ArmLib
Expand All @@ -44,4 +45,4 @@
gArmTokenSpaceGuid.PcdSystemMemorySize
gArmTokenSpaceGuid.PcdFdSize
gArmTokenSpaceGuid.PcdFvSize
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
3 changes: 2 additions & 1 deletion ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
OvmfPkg/OvmfPkg.dec

[LibraryClasses]
BaseLib
Expand Down Expand Up @@ -93,6 +94,6 @@
[Pcd]
gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize
gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdFvBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress
15 changes: 15 additions & 0 deletions OvmfPkg/OvmfPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,21 @@
#
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]
gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE|BOOLEAN|0x1c
gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|FALSE|BOOLEAN|0x1d
Expand Down

0 comments on commit 54c2cdb

Please sign in to comment.