X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-arm%2Farch-s3c2410%2Funcompress.h;h=a6f6a0e44afaf2e818a716288fc7ba34e1316ffc;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=d7a4a8354fa9854be8a2bc23203a0336b57b93fa;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index d7a4a8354..a6f6a0e44 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h @@ -35,13 +35,13 @@ #undef S3C2410_GPIOREG #undef S3C2410_WDOGREG -#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x))) -#define S3C2410_WDOGREG(x) ((S3C2410_PA_WATCHDOG + (x))) +#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) +#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x))) /* how many bytes we allow into the FIFO at a time in FIFO mode */ #define FIFO_MAX (14) -#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) +#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) static __inline__ void uart_wr(unsigned int reg, unsigned int val) @@ -67,8 +67,7 @@ uart_rd(unsigned int reg) * waiting for tx to happen... */ -static void -putc(char ch) +static void putc(int ch) { int cpuid = S3C2410_GSTATUS1_2410; @@ -77,9 +76,6 @@ putc(char ch) cpuid &= S3C2410_GSTATUS1_IDMASK; #endif - if (ch == '\n') - putc('\r'); /* expand newline to \r\n */ - if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) { int level; @@ -101,21 +97,20 @@ putc(char ch) } else { /* not using fifos */ - while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE); + while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE) + barrier(); } /* write byte to transmission register */ uart_wr(S3C2410_UTXH, ch); } -static void -putstr(const char *ptr) +static inline void flush(void) { - for (; *ptr != '\0'; ptr++) { - putc(*ptr); - } } +#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) + /* CONFIG_S3C2410_BOOT_WATCHDOG * * Simple boot-time watchdog setup, to reboot the system if there is @@ -126,8 +121,6 @@ putstr(const char *ptr) #define WDOG_COUNT (0xff00) -#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) - static inline void arch_decomp_wdog(void) { __raw_writel(WDOG_COUNT, S3C2410_WTCNT); @@ -145,6 +138,24 @@ static void arch_decomp_wdog_start(void) #define arch_decomp_wdog() #endif +#ifdef CONFIG_S3C2410_BOOT_ERROR_RESET + +static void arch_decomp_error(const char *x) +{ + putstr("\n\n"); + putstr(x); + putstr("\n\n -- System resetting\n"); + + __raw_writel(0x4000, S3C2410_WTDAT); + __raw_writel(0x4000, S3C2410_WTCNT); + __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON); + + while(1); +} + +#define arch_error arch_decomp_error +#endif + static void error(char *err); static void