[edk2-platform][PATCH 2/3] Platform,Silicon/Qemu: Define PcdPcie*Limit variables


Tomas Pilar (tpilar)
 

The ACPI tables require not only the base and the size
of various PCIe memory windows, but also the limit
defined as

Limit = Base + Size - 1

Given that ASL does not permit basic constant arithmetics when
defining resources or passing arguements to functions, we
define PCDs that hold these limits. The PCDs can then be modified
individually in platform DSC files.

Cc: Leif Lindholm <leif@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Cc: Tanmay Jagdale <tanmay.jagdale@...>
Signed-off-by: Tomas Pilar <tomas@...>
---
Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 6 ++++++
Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 11 +++++++++++
2 files changed, 17 insertions(+)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 0e6d738bee..49bc5033f4 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -458,15 +458,21 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
gArmTokenSpaceGuid.PcdPciBusMax|255
gArmTokenSpaceGuid.PcdPciIoBase|0x0
gArmTokenSpaceGuid.PcdPciIoSize|0x00010000
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciIoLimit|0x0000ffff
gArmTokenSpaceGuid.PcdPciMmio32Base|0x80000000
gArmTokenSpaceGuid.PcdPciMmio32Size|0x70000000
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio32Limit|0xEFFFFFFF
gArmTokenSpaceGuid.PcdPciMmio64Base|0x100000000
gArmTokenSpaceGuid.PcdPciMmio64Size|0xFF00000000
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio64Limit|0xFFFFFFFFFF

# set PcdPciExpressBaseAddress to MAX_UINT64, which signifies that this
# PCD and PcdPciDisableBusEnumeration have not been assigned yet
# TODO: PcdPciExpressBaseAddress set to max_uint64
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xf0000000
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarSize|0x10000000
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit|0xFFFFFFFF
+
gArmTokenSpaceGuid.PcdPciIoTranslation|0x7fff0000
gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0
gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0
diff --git a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
index e8d55a530d..476dc82f98 100644
--- a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
+++ b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
@@ -36,6 +36,17 @@
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize|0x10000|UINT32|0x00000004
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress|0x10000000000|UINT64|0x00000005

+ # PCDs complementing PCIe layout pulled into ACPI tables
+ # Limit = Base + Size - 1
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciIoLimit|0x0000ffff|UINT32|0x00000006
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio32Limit|0xEFFFFFFF|UINT32|0x00000007
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio64Limit|0xFFFFFFFFFF|UINT64|0x00000008
+
+ # PCDs complementing gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
+ # BarLimit = BaseAddress + BarSize - 1
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarSize|0x10000000|UINT64|0x00000009
+ gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit|0xFFFFFFFF|UINT64|0x00000010
+
[PcdsDynamic.common]
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount|0x1|UINT32|0x00000100
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdClusterCount|0x1|UINT32|0x00000101
--
2.25.1

Join devel@edk2.groups.io to automatically receive all group messages.