X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-arm%2Farch-s3c2410%2Funcompress.h;h=fa240af7f591c76a839fa483775dcc5bbabeef78;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=023f22b14378894cd133d08b76067e445e87cf58;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index 023f22b14..fa240af7f 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h @@ -13,24 +13,29 @@ * 22-May-2003 BJD Created * 08-Sep-2003 BJD Moved to linux v2.6 * 12-Mar-2004 BJD Updated header protection + * 12-Oct-2004 BJD Take account of debug uart configuration + * 15-Nov-2004 BJD Fixed uart configuration */ #ifndef __ASM_ARCH_UNCOMPRESS_H #define __ASM_ARCH_UNCOMPRESS_H +#include + /* defines for UART registers */ #include "asm/arch/regs-serial.h" +#include "asm/arch/regs-gpio.h" #include +/* working in physical space... */ +#undef S3C2410_GPIOREG +#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x))) + /* how many bytes we allow into the FIFO at a time in FIFO mode */ #define FIFO_MAX (14) -#if 1 -#define uart_base S3C2410_PA_UART -#else -static unsigned int uart_base = S3C2410_PA_UART; -#endif +#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) static __inline__ void uart_wr(unsigned int reg, unsigned int val) @@ -74,6 +79,10 @@ arch_decomp_setup(void) static void putc(char ch) { + int cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); + + cpuid &= S3C2410_GSTATUS1_IDMASK; + if (ch == '\n') putc('\r'); /* expand newline to \r\n */ @@ -82,8 +91,14 @@ putc(char ch) while (1) { level = uart_rd(S3C2410_UFSTAT); - level &= S3C2410_UFSTAT_TXMASK; - level >>= S3C2410_UFSTAT_TXSHIFT; + + if (cpuid == S3C2410_GSTATUS1_2440) { + level &= S3C2440_UFSTAT_TXMASK; + level >>= S3C2440_UFSTAT_TXSHIFT; + } else { + level &= S3C2410_UFSTAT_TXMASK; + level >>= S3C2410_UFSTAT_TXSHIFT; + } if (level < FIFO_MAX) break; @@ -92,7 +107,7 @@ putc(char ch) } else { /* not using fifos */ - while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE) != S3C2410_UTRSTAT_TXFE); + while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE); } /* write byte to transmission register */