Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Tony Lindgren | 9839c6b | 2005-09-07 17:20:27 +0100 | [diff] [blame^] | 23 | #include <asm/arch/serial.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
| 25 | unsigned 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 | |
| 33 | static void |
| 34 | putstr(const char *s) |
| 35 | { |
| 36 | volatile u8 * uart = 0; |
Tony Lindgren | 9839c6b | 2005-09-07 17:20:27 +0100 | [diff] [blame^] | 37 | int shift = 2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Tony Lindgren | 9839c6b | 2005-09-07 17:20:27 +0100 | [diff] [blame^] | 39 | #ifdef CONFIG_ARCH_OMAP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 |
| 41 | uart = (volatile u8 *)(OMAP_UART3_BASE); |
| 42 | #elif CONFIG_OMAP_LL_DEBUG_UART2 |
| 43 | uart = (volatile u8 *)(OMAP_UART2_BASE); |
| 44 | #else |
| 45 | uart = (volatile u8 *)(OMAP_UART1_BASE); |
| 46 | #endif |
| 47 | |
Tony Lindgren | 9839c6b | 2005-09-07 17:20:27 +0100 | [diff] [blame^] | 48 | #ifdef CONFIG_ARCH_OMAP1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | /* Determine which serial port to use */ |
| 50 | do { |
| 51 | /* MMU is not on, so cpu_is_omapXXXX() won't work here */ |
| 52 | unsigned int omap_id = omap_get_id(); |
| 53 | |
| 54 | if (omap_id == OMAP_ID_730) |
| 55 | shift = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
| 57 | if (check_port(uart, shift)) |
| 58 | break; |
| 59 | /* Silent boot if no serial ports are enabled. */ |
| 60 | return; |
| 61 | } while (0); |
Tony Lindgren | 9839c6b | 2005-09-07 17:20:27 +0100 | [diff] [blame^] | 62 | #endif /* CONFIG_ARCH_OMAP1 */ |
| 63 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
| 65 | /* |
| 66 | * Now, xmit each character |
| 67 | */ |
| 68 | while (*s) { |
| 69 | while (!(uart[UART_LSR << shift] & UART_LSR_THRE)) |
| 70 | barrier(); |
| 71 | uart[UART_TX << shift] = *s; |
| 72 | if (*s++ == '\n') { |
| 73 | while (!(uart[UART_LSR << shift] & UART_LSR_THRE)) |
| 74 | barrier(); |
| 75 | uart[UART_TX << shift] = '\r'; |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | * nothing to do |
| 82 | */ |
| 83 | #define arch_decomp_setup() |
| 84 | #define arch_decomp_wdog() |