blob: 34ef48fe327eff50b05329a9a053a61a758f724b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Krzysztof Halasac18f6582007-12-18 03:53:27 +010016#include "ixp4xx-regs.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#include <asm/mach-types.h>
18#include <linux/serial_reg.h>
19
20#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
21
22static volatile u32* uart_base;
23
Russell Kinga0815682006-03-28 10:24:33 +010024static inline void putc(int c)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025{
26 /* Check THRE and TEMT bits before we transmit the character.
27 */
Russell Kinga0815682006-03-28 10:24:33 +010028 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
29 barrier();
30
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 *uart_base = c;
32}
33
Russell Kinga0815682006-03-28 10:24:33 +010034static void flush(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070035{
Linus Torvalds1da177e2005-04-16 15:20:36 -070036}
37
38static __inline__ void __arch_decomp_setup(unsigned long arch_id)
39{
40 /*
Imre Kaloz46918bd2007-06-02 15:44:08 +010041 * Some boards are using UART2 as console
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 */
Imre Kaloz46918bd2007-06-02 15:44:08 +010043 if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
Imre Kalozdcdeeb22007-06-02 15:47:51 +010044 machine_is_gateway7001() || machine_is_wg302v2())
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
46 else
47 uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
48}
49
50/*
51 * arch_id is a variable in decompress_kernel()
52 */
53#define arch_decomp_setup() __arch_decomp_setup(arch_id)
54
55#define arch_decomp_wdog()
56
57#endif