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>
This commit is contained in:
Jeremy Kerr 2010-07-06 18:30:06 +08:00 committed by Nicolas Pitre
parent 1ea6461560
commit 0ea1293009
56 changed files with 440 additions and 454 deletions

View file

@ -22,7 +22,7 @@
#if defined(CONFIG_DEBUG_ICEDCC)
@@ debug using ARM EmbeddedICE DCC channel
.macro addruart, rx, tmp
.macro addruart, rp, rv
.endm
#if defined(CONFIG_CPU_V6)
@ -121,6 +121,22 @@ wait: mrc p14, 0, pc, c0, c1, 0
#include <mach/debug-macro.S>
#endif /* CONFIG_DEBUG_ICEDCC */
#ifdef CONFIG_MMU
.macro addruart_current, rx, tmp1, tmp2
addruart \tmp1, \tmp2
mrc p15, 0, \rx, c1, c0
tst \rx, #1
moveq \rx, \tmp1
movne \rx, \tmp2
.endm
#else /* !CONFIG_MMU */
.macro addruart_current, rx, tmp1, tmp2
addruart \rx, \tmp1
.endm
#endif /* CONFIG_MMU */
/*
* Useful debugging routines
*/
@ -155,7 +171,7 @@ ENDPROC(printhex2)
.ltorg
ENTRY(printascii)
addruart r3, r1
addruart_current r3, r1, r2
b 2f
1: waituart r2, r3
senduart r1, r3
@ -171,7 +187,7 @@ ENTRY(printascii)
ENDPROC(printascii)
ENTRY(printch)
addruart r3, r1
addruart_current r3, r1, r2
mov r1, r0
mov r0, #0
b 1b