Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / arm / mach-at91 / include / mach / uncompress.h
blob0234fd9d20d6f13dc81f6e98984a22e954b03aeb
1 /*
2 * arch/arm/mach-at91/include/mach/uncompress.h
4 * Copyright (C) 2003 SAN People
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __ASM_ARCH_UNCOMPRESS_H
22 #define __ASM_ARCH_UNCOMPRESS_H
24 #include <linux/io.h>
25 #include <linux/atmel_serial.h>
27 #if defined(CONFIG_AT91_EARLY_DBGU0)
28 #define UART_OFFSET AT91_BASE_DBGU0
29 #elif defined(CONFIG_AT91_EARLY_DBGU1)
30 #define UART_OFFSET AT91_BASE_DBGU1
31 #elif defined(CONFIG_AT91_EARLY_USART0)
32 #define UART_OFFSET AT91_USART0
33 #elif defined(CONFIG_AT91_EARLY_USART1)
34 #define UART_OFFSET AT91_USART1
35 #elif defined(CONFIG_AT91_EARLY_USART2)
36 #define UART_OFFSET AT91_USART2
37 #elif defined(CONFIG_AT91_EARLY_USART3)
38 #define UART_OFFSET AT91_USART3
39 #elif defined(CONFIG_AT91_EARLY_USART4)
40 #define UART_OFFSET AT91_USART4
41 #elif defined(CONFIG_AT91_EARLY_USART5)
42 #define UART_OFFSET AT91_USART5
43 #endif
46 * The following code assumes the serial port has already been
47 * initialized by the bootloader. If you didn't setup a port in
48 * your bootloader then nothing will appear (which might be desired).
50 * This does not append a newline
52 static void putc(int c)
54 #ifdef UART_OFFSET
55 void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
57 while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY))
58 barrier();
59 __raw_writel(c, sys + ATMEL_US_THR);
60 #endif
63 static inline void flush(void)
65 #ifdef UART_OFFSET
66 void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
68 /* wait for transmission to complete */
69 while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
70 barrier();
71 #endif
74 #define arch_decomp_setup()
76 #define arch_decomp_wdog()
78 #endif