From 0e29a2481468e238f3925343aad78d9fa6e1d4f0 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Fri, 28 Dec 2012 02:51:53 +0000 Subject: [PATCH 1/4] OMAP3: igep00x0: add CONFIG_SPL_BOARD_INIT for CONFIG_SPL_NAND_SUPPORT When booting an IGEPv2 board from NAND with SPL, U-Boot hangs trying to read the OMAP General Purpose Memory Controller (GPMC). The reason is that the GPMC initialization function is called inside spl_board_init() and this function is only executed when CONFIG_SPL_BOARD_INIT is defined. Signed-off-by: Javier Martinez Canillas Acked-by: Enric Balletbo i Serra --- include/configs/igep00x0.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h index 43dd06e246..0617a58a26 100644 --- a/include/configs/igep00x0.h +++ b/include/configs/igep00x0.h @@ -312,6 +312,7 @@ #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img" +#define CONFIG_SPL_BOARD_INIT #define CONFIG_SPL_LIBCOMMON_SUPPORT #define CONFIG_SPL_LIBDISK_SUPPORT #define CONFIG_SPL_I2C_SUPPORT From 94bcfe524cab9574f799bd2b7df9c7de2b81465a Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Wed, 2 Jan 2013 07:59:24 +0000 Subject: [PATCH 2/4] Makefile: remove MLO.byteswap on clobber On clobber, do a cleanup even for SPL build else, we'd have MLO.byteswap remaining for certain platforms like am33xx SPL builds Signed-off-by: Nishanth Menon --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a7b6cd1cba..4e64622967 100644 --- a/Makefile +++ b/Makefile @@ -869,7 +869,7 @@ clobber: tidy @rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map} @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map} @rm -f $(obj)spl/{u-boot-spl.lds,u-boot.lst} - @rm -f $(obj)MLO + @rm -f $(obj)MLO MLO.byteswap @rm -f $(obj)SPL @rm -f $(obj)tools/xway-swap-bytes @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c From 7de0fe1ac330399afc1873e11061668a93cf4fb9 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 7 Jan 2013 01:35:20 +0000 Subject: [PATCH 3/4] serial/ns16550: add an option to avoid hanging on broken platforms Some platforms (e.g. IGEPv2 board) has a broken ns16550 UART that does not set the TEMT bit when the transmitter is empty in SPL. This makes U-Boot to hang while waiting for TEMT to be set. Add a new option to avoid this: CONFIG_SYS_NS16550_BROKEN_TEMT 16550 UART set the Transmitter Empty (TEMT) Bit when all output has finished and the transmitter is totally empty. U-Boot waits for this bit to be set to initialize the serial console. On some broken platforms this bit is not set in SPL making U-Boot to hang while waiting for TEMT. Define this option to avoid it. Signed-off-by: Javier Martinez Canillas --- README | 8 ++++++++ drivers/serial/ns16550.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/README b/README index 653ef6aa4a..98dbe98c2e 100644 --- a/README +++ b/README @@ -616,6 +616,14 @@ The following options need to be configured: boot loader that has already initialized the UART. Define this variable to flush the UART at init time. + CONFIG_SYS_NS16550_BROKEN_TEMT + + 16550 UART set the Transmitter Empty (TEMT) Bit when all output + has finished and the transmitter is totally empty. U-Boot waits + for this bit to be set to initialize the serial console. On some + broken platforms this bit is not set in SPL making U-Boot to + hang while waiting for TEMT. Define this option to avoid it. + - Console Interface: Depending on board, define exactly one serial port diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index bbd91ca247..87a0917086 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -36,8 +36,10 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) { +#if (!defined(CONFIG_SYS_NS16550_BROKEN_TEMT)) while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT)) ; +#endif serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier); #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \ From 039cbaefcf57338cc9b6a3c656db64e7907838db Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 7 Jan 2013 01:35:21 +0000 Subject: [PATCH 4/4] OMAP3: igep00x0: add CONFIG_SYS_NS16550_BROKEN_TEMT IGEP board PC16550D (ns16550) UART doesn't set the Transmitter Empty (TEMT) Bit in SPL. This makes U-Boot to hang while waiting for TEMT. Add the CONFIG_SYS_NS16550_BROKEN_TEMT config option to avoid this issue. Signed-off-by: Javier Martinez Canillas --- include/configs/igep00x0.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h index 0617a58a26..f8131b1baf 100644 --- a/include/configs/igep00x0.h +++ b/include/configs/igep00x0.h @@ -67,6 +67,9 @@ #define CONFIG_SYS_NS16550_REG_SIZE (-4) #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK +/* define to avoid U-Boot to hang while waiting for TEMT */ +#define CONFIG_SYS_NS16550_BROKEN_TEMT + /* select serial console configuration */ #define CONFIG_CONS_INDEX 3 #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3