aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2011-08-31 13:57:37 -0400
committerNicolas Pitre <nico@fluxnic.net>2011-09-26 10:11:25 -0400
commitdd185456efce7f326c058fc12fd0df17bd8466eb (patch)
tree78abc6ff08a905c25eda49b7f67e6790c6257f7c /arch
parent639da5ee374ba8f070690bbd355ca30139ce145a (diff)
ARM: plat-omap: make OMAP_UART_INFO into a relative offset
This is the first step to remove PLAT_PHYS_OFFSET usage from the debug UART code. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S8
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S9
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h6
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h8
4 files changed, 17 insertions, 14 deletions
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index f944ae8abc97..6a171181986f 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -46,11 +46,9 @@ omap_uart_virt: .word 0x0
46 bne 99f @ already configured 46 bne 99f @ already configured
47 47
48 /* Check the debug UART configuration set in uncompress.h */ 48 /* Check the debug UART configuration set in uncompress.h */
49 mrc p15, 0, \rp, c1, c0 49 and \rp, pc, #0xff000000
50 tst \rp, #1 @ MMU enabled? 50 ldr \rv, =OMAP_UART_INFO_OFS
51 ldreq \rp, =OMAP_UART_INFO @ MMU not enabled 51 ldr \rp, [\rp, \rv]
52 ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled
53 ldr \rp, [\rp, #0]
54 52
55 /* Select the UART to use based on the UART1 scratchpad value */ 53 /* Select the UART to use based on the UART1 scratchpad value */
5610: cmp \rp, #0 @ no port configured? 5410: cmp \rp, #0 @ no port configured?
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index fbd23ec81a20..745e2ff3e906 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -49,11 +49,10 @@ omap_uart_lsr: .word 0
49 bne 99f @ already configured 49 bne 99f @ already configured
50 50
51 /* Check the debug UART configuration set in uncompress.h */ 51 /* Check the debug UART configuration set in uncompress.h */
52 mrc p15, 0, \rp, c1, c0 52 mov \rp, pc
53 tst \rp, #1 @ MMU enabled? 53 ldr \rv, =OMAP_UART_INFO_OFS
54 ldreq \rp, =OMAP_UART_INFO @ MMU not enabled 54 and \rp, \rp, #0xff000000
55 ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled 55 ldr \rp, [\rp, \rv]
56 ldr \rp, [\rp, #0]
57 56
58 /* Select the UART to use based on the UART1 scratchpad value */ 57 /* Select the UART to use based on the UART1 scratchpad value */
59 cmp \rp, #0 @ no port configured? 58 cmp \rp, #0 @ no port configured?
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index de3b10c18127..1ab9fd6abe6d 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -16,8 +16,8 @@
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18/* 18/*
19 * Memory entry used for the DEBUG_LL UART configuration. See also 19 * Memory entry used for the DEBUG_LL UART configuration, relative to
20 * uncompress.h and debug-macro.S. 20 * start of RAM. See also uncompress.h and debug-macro.S.
21 * 21 *
22 * Note that using a memory location for storing the UART configuration 22 * Note that using a memory location for storing the UART configuration
23 * has at least two limitations: 23 * has at least two limitations:
@@ -27,7 +27,7 @@
27 * 2. We assume printascii is called at least once before paging_init, 27 * 2. We assume printascii is called at least once before paging_init,
28 * and addruart has a chance to read OMAP_UART_INFO 28 * and addruart has a chance to read OMAP_UART_INFO
29 */ 29 */
30#define OMAP_UART_INFO (PLAT_PHYS_OFFSET + 0x3ffc) 30#define OMAP_UART_INFO_OFS 0x3ffc
31 31
32/* OMAP1 serial ports */ 32/* OMAP1 serial ports */
33#define OMAP1_UART1_BASE 0xfffb0000 33#define OMAP1_UART1_BASE 0xfffb0000
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index a067484cc4a2..2f472e989ec6 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -36,7 +36,13 @@ int uart_shift;
36 */ 36 */
37static void set_omap_uart_info(unsigned char port) 37static void set_omap_uart_info(unsigned char port)
38{ 38{
39 *(volatile u32 *)OMAP_UART_INFO = port; 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;
40} 46}
41 47
42static void putc(int c) 48static void putc(int c)