diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-08-25 13:11:11 +0000 |
---|---|---|
committer | abiesheuvel <abiesheuvel@Edk2> | 2015-08-25 13:11:11 +0000 |
commit | 9dc94d9891ec4d6f946f85f25be4ccf551e2a7ed (patch) | |
tree | e5a61db77688bbd09e6c853ebd03dee4ef52ca1b /ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe | |
parent | 300fc77a8a4bf4bb160004dd6e5bec7333d1dc7a (diff) | |
download | edk2-9dc94d9891ec4d6f946f85f25be4ccf551e2a7ed.tar.gz edk2-9dc94d9891ec4d6f946f85f25be4ccf551e2a7ed.tar.bz2 edk2-9dc94d9891ec4d6f946f85f25be4ccf551e2a7ed.zip |
ArmPlatformPkg/LcdGraphicsOutputDxe: check PrimeCell ID before initializing
To deal gracefully with the absence of the PL111 hardware on
the Foundation model, check the PrimeCell ID before proceeding
with the installation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18308 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe')
3 files changed, 28 insertions, 1 deletions
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c index cbc2034349..b721061fc1 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c @@ -156,6 +156,11 @@ LcdGraphicsOutputDxeInitialize ( EFI_STATUS Status = EFI_SUCCESS;
LCD_INSTANCE* Instance;
+ Status = LcdIdentify ();
+ if (EFI_ERROR(Status)) {
+ goto EXIT;
+ }
+
Status = LcdInstanceContructor (&Instance);
if (EFI_ERROR(Status)) {
goto EXIT;
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h index dfbf2ed671..8856b79901 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h @@ -106,7 +106,7 @@ InitializeDisplay ( );
EFI_STATUS
-LcdIndentify (
+LcdIdentify (
VOID
);
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c index ad841cd8dc..b5e113b844 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c @@ -27,6 +27,28 @@ **********************************************************************/
EFI_STATUS
+LcdIdentify (
+ VOID
+ )
+{
+ DEBUG ((EFI_D_WARN, "Probing ID registers at 0x%lx for a PL111\n",
+ PL111_REG_CLCD_PERIPH_ID_0));
+
+ // Check if this is a PL111
+ if (MmioRead8 (PL111_REG_CLCD_PERIPH_ID_0) == PL111_CLCD_PERIPH_ID_0 &&
+ MmioRead8 (PL111_REG_CLCD_PERIPH_ID_1) == PL111_CLCD_PERIPH_ID_1 &&
+ (MmioRead8 (PL111_REG_CLCD_PERIPH_ID_2) & 0xf) == PL111_CLCD_PERIPH_ID_2 &&
+ MmioRead8 (PL111_REG_CLCD_PERIPH_ID_3) == PL111_CLCD_PERIPH_ID_3 &&
+ MmioRead8 (PL111_REG_CLCD_P_CELL_ID_0) == PL111_CLCD_P_CELL_ID_0 &&
+ MmioRead8 (PL111_REG_CLCD_P_CELL_ID_1) == PL111_CLCD_P_CELL_ID_1 &&
+ MmioRead8 (PL111_REG_CLCD_P_CELL_ID_2) == PL111_CLCD_P_CELL_ID_2 &&
+ MmioRead8 (PL111_REG_CLCD_P_CELL_ID_3) == PL111_CLCD_P_CELL_ID_3) {
+ return EFI_SUCCESS;
+ }
+ return EFI_NOT_FOUND;
+}
+
+EFI_STATUS
LcdInitialize (
IN EFI_PHYSICAL_ADDRESS VramBaseAddress
)
|