Path: blob/master/arch/arm/mach-netx/include/mach/uncompress.h
10820 views
/*1* arch/arm/mach-netx/include/mach/uncompress.h2*3* Copyright (C) 2005 Sascha Hauer <[email protected]>, Pengutronix4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 27* as published by the Free Software Foundation.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.13*14* You should have received a copy of the GNU General Public License15* along with this program; if not, write to the Free Software16* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA17*/1819/*20* The following code assumes the serial port has already been21* initialized by the bootloader. We search for the first enabled22* port in the most probable order. If you didn't setup a port in23* your bootloader then nothing will appear (which might be desired).24*25* This does not append a newline26*/2728#define REG(x) (*(volatile unsigned long *)(x))2930#define UART1_BASE 0x100a0031#define UART2_BASE 0x100a803233#define UART_DR 0x03435#define UART_CR 0x1436#define CR_UART_EN (1<<0)3738#define UART_FR 0x1839#define FR_BUSY (1<<3)40#define FR_TXFF (1<<5)4142static void putc(char c)43{44unsigned long base;4546if (REG(UART1_BASE + UART_CR) & CR_UART_EN)47base = UART1_BASE;48else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)49base = UART2_BASE;50else51return;5253while (REG(base + UART_FR) & FR_TXFF);54REG(base + UART_DR) = c;55}5657static inline void flush(void)58{59unsigned long base;6061if (REG(UART1_BASE + UART_CR) & CR_UART_EN)62base = UART1_BASE;63else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)64base = UART2_BASE;65else66return;6768while (REG(base + UART_FR) & FR_BUSY);69}7071/*72* nothing to do73*/74#define arch_decomp_setup()75#define arch_decomp_wdog()767778