Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Serial port stubs for kernel decompress status messages |
| 3 | * |
| 4 | * Author: Anant Gole |
| 5 | * (C) Copyright (C) 2006, Texas Instruments, Inc |
| 6 | * |
| 7 | * This file is licensed under the terms of the GNU General Public License |
| 8 | * version 2. This program is licensed "as is" without any warranty of any |
| 9 | * kind, whether express or implied. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/types.h> |
| 13 | #include <linux/serial_reg.h> |
| 14 | #include <mach/serial.h> |
| 15 | |
Mark A. Greer | 27428e3 | 2009-02-18 14:00:36 -0700 | [diff] [blame^] | 16 | #include <asm/mach-types.h> |
| 17 | |
| 18 | extern unsigned int __machine_arch_type; |
| 19 | |
| 20 | static u32 *uart; |
| 21 | |
| 22 | static u32 *get_uart_base(void) |
| 23 | { |
| 24 | /* Add logic here for new platforms, using __macine_arch_type */ |
| 25 | return (u32 *)DAVINCI_UART0_BASE; |
| 26 | } |
| 27 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | /* PORT_16C550A, in polled non-fifo mode */ |
| 29 | |
| 30 | static void putc(char c) |
| 31 | { |
Mark A. Greer | 27428e3 | 2009-02-18 14:00:36 -0700 | [diff] [blame^] | 32 | if (!uart) |
| 33 | uart = get_uart_base(); |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 34 | |
| 35 | while (!(uart[UART_LSR] & UART_LSR_THRE)) |
| 36 | barrier(); |
| 37 | uart[UART_TX] = c; |
| 38 | } |
| 39 | |
| 40 | static inline void flush(void) |
| 41 | { |
Mark A. Greer | 27428e3 | 2009-02-18 14:00:36 -0700 | [diff] [blame^] | 42 | if (!uart) |
| 43 | uart = get_uart_base(); |
| 44 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 45 | while (!(uart[UART_LSR] & UART_LSR_THRE)) |
| 46 | barrier(); |
| 47 | } |
| 48 | |
| 49 | #define arch_decomp_setup() |
| 50 | #define arch_decomp_wdog() |