Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / arm / mach-pxa / include / mach / uncompress.h
blob8c27757e68ff1b638d3cd4f705aeff86bd585ff5
1 /*
2 * arch/arm/mach-pxa/include/mach/uncompress.h
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2001 MontaVista Software Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/serial_reg.h>
13 #include <asm/mach-types.h>
15 #define FFUART_BASE (0x40100000)
16 #define BTUART_BASE (0x40200000)
17 #define STUART_BASE (0x40700000)
19 unsigned long uart_base;
20 unsigned int uart_shift;
21 unsigned int uart_is_pxa;
23 static inline unsigned char uart_read(int offset)
25 return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
28 static inline void uart_write(unsigned char val, int offset)
30 *(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
33 static inline int uart_is_enabled(void)
35 /* assume enabled by default for non-PXA uarts */
36 return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
39 static inline void putc(char c)
41 if (!uart_is_enabled())
42 return;
44 while (!(uart_read(UART_LSR) & UART_LSR_THRE))
45 barrier();
47 uart_write(c, UART_TX);
51 * This does not append a newline
53 static inline void flush(void)
57 static inline void arch_decomp_setup(void)
59 /* initialize to default */
60 uart_base = FFUART_BASE;
61 uart_shift = 2;
62 uart_is_pxa = 1;
64 if (machine_is_littleton() || machine_is_intelmote2()
65 || machine_is_csb726() || machine_is_stargate2()
66 || machine_is_cm_x300() || machine_is_balloon3())
67 uart_base = STUART_BASE;
69 if (machine_is_arcom_zeus()) {
70 uart_base = 0x10000000; /* nCS4 */
71 uart_shift = 1;
72 uart_is_pxa = 0;