1 /* linux/include/asm-arm/arch-s3c2410/uncompress.h
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * S3C2410 - uncompress code
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 * 22-May-2003 BJD Created
14 * 08-Sep-2003 BJD Moved to linux v2.6
15 * 12-Mar-2004 BJD Updated header protection
18 #ifndef __ASM_ARCH_UNCOMPRESS_H
19 #define __ASM_ARCH_UNCOMPRESS_H
21 /* defines for UART registers */
22 #include "asm/arch/regs-serial.h"
24 #include <asm/arch/map.h>
26 /* how many bytes we allow into the FIFO at a time in FIFO mode */
30 #define uart_base S3C2410_PA_UART
32 static unsigned int uart_base = S3C2410_PA_UART;
35 static __inline__ void
36 uart_wr(unsigned int reg, unsigned int val)
38 volatile unsigned int *ptr;
40 ptr = (volatile unsigned int *)(reg + uart_base);
44 static __inline__ unsigned int
45 uart_rd(unsigned int reg)
47 volatile unsigned int *ptr;
49 ptr = (volatile unsigned int *)(reg + uart_base);
54 /* currently we do not need the watchdog... */
55 #define arch_decomp_wdog()
58 static void error(char *err);
61 arch_decomp_setup(void)
63 /* we may need to setup the uart(s) here if we are not running
64 * on an BAST... the BAST will have left the uarts configured
65 * after calling linux.
69 /* we can deal with the case the UARTs are being run
70 * in FIFO mode, so that we don't hold up our execution
71 * waiting for tx to happen...
78 putc('\r'); /* expand newline to \r\n */
80 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
84 level = uart_rd(S3C2410_UFSTAT);
85 level &= S3C2410_UFSTAT_TXMASK;
86 level >>= S3C2410_UFSTAT_TXSHIFT;
95 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE) != S3C2410_UTRSTAT_TXFE);
98 /* write byte to transmission register */
99 uart_wr(S3C2410_UTXH, ch);
103 putstr(const char *ptr)
105 for (; *ptr != '\0'; ptr++) {
110 #endif /* __ASM_ARCH_UNCOMPRESS_H */