1/*
2 *  linux/include/asm-arm/arch-anakin/uncompress.h
3 *
4 *  Copyright (C) 2001 Aleph One Ltd. for Acunia N.V.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 *  Changelog:
11 *   10-Apr-2001 TTC	Created
12 */
13
14#ifndef __ASM_ARCH_UNCOMPRESS_H
15#define __ASM_ARCH_UNCOMPRESS_H
16
17#include <linux/config.h>
18#include <asm/io.h>
19#include <asm/arch/serial_reg.h>
20
21#ifndef CONFIG_ANAKIN_DEFAULT_BAUDRATE
22#define CONFIG_ANAKIN_DEFAULT_BAUDRATE	9600
23#endif
24
25static inline void
26putc(int c)
27{
28	while (!(__raw_readl(IO_START + UART0 + 0x10) & TXEMPTY))
29		barrier();
30
31	__raw_writel(c, IO_START + UART0 + 0x14);
32	__raw_writel(__raw_readl(IO_START + UART0 + 0x18)
33			| SENDREQUEST, IO_START + UART0 + 0x18);
34}
35
36static void
37puts(const char *s)
38{
39	int c;
40
41	while ((c = *s++)) {
42		putc(c);
43		if (c == '\n') putc('\r');
44	}
45}
46
47static void
48arch_decomp_setup(void)
49{
50	__raw_writel(__raw_readl(IO_START + UART0 + 0x10) & ~PRESCALER
51			| SETBAUD(CONFIG_ANAKIN_DEFAULT_BAUDRATE),
52			IO_START + UART0 + 0x10);
53	__raw_writel(__raw_readl(IO_START + UART0 + 0x18) & ~(IRQENABLE
54			| RTS | DTR | BLOCKRX | PARITY),
55			IO_START + UART0 + 0x18);
56}
57
58#define arch_decomp_wdog()
59
60#endif
61