aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2011-09-01 19:17:43 -0400
committerNicolas Pitre <nico@fluxnic.net>2011-09-26 10:11:26 -0400
commit28362d5153757dcb7af9a63978202c1ed1e3cf39 (patch)
tree2f7ab78240cf32908a6fc7e33ee1eed0c2e47fba /arch/arm/mach-omap1
parentdd185456efce7f326c058fc12fd0df17bd8466eb (diff)
ARM: mach-omap1: clean up debug-macro.S
This achieves two goals: 1) Get rid of omap_uart_v2p() and omap_uart_p2v() which were the last users of PLAT_PHYS_OFFSET. 2) Remove the probing of the M bit in the CP15 control reg and make the access to the .data variables completely position independent. 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/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S38
1 files changed, 17 insertions, 21 deletions
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 6a171181986f..2b36a281dc84 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -13,13 +13,8 @@
13 13
14#include <linux/serial_reg.h> 14#include <linux/serial_reg.h>
15 15
16#include <asm/memory.h>
17
18#include <plat/serial.h> 16#include <plat/serial.h>
19 17
20#define omap_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
21#define omap_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
22
23 .pushsection .data 18 .pushsection .data
24omap_uart_phys: .word 0x0 19omap_uart_phys: .word 0x0
25omap_uart_virt: .word 0x0 20omap_uart_virt: .word 0x0
@@ -34,16 +29,16 @@ omap_uart_virt: .word 0x0
34 .macro addruart, rp, rv, tmp 29 .macro addruart, rp, rv, tmp
35 30
36 /* Use omap_uart_phys/virt if already configured */ 31 /* Use omap_uart_phys/virt if already configured */
379: mrc p15, 0, \rp, c1, c0 329: adr \rp, 99f @ get effective addr of 99f
38 tst \rp, #1 @ MMU enabled? 33 ldr \rv, [\rp] @ get absolute addr of 99f
39 ldreq \rp, =omap_uart_v2p(omap_uart_phys) @ MMU disabled 34 sub \rv, \rv, \rp @ offset between the two
40 ldrne \rp, =omap_uart_phys @ MMU enabled 35 ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys
41 add \rv, \rp, #4 @ omap_uart_virt 36 sub \tmp, \rp, \rv @ make it effective
42 ldr \rp, [\rp, #0] 37 ldr \rp, [\tmp, #0] @ omap_uart_phys
43 ldr \rv, [\rv, #0] 38 ldr \rv, [\tmp, #4] @ omap_uart_virt
44 cmp \rp, #0 @ is port configured? 39 cmp \rp, #0 @ is port configured?
45 cmpne \rv, #0 40 cmpne \rv, #0
46 bne 99f @ already configured 41 bne 100f @ already configured
47 42
48 /* Check the debug UART configuration set in uncompress.h */ 43 /* Check the debug UART configuration set in uncompress.h */
49 and \rp, pc, #0xff000000 44 and \rp, pc, #0xff000000
@@ -72,17 +67,18 @@ omap_uart_virt: .word 0x0
72 67
73 /* Store both phys and virt address for the uart */ 68 /* Store both phys and virt address for the uart */
7498: add \rp, \rp, #0xff000000 @ phys base 6998: add \rp, \rp, #0xff000000 @ phys base
75 mrc p15, 0, \rv, c1, c0 70 str \rp, [\tmp, #0] @ omap_uart_phys
76 tst \rv, #1 @ MMU enabled?
77 ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled
78 ldrne \rv, =omap_uart_phys @ MMU enabled
79 str \rp, [\rv, #0]
80 sub \rp, \rp, #0xff000000 @ phys base 71 sub \rp, \rp, #0xff000000 @ phys base
81 add \rp, \rp, #0xfe000000 @ virt base 72 add \rp, \rp, #0xfe000000 @ virt base
82 add \rv, \rv, #4 @ omap_uart_lsr 73 str \rp, [\tmp, #4] @ omap_uart_virt
83 str \rp, [\rv, #0]
84 b 9b 74 b 9b
8599: 75
76 .align
7799: .word .
78 .word omap_uart_phys
79 .ltorg
80
81100:
86 .endm 82 .endm
87 83
88 .macro senduart,rd,rx 84 .macro senduart,rd,rx