uncompress.h 2.05 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
/*
2
 * arch/arm/plat-omap/include/mach/uncompress.h
Linus Torvalds's avatar
Linus Torvalds committed
3
4
5
6
 *
 * Serial port stubs for kernel decompress status messages
 *
 * Initially based on:
7
 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
Linus Torvalds's avatar
Linus Torvalds committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 * Copyright (C) 2000 RidgeRun, Inc.
 * Author: Greg Lonnon <glonnon@ridgerun.com>
 *
 * Rewritten by:
 * Author: <source@mvista.com>
 * 2004 (c) MontaVista Software, Inc.
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2. This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 */

#include <linux/types.h>
#include <linux/serial_reg.h>
22
#include <plat/serial.h>
Linus Torvalds's avatar
Linus Torvalds committed
23
24
25
26
27

unsigned int system_rev;

#define UART_OMAP_MDR1		0x08	/* mode definition register */
#define OMAP_ID_730		0x355F
Alistair Buxton's avatar
Alistair Buxton committed
28
#define OMAP_ID_850		0x362C
Linus Torvalds's avatar
Linus Torvalds committed
29
30
31
32
#define ID_MASK			0x7fff
#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK

33
static void putc(int c)
Linus Torvalds's avatar
Linus Torvalds committed
34
35
{
	volatile u8 * uart = 0;
36
	int shift = 2;
Linus Torvalds's avatar
Linus Torvalds committed
37

38
39
40
41
#ifdef CONFIG_MACH_OMAP_PALMTE
	return;
#endif

42
#ifdef CONFIG_ARCH_OMAP
Linus Torvalds's avatar
Linus Torvalds committed
43
44
#ifdef	CONFIG_OMAP_LL_DEBUG_UART3
	uart = (volatile u8 *)(OMAP_UART3_BASE);
45
#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
Linus Torvalds's avatar
Linus Torvalds committed
46
	uart = (volatile u8 *)(OMAP_UART2_BASE);
47
#elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
Linus Torvalds's avatar
Linus Torvalds committed
48
	uart = (volatile u8 *)(OMAP_UART1_BASE);
49
50
51
52
#elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
	return;
#else
	return;
Linus Torvalds's avatar
Linus Torvalds committed
53
54
#endif

55
#ifdef CONFIG_ARCH_OMAP1
Linus Torvalds's avatar
Linus Torvalds committed
56
57
58
59
60
	/* Determine which serial port to use */
	do {
		/* MMU is not on, so cpu_is_omapXXXX() won't work here */
		unsigned int omap_id = omap_get_id();

Alistair Buxton's avatar
Alistair Buxton committed
61
		if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850)
Linus Torvalds's avatar
Linus Torvalds committed
62
63
64
65
66
67
68
			shift = 0;

		if (check_port(uart, shift))
			break;
		/* Silent boot if no serial ports are enabled. */
		return;
	} while (0);
69
70
#endif /* CONFIG_ARCH_OMAP1 */
#endif
Linus Torvalds's avatar
Linus Torvalds committed
71
72
73
74

	/*
	 * Now, xmit each character
	 */
75
76
77
78
79
80
81
	while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
		barrier();
	uart[UART_TX << shift] = c;
}

static inline void flush(void)
{
Linus Torvalds's avatar
Linus Torvalds committed
82
83
84
85
86
87
88
}

/*
 * nothing to do
 */
#define arch_decomp_setup()
#define arch_decomp_wdog()