Skip to content

Commit

Permalink
[ARM] S3C: Add UART FIFO selection during arch decompression
Browse files Browse the repository at this point in the history
Add a configuration option to start the UART FIFOs during the
decompressions sequence to improve boot time when the bootloader
fails to enable the UART FIFOs.

For example, the SMDK6410 UBoot 1.1.6 leaves the FIFOs off.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Ben Dooks committed Dec 16, 2008
1 parent 7d2dbcf commit e7aa6f4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/arm/plat-s3c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/plat-s3c/include/plat/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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();
}


Expand Down

0 comments on commit e7aa6f4

Please sign in to comment.