| * 16550 compatible uart based serial debug support for zboot |
| #include <linux/serial_reg.h> |
| #include <asm/addrspace.h> |
| #if defined(CONFIG_MACH_LOONGSON64) || defined(CONFIG_MIPS_MALTA) |
| #define UART_BASE 0x1fd003f8 |
| #define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset)) |
| #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset)) |
| #ifdef CONFIG_MACH_JZ4740 |
| #include <asm/mach-jz4740/base.h> |
| #define PORT(offset) (CKSEG1ADDR(JZ4740_UART0_BASE_ADDR) + (4 * offset)) |
| #define UART0_BASE 0x1EF14000 |
| #define PORT(offset) (CKSEG1ADDR(UART0_BASE) + (4 * offset)) |
| #define IOTYPE unsigned int |
| #define UART0_BASE 0x18030100 |
| #define PORT(offset) (CKSEG1ADDR(UART0_BASE) + (4 * offset)) |
| #define IOTYPE unsigned int |
| #error please define the serial port address for your own machine |
| static inline unsigned int serial_in(int offset) |
| return *((volatile IOTYPE *)PORT(offset)) & 0xFF; |
| static inline void serial_out(int offset, int value) |
| *((volatile IOTYPE *)PORT(offset)) = value & 0xFF; |
| while (((serial_in(UART_LSR) & UART_LSR_THRE) == 0) && (timeout-- > 0)) |