uncompress.h 1.2 KB
Newer Older
L
Linus Torvalds 已提交
1
/*
2
 * arch/arm/mach-ixp4xx/include/mach/uncompress.h 
L
Linus Torvalds 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15
 *
 * Copyright (C) 2002 Intel Corporation.
 * Copyright (C) 2003-2004 MontaVista Software, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

#ifndef _ARCH_UNCOMPRESS_H_
#define _ARCH_UNCOMPRESS_H_

16
#include "ixp4xx-regs.h"
L
Linus Torvalds 已提交
17 18 19 20 21
#include <asm/mach-types.h>
#include <linux/serial_reg.h>

#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)

22
volatile u32* uart_base;
L
Linus Torvalds 已提交
23

24
static inline void putc(int c)
L
Linus Torvalds 已提交
25 26 27
{
	/* Check THRE and TEMT bits before we transmit the character.
	 */
28 29 30
	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
		barrier();

L
Linus Torvalds 已提交
31 32 33
	*uart_base = c;
}

34
static void flush(void)
L
Linus Torvalds 已提交
35 36 37 38 39 40
{
}

static __inline__ void __arch_decomp_setup(unsigned long arch_id)
{
	/*
41
	 * Some boards are using UART2 as console
L
Linus Torvalds 已提交
42
	 */
43
	if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
44
			 machine_is_gateway7001() || machine_is_wg302v2())
L
Linus Torvalds 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57
		uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
	else
		uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
}

/*
 * arch_id is a variable in decompress_kernel()
 */
#define arch_decomp_setup()	__arch_decomp_setup(arch_id)

#define arch_decomp_wdog()

#endif