From e1003b1536091a7bdc421e05bd9eefcddd366bfe Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 10 Feb 2014 22:29:31 +0100 Subject: zen/bootloader: power down the LCD at the end of the bootloader if needed On the ZEN, the LCD is fed continuously by the DMA and this refresh needs to be stop when the bootloader gives control to the firmware, otherwise the DMA will source data from invalid region and it might even lock-up if the new code touches the memory setup. Work around this by properly stopping the LCD driver: the bootloader assumes that if the target defines HAVE_LCD_ENABLE in bootloader build (which is unusual) then it needs to stop the LCD. Since stopping the LCD could produce funny screens, power down backlight which is expected to power down the LCD too, giving a nice black screen instead of some random pixels. Change-Id: I7ce5ba9bfd08e596907c4ff8f80feb189f0576ce --- bootloader/imx233.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bootloader/imx233.c') diff --git a/bootloader/imx233.c b/bootloader/imx233.c index 6dc503bb16..1169b392aa 100644 --- a/bootloader/imx233.c +++ b/bootloader/imx233.c @@ -43,6 +43,7 @@ #include "version.h" #include "powermgmt-imx233.h" #include "partitions-imx233.h" +#include "backlight-target.h" #include "adc.h" #include "usb.h" @@ -211,6 +212,12 @@ void main(uint32_t arg, uint32_t addr) printf("Executing"); /* stop what was initialized to start from clean state */ system_prepare_fw_start(); + /* if target defines lcd_enable() in bootloader, take this as a hint that + * we should use it to properly stop the lcd before moving one, the + * _backlight_off() routine is supposed to disable the lcd at the same time */ +#ifdef HAVE_LCD_ENABLE + _backlight_off(); +#endif disable_interrupt(IRQ_FIQ_STATUS); commit_discard_idcache(); kernel_entry(); -- cgit v1.2.3