summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Drivers/PL180MciDxe
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg/Drivers/PL180MciDxe')
-rw-r--r--ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c16
-rw-r--r--ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.h17
2 files changed, 33 insertions, 0 deletions
diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
index 411a61ed04..688cd8a98c 100644
--- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
+++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
@@ -521,6 +521,22 @@ PL180MciDxeInitialize (
EFI_STATUS Status;
EFI_HANDLE Handle;
+ DEBUG ((EFI_D_WARN, "Probing ID registers at 0x%lx for a PL180\n",
+ MCI_PERIPH_ID_REG0));
+
+ // Check if this is a PL180
+ if (MmioRead8 (MCI_PERIPH_ID_REG0) != MCI_PERIPH_ID0 ||
+ MmioRead8 (MCI_PERIPH_ID_REG1) != MCI_PERIPH_ID1 ||
+ MmioRead8 (MCI_PERIPH_ID_REG2) != MCI_PERIPH_ID2 ||
+ MmioRead8 (MCI_PERIPH_ID_REG3) != MCI_PERIPH_ID3 ||
+ MmioRead8 (MCI_PCELL_ID_REG0) != MCI_PCELL_ID0 ||
+ MmioRead8 (MCI_PCELL_ID_REG1) != MCI_PCELL_ID1 ||
+ MmioRead8 (MCI_PCELL_ID_REG2) != MCI_PCELL_ID2 ||
+ MmioRead8 (MCI_PCELL_ID_REG3) != MCI_PCELL_ID3) {
+
+ return EFI_NOT_FOUND;
+ }
+
Handle = NULL;
MCI_TRACE ("PL180MciDxeInitialize()");
diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.h b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.h
index 6dc155ee9a..ce38a9e706 100644
--- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.h
+++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.h
@@ -51,6 +51,23 @@
#define MCI_SELECT_REG (MCI_SYSCTL + 0x044)
#define MCI_FIFOCOUNT_REG (MCI_SYSCTL + 0x048)
#define MCI_FIFO_REG (MCI_SYSCTL + 0x080)
+#define MCI_PERIPH_ID_REG0 (MCI_SYSCTL + 0xFE0)
+#define MCI_PERIPH_ID_REG1 (MCI_SYSCTL + 0xFE4)
+#define MCI_PERIPH_ID_REG2 (MCI_SYSCTL + 0xFE8)
+#define MCI_PERIPH_ID_REG3 (MCI_SYSCTL + 0xFEC)
+#define MCI_PCELL_ID_REG0 (MCI_SYSCTL + 0xFF0)
+#define MCI_PCELL_ID_REG1 (MCI_SYSCTL + 0xFF4)
+#define MCI_PCELL_ID_REG2 (MCI_SYSCTL + 0xFF8)
+#define MCI_PCELL_ID_REG3 (MCI_SYSCTL + 0xFFC)
+
+#define MCI_PERIPH_ID0 0x80
+#define MCI_PERIPH_ID1 0x11
+#define MCI_PERIPH_ID2 0x04
+#define MCI_PERIPH_ID3 0x00
+#define MCI_PCELL_ID0 0x0D
+#define MCI_PCELL_ID1 0xF0
+#define MCI_PCELL_ID2 0x05
+#define MCI_PCELL_ID3 0xB1
#define MCI_POWER_OFF 0
#define MCI_POWER_UP BIT1