diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-09-01 20:50:14 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-09-26 10:11:28 -0400 |
commit | 67f462b29310814a8de29d35b422a9ed41d5f39a (patch) | |
tree | a11c1e77f2e7b9cf8211d920ab07a0829ec6c405 | |
parent | e020fe34f8fc5cb42c2f518ea120005b4d01923d (diff) |
ARM: mach-davinci: clean up debug-macro.S
This achieves two goals:
1) Get rid of davinci_uart_v2p() and davinci_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>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
-rw-r--r-- | arch/arm/mach-davinci/include/mach/debug-macro.S | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index 45fff2c61f48..cf94552d5274 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S | |||
@@ -18,15 +18,10 @@ | |||
18 | 18 | ||
19 | #include <linux/serial_reg.h> | 19 | #include <linux/serial_reg.h> |
20 | 20 | ||
21 | #include <asm/memory.h> | ||
22 | |||
23 | #include <mach/serial.h> | 21 | #include <mach/serial.h> |
24 | 22 | ||
25 | #define UART_SHIFT 2 | 23 | #define UART_SHIFT 2 |
26 | 24 | ||
27 | #define davinci_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET) | ||
28 | #define davinci_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET) | ||
29 | |||
30 | .pushsection .data | 25 | .pushsection .data |
31 | davinci_uart_phys: .word 0 | 26 | davinci_uart_phys: .word 0 |
32 | davinci_uart_virt: .word 0 | 27 | davinci_uart_virt: .word 0 |
@@ -35,38 +30,38 @@ davinci_uart_virt: .word 0 | |||
35 | .macro addruart, rp, rv, tmp | 30 | .macro addruart, rp, rv, tmp |
36 | 31 | ||
37 | /* Use davinci_uart_phys/virt if already configured */ | 32 | /* Use davinci_uart_phys/virt if already configured */ |
38 | 10: mrc p15, 0, \rp, c1, c0 | 33 | 10: adr \rp, 99f @ get effective addr of 99f |
39 | tst \rp, #1 @ MMU enabled? | 34 | ldr \rv, [\rp] @ get absolute addr of 99f |
40 | ldreq \rp, =davinci_uart_v2p(davinci_uart_phys) | 35 | sub \rv, \rv, \rp @ offset between the two |
41 | ldrne \rp, =davinci_uart_phys | 36 | ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys |
42 | add \rv, \rp, #4 @ davinci_uart_virt | 37 | sub \tmp, \rp, \rv @ make it effective |
43 | ldr \rp, [\rp, #0] | 38 | ldr \rp, [\tmp, #0] @ davinci_uart_phys |
44 | ldr \rv, [\rv, #0] | 39 | ldr \rv, [\tmp, #4] @ davinci_uart_virt |
45 | cmp \rp, #0 @ is port configured? | 40 | cmp \rp, #0 @ is port configured? |
46 | cmpne \rv, #0 | 41 | cmpne \rv, #0 |
47 | bne 99f @ already configured | 42 | bne 100f @ already configured |
48 | 43 | ||
49 | /* Check the debug UART address set in uncompress.h */ | 44 | /* Check the debug UART address set in uncompress.h */ |
50 | mrc p15, 0, \rp, c1, c0 | ||
51 | tst \rp, #1 @ MMU enabled? | ||
52 | |||
53 | and \rp, pc, #0xff000000 | 45 | and \rp, pc, #0xff000000 |
54 | ldr \rv, =DAVINCI_UART_INFO_OFS | 46 | ldr \rv, =DAVINCI_UART_INFO_OFS |
55 | add \rp, \rp, \rv | 47 | add \rp, \rp, \rv |
56 | 48 | ||
57 | ldreq \rv, =davinci_uart_v2p(davinci_uart_phys) | ||
58 | ldrne \rv, =davinci_uart_phys | ||
59 | |||
60 | /* Copy uart phys address from decompressor uart info */ | 49 | /* Copy uart phys address from decompressor uart info */ |
61 | ldr \tmp, [\rp, #0] | 50 | ldr \rv, [\rp, #0] |
62 | str \tmp, [\rv, #0] | 51 | str \rv, [\tmp, #0] |
63 | 52 | ||
64 | /* Copy uart virt address from decompressor uart info */ | 53 | /* Copy uart virt address from decompressor uart info */ |
65 | ldr \tmp, [\rp, #4] | 54 | ldr \rv, [\rp, #4] |
66 | str \tmp, [\rv, #4] | 55 | str \rv, [\tmp, #4] |
67 | 56 | ||
68 | b 10b | 57 | b 10b |
69 | 99: | 58 | |
59 | .align | ||
60 | 99: .word . | ||
61 | .word davinci_uart_phys | ||
62 | .ltorg | ||
63 | |||
64 | 100: | ||
70 | .endm | 65 | .endm |
71 | 66 | ||
72 | .macro senduart,rd,rx | 67 | .macro senduart,rd,rx |