]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
a09e64fb | 2 | * arch/arm/plat-omap/include/mach/uncompress.h |
1da177e4 LT |
3 | * |
4 | * Serial port stubs for kernel decompress status messages | |
5 | * | |
6 | * Initially based on: | |
a09e64fb | 7 | * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h |
1da177e4 LT |
8 | * Copyright (C) 2000 RidgeRun, Inc. |
9 | * Author: Greg Lonnon <glonnon@ridgerun.com> | |
10 | * | |
11 | * Rewritten by: | |
12 | * Author: <source@mvista.com> | |
13 | * 2004 (c) MontaVista Software, Inc. | |
14 | * | |
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. | |
18 | */ | |
19 | ||
1da177e4 LT |
20 | #include <linux/types.h> |
21 | #include <linux/serial_reg.h> | |
ce491cf8 | 22 | #include <plat/serial.h> |
1da177e4 LT |
23 | |
24 | unsigned int system_rev; | |
25 | ||
26 | #define UART_OMAP_MDR1 0x08 /* mode definition register */ | |
27 | #define OMAP_ID_730 0x355F | |
f8631e7b | 28 | #define OMAP_ID_850 0x362C |
1da177e4 LT |
29 | #define ID_MASK 0x7fff |
30 | #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0) | |
31 | #define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK | |
32 | ||
a081568d | 33 | static void putc(int c) |
1da177e4 LT |
34 | { |
35 | volatile u8 * uart = 0; | |
9839c6b8 | 36 | int shift = 2; |
1da177e4 | 37 | |
9ad5897c TL |
38 | #ifdef CONFIG_MACH_OMAP_PALMTE |
39 | return; | |
40 | #endif | |
41 | ||
9839c6b8 | 42 | #ifdef CONFIG_ARCH_OMAP |
4f2c49fe | 43 | /* Will get removed in the next patch, set to OMAP3 to compile */ |
1da177e4 | 44 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 |
4f2c49fe | 45 | uart = (volatile u8 *)(OMAP3_UART3_BASE); |
9ad5897c | 46 | #elif defined(CONFIG_OMAP_LL_DEBUG_UART2) |
4f2c49fe | 47 | uart = (volatile u8 *)(OMAP3_UART2_BASE); |
d9f50074 | 48 | #elif defined(CONFIG_OMAP_LL_DEBUG_UART1) |
4f2c49fe | 49 | uart = (volatile u8 *)(OMAP3_UART1_BASE); |
d9f50074 | 50 | #elif defined(CONFIG_OMAP_LL_DEBUG_NONE) |
51 | return; | |
52 | #else | |
53 | return; | |
1da177e4 LT |
54 | #endif |
55 | ||
9839c6b8 | 56 | #ifdef CONFIG_ARCH_OMAP1 |
1da177e4 LT |
57 | /* Determine which serial port to use */ |
58 | do { | |
59 | /* MMU is not on, so cpu_is_omapXXXX() won't work here */ | |
60 | unsigned int omap_id = omap_get_id(); | |
61 | ||
f8631e7b | 62 | if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850) |
1da177e4 | 63 | shift = 0; |
1da177e4 LT |
64 | |
65 | if (check_port(uart, shift)) | |
66 | break; | |
67 | /* Silent boot if no serial ports are enabled. */ | |
68 | return; | |
69 | } while (0); | |
9839c6b8 TL |
70 | #endif /* CONFIG_ARCH_OMAP1 */ |
71 | #endif | |
1da177e4 LT |
72 | |
73 | /* | |
74 | * Now, xmit each character | |
75 | */ | |
a081568d RK |
76 | while (!(uart[UART_LSR << shift] & UART_LSR_THRE)) |
77 | barrier(); | |
78 | uart[UART_TX << shift] = c; | |
79 | } | |
80 | ||
81 | static inline void flush(void) | |
82 | { | |
1da177e4 LT |
83 | } |
84 | ||
85 | /* | |
86 | * nothing to do | |
87 | */ | |
88 | #define arch_decomp_setup() | |
89 | #define arch_decomp_wdog() |