1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * arch/arm/mach-pxa/include/mach/uncompress.h
5 * Author: Nicolas Pitre
6 * Copyright: (C) 2001 MontaVista Software Inc.
9 #include <linux/serial_reg.h>
10 #include <asm/mach-types.h>
12 #define FFUART_BASE (0x40100000)
13 #define BTUART_BASE (0x40200000)
14 #define STUART_BASE (0x40700000)
16 unsigned long uart_base;
17 unsigned int uart_shift;
18 unsigned int uart_is_pxa;
20 static inline unsigned char uart_read(int offset)
22 return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
25 static inline void uart_write(unsigned char val, int offset)
27 *(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
30 static inline int uart_is_enabled(void)
32 /* assume enabled by default for non-PXA uarts */
33 return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
36 static inline void putc(char c)
38 if (!uart_is_enabled())
41 while (!(uart_read(UART_LSR) & UART_LSR_THRE))
44 uart_write(c, UART_TX);
48 * This does not append a newline
50 static inline void flush(void)
54 static inline void arch_decomp_setup(void)
56 /* initialize to default */
57 uart_base = FFUART_BASE;
61 if (machine_is_littleton() || machine_is_intelmote2()
62 || machine_is_csb726() || machine_is_stargate2()
63 || machine_is_cm_x300() || machine_is_balloon3())
64 uart_base = STUART_BASE;
66 if (machine_is_arcom_zeus()) {
67 uart_base = 0x10000000; /* nCS4 */