2 * 16550 compatible uart based serial debug support for zboot
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))
18 #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
22 #error please define the serial port address for your own machine
25 static inline unsigned int serial_in(int offset
)
27 return *((char *)PORT(offset
));
30 static inline void serial_out(int offset
, int value
)
32 *((char *)PORT(offset
)) = value
;
39 while (((serial_in(UART_LSR
) & UART_LSR_THRE
) == 0) && (timeout
-- > 0))
42 serial_out(UART_TX
, c
);