1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * arch/arm/mach-netx/include/mach/uncompress.h
5 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
9 * The following code assumes the serial port has already been
10 * initialized by the bootloader. We search for the first enabled
11 * port in the most probable order. If you didn't setup a port in
12 * your bootloader then nothing will appear (which might be desired).
14 * This does not append a newline
17 #define REG(x) (*(volatile unsigned long *)(x))
19 #define UART1_BASE 0x100a00
20 #define UART2_BASE 0x100a80
25 #define CR_UART_EN (1<<0)
28 #define FR_BUSY (1<<3)
29 #define FR_TXFF (1<<5)
31 static inline void putc(char c)
35 if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
37 else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
42 while (REG(base + UART_FR) & FR_TXFF);
43 REG(base + UART_DR) = c;
46 static inline void flush(void)
50 if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
52 else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
57 while (REG(base + UART_FR) & FR_BUSY);
63 #define arch_decomp_setup()