blob: ca2c8bec82e7d299a1f8fbf94465f68f1a090b80 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/include/asm-arm/arch-omap/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/include/asm-arm/arch-omap1510/uncompress.h
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
20#include <linux/config.h>
21#include <linux/types.h>
22#include <linux/serial_reg.h>
Tony Lindgren9839c6b2005-09-07 17:20:27 +010023#include <asm/arch/serial.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
25unsigned int system_rev;
26
27#define UART_OMAP_MDR1 0x08 /* mode definition register */
28#define OMAP_ID_730 0x355F
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
Russell Kinga0815682006-03-28 10:24:33 +010033static void putc(int c)
Linus Torvalds1da177e2005-04-16 15:20:36 -070034{
35 volatile u8 * uart = 0;
Tony Lindgren9839c6b2005-09-07 17:20:27 +010036 int shift = 2;
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Tony Lindgren9ad58972005-11-10 14:26:53 +000038#ifdef CONFIG_MACH_OMAP_PALMTE
39 return;
40#endif
41
Tony Lindgren9839c6b2005-09-07 17:20:27 +010042#ifdef CONFIG_ARCH_OMAP
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#ifdef CONFIG_OMAP_LL_DEBUG_UART3
44 uart = (volatile u8 *)(OMAP_UART3_BASE);
Tony Lindgren9ad58972005-11-10 14:26:53 +000045#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 uart = (volatile u8 *)(OMAP_UART2_BASE);
47#else
48 uart = (volatile u8 *)(OMAP_UART1_BASE);
49#endif
50
Tony Lindgren9839c6b2005-09-07 17:20:27 +010051#ifdef CONFIG_ARCH_OMAP1
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 /* Determine which serial port to use */
53 do {
54 /* MMU is not on, so cpu_is_omapXXXX() won't work here */
55 unsigned int omap_id = omap_get_id();
56
57 if (omap_id == OMAP_ID_730)
58 shift = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
60 if (check_port(uart, shift))
61 break;
62 /* Silent boot if no serial ports are enabled. */
63 return;
64 } while (0);
Tony Lindgren9839c6b2005-09-07 17:20:27 +010065#endif /* CONFIG_ARCH_OMAP1 */
66#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
68 /*
69 * Now, xmit each character
70 */
Russell Kinga0815682006-03-28 10:24:33 +010071 while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
72 barrier();
73 uart[UART_TX << shift] = c;
74}
75
76static inline void flush(void)
77{
Linus Torvalds1da177e2005-04-16 15:20:36 -070078}
79
80/*
81 * nothing to do
82 */
83#define arch_decomp_setup()
84#define arch_decomp_wdog()