2 * arch/arm/plat-omap/include/mach/uncompress.h
4 * Serial port stubs for kernel decompress status messages
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
20 #include <linux/types.h>
21 #include <linux/serial_reg.h>
23 #include <asm/memory.h>
24 #include <asm/mach-types.h>
26 #include <plat/serial.h>
28 static volatile u8 *uart_base;
29 static int uart_shift;
32 * Store the DEBUG_LL uart number into memory.
33 * See also debug-macro.S, and serial.c for related code.
35 static void set_omap_uart_info(unsigned char port)
37 *(volatile u32 *)OMAP_UART_INFO = port;
40 static void putc(int c)
45 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
47 uart_base[UART_TX << uart_shift] = c;
50 static inline void flush(void)
55 * Macros to configure UART1 and debug UART
57 #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
58 if (machine_is_##mach()) { \
59 uart_base = (volatile u8 *)(dbg_uart); \
60 uart_shift = (dbg_shft); \
62 set_omap_uart_info(port); \
66 #define DEBUG_LL_OMAP7XX(p, mach) \
67 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
70 #define DEBUG_LL_OMAP1(p, mach) \
71 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
74 #define DEBUG_LL_OMAP2(p, mach) \
75 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
78 #define DEBUG_LL_OMAP3(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
82 #define DEBUG_LL_OMAP4(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
86 /* Zoom2/3 shift is different for UART1 and external port */
87 #define DEBUG_LL_ZOOM(mach) \
88 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
90 static inline void __arch_decomp_setup(unsigned long arch_id)
95 * Initialize the port based on the machine ID from the bootloader.
96 * Note that we're using macros here instead of switch statement
97 * as machine_is functions are optimized out for the boards that
101 /* omap7xx/8xx based boards using UART1 with shift 0 */
102 DEBUG_LL_OMAP7XX(1, herald);
103 DEBUG_LL_OMAP7XX(1, omap_perseus2);
105 /* omap15xx/16xx based boards using UART1 */
106 DEBUG_LL_OMAP1(1, ams_delta);
107 DEBUG_LL_OMAP1(1, nokia770);
108 DEBUG_LL_OMAP1(1, omap_h2);
109 DEBUG_LL_OMAP1(1, omap_h3);
110 DEBUG_LL_OMAP1(1, omap_innovator);
111 DEBUG_LL_OMAP1(1, omap_osk);
112 DEBUG_LL_OMAP1(1, omap_palmte);
113 DEBUG_LL_OMAP1(1, omap_palmz71);
115 /* omap15xx/16xx based boards using UART2 */
116 DEBUG_LL_OMAP1(2, omap_palmtt);
118 /* omap15xx/16xx based boards using UART3 */
119 DEBUG_LL_OMAP1(3, sx1);
121 /* omap2 based boards using UART1 */
122 DEBUG_LL_OMAP2(1, omap2evm);
123 DEBUG_LL_OMAP2(1, omap_2430sdp);
124 DEBUG_LL_OMAP2(1, omap_apollon);
125 DEBUG_LL_OMAP2(1, omap_h4);
127 /* omap2 based boards using UART3 */
128 DEBUG_LL_OMAP2(3, nokia_n800);
129 DEBUG_LL_OMAP2(3, nokia_n810);
130 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
132 /* omap3 based boards using UART1 */
133 DEBUG_LL_OMAP2(1, omap3evm);
134 DEBUG_LL_OMAP3(1, omap_3430sdp);
135 DEBUG_LL_OMAP3(1, omap_3630sdp);
137 /* omap3 based boards using UART3 */
138 DEBUG_LL_OMAP3(3, cm_t35);
139 DEBUG_LL_OMAP3(3, igep0020);
140 DEBUG_LL_OMAP3(3, nokia_rx51);
141 DEBUG_LL_OMAP3(3, omap3517evm);
142 DEBUG_LL_OMAP3(3, omap3_beagle);
143 DEBUG_LL_OMAP3(3, omap3_pandora);
144 DEBUG_LL_OMAP3(3, omap_ldp);
145 DEBUG_LL_OMAP3(3, overo);
146 DEBUG_LL_OMAP3(3, touchbook);
148 /* omap4 based boards using UART3 */
149 DEBUG_LL_OMAP4(3, omap_4430sdp);
151 /* zoom2/3 external uart */
152 DEBUG_LL_ZOOM(omap_zoom2);
153 DEBUG_LL_ZOOM(omap_zoom3);
158 #define arch_decomp_setup() __arch_decomp_setup(arch_id)
163 #define arch_decomp_wdog()