-/** @file PL111Lcd.c\r
+/** @file\r
\r
- Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
#include "PL111Lcd.h"\r
\r
-/**********************************************************************\r
- *\r
- * This file contains all the bits of the PL111 that are\r
- * platform independent.\r
- *\r
- **********************************************************************/\r
+/** This file contains all the bits of the PL111 that are\r
+ platform independent.\r
\r
+**/\r
EFI_STATUS\r
LcdIdentify (\r
VOID\r
)\r
{\r
// Define start of the VRAM. This never changes for any graphics mode\r
- MmioWrite32(PL111_REG_LCD_UP_BASE, (UINT32) VramBaseAddress);\r
- MmioWrite32(PL111_REG_LCD_LP_BASE, 0); // We are not using a double buffer\r
+ MmioWrite32 (PL111_REG_LCD_UP_BASE, (UINT32)VramBaseAddress);\r
+ MmioWrite32 (PL111_REG_LCD_LP_BASE, 0); // We are not using a double buffer\r
\r
// Disable all interrupts from the PL111\r
- MmioWrite32(PL111_REG_LCD_IMSC, 0);\r
+ MmioWrite32 (PL111_REG_LCD_IMSC, 0);\r
\r
return EFI_SUCCESS;\r
}\r
LCD_BPP LcdBpp;\r
\r
// Set the video mode timings and other relevant information\r
- Status = LcdPlatformGetTimings (ModeNumber,\r
- &HRes,&HSync,&HBackPorch,&HFrontPorch,\r
- &VRes,&VSync,&VBackPorch,&VFrontPorch);\r
+ Status = LcdPlatformGetTimings (\r
+ ModeNumber,\r
+ &HRes,\r
+ &HSync,\r
+ &HBackPorch,\r
+ &HFrontPorch,\r
+ &VRes,\r
+ &VSync,\r
+ &VBackPorch,\r
+ &VFrontPorch\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
- if (EFI_ERROR( Status )) {\r
+ if (EFI_ERROR (Status)) {\r
return EFI_DEVICE_ERROR;\r
}\r
\r
- Status = LcdPlatformGetBpp (ModeNumber,&LcdBpp);\r
+ Status = LcdPlatformGetBpp (ModeNumber, &LcdBpp);\r
ASSERT_EFI_ERROR (Status);\r
- if (EFI_ERROR( Status )) {\r
+ if (EFI_ERROR (Status)) {\r
return EFI_DEVICE_ERROR;\r
}\r
\r
// Disable the CLCD_LcdEn bit\r
- LcdControl = MmioRead32( PL111_REG_LCD_CONTROL);\r
- MmioWrite32(PL111_REG_LCD_CONTROL, LcdControl & ~1);\r
+ LcdControl = MmioRead32 (PL111_REG_LCD_CONTROL);\r
+ MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl & ~1);\r
\r
// Set Timings\r
- MmioWrite32 (PL111_REG_LCD_TIMING_0, HOR_AXIS_PANEL(HBackPorch, HFrontPorch, HSync, HRes));\r
- MmioWrite32 (PL111_REG_LCD_TIMING_1, VER_AXIS_PANEL(VBackPorch, VFrontPorch, VSync, VRes));\r
- MmioWrite32 (PL111_REG_LCD_TIMING_2, CLK_SIG_POLARITY(HRes));\r
+ MmioWrite32 (\r
+ PL111_REG_LCD_TIMING_0,\r
+ HOR_AXIS_PANEL (HBackPorch, HFrontPorch, HSync, HRes)\r
+ );\r
+\r
+ MmioWrite32 (\r
+ PL111_REG_LCD_TIMING_1,\r
+ VER_AXIS_PANEL (VBackPorch, VFrontPorch, VSync, VRes)\r
+ );\r
+\r
+ MmioWrite32 (PL111_REG_LCD_TIMING_2, CLK_SIG_POLARITY (HRes));\r
MmioWrite32 (PL111_REG_LCD_TIMING_3, 0);\r
\r
// PL111_REG_LCD_CONTROL\r
- LcdControl = PL111_CTRL_LCD_EN | PL111_CTRL_LCD_BPP(LcdBpp) | PL111_CTRL_LCD_TFT | PL111_CTRL_BGR;\r
- MmioWrite32(PL111_REG_LCD_CONTROL, LcdControl);\r
+ LcdControl = PL111_CTRL_LCD_EN | PL111_CTRL_LCD_BPP (LcdBpp) |\r
+ PL111_CTRL_LCD_TFT | PL111_CTRL_BGR;\r
+ MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl);\r
\r
// Turn on power to the LCD Panel\r
LcdControl |= PL111_CTRL_LCD_PWR;\r
- MmioWrite32(PL111_REG_LCD_CONTROL, LcdControl);\r
+ MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl);\r
\r
return EFI_SUCCESS;\r
}\r