blob: 4ebc9c9084424f7ebf46b8ae9821957efa4b58bf [file] [log] [blame]
Catalin Marinas8ad68bb2005-10-31 14:25:02 +00001/*
2 * linux/include/asm-arm/arch-realview/uncompress.h
3 *
4 * Copyright (C) 2003 ARM Limited
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <asm/hardware.h>
Catalin Marinas9a386f02008-04-18 22:43:11 +010021#include <asm/mach-types.h>
Catalin Marinas8ad68bb2005-10-31 14:25:02 +000022
Catalin Marinas9a386f02008-04-18 22:43:11 +010023#include <asm/arch/board-eb.h>
Catalin Marinas34401ec2008-04-18 22:43:13 +010024#include <asm/arch/board-pb11mp.h>
Catalin Marinas356cb472008-02-04 17:34:58 +010025
Catalin Marinas9a386f02008-04-18 22:43:11 +010026#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
27#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c))
28#define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30))
29#define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18))
30
31/*
32 * Return the UART base address
33 */
34static inline unsigned long get_uart_base(void)
35{
36 if (machine_is_realview_eb())
37 return REALVIEW_EB_UART0_BASE;
Catalin Marinas34401ec2008-04-18 22:43:13 +010038 else if (machine_is_realview_pb11mp())
39 return REALVIEW_PB11MP_UART0_BASE;
Catalin Marinas9a386f02008-04-18 22:43:11 +010040 else
41 return 0;
42}
Catalin Marinas8ad68bb2005-10-31 14:25:02 +000043
44/*
45 * This does not append a newline
46 */
Russell Kinga0815682006-03-28 10:24:33 +010047static inline void putc(int c)
Catalin Marinas8ad68bb2005-10-31 14:25:02 +000048{
Catalin Marinas9a386f02008-04-18 22:43:11 +010049 unsigned long base = get_uart_base();
50
51 while (AMBA_UART_FR(base) & (1 << 5))
Russell Kinga0815682006-03-28 10:24:33 +010052 barrier();
Catalin Marinas8ad68bb2005-10-31 14:25:02 +000053
Catalin Marinas9a386f02008-04-18 22:43:11 +010054 AMBA_UART_DR(base) = c;
Russell Kinga0815682006-03-28 10:24:33 +010055}
Catalin Marinas8ad68bb2005-10-31 14:25:02 +000056
Russell Kinga0815682006-03-28 10:24:33 +010057static inline void flush(void)
58{
Catalin Marinas9a386f02008-04-18 22:43:11 +010059 unsigned long base = get_uart_base();
60
61 while (AMBA_UART_FR(base) & (1 << 3))
Catalin Marinas8ad68bb2005-10-31 14:25:02 +000062 barrier();
63}
64
65/*
66 * nothing to do
67 */
68#define arch_decomp_setup()
69#define arch_decomp_wdog()