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>
28 #define MDR1_MODE_MASK 0x07
30 volatile u8
*uart_base
;
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
)
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
43 u32 ram_start
= (u32
)&uart_shift
& 0xf8000000;
44 u32
*uart_info
= (u32
*)(ram_start
+ OMAP_UART_INFO_OFS
);
48 static inline void putc(int c
)
53 /* Check for UART 16x mode */
54 if ((uart_base
[UART_OMAP_MDR1
<< uart_shift
] & MDR1_MODE_MASK
) != 0)
57 while (!(uart_base
[UART_LSR
<< uart_shift
] & UART_LSR_THRE
))
59 uart_base
[UART_TX
<< uart_shift
] = c
;
62 static inline void flush(void)
67 * Macros to configure UART1 and debug UART
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); \
74 set_omap_uart_info(port); \
78 #define DEBUG_LL_OMAP7XX(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
82 #define DEBUG_LL_OMAP1(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
86 static inline void arch_decomp_setup(void)
91 * Initialize the port based on the machine ID from the bootloader.
92 * Note that we're using macros here instead of switch statement
93 * as machine_is functions are optimized out for the boards that
97 /* omap7xx/8xx based boards using UART1 with shift 0 */
98 DEBUG_LL_OMAP7XX(1, herald
);
99 DEBUG_LL_OMAP7XX(1, omap_perseus2
);
101 /* omap15xx/16xx based boards using UART1 */
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
);
111 /* omap15xx/16xx based boards using UART2 */
112 DEBUG_LL_OMAP1(2, omap_palmtt
);
114 /* omap15xx/16xx based boards using UART3 */
115 DEBUG_LL_OMAP1(3, sx1
);