diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec index 99ca4e1822..372cf2dc09 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -100,6 +100,9 @@ # Default is set to UEFI console font format PixelBlueGreenRedReserved8BitPerColor gArmPlatformTokenSpaceGuid.PcdGopPixelFormat|0x00000001|UINT32|0x00000040 + ## If set, this will swap settings for HDLCD RED_SELECT and BLUE_SELECT registers + gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect|FALSE|BOOLEAN|0x00000045 + [PcdsFixedAtBuild.common,PcdsDynamic.common] ## PL031 RealTimeClock gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0|UINT32|0x00000024 diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/HdLcd/HdLcd.c index 96f2bf437f..5396dde3ba 100644 --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c @@ -73,6 +73,8 @@ LcdSetMode ( SCAN_TIMINGS *Horizontal; SCAN_TIMINGS *Vertical; + EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION ModeInfo; // Set the video mode timings and other relevant information @@ -96,7 +98,14 @@ LcdSetMode ( return Status; } - if (ModeInfo.PixelFormat == PixelBlueGreenRedReserved8BitPerColor) { + // By default PcdArmHdLcdSwapBlueRedSelect is set to false + // However on the Juno platform HW lines for BLUE and RED are swapped + // Therefore PcdArmHdLcdSwapBlueRedSelect is set to TRUE for the Juno platform + PixelFormat = FixedPcdGetBool (PcdArmHdLcdSwapBlueRedSelect) + ? PixelRedGreenBlueReserved8BitPerColor + : PixelBlueGreenRedReserved8BitPerColor; + + if (ModeInfo.PixelFormat == PixelFormat) { MmioWrite32 (HDLCD_REG_RED_SELECT, (8 << 8) | 16); MmioWrite32 (HDLCD_REG_BLUE_SELECT, (8 << 8) | 0); } else { diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.inf b/ArmPlatformPkg/Library/HdLcd/HdLcd.inf index 67aad05d21..7f2ba7bf1c 100644 --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.inf +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.inf @@ -2,7 +2,7 @@ # # Component description file for HDLCD module # -# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
+# Copyright (c) 2011-2018, 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 @@ -40,3 +40,5 @@ [FixedPcd] gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase + gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect +