| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  * include/asm-arm/arch-ixp4xx/uncompress.h  | 
 | 3 |  * | 
 | 4 |  * Copyright (C) 2002 Intel Corporation. | 
 | 5 |  * Copyright (C) 2003-2004 MontaVista Software, Inc. | 
 | 6 |  * | 
 | 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. | 
 | 10 |  * | 
 | 11 |  */ | 
 | 12 |  | 
 | 13 | #ifndef _ARCH_UNCOMPRESS_H_ | 
 | 14 | #define _ARCH_UNCOMPRESS_H_ | 
 | 15 |  | 
 | 16 | #include <asm/hardware.h> | 
 | 17 | #include <asm/mach-types.h> | 
 | 18 | #include <linux/serial_reg.h> | 
 | 19 |  | 
 | 20 | #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE) | 
 | 21 |  | 
 | 22 | static volatile u32* uart_base; | 
 | 23 |  | 
| Russell King | a081568 | 2006-03-28 10:24:33 +0100 | [diff] [blame] | 24 | static inline void putc(int c) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | { | 
 | 26 | 	/* Check THRE and TEMT bits before we transmit the character. | 
 | 27 | 	 */ | 
| Russell King | a081568 | 2006-03-28 10:24:33 +0100 | [diff] [blame] | 28 | 	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE) | 
 | 29 | 		barrier(); | 
 | 30 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | 	*uart_base = c; | 
 | 32 | } | 
 | 33 |  | 
| Russell King | a081568 | 2006-03-28 10:24:33 +0100 | [diff] [blame] | 34 | static void flush(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | } | 
 | 37 |  | 
 | 38 | static __inline__ void __arch_decomp_setup(unsigned long arch_id) | 
 | 39 | { | 
 | 40 | 	/* | 
 | 41 | 	 * Coyote and gtwx5715 only have UART2 connected | 
 | 42 | 	 */ | 
 | 43 | 	if (machine_is_adi_coyote() || machine_is_gtwx5715()) | 
 | 44 | 		uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; | 
 | 45 | 	else | 
 | 46 | 		uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; | 
 | 47 | } | 
 | 48 |  | 
 | 49 | /* | 
 | 50 |  * arch_id is a variable in decompress_kernel() | 
 | 51 |  */ | 
 | 52 | #define arch_decomp_setup()	__arch_decomp_setup(arch_id) | 
 | 53 |  | 
 | 54 | #define arch_decomp_wdog() | 
 | 55 |  | 
 | 56 | #endif |