summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap3-pm-git/zoom2/0001-OMAP1-2-3-4-DEBUG_LL-cleanup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap3-pm-git/zoom2/0001-OMAP1-2-3-4-DEBUG_LL-cleanup.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap3-pm-git/zoom2/0001-OMAP1-2-3-4-DEBUG_LL-cleanup.patch217
1 files changed, 217 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap3-pm-git/zoom2/0001-OMAP1-2-3-4-DEBUG_LL-cleanup.patch b/meta/recipes-kernel/linux/linux-omap3-pm-git/zoom2/0001-OMAP1-2-3-4-DEBUG_LL-cleanup.patch
new file mode 100644
index 0000000000..e1e216c915
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap3-pm-git/zoom2/0001-OMAP1-2-3-4-DEBUG_LL-cleanup.patch
@@ -0,0 +1,217 @@
1From 51f967864f0e30225c8a8e50e0bbaf92258c0032 Mon Sep 17 00:00:00 2001
2From: Vikram Pandita <vikram.pandita@ti.com>
3Date: Thu, 20 Aug 2009 16:13:20 -0500
4Subject: [PATCH 1/5] OMAP1/2/3/4: DEBUG_LL: cleanup
5
6This patch cleans up the DEBUG_LL infrastructure for omap boards.
7
8The three stages of log printing infrastructure is using their own #defines
9The patch integrates the three stages to use the same variable.
10
11Three stages are:
12Stage 1: Prints - Uncompressing Linux......
13 File getting used: arch/arm/plat-omap/include/mach/uncompress.h
14Stage 2: Prints - <5>Linux version 2.6.31
15 File getting used: arch/arm/plat-omap/include/mach/debug-macro.S
16Stage 3: Kernel ttyS console takes over
17
18On enabling the DEBUG_LL menuconfig item
19[Kernel Hacking -> Kernel low-level debugging functions]
20
21the following entry gets auto selected
22[Systerm Type -> TI OMAP Implementations -> Low-level Debug console UART]
23
24This is the physical address of the UART getting used for the board.
25The physical address of debug uart is provided as a menuconfig option now.
26
27Issue with current system:
28(a) Zoom2 board has a detachable debug board having the TL16CP754 Quad uart chip.
29If the debug board is not attached, _NO_ debug uart is available.
30OMAP internal uarts are not used for traces on zoom2 board.
31Current framework does not account for boards that may not have a debug uart
32at all. The Stage 1 always accesses one of the uarts. Thats fixed now.
33
34(b) this patch does a cleanup of arch/arm/plat-omap/include/mach/debug-macro.S
35
36Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
37---
38 arch/arm/plat-omap/Kconfig | 50 ++++++++++++++++++-------
39 arch/arm/plat-omap/include/mach/common.h | 7 +++
40 arch/arm/plat-omap/include/mach/debug-macro.S | 40 ++++----------------
41 arch/arm/plat-omap/include/mach/uncompress.h | 12 +----
42 4 files changed, 54 insertions(+), 55 deletions(-)
43
44diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
45index ab9f9ef..2fefb64 100644
46--- a/arch/arm/plat-omap/Kconfig
47+++ b/arch/arm/plat-omap/Kconfig
48@@ -162,21 +162,43 @@ config OMAP_DM_TIMER
49 help
50 Select this option if you want to use OMAP Dual-Mode timers.
51
52-choice
53- prompt "Low-level debug console UART"
54- depends on ARCH_OMAP
55- default OMAP_LL_DEBUG_UART1
56-
57-config OMAP_LL_DEBUG_UART1
58- bool "UART1"
59-
60-config OMAP_LL_DEBUG_UART2
61- bool "UART2"
62
63-config OMAP_LL_DEBUG_UART3
64- bool "UART3"
65-
66-endchoice
67+config OMAP_DEBUG_LL_UART_PHY_ADDR
68+ hex "Low-level debug console UART Physical Address"
69+ depends on ARCH_OMAP && DEBUG_LL
70+
71+ default "0xfffb0800" if ARCH_OMAP1 && (MACH_OMAP_PALMTT || MACH_SX1)
72+ default "0xfffb0000" if ARCH_OMAP1
73+ default "0x4806e000" if ARCH_OMAP2 && MACH_NOKIA_N8X0
74+ default "0x4806a000" if ARCH_OMAP2
75+ default "0x49020000" if ARCH_OMAP3 && (MACH_NOKIA_RX51 || MACH_OMAP_BEAGLE)
76+ default "0x49020000" if ARCH_OMAP3 && (MACH_OMAP3_PANDORA || MACH_OMAP_LDP || MACH_OVERO)
77+ default "0x10000000" if ARCH_OMAP3 && MACH_OMAP_ZOOM2
78+ default "0x4806a000" if ARCH_OMAP3
79+ default "0x4806a000" if ARCH_OMAP4
80+ help
81+ Specify the Physical address of Low level debug UART
82+ Specify 0x0 in case you do not want DEBUG_LL functions to iterfere with your board uarts
83+
84+ OMAP1:
85+ -------------------
86+ UART1 -> 0xfffb0000 (default)
87+ UART2 -> 0xfffb0800
88+ UART3 -> 0xfffb9800 (sx1, palmtt)
89+
90+ OMAP2:
91+ -------------------
92+ UART1 -> 0x4806a000 (default)
93+ UART2 -> 0x4806c000
94+ UART3 -> 0x4806e000 (N8X0)
95+
96+ OMAP3/4:
97+ -------------------
98+ UART1 -> 0x4806a000 (default: except following)
99+ UART2 -> 0x4806c000
100+ UART3 -> 0x49020000 (rx51, beagle, pendora, ldp, overo)
101+ UART4 -> 0x4806e000
102+ UART_EXT -> 0x10000000 (zoom2: Debug uart is on external debug board)
103
104 config OMAP_SERIAL_WAKE
105 bool "Enable wake-up events for serial ports"
106diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/mach/common.h
107index fdeab42..f29d31f 100644
108--- a/arch/arm/plat-omap/include/mach/common.h
109+++ b/arch/arm/plat-omap/include/mach/common.h
110@@ -68,4 +68,11 @@ void omap2_set_globals_sdrc(struct omap_globals *);
111 void omap2_set_globals_control(struct omap_globals *);
112 void omap2_set_globals_prcm(struct omap_globals *);
113
114+/* In case Low Level debug is not defined
115+ * make the low level uart address as zero
116+ */
117+#if !defined(CONFIG_DEBUG_LL)
118+#define CONFIG_OMAP_DEBUG_LL_UART_PHY_ADDR 0
119+#endif
120+
121 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
122diff --git a/arch/arm/plat-omap/include/mach/debug-macro.S b/arch/arm/plat-omap/include/mach/debug-macro.S
123index ac24050..f546d6c 100644
124--- a/arch/arm/plat-omap/include/mach/debug-macro.S
125+++ b/arch/arm/plat-omap/include/mach/debug-macro.S
126@@ -10,43 +10,19 @@
127 * published by the Free Software Foundation.
128 *
129 */
130+#include "io.h"
131
132 .macro addruart,rx
133 mrc p15, 0, \rx, c1, c0
134 tst \rx, #1 @ MMU enabled?
135 #ifdef CONFIG_ARCH_OMAP1
136- moveq \rx, #0xff000000 @ physical base address
137- movne \rx, #0xfe000000 @ virtual base
138- orr \rx, \rx, #0x00fb0000
139-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
140- orr \rx, \rx, #0x00009000 @ UART 3
141-#endif
142-#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
143- orr \rx, \rx, #0x00000800 @ UART 2 & 3
144-#endif
145-
146-#elif CONFIG_ARCH_OMAP2
147- moveq \rx, #0x48000000 @ physical base address
148- movne \rx, #0xd8000000 @ virtual base
149- orr \rx, \rx, #0x0006a000
150-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
151- add \rx, \rx, #0x00002000 @ UART 2
152-#endif
153-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
154- add \rx, \rx, #0x00004000 @ UART 3
155-#endif
156-
157-#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
158- moveq \rx, #0x48000000 @ physical base address
159- movne \rx, #0xd8000000 @ virtual base
160- orr \rx, \rx, #0x0006a000
161-#ifdef CONFIG_OMAP_LL_DEBUG_UART2
162- add \rx, \rx, #0x00002000 @ UART 2
163-#endif
164-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
165- add \rx, \rx, #0x00fb0000 @ UART 3
166- add \rx, \rx, #0x00006000
167-#endif
168+ /* omap1 */
169+ ldr \rx, =CONFIG_OMAP_DEBUG_LL_UART_PHY_ADDR @ physical base address
170+ subne \rx, #CONFIG_OMAP_DEBUG_LL_UART_PHY_ADDR, #OMAP1_IO_OFFSET @ virtual base
171+#else
172+ /* omap2/omap3/omap4 */
173+ ldr \rx, =CONFIG_OMAP_DEBUG_LL_UART_PHY_ADDR @ physical base address
174+ orrne \rx, \rx, #OMAP2_IO_OFFSET @ virtual base
175 #endif
176 .endm
177
178diff --git a/arch/arm/plat-omap/include/mach/uncompress.h b/arch/arm/plat-omap/include/mach/uncompress.h
179index 0814c5f..0e21eb3 100644
180--- a/arch/arm/plat-omap/include/mach/uncompress.h
181+++ b/arch/arm/plat-omap/include/mach/uncompress.h
182@@ -38,14 +38,8 @@ static void putc(int c)
183 return;
184 #endif
185
186-#ifdef CONFIG_ARCH_OMAP
187-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
188- uart = (volatile u8 *)(OMAP_UART3_BASE);
189-#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
190- uart = (volatile u8 *)(OMAP_UART2_BASE);
191-#else
192- uart = (volatile u8 *)(OMAP_UART1_BASE);
193-#endif
194+#if defined(CONFIG_DEBUG_LL)
195+ uart = (volatile u8 *)(CONFIG_OMAP_DEBUG_LL_UART_PHY_ADDR);
196
197 #ifdef CONFIG_ARCH_OMAP1
198 /* Determine which serial port to use */
199@@ -62,7 +56,6 @@ static void putc(int c)
200 return;
201 } while (0);
202 #endif /* CONFIG_ARCH_OMAP1 */
203-#endif
204
205 /*
206 * Now, xmit each character
207@@ -70,6 +63,7 @@ static void putc(int c)
208 while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
209 barrier();
210 uart[UART_TX << shift] = c;
211+#endif /* CONFIG_DEBUG_LL */
212 }
213
214 static inline void flush(void)
215--
2161.6.3.2
217