2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2008-08-05 15:14:15 +00:00
|
|
|
* arch/arm/mach-ixp4xx/include/mach/uncompress.h
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* 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_
|
|
|
|
|
2007-12-18 02:53:27 +00:00
|
|
|
#include "ixp4xx-regs.h"
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm/mach-types.h>
|
|
|
|
#include <linux/serial_reg.h>
|
|
|
|
|
|
|
|
#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
|
|
|
|
|
2011-04-28 21:00:17 +00:00
|
|
|
volatile u32* uart_base;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-03-28 09:24:33 +00:00
|
|
|
static inline void putc(int c)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
/* Check THRE and TEMT bits before we transmit the character.
|
|
|
|
*/
|
2006-03-28 09:24:33 +00:00
|
|
|
while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
|
|
|
|
barrier();
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
*uart_base = c;
|
|
|
|
}
|
|
|
|
|
2006-03-28 09:24:33 +00:00
|
|
|
static void flush(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline__ void __arch_decomp_setup(unsigned long arch_id)
|
|
|
|
{
|
|
|
|
/*
|
2007-06-02 14:44:08 +00:00
|
|
|
* Some boards are using UART2 as console
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2007-06-02 14:44:08 +00:00
|
|
|
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
|
2007-06-02 14:47:51 +00:00
|
|
|
machine_is_gateway7001() || machine_is_wg302v2())
|
2005-04-16 22:20:36 +00:00
|
|
|
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
|