aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/include
diff options
context:
space:
mode:
authorJeremy Kerr <jeremy.kerr@canonical.com>2010-07-06 06:30:06 -0400
committerNicolas Pitre <nico@fluxnic.net>2010-10-20 00:27:33 -0400
commit0ea1293009826da45e1019f45dfde1e557bb30df (patch)
tree7111bcd355921f03415182845e5f236ffe1896f4 /arch/arm/mach-davinci/include
parent1ea64615601229f0dc16dee91dc5b50216411baa (diff)
arm: return both physical and virtual addresses from addruart
Rather than checking the MMU status in every instance of addruart, do it once in kernel/debug.S, and change the existing addruart macros to return both physical and virtual addresses. The main debug code can then select the appropriate address to use. This will also allow us to retreive the address of a uart for the MMU state that we're not current in. Updated with fixes for OMAP from Jason Wang <jason77.wang@gmail.com> and Tony Lindgren <tony@atomide.com>, and fix for versatile express from Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Jason Wang <jason77.wang@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S46
1 files changed, 25 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..9f1befc5ac38 100644
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ b/arch/arm/mach-davinci/include/mach/debug-macro.S
@@ -29,35 +29,39 @@ davinci_uart_phys: .word 0
29davinci_uart_virt: .word 0 29davinci_uart_virt: .word 0
30 .popsection 30 .popsection
31 31
32 .macro addruart, rx, tmp 32 .macro addruart, rp, rv
33 33
34 /* Use davinci_uart_phys/virt if already configured */ 34 /* Use davinci_uart_phys/virt if already configured */
3510: mrc p15, 0, \rx, c1, c0 3510: mrc p15, 0, \rp, c1, c0
36 tst \rx, #1 @ MMU enabled? 36 tst \rp, #1 @ MMU enabled?
37 ldreq \rx, =__virt_to_phys(davinci_uart_phys) 37 ldreq \rp, =__virt_to_phys(davinci_uart_phys)
38 ldrne \rx, =davinci_uart_virt 38 ldrne \rp, =davinci_uart_phys
39 ldr \rx, [\rx] 39 add \rv, \rp, #4 @ davinci_uart_virt
40 cmp \rx, #0 @ is port configured? 40 ldr \rp, [\rp, #0]
41 ldr \rv, [\rv, #0]
42 cmp \rp, #0 @ is port configured?
43 cmpne \rv, #0
41 bne 99f @ already configured 44 bne 99f @ already configured
42 45
43 mrc p15, 0, \rx, c1, c0 46 /* Check the debug UART address set in uncompress.h */
44 tst \rx, #1 @ MMU enabled? 47 mrc p15, 0, \rp, c1, c0
48 tst \rp, #1 @ MMU enabled?
45 49
46 /* Copy uart phys address from decompressor uart info */ 50 /* Copy uart phys address from decompressor uart info */
47 ldreq \tmp, =__virt_to_phys(davinci_uart_phys) 51 ldreq \rv, =__virt_to_phys(davinci_uart_phys)
48 ldrne \tmp, =davinci_uart_phys 52 ldrne \rv, =davinci_uart_phys
49 ldreq \rx, =DAVINCI_UART_INFO 53 ldreq \rp, =DAVINCI_UART_INFO
50 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO) 54 ldrne \rp, =__phys_to_virt(DAVINCI_UART_INFO)
51 ldr \rx, [\rx, #0] 55 ldr \rp, [\rp, #0]
52 str \rx, [\tmp] 56 str \rp, [\rv]
53 57
54 /* Copy uart virt address from decompressor uart info */ 58 /* Copy uart virt address from decompressor uart info */
55 ldreq \tmp, =__virt_to_phys(davinci_uart_virt) 59 ldreq \rv, =__virt_to_phys(davinci_uart_virt)
56 ldrne \tmp, =davinci_uart_virt 60 ldrne \rv, =davinci_uart_virt
57 ldreq \rx, =DAVINCI_UART_INFO 61 ldreq \rp, =DAVINCI_UART_INFO
58 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO) 62 ldrne \rp, =__phys_to_virt(DAVINCI_UART_INFO)
59 ldr \rx, [\rx, #4] 63 ldr \rp, [\rp, #4]
60 str \rx, [\tmp] 64 str \rp, [\rv]
61 65
62 b 10b 66 b 10b
6399: 6799: