2 * Arch specific code for Ralink based boards
4 * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
14 #define READREG(r) *(volatile unsigned int *)(r)
15 #define WRITEREG(r,v) *(volatile unsigned int *)(r) = v
17 #define KSEG1ADDR(_x) (((_x) & 0x1fffffff) | 0xa0000000)
19 #ifdef CONFIG_SOC_RT288X
20 #define UART_BASE 0xb0300c00
22 #define UART_BASE 0xb0000c00
28 #define UART_LSR_THRE 0x20
30 #define UART_READ(r) READREG(UART_BASE + 4 * (r))
31 #define UART_WRITE(r,v) WRITEREG(UART_BASE + 4 * (r), (v))
33 void board_putc(int ch)
35 while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
36 UART_WRITE(UART_TX, ch);
37 while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);