[edk2] [PATCH v3 07/16] ArmPlatformPkg: PL111Lcd: Combine two writes to LCDControl

Girish Pathak posted 16 patches 7 years, 10 months ago
There is a newer version of this series
[edk2] [PATCH v3 07/16] ArmPlatformPkg: PL111Lcd: Combine two writes to LCDControl
Posted by Girish Pathak 7 years, 10 months ago
Currenty bit LcdPwr of the LCDControl register is enabled immediately
after setting other bits of the LCDControl register. This two write
sequence is unnecessary. This change removes this extra write by setting
LcdPwr bit along with other bits of the LcdControl register.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Girish Pathak <girish.pathak@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
 ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
index 287e3ca272c0c19f8045a3bf4e69a092d8da6fd8..465cb6845437f57d15f05a271d1b01f634e11b56 100644
--- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
+++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
@@ -137,11 +137,7 @@ LcdSetMode (
 
   // PL111_REG_LCD_CONTROL
   LcdControl = PL111_CTRL_LCD_EN | PL111_CTRL_LCD_BPP (LcdBpp) |
-               PL111_CTRL_LCD_TFT | PL111_CTRL_BGR;
-  MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl);
-
-  // Turn on power to the LCD Panel
-  LcdControl |= PL111_CTRL_LCD_PWR;
+               PL111_CTRL_LCD_TFT | PL111_CTRL_LCD_PWR | PL111_CTRL_BGR;
   MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl);
 
   return EFI_SUCCESS;
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v3 07/16] ArmPlatformPkg: PL111Lcd: Combine two writes to LCDControl
Posted by Evan Lloyd 7 years, 10 months ago
Reviewed-by: Evan Lloyd <evan.lloyd@arm.com>

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Girish
> Pathak
> Sent: 20 March 2018 16:12
> To: edk2-devel@lists.01.org
> Cc: nd <nd@arm.com>; Stephanie Hughes-Fitt <Stephanie.Hughes-
> Fitt@arm.com>; leif.lindholm@linaro.org; ard.biesheuvel@linaro.org
> Subject: [edk2] [PATCH v3 07/16] ArmPlatformPkg: PL111Lcd: Combine
> two writes to LCDControl
> 
> Currenty bit LcdPwr of the LCDControl register is enabled immediately after
> setting other bits of the LCDControl register. This two write sequence is
> unnecessary. This change removes this extra write by setting LcdPwr bit
> along with other bits of the LcdControl register.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Girish Pathak <girish.pathak@arm.com>
> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
> ---
>  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> index
> 287e3ca272c0c19f8045a3bf4e69a092d8da6fd8..465cb6845437f57d15f05
> a271d1b01f634e11b56 100644
> --- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> +++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> @@ -137,11 +137,7 @@ LcdSetMode (
> 
>    // PL111_REG_LCD_CONTROL
>    LcdControl = PL111_CTRL_LCD_EN | PL111_CTRL_LCD_BPP (LcdBpp) |
> -               PL111_CTRL_LCD_TFT | PL111_CTRL_BGR;
> -  MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl);
> -
> -  // Turn on power to the LCD Panel
> -  LcdControl |= PL111_CTRL_LCD_PWR;
> +               PL111_CTRL_LCD_TFT | PL111_CTRL_LCD_PWR |
> + PL111_CTRL_BGR;
>    MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl);
> 
>    return EFI_SUCCESS;
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
> 
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel