[edk2-platforms PATCH 2/6] Marvell: Armada7k8k/OcteonTx: Allow tuning PCIE config space size


Marcin Wojtas
 

Until now it was assumed that the configuration space size is 256MB.
Allow setting different values in the board description library
instance for each platform.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h | 1 +
Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c | 4 ++=
+-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h b/Silicon=
/Marvell/Include/Library/ArmadaBoardDescLib.h
index 2ad19aae7a..80c55eb3a7 100644
--- a/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h
+++ b/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h
@@ -111,6 +111,7 @@ typedef struct {
typedef struct {=0D
EFI_PHYSICAL_ADDRESS PcieDbiAddress;=0D
EFI_PHYSICAL_ADDRESS ConfigSpaceAddress;=0D
+ UINT64 ConfigSpaceSize;=0D
BOOLEAN HaveResetGpio;=0D
MV_GPIO_PIN PcieResetGpio;=0D
UINT64 PcieBusMin;=0D
diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLib=
Mem.c b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c
index 853c1b4e56..43aacb7a11 100644
--- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c
+++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c
@@ -141,7 +141,9 @@ ArmPlatformGetVirtualMemoryMap (
for (PcieIndex =3D 0; PcieIndex < PcieControllerCount; PcieIndex++) {=0D
mVirtualMemoryTable[++Index].PhysicalBase =3D PcieControllers[PcieInd=
ex].ConfigSpaceAddress;=0D
mVirtualMemoryTable[Index].VirtualBase =3D PcieControllers[PcieInd=
ex].ConfigSpaceAddress;=0D
- mVirtualMemoryTable[Index].Length =3D SIZE_256MB;=0D
+ mVirtualMemoryTable[Index].Length =3D (PcieControllers[PcieIn=
dex].ConfigSpaceSize =3D=3D 0) ?=0D
+ SIZE_256MB :=0D
+ PcieControllers[PcieIndex=
].ConfigSpaceSize;=0D
mVirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRI=
BUTE_DEVICE;=0D
}=0D
=0D
--=20
2.29.0