X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ArmPlatformPkg%2FDrivers%2FLcdGraphicsOutputDxe%2FPL111Lcd.c;h=b5e113b844d4e4df2e35ccd880c01344b4b8b9d7;hb=c1c72a46b98159df009dfb7566cdbf49f34453ca;hp=ec1a1998244bd45f8731f5e77a503488aeb40bc9;hpb=0db25ccc6cf1d05dc6b8fd9b07d033b40c387c88;p=mirror_edk2.git diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c index ec1a199824..b5e113b844 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c @@ -1,6 +1,7 @@ /** @file PL111Lcd.c - Copyright (c) 2011, ARM Ltd. All rights reserved.
+ Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -26,27 +27,25 @@ **********************************************************************/ EFI_STATUS -PL111Indentify ( +LcdIdentify ( VOID ) { - // Check if this is a PrimeCell Peripheral - if ( ( MmioRead8( PL111_REG_CLCD_P_CELL_ID_0 ) != 0x0D ) - || ( MmioRead8( PL111_REG_CLCD_P_CELL_ID_1 ) != 0xF0 ) - || ( MmioRead8( PL111_REG_CLCD_P_CELL_ID_2 ) != 0x05 ) - || ( MmioRead8( PL111_REG_CLCD_P_CELL_ID_3 ) != 0xB1 ) ) { - return EFI_NOT_FOUND; - } - - // Check if this PrimeCell Peripheral is the PL111 LCD - if ( ( MmioRead8( PL111_REG_CLCD_PERIPH_ID_0 ) != 0x11 ) - || ( MmioRead8( PL111_REG_CLCD_PERIPH_ID_1 ) != 0x11 ) - || ( (MmioRead8( PL111_REG_CLCD_PERIPH_ID_2 ) & 0xF) != 0x04 ) - || ( MmioRead8( PL111_REG_CLCD_PERIPH_ID_3 ) != 0x00 ) ) { - return EFI_NOT_FOUND; + 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_SUCCESS; + return EFI_NOT_FOUND; } EFI_STATUS @@ -54,14 +53,6 @@ LcdInitialize ( IN EFI_PHYSICAL_ADDRESS VramBaseAddress ) { - EFI_STATUS Status = EFI_SUCCESS; - - // Check if the PL111 is fitted on this motherboard - Status = PL111Indentify (); - if (EFI_ERROR( Status )) { - return EFI_DEVICE_ERROR; - } - // Define start of the VRAM. This never changes for any graphics mode MmioWrite32(PL111_REG_LCD_UP_BASE, (UINT32) VramBaseAddress); MmioWrite32(PL111_REG_LCD_LP_BASE, 0); // We are not using a double buffer @@ -130,8 +121,6 @@ LcdShutdown ( VOID ) { - // Nothing to do in terms of hardware. - // We could switch off the monitor display if required - - //TODO: ImplementMe + // Disable the controller + MmioAnd32 (PL111_REG_LCD_CONTROL, ~PL111_CTRL_LCD_EN); }