ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-arm / arch-omap / uncompress.h
1 /*
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>
23 #include <asm/mach-types.h>
24 #include <asm/hardware.h>
25 #include <asm/arch/serial.h>
26
27 #define UART_OMAP_MDR1          0x08    /* mode definition register */
28
29 #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
30
31 static void
32 puts(const char *s)
33 {
34         volatile u8 * uart = 0;
35         int shift = 0;
36
37         /* Determine which serial port to use */
38         do {
39                 if (machine_is_omap_innovator() || machine_is_omap_osk()) {
40                         shift = 2;
41                         uart = (volatile u8 *)(OMAP_UART1_BASE);
42                 } else if (machine_is_omap_perseus2()) {
43                         shift = 0;
44                         uart = (volatile u8 *)(OMAP_UART1_BASE);
45                 } else {
46                         /* Assume nothing for unknown machines.
47                          * Add an entry for your machine to select
48                          * the default serial console here. If the
49                          * serial port is enabled, we'll use it to
50                          * display status messages. Else we'll be
51                          * quiet.
52                          */
53                         return;
54                 }
55                 if (check_port(uart, shift))
56                         break;
57                 /* Silent boot if no serial ports are enabled. */
58                 return;
59         } while (0);
60
61         /*
62          * Now, xmit each character
63          */
64         while (*s) {
65                 while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
66                         barrier();
67                 uart[UART_TX << shift] = *s;
68                 if (*s++ == '\n') {
69                         while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
70                                 barrier();
71                         uart[UART_TX << shift] = '\r';
72                 }
73         }
74 }
75
76 /*
77  * nothing to do
78  */
79 #define arch_decomp_setup()
80 #define arch_decomp_wdog()