aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/include/mach/debug-macro.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/include/mach/debug-macro.S')
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S49
1 files changed, 28 insertions, 21 deletions
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S
index f761dfdb8689..f8b7ea4f6235 100644
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ b/arch/arm/mach-davinci/include/mach/debug-macro.S
@@ -24,40 +24,47 @@
24 24
25#define UART_SHIFT 2 25#define UART_SHIFT 2
26 26
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
27 .pushsection .data 30 .pushsection .data
28davinci_uart_phys: .word 0 31davinci_uart_phys: .word 0
29davinci_uart_virt: .word 0 32davinci_uart_virt: .word 0
30 .popsection 33 .popsection
31 34
32 .macro addruart, rx, tmp 35 .macro addruart, rp, rv
33 36
34 /* Use davinci_uart_phys/virt if already configured */ 37 /* Use davinci_uart_phys/virt if already configured */
3510: mrc p15, 0, \rx, c1, c0 3810: mrc p15, 0, \rp, c1, c0
36 tst \rx, #1 @ MMU enabled? 39 tst \rp, #1 @ MMU enabled?
37 ldreq \rx, =__virt_to_phys(davinci_uart_phys) 40 ldreq \rp, =davinci_uart_v2p(davinci_uart_phys)
38 ldrne \rx, =davinci_uart_virt 41 ldrne \rp, =davinci_uart_phys
39 ldr \rx, [\rx] 42 add \rv, \rp, #4 @ davinci_uart_virt
40 cmp \rx, #0 @ is port configured? 43 ldr \rp, [\rp, #0]
44 ldr \rv, [\rv, #0]
45 cmp \rp, #0 @ is port configured?
46 cmpne \rv, #0
41 bne 99f @ already configured 47 bne 99f @ already configured
42 48
43 mrc p15, 0, \rx, c1, c0 49 /* Check the debug UART address set in uncompress.h */
44 tst \rx, #1 @ MMU enabled? 50 mrc p15, 0, \rp, c1, c0
51 tst \rp, #1 @ MMU enabled?
45 52
46 /* Copy uart phys address from decompressor uart info */ 53 /* Copy uart phys address from decompressor uart info */
47 ldreq \tmp, =__virt_to_phys(davinci_uart_phys) 54 ldreq \rv, =davinci_uart_v2p(davinci_uart_phys)
48 ldrne \tmp, =davinci_uart_phys 55 ldrne \rv, =davinci_uart_phys
49 ldreq \rx, =DAVINCI_UART_INFO 56 ldreq \rp, =DAVINCI_UART_INFO
50 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO) 57 ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
51 ldr \rx, [\rx, #0] 58 ldr \rp, [\rp, #0]
52 str \rx, [\tmp] 59 str \rp, [\rv]
53 60
54 /* Copy uart virt address from decompressor uart info */ 61 /* Copy uart virt address from decompressor uart info */
55 ldreq \tmp, =__virt_to_phys(davinci_uart_virt) 62 ldreq \rv, =davinci_uart_v2p(davinci_uart_virt)
56 ldrne \tmp, =davinci_uart_virt 63 ldrne \rv, =davinci_uart_virt
57 ldreq \rx, =DAVINCI_UART_INFO 64 ldreq \rp, =DAVINCI_UART_INFO
58 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO) 65 ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
59 ldr \rx, [\rx, #4] 66 ldr \rp, [\rp, #4]
60 str \rx, [\tmp] 67 str \rp, [\rv]
61 68
62 b 10b 69 b 10b
6399: 7099: