Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / arch / arm / plat-omap / include / plat / uncompress.h
bloba067484cc4a245c3dd28a3af46ec0ca3426f46d0
1 /*
2 * arch/arm/plat-omap/include/mach/uncompress.h
4 * Serial port stubs for kernel decompress status messages
6 * Initially based on:
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>
11 * Rewritten by:
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 #define MDR1_MODE_MASK 0x07
30 volatile u8 *uart_base;
31 int uart_shift;
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
37 static void set_omap_uart_info(unsigned char port)
39 *(volatile u32 *)OMAP_UART_INFO = port;
42 static void putc(int c)
44 if (!uart_base)
45 return;
47 /* Check for UART 16x mode */
48 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
49 return;
51 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
52 barrier();
53 uart_base[UART_TX << uart_shift] = c;
56 static inline void flush(void)
61 * Macros to configure UART1 and debug UART
63 #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
64 if (machine_is_##mach()) { \
65 uart_base = (volatile u8 *)(dbg_uart); \
66 uart_shift = (dbg_shft); \
67 port = (dbg_id); \
68 set_omap_uart_info(port); \
69 break; \
72 #define DEBUG_LL_OMAP7XX(p, mach) \
73 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
74 OMAP1UART##p)
76 #define DEBUG_LL_OMAP1(p, mach) \
77 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
78 OMAP1UART##p)
80 #define DEBUG_LL_OMAP2(p, mach) \
81 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
82 OMAP2UART##p)
84 #define DEBUG_LL_OMAP3(p, mach) \
85 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
86 OMAP3UART##p)
88 #define DEBUG_LL_OMAP4(p, mach) \
89 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
90 OMAP4UART##p)
92 /* Zoom2/3 shift is different for UART1 and external port */
93 #define DEBUG_LL_ZOOM(mach) \
94 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
96 #define DEBUG_LL_TI816X(p, mach) \
97 _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT, \
98 TI816XUART##p)
100 static inline void __arch_decomp_setup(unsigned long arch_id)
102 int port = 0;
105 * Initialize the port based on the machine ID from the bootloader.
106 * Note that we're using macros here instead of switch statement
107 * as machine_is functions are optimized out for the boards that
108 * are not selected.
110 do {
111 /* omap7xx/8xx based boards using UART1 with shift 0 */
112 DEBUG_LL_OMAP7XX(1, herald);
113 DEBUG_LL_OMAP7XX(1, omap_perseus2);
115 /* omap15xx/16xx based boards using UART1 */
116 DEBUG_LL_OMAP1(1, ams_delta);
117 DEBUG_LL_OMAP1(1, nokia770);
118 DEBUG_LL_OMAP1(1, omap_h2);
119 DEBUG_LL_OMAP1(1, omap_h3);
120 DEBUG_LL_OMAP1(1, omap_innovator);
121 DEBUG_LL_OMAP1(1, omap_osk);
122 DEBUG_LL_OMAP1(1, omap_palmte);
123 DEBUG_LL_OMAP1(1, omap_palmz71);
125 /* omap15xx/16xx based boards using UART2 */
126 DEBUG_LL_OMAP1(2, omap_palmtt);
128 /* omap15xx/16xx based boards using UART3 */
129 DEBUG_LL_OMAP1(3, sx1);
131 /* omap2 based boards using UART1 */
132 DEBUG_LL_OMAP2(1, omap_2430sdp);
133 DEBUG_LL_OMAP2(1, omap_apollon);
134 DEBUG_LL_OMAP2(1, omap_h4);
136 /* omap2 based boards using UART3 */
137 DEBUG_LL_OMAP2(3, nokia_n800);
138 DEBUG_LL_OMAP2(3, nokia_n810);
139 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
141 /* omap3 based boards using UART1 */
142 DEBUG_LL_OMAP2(1, omap3evm);
143 DEBUG_LL_OMAP3(1, omap_3430sdp);
144 DEBUG_LL_OMAP3(1, omap_3630sdp);
145 DEBUG_LL_OMAP3(1, omap3530_lv_som);
146 DEBUG_LL_OMAP3(1, omap3_torpedo);
148 /* omap3 based boards using UART3 */
149 DEBUG_LL_OMAP3(3, cm_t35);
150 DEBUG_LL_OMAP3(3, cm_t3517);
151 DEBUG_LL_OMAP3(3, cm_t3730);
152 DEBUG_LL_OMAP3(3, craneboard);
153 DEBUG_LL_OMAP3(3, devkit8000);
154 DEBUG_LL_OMAP3(3, igep0020);
155 DEBUG_LL_OMAP3(3, igep0030);
156 DEBUG_LL_OMAP3(3, nokia_rm680);
157 DEBUG_LL_OMAP3(3, nokia_rx51);
158 DEBUG_LL_OMAP3(3, omap3517evm);
159 DEBUG_LL_OMAP3(3, omap3_beagle);
160 DEBUG_LL_OMAP3(3, omap3_pandora);
161 DEBUG_LL_OMAP3(3, omap_ldp);
162 DEBUG_LL_OMAP3(3, overo);
163 DEBUG_LL_OMAP3(3, touchbook);
165 /* omap4 based boards using UART3 */
166 DEBUG_LL_OMAP4(3, omap_4430sdp);
167 DEBUG_LL_OMAP4(3, omap4_panda);
169 /* zoom2/3 external uart */
170 DEBUG_LL_ZOOM(omap_zoom2);
171 DEBUG_LL_ZOOM(omap_zoom3);
173 /* TI8168 base boards using UART3 */
174 DEBUG_LL_TI816X(3, ti8168evm);
176 } while (0);
179 #define arch_decomp_setup() __arch_decomp_setup(arch_id)
182 * nothing to do
184 #define arch_decomp_wdog()