aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/include/mach
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/include/mach')
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S165
-rw-r--r--arch/arm/mach-omap2/include/mach/serial.h37
-rw-r--r--arch/arm/mach-omap2/include/mach/uncompress.h171
3 files changed, 0 insertions, 373 deletions
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
deleted file mode 100644
index cfaed13d0040..000000000000
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ /dev/null
@@ -1,165 +0,0 @@
1/* arch/arm/mach-omap2/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include <linux/serial_reg.h>
15
16#include <mach/serial.h>
17
18#define UART_OFFSET(addr) ((addr) & 0x00ffffff)
19
20 .pushsection .data
21omap_uart_phys: .word 0
22omap_uart_virt: .word 0
23omap_uart_lsr: .word 0
24 .popsection
25
26 /*
27 * Note that this code won't work if the bootloader passes
28 * a wrong machine ID number in r1. To debug, just hardcode
29 * the desired UART phys and virt addresses temporarily into
30 * the omap_uart_phys and omap_uart_virt above.
31 */
32 .macro addruart, rp, rv, tmp
33
34 /* Use omap_uart_phys/virt if already configured */
3510: adr \rp, 99f @ get effective addr of 99f
36 ldr \rv, [\rp] @ get absolute addr of 99f
37 sub \rv, \rv, \rp @ offset between the two
38 ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys
39 sub \tmp, \rp, \rv @ make it effective
40 ldr \rp, [\tmp, #0] @ omap_uart_phys
41 ldr \rv, [\tmp, #4] @ omap_uart_virt
42 cmp \rp, #0 @ is port configured?
43 cmpne \rv, #0
44 bne 100f @ already configured
45
46 /* Check the debug UART configuration set in uncompress.h */
47 mov \rp, pc
48 ldr \rv, =OMAP_UART_INFO_OFS
49 and \rp, \rp, #0xff000000
50 ldr \rp, [\rp, \rv]
51
52 /* Select the UART to use based on the UART1 scratchpad value */
53 cmp \rp, #0 @ no port configured?
54 beq 21f @ if none, try to use UART1
55 cmp \rp, #OMAP2UART1 @ OMAP2/3/4UART1
56 beq 21f @ configure OMAP2/3/4UART1
57 cmp \rp, #OMAP2UART2 @ OMAP2/3/4UART2
58 beq 22f @ configure OMAP2/3/4UART2
59 cmp \rp, #OMAP2UART3 @ only on 24xx
60 beq 23f @ configure OMAP2UART3
61 cmp \rp, #OMAP3UART3 @ only on 34xx
62 beq 33f @ configure OMAP3UART3
63 cmp \rp, #OMAP4UART3 @ only on 44xx/54xx
64 beq 43f @ configure OMAP4/5UART3
65 cmp \rp, #OMAP3UART4 @ only on 36xx
66 beq 34f @ configure OMAP3UART4
67 cmp \rp, #OMAP4UART4 @ only on 44xx/54xx
68 beq 44f @ configure OMAP4/5UART4
69 cmp \rp, #TI81XXUART1 @ ti81Xx UART offsets different
70 beq 81f @ configure UART1
71 cmp \rp, #TI81XXUART2 @ ti81Xx UART offsets different
72 beq 82f @ configure UART2
73 cmp \rp, #TI81XXUART3 @ ti81Xx UART offsets different
74 beq 83f @ configure UART3
75 cmp \rp, #AM33XXUART1 @ AM33XX UART offsets different
76 beq 84f @ configure UART1
77 cmp \rp, #ZOOM_UART @ only on zoom2/3
78 beq 95f @ configure ZOOM_UART
79
80 /* Configure the UART offset from the phys/virt base */
8121: mov \rp, #UART_OFFSET(OMAP2_UART1_BASE) @ omap2/3/4
82 b 98f
8322: mov \rp, #UART_OFFSET(OMAP2_UART2_BASE) @ omap2/3/4
84 b 98f
8523: mov \rp, #UART_OFFSET(OMAP2_UART3_BASE)
86 b 98f
8733: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE)
88 add \rp, \rp, #0x00fb0000
89 add \rp, \rp, #0x00006000 @ OMAP3_UART3_BASE
90 b 98f
9134: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE)
92 add \rp, \rp, #0x00fb0000
93 add \rp, \rp, #0x00028000 @ OMAP3_UART4_BASE
94 b 98f
9543: mov \rp, #UART_OFFSET(OMAP4_UART3_BASE)
96 b 98f
9744: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
98 b 98f
9981: mov \rp, #UART_OFFSET(TI81XX_UART1_BASE)
100 b 98f
10182: mov \rp, #UART_OFFSET(TI81XX_UART2_BASE)
102 b 98f
10383: mov \rp, #UART_OFFSET(TI81XX_UART3_BASE)
104 b 98f
10584: ldr \rp, =AM33XX_UART1_BASE
106 and \rp, \rp, #0x00ffffff
107 b 97f
10895: ldr \rp, =ZOOM_UART_BASE
109 str \rp, [\tmp, #0] @ omap_uart_phys
110 ldr \rp, =ZOOM_UART_VIRT
111 str \rp, [\tmp, #4] @ omap_uart_virt
112 mov \rp, #(UART_LSR << ZOOM_PORT_SHIFT)
113 str \rp, [\tmp, #8] @ omap_uart_lsr
114 b 10b
115
116 /* AM33XX: Store both phys and virt address for the uart */
11797: add \rp, \rp, #0x44000000 @ phys base
118 str \rp, [\tmp, #0] @ omap_uart_phys
119 sub \rp, \rp, #0x44000000 @ phys base
120 add \rp, \rp, #0xf9000000 @ virt base
121 str \rp, [\tmp, #4] @ omap_uart_virt
122 mov \rp, #(UART_LSR << OMAP_PORT_SHIFT)
123 str \rp, [\tmp, #8] @ omap_uart_lsr
124
125 b 10b
126
127 /* Store both phys and virt address for the uart */
12898: add \rp, \rp, #0x48000000 @ phys base
129 str \rp, [\tmp, #0] @ omap_uart_phys
130 sub \rp, \rp, #0x48000000 @ phys base
131 add \rp, \rp, #0xfa000000 @ virt base
132 str \rp, [\tmp, #4] @ omap_uart_virt
133 mov \rp, #(UART_LSR << OMAP_PORT_SHIFT)
134 str \rp, [\tmp, #8] @ omap_uart_lsr
135
136 b 10b
137
138 .align
13999: .word .
140 .word omap_uart_phys
141 .ltorg
142
143100: /* Pass the UART_LSR reg address */
144 ldr \tmp, [\tmp, #8] @ omap_uart_lsr
145 add \rp, \rp, \tmp
146 add \rv, \rv, \tmp
147 .endm
148
149 .macro senduart,rd,rx
150 orr \rd, \rd, \rx, lsl #24 @ preserve LSR reg offset
151 bic \rx, \rx, #0xff @ get base (THR) reg address
152 strb \rd, [\rx] @ send lower byte of rd
153 orr \rx, \rx, \rd, lsr #24 @ restore original rx (LSR)
154 bic \rd, \rd, #(0xff << 24) @ restore original rd
155 .endm
156
157 .macro busyuart,rd,rx
1581001: ldrb \rd, [\rx] @ rx contains UART_LSR address
159 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
160 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
161 bne 1001b
162 .endm
163
164 .macro waituart,rd,rx
165 .endm
diff --git a/arch/arm/mach-omap2/include/mach/serial.h b/arch/arm/mach-omap2/include/mach/serial.h
index 70eda00db7a4..7ca1fcff453b 100644
--- a/arch/arm/mach-omap2/include/mach/serial.h
+++ b/arch/arm/mach-omap2/include/mach/serial.h
@@ -8,20 +8,6 @@
8 * GNU General Public License for more details. 8 * GNU General Public License for more details.
9 */ 9 */
10 10
11/*
12 * Memory entry used for the DEBUG_LL UART configuration, relative to
13 * start of RAM. See also uncompress.h and debug-macro.S.
14 *
15 * Note that using a memory location for storing the UART configuration
16 * has at least two limitations:
17 *
18 * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
19 * uncompress code could then partially overwrite itself
20 * 2. We assume printascii is called at least once before paging_init,
21 * and addruart has a chance to read OMAP_UART_INFO
22 */
23#define OMAP_UART_INFO_OFS 0x3ffc
24
25/* OMAP2 serial ports */ 11/* OMAP2 serial ports */
26#define OMAP2_UART1_BASE 0x4806a000 12#define OMAP2_UART1_BASE 0x4806a000
27#define OMAP2_UART2_BASE 0x4806c000 13#define OMAP2_UART2_BASE 0x4806c000
@@ -68,29 +54,6 @@
68 54
69#define OMAP24XX_BASE_BAUD (48000000/16) 55#define OMAP24XX_BASE_BAUD (48000000/16)
70 56
71/*
72 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
73 * decomp_setup in uncompress.h
74 */
75#define OMAP2UART1 21
76#define OMAP2UART2 22
77#define OMAP2UART3 23
78#define OMAP3UART1 OMAP2UART1
79#define OMAP3UART2 OMAP2UART2
80#define OMAP3UART3 33
81#define OMAP3UART4 34 /* Only on 36xx */
82#define OMAP4UART1 OMAP2UART1
83#define OMAP4UART2 OMAP2UART2
84#define OMAP4UART3 43
85#define OMAP4UART4 44
86#define TI81XXUART1 81
87#define TI81XXUART2 82
88#define TI81XXUART3 83
89#define AM33XXUART1 84
90#define OMAP5UART3 OMAP4UART3
91#define OMAP5UART4 OMAP4UART4
92#define ZOOM_UART 95 /* Only on zoom2/3 */
93
94#ifndef __ASSEMBLER__ 57#ifndef __ASSEMBLER__
95 58
96struct omap_board_data; 59struct omap_board_data;
diff --git a/arch/arm/mach-omap2/include/mach/uncompress.h b/arch/arm/mach-omap2/include/mach/uncompress.h
deleted file mode 100644
index 7b360acd19c9..000000000000
--- a/arch/arm/mach-omap2/include/mach/uncompress.h
+++ /dev/null
@@ -1,171 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
18 */
19
20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include <mach/serial.h>
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 /*
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
42 */
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46}
47
48static void putc(int c)
49{
50 if (!uart_base)
51 return;
52
53 /* Check for UART 16x mode */
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * Macros to configure UART1 and debug UART
68 */
69#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78#define DEBUG_LL_OMAP2(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
80 OMAP2UART##p)
81
82#define DEBUG_LL_OMAP3(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP3UART##p)
85
86#define DEBUG_LL_OMAP4(p, mach) \
87 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
88 OMAP4UART##p)
89
90#define DEBUG_LL_OMAP5(p, mach) \
91 _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \
92 OMAP5UART##p)
93/* Zoom2/3 shift is different for UART1 and external port */
94#define DEBUG_LL_ZOOM(mach) \
95 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
96
97#define DEBUG_LL_TI81XX(p, mach) \
98 _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
99 TI81XXUART##p)
100
101#define DEBUG_LL_AM33XX(p, mach) \
102 _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
103 AM33XXUART##p)
104
105static inline void arch_decomp_setup(void)
106{
107 int port = 0;
108
109 /*
110 * Initialize the port based on the machine ID from the bootloader.
111 * Note that we're using macros here instead of switch statement
112 * as machine_is functions are optimized out for the boards that
113 * are not selected.
114 */
115 do {
116 /* omap2 based boards using UART1 */
117 DEBUG_LL_OMAP2(1, omap_2430sdp);
118 DEBUG_LL_OMAP2(1, omap_apollon);
119 DEBUG_LL_OMAP2(1, omap_h4);
120
121 /* omap2 based boards using UART3 */
122 DEBUG_LL_OMAP2(3, nokia_n800);
123 DEBUG_LL_OMAP2(3, nokia_n810);
124 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
125
126 /* omap3 based boards using UART1 */
127 DEBUG_LL_OMAP2(1, omap3evm);
128 DEBUG_LL_OMAP3(1, omap_3430sdp);
129 DEBUG_LL_OMAP3(1, omap_3630sdp);
130 DEBUG_LL_OMAP3(1, omap3530_lv_som);
131 DEBUG_LL_OMAP3(1, omap3_torpedo);
132
133 /* omap3 based boards using UART3 */
134 DEBUG_LL_OMAP3(3, cm_t35);
135 DEBUG_LL_OMAP3(3, cm_t3517);
136 DEBUG_LL_OMAP3(3, cm_t3730);
137 DEBUG_LL_OMAP3(3, craneboard);
138 DEBUG_LL_OMAP3(3, devkit8000);
139 DEBUG_LL_OMAP3(3, igep0020);
140 DEBUG_LL_OMAP3(3, igep0030);
141 DEBUG_LL_OMAP3(3, nokia_rm680);
142 DEBUG_LL_OMAP3(3, nokia_rm696);
143 DEBUG_LL_OMAP3(3, nokia_rx51);
144 DEBUG_LL_OMAP3(3, omap3517evm);
145 DEBUG_LL_OMAP3(3, omap3_beagle);
146 DEBUG_LL_OMAP3(3, omap3_pandora);
147 DEBUG_LL_OMAP3(3, omap_ldp);
148 DEBUG_LL_OMAP3(3, overo);
149 DEBUG_LL_OMAP3(3, touchbook);
150
151 /* omap4 based boards using UART3 */
152 DEBUG_LL_OMAP4(3, omap_4430sdp);
153 DEBUG_LL_OMAP4(3, omap4_panda);
154
155 /* omap5 based boards using UART3 */
156 DEBUG_LL_OMAP5(3, omap5_sevm);
157
158 /* zoom2/3 external uart */
159 DEBUG_LL_ZOOM(omap_zoom2);
160 DEBUG_LL_ZOOM(omap_zoom3);
161
162 /* TI8168 base boards using UART3 */
163 DEBUG_LL_TI81XX(3, ti8168evm);
164
165 /* TI8148 base boards using UART1 */
166 DEBUG_LL_TI81XX(1, ti8148evm);
167
168 /* AM33XX base boards using UART1 */
169 DEBUG_LL_AM33XX(1, am335xevm);
170 } while (0);
171}