diff options
author | Jeremy Linton <jeremy.linton@arm.com> | 2016-07-27 14:24:35 -0500 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2016-07-28 15:29:35 +0100 |
commit | 7ac29b544f4fd2f9d604e1fb39ea83c6f538a6d2 (patch) | |
tree | 32f08d4b58ac95cce9e7cf949b894f40c7695e19 /ArmPlatformPkg/ArmJunoPkg | |
parent | 25654e2469d5387740addd4a2d24f61dd665a3b0 (diff) | |
download | edk2-platforms-7ac29b544f4fd2f9d604e1fb39ea83c6f538a6d2.tar.xz |
ArmPlatformPkg: break out juno revision detection
The code to detect what juno revision we are running on
is fairly small put it in a common header where it may be
used in a couple places.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/ArmJunoPkg')
-rw-r--r-- | ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h b/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h index d01d1367f9..7eaa239b1c 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h +++ b/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h @@ -23,6 +23,11 @@ // Motherboard Peripheral and On-chip peripheral
#define ARM_VE_BOARD_PERIPH_BASE 0x1C010000
+#define ARM_VE_BOARD_SYS_ID 0x0000
+#define ARM_VE_BOARD_SYS_PCIE_GBE_L 0x0074
+#define ARM_VE_BOARD_SYS_PCIE_GBE_H 0x0078
+
+#define ARM_VE_BOARD_SYS_ID_REV(word) ((word >> 28) & 0xff)
// NOR Flash 0
#define ARM_VE_SMB_NOR0_BASE 0x08000000
@@ -83,6 +88,26 @@ EFI_ACPI_ARM_CREATOR_REVISION /* UINT32 CreatorRevision */ \
}
+//
+// Hardware platform identifiers
+//
+#define JUNO_REVISION_PROTOTYPE 0
+#define JUNO_REVISION_R0 1
+#define JUNO_REVISION_R1 2
+#define JUNO_REVISION_R2 3
+#define JUNO_REVISION_UKNOWN 0xFF
+
+//
+// We detect whether we are running on a Juno r0, r1 or r2
+// board at runtime by checking the value of board SYS_ID
+//
+#define GetJunoRevision(JunoRevision) \
+{ \
+ UINT32 SysId; \
+ SysId = MmioRead32 (ARM_VE_BOARD_PERIPH_BASE+ARM_VE_BOARD_SYS_ID); \
+ JunoRevision = ARM_VE_BOARD_SYS_ID_REV( SysId ); \
+}
+
#define JUNO_WATCHDOG_COUNT 2
// Define if the exported ACPI Tables are based on ACPI 5.0 spec or latest
@@ -93,7 +118,7 @@ // assigned to the PCI Gigabyte Ethernet device.
//
-#define ARM_JUNO_SYS_PCIGBE_L (ARM_VE_BOARD_PERIPH_BASE + 0x74)
-#define ARM_JUNO_SYS_PCIGBE_H (ARM_VE_BOARD_PERIPH_BASE + 0x78)
+#define ARM_JUNO_SYS_PCIGBE_L (ARM_VE_BOARD_PERIPH_BASE + ARM_VE_BOARD_SYS_PCIE_GBE_L)
+#define ARM_JUNO_SYS_PCIGBE_H (ARM_VE_BOARD_PERIPH_BASE + ARM_VE_BOARD_SYS_PCIE_GBE_H)
#endif
|