Root/
Source at commit c1baa36bbe91835b415af6ae89c43ec67d49cb4d created 12 years 2 months ago. By LluĂs Batlle i Rossell, MIPS: Enable vmlinuz for JZ4740 | |
---|---|
1 | /* |
2 | * 16550 compatible uart based serial debug support for zboot |
3 | */ |
4 | |
5 | #include <linux/types.h> |
6 | #include <linux/serial_reg.h> |
7 | #include <linux/init.h> |
8 | |
9 | #include <asm/addrspace.h> |
10 | |
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 |
15 | |
16 | #ifdef CONFIG_AR7 |
17 | #include <ar7.h> |
18 | #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset)) |
19 | #endif |
20 | |
21 | #ifdef CONFIG_MACH_JZ4740 |
22 | #define UART0_BASE 0xB0030000 |
23 | #define PORT(offset) (UART0_BASE + (4 * offset)) |
24 | #endif |
25 | |
26 | #ifndef PORT |
27 | #error please define the serial port address for your own machine |
28 | #endif |
29 | |
30 | static inline unsigned int serial_in(int offset) |
31 | { |
32 | return *((char *)PORT(offset)); |
33 | } |
34 | |
35 | static inline void serial_out(int offset, int value) |
36 | { |
37 | *((char *)PORT(offset)) = value; |
38 | } |
39 | |
40 | void putc(char c) |
41 | { |
42 | int timeout = 1024; |
43 | |
44 | while (((serial_in(UART_LSR) & UART_LSR_THRE) == 0) && (timeout-- > 0)) |
45 | ; |
46 | |
47 | serial_out(UART_TX, c); |
48 | } |
49 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9