From 638dffc01d2d3fc19cf61d883175ef56bb0de015 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 2 Dec 2008 19:34:52 +0000 Subject: [PATCH] --- yaml --- r: 123822 b: refs/heads/master c: e7aa6f46f6e4644d466e04f54b5750a91d188abf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/plat-s3c/Kconfig | 8 ++++++ .../arm/plat-s3c/include/plat/uncompress.h | 28 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 10f47e9bd46a..77a996924578 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7d2dbcf9faad074c52a941d01fc21eea3c95ca33 +refs/heads/master: e7aa6f46f6e4644d466e04f54b5750a91d188abf diff --git a/trunk/arch/arm/plat-s3c/Kconfig b/trunk/arch/arm/plat-s3c/Kconfig index 31656c33e05e..10c1dd3cd463 100644 --- a/trunk/arch/arm/plat-s3c/Kconfig +++ b/trunk/arch/arm/plat-s3c/Kconfig @@ -57,6 +57,14 @@ config S3C_BOOT_ERROR_RESET Say y here to use the watchdog to reset the system if the kernel decompressor detects an error during decompression. +config S3C_BOOT_UART_FORCE_FIFO + bool "Force UART FIFO on during boot process" + depends on PLAT_S3C + default y + help + Say Y here to force the UART FIFOs on during the kernel + uncompressor + comment "Power management" config S3C2410_PM_DEBUG diff --git a/trunk/arch/arm/plat-s3c/include/plat/uncompress.h b/trunk/arch/arm/plat-s3c/include/plat/uncompress.h index 8a8a927292e0..2c39a309aeb0 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/uncompress.h +++ b/trunk/arch/arm/plat-s3c/include/plat/uncompress.h @@ -139,6 +139,28 @@ static void arch_decomp_error(const char *x) static void error(char *err); +#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO +static inline void arch_enable_uart_fifo(void) +{ + u32 fifocon = uart_rd(S3C2410_UFCON); + + if (!(fifocon & S3C2410_UFCON_FIFOMODE)) { + fifocon |= S3C2410_UFCON_RESETBOTH; + uart_wr(S3C2410_UFCON, fifocon); + + /* wait for fifo reset to complete */ + while (1) { + fifocon = uart_rd(S3C2410_UFCON); + if (!(fifocon & S3C2410_UFCON_RESETBOTH)) + break; + } + } +} +#else +#define arch_enable_uart_fifo() do { } while(0) +#endif + + static void arch_decomp_setup(void) { @@ -149,6 +171,12 @@ arch_decomp_setup(void) arch_detect_cpu(); arch_decomp_wdog_start(); + + /* Enable the UART FIFOs if they where not enabled and our + * configuration says we should turn them on. + */ + + arch_enable_uart_fifo(); }