llc2: Remove dead code for state machine
[linux/fpc-iii.git] / arch / mips / boot / compressed / uart-16550.c
blob1c7b739b6a1dfcc9383e403307fbca269f3d43a6
1 /*
2 * 16550 compatible uart based serial debug support for zboot
3 */
5 #include <linux/types.h>
6 #include <linux/serial_reg.h>
7 #include <linux/init.h>
9 #include <asm/addrspace.h>
11 #if defined(CONFIG_MACH_LOONGSON) || defined(CONFIG_MIPS_MALTA)
12 #define UART_BASE 0x1fd003f8
13 #define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset))
14 #endif
16 #ifdef CONFIG_AR7
17 #include <ar7.h>
18 #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
19 #endif
21 #ifdef CONFIG_MACH_JZ4740
22 #define UART0_BASE 0xB0030000
23 #define PORT(offset) (UART0_BASE + (4 * offset))
24 #endif
26 #ifndef PORT
27 #error please define the serial port address for your own machine
28 #endif
30 static inline unsigned int serial_in(int offset)
32 return *((char *)PORT(offset));
35 static inline void serial_out(int offset, int value)
37 *((char *)PORT(offset)) = value;
40 void putc(char c)
42 int timeout = 1024;
44 while (((serial_in(UART_LSR) & UART_LSR_THRE) == 0) && (timeout-- > 0))
47 serial_out(UART_TX, c);