This source file includes following definitions.
- set_omap_uart_info
- putc
- flush
- arch_decomp_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include <linux/types.h>
21 #include <linux/serial_reg.h>
22
23 #include <asm/memory.h>
24 #include <asm/mach-types.h>
25
26 #include "serial.h"
27
28 #define MDR1_MODE_MASK 0x07
29
30 volatile u8 *uart_base;
31 int uart_shift;
32
33
34
35
36
37 static void set_omap_uart_info(unsigned char port)
38 {
39
40
41
42
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46 }
47
48 static inline void putc(int c)
49 {
50 if (!uart_base)
51 return;
52
53
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60 }
61
62 static inline void flush(void)
63 {
64 }
65
66
67
68
69 #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78 #define DEBUG_LL_OMAP7XX(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
80 OMAP1UART##p)
81
82 #define DEBUG_LL_OMAP1(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP1UART##p)
85
86 static inline void arch_decomp_setup(void)
87 {
88 int port = 0;
89
90
91
92
93
94
95
96 do {
97
98 DEBUG_LL_OMAP7XX(1, herald);
99 DEBUG_LL_OMAP7XX(1, omap_perseus2);
100
101
102 DEBUG_LL_OMAP1(1, ams_delta);
103 DEBUG_LL_OMAP1(1, nokia770);
104 DEBUG_LL_OMAP1(1, omap_h2);
105 DEBUG_LL_OMAP1(1, omap_h3);
106 DEBUG_LL_OMAP1(1, omap_innovator);
107 DEBUG_LL_OMAP1(1, omap_osk);
108 DEBUG_LL_OMAP1(1, omap_palmte);
109 DEBUG_LL_OMAP1(1, omap_palmz71);
110
111
112 DEBUG_LL_OMAP1(2, omap_palmtt);
113
114
115 DEBUG_LL_OMAP1(3, sx1);
116 } while (0);
117 }