diff options
author | Pranav Madhu <pranav.madhu@arm.com> | 2021-04-13 00:03:30 +0530 |
---|---|---|
committer | Sami Mujawar <sami.mujawar@arm.com> | 2021-04-13 08:41:16 +0100 |
commit | 7545558886de73639146daeb8902099940a22e1d (patch) | |
tree | 0d024728954519cdb404ba29972a3f9d82a36f45 | |
parent | eb55ab4a2dc8565e7006aff2f6ff9a67ae0526bf (diff) |
Platform/Sgi: add SMMU and timer entries to memory description table
Add PCDs for base address and address space size for generic timer and
SMMU controllers. Use those PCDs to add platform memory map entries. The
ServerReady SBSA tests, when executed, accesses these controllers and so
the memory mapping for generic timer and SMMU controllers are required.
In addition to this, PCDs for watchdog timer controller base address and
size are introduced instead of using macros for the same. This allows
the base address and address space size for watchdog timer controller to
be specified by platform description files.
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
-rw-r--r-- | Platform/ARM/SgiPkg/Include/SgiPlatform.h | 4 | ||||
-rw-r--r-- | Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 11 | ||||
-rw-r--r-- | Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 32 | ||||
-rw-r--r-- | Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc | 4 | ||||
-rw-r--r-- | Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc | 4 | ||||
-rw-r--r-- | Platform/ARM/SgiPkg/SgiPlatform.dec | 14 | ||||
-rw-r--r-- | Platform/ARM/SgiPkg/SgiPlatform.dsc.inc | 10 |
7 files changed, 70 insertions, 9 deletions
diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h b/Platform/ARM/SgiPkg/Include/SgiPlatform.h index d6ab585c..818879b5 100644 --- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h +++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h @@ -21,10 +21,6 @@ #define SGI_SUBSYS_UART1_BASE 0x2A410000
#define SGI_SUBSYS_UART1_SZ 0x00010000
-// Sub System Peripherals - Generic Watchdog
-#define SGI_SUBSYS_GENERIC_WDOG_BASE 0x2A440000
-#define SGI_SUBSYS_GENERIC_WDOG_SZ SIZE_128KB
-
// Register offsets into the System Registers Block
#define SGI_SYSPH_SYS_REG_FLASH 0x4C
#define SGI_SYSPH_SYS_REG_FLASH_RWEN 0x1
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf index 333247d0..22e247ea 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf @@ -64,9 +64,20 @@ gArmTokenSpaceGuid.PcdMmBufferBase
gArmTokenSpaceGuid.PcdMmBufferSize
+
gArmSgiTokenSpaceGuid.PcdSmcCs0Base
gArmSgiTokenSpaceGuid.PcdSmcCs1Base
+ gArmSgiTokenSpaceGuid.PcdSmmuBase
+ gArmSgiTokenSpaceGuid.PcdSmmuSize
gArmSgiTokenSpaceGuid.PcdSysPeriphBase
+ gArmSgiTokenSpaceGuid.PcdTimerBase0Base
+ gArmSgiTokenSpaceGuid.PcdTimerBase0Size
+ gArmSgiTokenSpaceGuid.PcdTimerControlBase
+ gArmSgiTokenSpaceGuid.PcdTimerControlSize
+ gArmSgiTokenSpaceGuid.PcdTimerCounterReadBase
+ gArmSgiTokenSpaceGuid.PcdTimerCounterReadSize
+ gArmSgiTokenSpaceGuid.PcdWdogBase
+ gArmSgiTokenSpaceGuid.PcdWdogSize
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c index 9bdc63b9..8139b75d 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c @@ -17,7 +17,7 @@ // Total number of descriptors, including the final "end-of-table" descriptor.
#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS \
- (10 + (FixedPcdGet32 (PcdChipCount) * 2))
+ (14 + (FixedPcdGet32 (PcdChipCount) * 2))
/**
Returns the Virtual Memory Map of the platform.
@@ -124,9 +124,9 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
// Sub System Peripherals - Generic Watchdog
- VirtualMemoryTable[++Index].PhysicalBase = SGI_SUBSYS_GENERIC_WDOG_BASE;
- VirtualMemoryTable[Index].VirtualBase = SGI_SUBSYS_GENERIC_WDOG_BASE;
- VirtualMemoryTable[Index].Length = SGI_SUBSYS_GENERIC_WDOG_SZ;
+ VirtualMemoryTable[++Index].PhysicalBase = FixedPcdGet32 (PcdWdogBase);
+ VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdWdogBase);
+ VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdWdogSize);
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
// Sub System Peripherals - GIC-600
@@ -135,6 +135,30 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length = FixedPcdGet64(PcdGicSize);
VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+ // Sub System Peripherals - Counter
+ VirtualMemoryTable[++Index].PhysicalBase = FixedPcdGet32 (PcdTimerCounterReadBase);
+ VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdTimerCounterReadBase);
+ VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdTimerCounterReadSize);
+ VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+ // Sub System Peripherals - Timer Control
+ VirtualMemoryTable[++Index].PhysicalBase = FixedPcdGet32 (PcdTimerControlBase);
+ VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdTimerControlBase);
+ VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdTimerControlSize);
+ VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+ // Sub System Peripherals - Timer Base0
+ VirtualMemoryTable[++Index].PhysicalBase = FixedPcdGet32 (PcdTimerBase0Base);
+ VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdTimerBase0Base);
+ VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdTimerBase0Size);
+ VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+ // Sub System Peripherals - SMMU
+ VirtualMemoryTable[++Index].PhysicalBase = FixedPcdGet32 (PcdSmmuBase);
+ VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdSmmuBase);
+ VirtualMemoryTable[Index].Length = FixedPcdGet32 (PcdSmmuSize);
+ VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
// Expansion AXI - Platform Peripherals - HDLCD1
VirtualMemoryTable[++Index].PhysicalBase = FixedPcdGet32 (PcdArmHdLcdBase);
VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdArmHdLcdBase);
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc index efbb013b..d3d65032 100644 --- a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc +++ b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc @@ -50,3 +50,7 @@ gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|91
gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|93
gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|94
+
+ # SMMU
+ gArmSgiTokenSpaceGuid.PcdSmmuBase|0x4F000000
+ gArmSgiTokenSpaceGuid.PcdSmmuSize|0x01000000
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc index 1167f1a6..c593156e 100644 --- a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc +++ b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc @@ -50,3 +50,7 @@ gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|108
gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|110
gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|111
+
+ # SMMU
+ gArmSgiTokenSpaceGuid.PcdSmmuBase|0x40000000
+ gArmSgiTokenSpaceGuid.PcdSmmuSize|0x10000000
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/SgiPlatform.dec index 86ead241..3effd495 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dec +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec @@ -57,11 +57,23 @@ gArmSgiTokenSpaceGuid.PcdSysPeriphBase|0x00000000|UINT64|0x0000000E
gArmSgiTokenSpaceGuid.PcdSysPeriphSysRegBase|0x0|UINT64|0x0000000F
- # Timer & Watchdog interrupts
+ # Counter, Timer and Watchdog
gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv|0|UINT32|0x00000011
gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|0|UINT32|0x00000012
+ gArmSgiTokenSpaceGuid.PcdTimerBase0Base|0|UINT32|0x00000015
+ gArmSgiTokenSpaceGuid.PcdTimerBase0Size|0|UINT32|0x00000016
+ gArmSgiTokenSpaceGuid.PcdTimerControlBase|0|UINT32|0x00000017
+ gArmSgiTokenSpaceGuid.PcdTimerControlSize|0|UINT32|0x00000018
+ gArmSgiTokenSpaceGuid.PcdTimerCounterReadBase|0|UINT32|0x00000019
+ gArmSgiTokenSpaceGuid.PcdTimerCounterReadSize|0|UINT32|0x0000001A
+ gArmSgiTokenSpaceGuid.PcdWdogBase|0|UINT32|0x0000001B
+ gArmSgiTokenSpaceGuid.PcdWdogSize|0|UINT32|0x0000001C
gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|0|UINT32|0x00000013
gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|0|UINT32|0x00000014
+ # SMMU
+ gArmSgiTokenSpaceGuid.PcdSmmuBase|0|UINT32|0x0000001D
+ gArmSgiTokenSpaceGuid.PcdSmmuSize|0|UINT32|0x0000001E
+
[Ppis]
gNtFwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc index 12a8f888..42e3600d 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc @@ -152,6 +152,16 @@ # Ethernet / Virtio Network
gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x10000
+ # Counter, Timer and Watchdog
+ gArmSgiTokenSpaceGuid.PcdTimerBase0Base|0x2A830000
+ gArmSgiTokenSpaceGuid.PcdTimerBase0Size|0x00010000
+ gArmSgiTokenSpaceGuid.PcdTimerControlBase|0x2A810000
+ gArmSgiTokenSpaceGuid.PcdTimerControlSize|0x00010000
+ gArmSgiTokenSpaceGuid.PcdTimerCounterReadBase|0x2A800000
+ gArmSgiTokenSpaceGuid.PcdTimerCounterReadSize|0x00010000
+ gArmSgiTokenSpaceGuid.PcdWdogBase|0x2A440000
+ gArmSgiTokenSpaceGuid.PcdWdogSize|0x00020000
+
#
# Set the base address and size of the buffer used
# for communication between the Normal world edk2
|