arm: return both physical and virtual addresses from addruart
authorJeremy Kerr <jeremy.kerr@canonical.com>
Tue, 6 Jul 2010 10:30:06 +0000 (18:30 +0800)
committerNicolas Pitre <nico@fluxnic.net>
Wed, 20 Oct 2010 04:27:33 +0000 (00:27 -0400)
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>
56 files changed:
arch/arm/kernel/debug.S
arch/arm/mach-aaec2000/include/mach/debug-macro.S
arch/arm/mach-at91/include/mach/debug-macro.S
arch/arm/mach-clps711x/include/mach/debug-macro.S
arch/arm/mach-cns3xxx/include/mach/debug-macro.S
arch/arm/mach-davinci/include/mach/debug-macro.S
arch/arm/mach-dove/include/mach/debug-macro.S
arch/arm/mach-ebsa110/include/mach/debug-macro.S
arch/arm/mach-ep93xx/include/mach/debug-macro.S
arch/arm/mach-footbridge/include/mach/debug-macro.S
arch/arm/mach-gemini/include/mach/debug-macro.S
arch/arm/mach-h720x/include/mach/debug-macro.S
arch/arm/mach-integrator/include/mach/debug-macro.S
arch/arm/mach-iop13xx/include/mach/debug-macro.S
arch/arm/mach-iop32x/include/mach/debug-macro.S
arch/arm/mach-iop33x/include/mach/debug-macro.S
arch/arm/mach-ixp2000/include/mach/debug-macro.S
arch/arm/mach-ixp23xx/include/mach/debug-macro.S
arch/arm/mach-ixp4xx/include/mach/debug-macro.S
arch/arm/mach-kirkwood/include/mach/debug-macro.S
arch/arm/mach-ks8695/include/mach/debug-macro.S
arch/arm/mach-l7200/include/mach/debug-macro.S [new file with mode: 0644]
arch/arm/mach-lh7a40x/include/mach/debug-macro.S
arch/arm/mach-loki/include/mach/debug-macro.S
arch/arm/mach-lpc32xx/include/mach/debug-macro.S
arch/arm/mach-mmp/include/mach/debug-macro.S
arch/arm/mach-msm/include/mach/debug-macro.S
arch/arm/mach-mv78xx0/include/mach/debug-macro.S
arch/arm/mach-netx/include/mach/debug-macro.S
arch/arm/mach-nomadik/include/mach/debug-macro.S
arch/arm/mach-ns9xxx/include/mach/debug-macro.S
arch/arm/mach-omap1/include/mach/debug-macro.S
arch/arm/mach-omap2/include/mach/debug-macro.S
arch/arm/mach-orion5x/include/mach/debug-macro.S
arch/arm/mach-pnx4008/include/mach/debug-macro.S
arch/arm/mach-pxa/include/mach/debug-macro.S
arch/arm/mach-realview/include/mach/debug-macro.S
arch/arm/mach-rpc/include/mach/debug-macro.S
arch/arm/mach-s3c2410/include/mach/debug-macro.S
arch/arm/mach-s3c24a0/include/mach/debug-macro.S
arch/arm/mach-s3c64xx/include/mach/debug-macro.S
arch/arm/mach-s5p6442/include/mach/debug-macro.S
arch/arm/mach-s5pc100/include/mach/debug-macro.S
arch/arm/mach-s5pv210/include/mach/debug-macro.S
arch/arm/mach-s5pv310/include/mach/debug-macro.S
arch/arm/mach-sa1100/include/mach/debug-macro.S
arch/arm/mach-shark/include/mach/debug-macro.S
arch/arm/mach-tegra/include/mach/debug-macro.S
arch/arm/mach-u300/include/mach/debug-macro.S
arch/arm/mach-ux500/include/mach/debug-macro.S
arch/arm/mach-versatile/include/mach/debug-macro.S
arch/arm/mach-vexpress/include/mach/debug-macro.S
arch/arm/plat-mxc/include/mach/debug-macro.S
arch/arm/plat-spear/include/plat/debug-macro.S
arch/arm/plat-stmp3xxx/include/mach/debug-macro.S
arch/arm/plat-tcc/include/mach/debug-macro.S

index f91395206a4b9792ccae43b9ef5ed0c41dc62218..a0f07521ca8a2dd1b5a3ffc375b6eaadc9f51131 100644 (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
index a9cac368bfe69f184c85ce7058ec29cfe10c83a2..bc7ad5561c4caee31fe32957ec297488b998c576 100644 (file)
  */
 
 #include "hardware.h"
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x80000000                @ physical
-               movne   \rx, #io_p2v(0x80000000)        @ virtual
-               orr     \rx, \rx, #0x00000800
+               .macro  addruart, rp, rv
+               mov     \rp, 0x00000800
+               orr     \rv, \rp, #io_p2v(0x80000000)   @ virtual
+               orr     \rp, \rp, #0x80000000           @ physical
                .endm
 
                .macro  senduart,rd,rx
index 9e750a1c1b5a80fbab076f70314f8ffd7f5a1bd2..0f959faf74a9ffe7eb9ddc02ee6d6fddebcae419 100644 (file)
 #include <mach/hardware.h>
 #include <mach/at91_dbgu.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                         @ MMU enabled?
-       ldreq   \rx, =(AT91_BASE_SYS + AT91_DBGU)               @ System peripherals (phys address)
-       ldrne   \rx, =(AT91_VA_BASE_SYS + AT91_DBGU)            @ System peripherals (virt address)
+       .macro  addruart, rp, rv
+       ldr     \rp, =(AT91_BASE_SYS + AT91_DBGU)               @ System peripherals (phys address)
+       ldr     \rv, =(AT91_VA_BASE_SYS + AT91_DBGU)            @ System peripherals (virt address)
        .endm
 
        .macro  senduart,rd,rx
index 072cc6b61ba30b7b6e363040b40d409e8a43e38f..507c6873b7ee7e3b297864838a9767c01e77807b 100644 (file)
 #include <mach/hardware.h>
 #include <asm/hardware/clps7111.h>
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #CLPS7111_PHYS_BASE
-               movne   \rx, #CLPS7111_VIRT_BASE
+               .macro  addruart, rp, rv
 #ifndef CONFIG_DEBUG_CLPS711X_UART2
-               add     \rx, \rx, #0x0000       @ UART1
+               mov     \rp, #0x0000    @ UART1
 #else
-               add     \rx, \rx, #0x1000       @ UART2
+               mov     \rp, #0x1000    @ UART2
 #endif
+               orr     \rv, \rp, #CLPS7111_VIRT_BASE
+               orr     \rp, \rp, #CLPS7111_PHYS_BASE
                .endm
 
                .macro  senduart,rd,rx
index d16ce7eb00e9092a765bc7968e40f7e5d0fb5ee8..56d828634db5d82a81a711f27bed2f6e9d6ce4d8 100644 (file)
  * published by the Free Software Foundation.
  */
 
-               .macro  addruart,rx
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx,      #0x10000000
-               movne   \rx,      #0xf0000000   @ virtual base
-               orr     \rx, \rx, #0x00009000
+               .macro  addruart,rp,rv
+               mov     \rp, #0x00009000
+               orr     \rv, \rp, #0xf0000000   @ virtual base
+               orr     \rp, \rp, #0x10000000
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index f761dfdb8689b3f191e784b228731d2eff12fbe0..9f1befc5ac387d2d0124c080c88458a67dc0b30f 100644 (file)
@@ -29,35 +29,39 @@ davinci_uart_phys:  .word   0
 davinci_uart_virt:     .word   0
                .popsection
 
-               .macro addruart, rx, tmp
+               .macro addruart, rp, rv
 
                /* Use davinci_uart_phys/virt if already configured */
-10:            mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               ldreq   \rx, =__virt_to_phys(davinci_uart_phys)
-               ldrne   \rx, =davinci_uart_virt
-               ldr     \rx, [\rx]
-               cmp     \rx, #0                 @ is port configured?
+10:            mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
+               ldreq   \rp, =__virt_to_phys(davinci_uart_phys)
+               ldrne   \rp, =davinci_uart_phys
+               add     \rv, \rp, #4            @ davinci_uart_virt
+               ldr     \rp, [\rp, #0]
+               ldr     \rv, [\rv, #0]
+               cmp     \rp, #0                 @ is port configured?
+               cmpne   \rv, #0
                bne     99f                     @ already configured
 
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
+               /* Check the debug UART address set in uncompress.h */
+               mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
 
                /* Copy uart phys address from decompressor uart info */
-               ldreq   \tmp, =__virt_to_phys(davinci_uart_phys)
-               ldrne   \tmp, =davinci_uart_phys
-               ldreq   \rx, =DAVINCI_UART_INFO
-               ldrne   \rx, =__phys_to_virt(DAVINCI_UART_INFO)
-               ldr     \rx, [\rx, #0]
-               str     \rx, [\tmp]
+               ldreq   \rv, =__virt_to_phys(davinci_uart_phys)
+               ldrne   \rv, =davinci_uart_phys
+               ldreq   \rp, =DAVINCI_UART_INFO
+               ldrne   \rp, =__phys_to_virt(DAVINCI_UART_INFO)
+               ldr     \rp, [\rp, #0]
+               str     \rp, [\rv]
 
                /* Copy uart virt address from decompressor uart info */
-               ldreq   \tmp, =__virt_to_phys(davinci_uart_virt)
-               ldrne   \tmp, =davinci_uart_virt
-               ldreq   \rx, =DAVINCI_UART_INFO
-               ldrne   \rx, =__phys_to_virt(DAVINCI_UART_INFO)
-               ldr     \rx, [\rx, #4]
-               str     \rx, [\tmp]
+               ldreq   \rv, =__virt_to_phys(davinci_uart_virt)
+               ldrne   \rv, =davinci_uart_virt
+               ldreq   \rp, =DAVINCI_UART_INFO
+               ldrne   \rp, =__phys_to_virt(DAVINCI_UART_INFO)
+               ldr     \rp, [\rp, #4]
+               str     \rp, [\rv]
 
                b       10b
 99:
index 1521d13f1d14928a12a1a8b79ad4fd4d5037e3c1..da8bf2bad3b1df0036527ba11b9d1df5ee50bc80 100644 (file)
@@ -8,12 +8,11 @@
 
 #include <mach/bridge-regs.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =DOVE_SB_REGS_PHYS_BASE
-       ldrne   \rx, =DOVE_SB_REGS_VIRT_BASE
-       orr     \rx, \rx, #0x00012000
+       .macro  addruart, rp, rv
+       ldr     \rp, =DOVE_SB_REGS_PHYS_BASE
+       ldr     \rv, =DOVE_SB_REGS_VIRT_BASE
+       orr     \rp, \rp, #0x00012000
+       orr     \rv, \rv, #0x00012000
        .endm
 
 #define UART_SHIFT     2
index ebbd89f0e6c0e8967171396e4113e82c6826d266..7ef5690fd08c876cc27366d0b38451988daf066c 100644 (file)
  *
 **/
 
-               .macro  addruart, rx, tmp
-               mov     \rx, #0xf0000000
-               orr     \rx, \rx, #0x00000be0
+               .macro  addruart, rp, rv
+               mov     \rp, #0xf0000000
+               orr     \rp, \rp, #0x00000be0
+               mov     \rp, \rv
                .endm
 
 #define UART_SHIFT     2
index 5cd22444e2236ae8fb73e59641e8dd82347f0fdf..b25bc90763673df4551e1bf0b6935a1d31e126f0 100644 (file)
  */
 #include <mach/ep93xx-regs.h>
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                         @ MMU enabled?
-               ldreq   \rx, =EP93XX_APB_PHYS_BASE      @ Physical base
-               ldrne   \rx, =EP93XX_APB_VIRT_BASE      @ virtual base
-               orr     \rx, \rx, #0x000c0000
+               .macro  addruart, rp, rv
+               ldr     \rp, =EP93XX_APB_PHYS_BASE      @ Physical base
+               ldr     \rv, =EP93XX_APB_VIRT_BASE      @ virtual base
+               orr     \rp, \rp, #0x000c0000
+               orr     \rv, \rv, #0x000c0000
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index 60dda1318f2285785829c46c399889d5da495c89..3c9e0c40c679196ba02766ad7949ae1d504c1bf7 100644 (file)
 
 #ifndef CONFIG_DEBUG_DC21285_PORT
        /* For NetWinder debugging */
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x7c000000        @ physical
-               movne   \rx, #0xff000000        @ virtual
-               orr     \rx, \rx, #0x000003f8
+               .macro  addruart, rp, rv
+               mov     \rp, #0x000003f8
+               orr     \rv, \rp, #0x7c000000   @ physical
+               orr     \rp, \rp, #0xff000000   @ virtual
                .endm
 
 #define UART_SHIFT     0
                .equ    dc21285_high, ARMCSR_BASE & 0xff000000
                .equ    dc21285_low,  ARMCSR_BASE & 0x00ffffff
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x42000000
-               movne   \rx, #dc21285_high
+               .macro  addruart, rp, rv
                .if     dc21285_low
-               orrne   \rx, \rx, #dc21285_low
+               mov     \rp, #dc21285_low
+               .else
+               mov     \rp, #0
                .endif
+               orr     \rv, \rp, #0x42000000
+               orr     \rp, \rp, #dc21285_high
                .endm
 
                .macro  senduart,rd,rx
index ad477047069ddc9188e33657f3ad0b5338b83e11..f40e006d296e66d884d63525e25d7db45517f41c 100644 (file)
  */
 #include <mach/hardware.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =GEMINI_UART_BASE                  @ physical
-       ldrne   \rx, =IO_ADDRESS(GEMINI_UART_BASE)      @ virtual
+       .macro  addruart, rp, rv
+       ldr     \rp, =GEMINI_UART_BASE                  @ physical
+       ldr     \rv, =IO_ADDRESS(GEMINI_UART_BASE)      @ virtual
        .endm
 
 #define UART_SHIFT     2
index 27cafd12f033cbba19bd507e5a90ac198c1db8e1..c2093e835720f55bc137362b3d12f8895f2a83b8 100644 (file)
                .equ    io_virt, IO_VIRT
                .equ    io_phys, IO_PHYS
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                @ MMU enabled?
-               moveq   \rx, #io_phys          @ physical base address
-               movne   \rx, #io_virt          @ virtual address
-               add     \rx, \rx, #0x00020000   @ UART1
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00020000        @ UART1
+               add     \rv, \rp, #io_virt      @ virtual address
+               add     \rp, \rp, #io_phys      @ physical base address
                .endm
 
                .macro  senduart,rd,rx
index 87a6888ae011ba71e3764f02ab97a1b74260e839..a1f598fd3a567292a6abf0f9857a5f455ed9c614 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x16000000        @ physical base address
-               movne   \rx, #0xf0000000        @ virtual base
-               addne   \rx, \rx, #0x16000000 >> 4
+               .macro  addruart, rp, rv
+               mov     \rp, #0x16000000        @ physical base address
+               mov     \rv, #0xf0000000        @ virtual base
+               add     \rv, \rv, #0x16000000 >> 4
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index c9d6ba46963da99c4f5c8ede984a27f470238024..e664466d51bf47a410235c19a1e60a9170e0a0bc 100644 (file)
  * published by the Free Software Foundation.
  */
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                 @ mmu enabled?
-       moveq   \rx, #0xff000000        @ physical
-       orreq   \rx, \rx, #0x00d80000
-       movne   \rx, #0xfe000000        @ virtual
-       orrne   \rx, \rx, #0x00e80000
-       orr     \rx, \rx, #0x00002300
-       orr     \rx, \rx, #0x00000040
+       .macro  addruart, rp, rv
+       mov     \rp, #0x00002300
+       orr     \rp, \rp, #0x00000040
+       orr     \rv, \rp, #0xfe000000   @ virtual
+       orr     \rv, \rv, #0x00e80000
+       orr     \rp, \rp, #0xff000000   @ physical
+       orr     \rp, \rp, #0x00d80000
        .endm
 
 #define UART_SHIFT     2
index 736afe1edd1f668c4f84850b1604a3fc98a699b2..ff9e76c09f35b28ec0c551ad107b37d27b398d20 100644 (file)
  * published by the Free Software Foundation.
  */
 
-               .macro  addruart, rx, tmp
-               mov     \rx, #0xfe000000        @ physical as well as virtual
-               orr     \rx, \rx, #0x00800000   @ location of the UART
+               .macro  addruart, rp, rv
+               mov     \rp, #0xfe000000        @ physical as well as virtual
+               orr     \rp, \rp, #0x00800000   @ location of the UART
+               mov     \rv, \rp
                .endm
 
 #define UART_SHIFT     0
index addb2da78422b0ff58df52a64dce48fe57bdd169..40c500dd1fac61ec3f520fe0fb0fab6934d43a74 100644 (file)
  * published by the Free Software Foundation.
  */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ mmu enabled?
-               moveq   \rx, #0xff000000        @ physical
-               movne   \rx, #0xfe000000        @ virtual
-               orr     \rx, \rx, #0x00ff0000
-               orr     \rx, \rx, #0x0000f700
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00ff0000
+               orr     \rp, \rp, #0x0000f700
+               orr     \rv, #0xfe000000        @ virtual
+               orr     \rp, #0xff000000        @ physical
                .endm
 
 #define UART_SHIFT     2
index 6a827681680fe20b833c07bc1990c488d1c20dae..0ef533b209721380abef4ffbd68d5c6a94a1c140 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0xc0000000        @ Physical base
-               movne   \rx, #0xfe000000        @ virtual base
-               orrne   \rx, \rx, #0x00f00000
-               orr     \rx, \rx, #0x00030000
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00030000
 #ifdef __ARMEB__
-               orr     \rx, \rx, #0x00000003
+               orr     \rp, \rp, #0x00000003
 #endif
+               orr     \rv, \rp, #0xfe000000   @ virtual base
+               orr     \rv, \rv, #0x00f00000
+               orr     \rp, \rp, #0xc0000000   @ Physical base
                .endm
 
 #define UART_SHIFT     2
index a82e375465e283651c4f8e96ea7913c4a77f4b35..f7c6eef7fa220d58a57b72e852002d22f14efe8f 100644 (file)
  */
 #include <mach/ixp23xx.h>
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                         @ mmu enabled?
-               ldreq   \rx, =IXP23XX_PERIPHERAL_PHYS   @ physical
-               ldrne   \rx, =IXP23XX_PERIPHERAL_VIRT   @ virtual
+               .macro  addruart, rp, rv
+               ldr     \rp, =IXP23XX_PERIPHERAL_PHYS   @ physical
+               ldr     \rv, =IXP23XX_PERIPHERAL_VIRT   @ virtual
 #ifdef __ARMEB__
-               orr     \rx, \rx, #0x00000003
+               orr     \rp, \rp, #0x00000003
+               orr     \rv, \rv, #0x00000003
 #endif
                .endm
 
index 3fc66d6d00a01f9d5b559f65ce096ebbf5576717..b974a49c0aff45a6a1ca1967b501f7d80588e757 100644 (file)
  * published by the Free Software Foundation.
 */
 
-                .macro  addruart, rx, tmp
-                mrc     p15, 0, \rx, c1, c0
-                tst     \rx, #1                 @ MMU enabled?
-                moveq   \rx, #0xc8000000
-                movne   \rx, #0xff000000
-               orrne   \rx, \rx, #0x00b00000
+                .macro  addruart, rp, rv
 #ifdef __ARMEB__
-                add     \rx,\rx,#3              @ Uart regs are at off set of 3 if
-                                               @ byte writes used - Big Endian.
+                mov     \rp, #3         @ Uart regs are at off set of 3 if
+                                       @ byte writes used - Big Endian.
+#else
+               mov     \rp, #0
 #endif
+                orr     \rv, \rp, #0xff000000  @ virtual
+               orr     \rv, \rv, #0x00b00000
+                orr     \rp, \rp, #0xc8000000  @ physical
                 .endm
 
 #define UART_SHIFT     2
index d0606774dea7de3baa03e4291dd016b0825dde07..db06ae437d08c69fa126edf696b377bdca54262e 100644 (file)
@@ -8,12 +8,11 @@
 
 #include <mach/bridge-regs.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =KIRKWOOD_REGS_PHYS_BASE
-       ldrne   \rx, =KIRKWOOD_REGS_VIRT_BASE
-       orr     \rx, \rx, #0x00012000
+       .macro  addruart, rp, rv
+       ldr     \rp, =KIRKWOOD_REGS_PHYS_BASE
+       ldr     \rv, =KIRKWOOD_REGS_VIRT_BASE
+       orr     \rp, \rp, #0x00012000
+       orr     \rv, \rv, #0x00012000
        .endm
 
 #define UART_SHIFT     2
index cf2095da2372cddfb0e3105f1ab04ac4fc4fc61c..bf516adf19250d05eb020fac0be6b51611416e45 100644 (file)
 #include <mach/hardware.h>
 #include <mach/regs-uart.h>
 
-       .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                         @ MMU enabled?
-               ldreq   \rx, =KS8695_UART_PA            @ physical base address
-               ldrne   \rx, =KS8695_UART_VA            @ virtual base address
+       .macro  addruart, rp, rv
+               ldr     \rp, =KS8695_UART_PA            @ physical base address
+               ldr     \rv, =KS8695_UART_VA            @ virtual base address
        .endm
 
        .macro  senduart, rd, rx
diff --git a/arch/arm/mach-l7200/include/mach/debug-macro.S b/arch/arm/mach-l7200/include/mach/debug-macro.S
new file mode 100644 (file)
index 0000000..b0a2db7
--- /dev/null
@@ -0,0 +1,38 @@
+/* arch/arm/mach-l7200/include/mach/debug-macro.S
+ *
+ * Debugging macro include header
+ *
+ *  Copyright (C) 1994-1999 Russell King
+ *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+               .equ    io_virt, IO_BASE
+               .equ    io_phys, IO_START
+
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00044000        @ UART1
+@              mov     \rp, #0x00045000        @ UART2
+               add     \rv, \rp, #io_virt      @ virtual address
+               add     \rp, \rp, #io_phys      @ physical base address
+               .endm
+
+               .macro  senduart,rd,rx
+               str     \rd, [\rx, #0x0]        @ UARTDR
+               .endm
+
+               .macro  waituart,rd,rx
+1001:          ldr     \rd, [\rx, #0x18]       @ UARTFLG
+               tst     \rd, #1 << 5            @ UARTFLGUTXFF - 1 when full
+               bne     1001b
+               .endm
+
+               .macro  busyuart,rd,rx
+1001:          ldr     \rd, [\rx, #0x18]       @ UARTFLG
+               tst     \rd, #1 << 3            @ UARTFLGUBUSY - 1 when busy
+               bne     1001b
+               .endm
index c0dcbbba22ba6f7eeb0af9893579f7aedc870879..cff33625276faa4bb4f6d78fbe9a9163cd9430d2 100644 (file)
        @ It is not known if this will be appropriate for every 40x
        @ board.
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               mov     \rx, #0x00000700        @ offset from base
-               orreq   \rx, \rx, #0x80000000   @ physical base
-               orrne   \rx, \rx, #0xf8000000   @ virtual base
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00000700        @ offset from base
+               orr     \rv, \rp, #0xf8000000   @ virtual base
+               orr     \rp, \rp, #0x80000000   @ physical base
                .endm
 
                .macro  senduart,rd,rx
index 3136c913a92c2c4886cbcd232f145f9aac2572f2..cc90d99ac76ce8419e8d12079afb9c72a4ca2618 100644 (file)
@@ -8,12 +8,11 @@
 
 #include <mach/loki.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =LOKI_REGS_PHYS_BASE
-       ldrne   \rx, =LOKI_REGS_VIRT_BASE
-       orr     \rx, \rx, #0x00012000
+       .macro  addruart, rp, rv
+       ldr     \rp, =LOKI_REGS_PHYS_BASE
+       ldr     \rv, =LOKI_REGS_VIRT_BASE
+       orr     \rp, \rp, #0x00012000
+       orr     \rv, \rv, #0x00012000
        .endm
 
 #define UART_SHIFT     2
index 621744d6b15205954bbad0980b89a2315c343d3f..629e744aeb9e980dd1c4ad2c5b9c7ba16274ff16 100644 (file)
  * Debug output is hardcoded to standard UART 5
 */
 
-       .macro  addruart,rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                         @ MMU enabled?
-       ldreq   \rx, =0x40090000
-       ldrne   \rx, =0xF4090000
+       .macro  addruart, rp, rv
+       ldreq   \rp, =0x40090000
+       ldrne   \rv, =0xF4090000
        .endm
 
 #define UART_SHIFT     2
index 76deff238e1c5f394505a0a413d3fb98577d0645..7e2ebd3efc7c0ba900ced458e0268cb99c166975 100644 (file)
 
 #include <mach/addr-map.h>
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                         @ MMU enabled?
-               ldreq   \rx, =APB_PHYS_BASE             @ physical
-               ldrne   \rx, =APB_VIRT_BASE             @ virtual
-               orr     \rx, \rx, #0x00017000
+               .macro  addruart, rp, rv
+               ldr     \rp, =APB_PHYS_BASE             @ physical
+               ldr     \rv, =APB_VIRT_BASE             @ virtual
+               orr     \rp, \rp, #0x00017000
+               orr     \rv, \rv, #0x00017000
                .endm
 
 #define UART_SHIFT     2
index 238c4f132cdb954d451addcb00e904cfd6131805..fbd5d90dcc8ce36ec411e8b8d1be04613a2742f0 100644 (file)
 #include <mach/msm_iomap.h>
 
 #ifdef CONFIG_HAS_MSM_DEBUG_UART_PHYS
-       .macro  addruart, rx, tmp
-       @ see if the MMU is enabled and select appropriate base address
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1
-       ldreq   \rx, =MSM_DEBUG_UART_PHYS
-       ldrne   \rx, =MSM_DEBUG_UART_BASE
+       .macro  addruart, rp, rv
+       ldr     \rp, =MSM_DEBUG_UART_PHYS
+       ldr     \rv, =MSM_DEBUG_UART_BASE
        .endm
 
        .macro  senduart,rd,rx
        tst     \rd, #0x04
        beq     1001b
        .endm
-#else
-       .macro  addruart, rx, tmp
-       .endm
-
-       .macro  senduart,rd,rx
-       .endm
-
-       .macro  waituart,rd,rx
-       .endm
-#endif
 
        .macro  busyuart,rd,rx
        .endm
+#endif
index cd81689c4621dad5bfa9b08d2b1a35bed5049b8a..04891428e48bcd9d4cc164679a8fbc0a77fff900 100644 (file)
@@ -8,12 +8,11 @@
 
 #include <mach/mv78xx0.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =MV78XX0_REGS_PHYS_BASE
-       ldrne   \rx, =MV78XX0_REGS_VIRT_BASE
-       orr     \rx, \rx, #0x00012000
+       .macro  addruart, rp, rv
+       ldr     \rp, =MV78XX0_REGS_PHYS_BASE
+       ldr     \rv, =MV78XX0_REGS_VIRT_BASE
+       orr     \rp, \rp, #0x00012000
+       orr     \rv, \rv, #0x00012000
        .endm
 
 #define UART_SHIFT     2
index e96339e71d88fec6cbf56e72f08ba9d0dd4d9008..56a9152281801fd7f0e32ccbd2c61895f69db4be 100644 (file)
 
 #include "hardware.h"
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x00100000                @ physical
-               movne   \rx, #io_p2v(0x00100000)        @ virtual
-               orr     \rx, \rx, #0x00000a00
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00000a00
+               orr     \rv, \rp, #io_p2v(0x00100000)   @ virtual
+               orr     \rp, \rp, #0x00100000           @ physical
                .endm
 
                .macro  senduart,rd,rx
index 4f92acfba9545aaf5f9043925b51d8fcd1334ac0..e7151b4b88896f8a8426d6c7c7eb8db4ae79860f 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x10000000        @ physical base address
-               movne   \rx, #0xf0000000        @ virtual base
-               add     \rx, \rx, #0x00100000
-               add     \rx, \rx, #0x000fb000
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00100000
+               add     \rp, \rp, #0x000fb000
+               add     \rv, \rp, #0xf0000000   @ virtual base
+               add     \rp, \rp, #0x10000000   @ physical base address
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index 5c934bdb71583e037c59fdadc3490e43838ff425..5a2acbdc3d679f2563aab0a8a24b4988b26431aa 100644 (file)
 
 #include <mach/regs-board-a9m9750dev.h>
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, =NS9XXX_CSxSTAT_PHYS(0)
-               ldrne   \rx, =io_p2v(NS9XXX_CSxSTAT_PHYS(0))
+               .macro  addruart, rp, rv
+               ldr     \rp, =NS9XXX_CSxSTAT_PHYS(0)
+               ldr     \rv, =io_p2v(NS9XXX_CSxSTAT_PHYS(0))
                .endm
 
 #define UART_SHIFT     2
index 671408eb4ab42f8d0128f125c546a8b2405bc9d0..6a0fa04623650237d7f496a045eb8e498ded221e 100644 (file)
@@ -28,56 +28,58 @@ omap_uart_virt:     .word   0x0
                 * the desired UART phys and virt addresses temporarily into
                 * the omap_uart_phys and omap_uart_virt above.
                 */
-               .macro  addruart, rx, tmp
+               .macro  addruart, rp, rv
 
                /* Use omap_uart_phys/virt if already configured */
-9:             mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               ldreq   \rx, =__virt_to_phys(omap_uart_phys)    @ physical base address
-               ldrne   \rx, =omap_uart_virt    @ virtual base
-               ldr     \rx, [\rx, #0]
-               cmp     \rx, #0                 @ is port configured?
+9:             mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
+               ldreq   \rp, =__virt_to_phys(omap_uart_phys)    @ MMU not enabled
+               ldrne   \rp, =omap_uart_phys    @ MMU enabled
+               add     \rv, \rp, #4            @ omap_uart_virt
+               ldr     \rp, [\rp, #0]
+               ldr     \rv, [\rv, #0]
+               cmp     \rp, #0                 @ is port configured?
+               cmpne   \rv, #0
                bne     99f                     @ already configured
 
                /* Check the debug UART configuration set in uncompress.h */
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               ldreq   \rx, =OMAP_UART_INFO
-               ldrne   \rx, =__phys_to_virt(OMAP_UART_INFO)
-               ldr     \rx, [\rx, #0]
+               mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
+               ldreq   \rp, =OMAP_UART_INFO    @ MMU not enabled
+               ldrne   \rp, =__phys_to_virt(OMAP_UART_INFO)    @ MMU enabled
+               ldr     \rp, [\rp, #0]
 
                /* Select the UART to use based on the UART1 scratchpad value */
-10:            cmp     \rx, #0                 @ no port configured?
+10:            cmp     \rp, #0                 @ no port configured?
                beq     11f                     @ if none, try to use UART1
-               cmp     \rx, #OMAP1UART1
+               cmp     \rp, #OMAP1UART1
                beq     11f                     @ configure OMAP1UART1
-               cmp     \rx, #OMAP1UART2
+               cmp     \rp, #OMAP1UART2
                beq     12f                     @ configure OMAP1UART2
-               cmp     \rx, #OMAP1UART3
+               cmp     \rp, #OMAP1UART3
                beq     13f                     @ configure OMAP2UART3
 
                /* Configure the UART offset from the phys/virt base */
-11:            mov     \rx, #0x00fb0000        @ OMAP1UART1
+11:            mov     \rp, #0x00fb0000        @ OMAP1UART1
                b       98f
-12:            mov     \rx, #0x00fb0000        @ OMAP1UART1
-               orr     \rx, \rx, #0x00000800   @ OMAP1UART2
+12:            mov     \rp, #0x00fb0000        @ OMAP1UART1
+               orr     \rp, \rp, #0x00000800   @ OMAP1UART2
                b       98f
-13:            mov     \rx, #0x00fb0000        @ OMAP1UART1
-               orr     \rx, \rx, #0x00000800   @ OMAP1UART2
-               orr     \rx, \rx, #0x00009000   @ OMAP1UART3
+13:            mov     \rp, #0x00fb0000        @ OMAP1UART1
+               orr     \rp, \rp, #0x00000800   @ OMAP1UART2
+               orr     \rp, \rp, #0x00009000   @ OMAP1UART3
 
                /* Store both phys and virt address for the uart */
-98:            add     \rx, \rx, #0xff000000   @ phys base
-               mrc     p15, 0, \tmp, c1, c0
-               tst     \tmp, #1                @ MMU enabled?
-               ldreq   \tmp, =__virt_to_phys(omap_uart_phys)
-               ldrne   \tmp, =omap_uart_phys
-               str     \rx, [\tmp, #0]
-               sub     \rx, \rx, #0xff000000   @ phys base
-               add     \rx, \rx, #0xfe000000   @ virt base
-               ldreq   \tmp, =__virt_to_phys(omap_uart_virt)
-               ldrne   \tmp, =omap_uart_virt
-               str     \rx, [\tmp, #0]
+98:            add     \rp, \rp, #0xff000000   @ phys base
+               mrc     p15, 0, \rv, c1, c0
+               tst     \rv, #1                 @ MMU enabled?
+               ldreq   \rv, =__virt_to_phys(omap_uart_phys)    @ MMU not enabled
+               ldrne   \rv, =omap_uart_phys    @ MMU enabled
+               str     \rp, [\rv, #0]
+               sub     \rp, \rp, #0xff000000   @ phys base
+               add     \rp, \rp, #0xfe000000   @ virt base
+               add     \rv, \rv, #4            @ omap_uart_lsr
+               str     \rp, [\rv, #0]
                b       9b
 99:
                .endm
index 09331bbbda52b66e267756b58cf8294472a010bb..6a4d4136002ed9999fa401e61c3776b74abe7581 100644 (file)
@@ -31,95 +31,94 @@ omap_uart_lsr:      .word   0
                 * the desired UART phys and virt addresses temporarily into
                 * the omap_uart_phys and omap_uart_virt above.
                 */
-               .macro  addruart, rx, tmp
+               .macro  addruart, rp, rv
 
                /* Use omap_uart_phys/virt if already configured */
-10:            mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               ldreq   \rx, =__virt_to_phys(omap_uart_phys)    @ physical base address
-               ldrne   \rx, =omap_uart_virt    @ virtual base address
-               ldr     \rx, [\rx, #0]
-               cmp     \rx, #0                 @ is port configured?
+10:            mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
+               ldreq   \rp, =__virt_to_phys(omap_uart_phys)    @ MMU not enabled
+               ldrne   \rp, =omap_uart_phys    @ MMU enabled
+               add     \rv, \rp, #4            @ omap_uart_virt
+               ldr     \rp, [\rp, #0]
+               ldr     \rv, [\rv, #0]
+               cmp     \rp, #0                 @ is port configured?
+               cmpne   \rv, #0
                bne     99f                     @ already configured
 
                /* Check the debug UART configuration set in uncompress.h */
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               ldreq   \rx, =OMAP_UART_INFO
-               ldrne   \rx, =__phys_to_virt(OMAP_UART_INFO)
-               ldr     \rx, [\rx, #0]
+               mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
+               ldreq   \rp, =OMAP_UART_INFO    @ MMU not enabled
+               ldrne   \rp, =__phys_to_virt(OMAP_UART_INFO)    @ MMU enabled
+               ldr     \rp, [\rp, #0]
 
                /* Select the UART to use based on the UART1 scratchpad value */
-               cmp     \rx, #0                 @ no port configured?
+               cmp     \rp, #0                 @ no port configured?
                beq     21f                     @ if none, try to use UART1
-               cmp     \rx, #OMAP2UART1        @ OMAP2/3/4UART1
+               cmp     \rp, #OMAP2UART1        @ OMAP2/3/4UART1
                beq     21f                     @ configure OMAP2/3/4UART1
-               cmp     \rx, #OMAP2UART2        @ OMAP2/3/4UART2
+               cmp     \rp, #OMAP2UART2        @ OMAP2/3/4UART2
                beq     22f                     @ configure OMAP2/3/4UART2
-               cmp     \rx, #OMAP2UART3        @ only on 24xx
+               cmp     \rp, #OMAP2UART3        @ only on 24xx
                beq     23f                     @ configure OMAP2UART3
-               cmp     \rx, #OMAP3UART3        @ only on 34xx
+               cmp     \rp, #OMAP3UART3        @ only on 34xx
                beq     33f                     @ configure OMAP3UART3
-               cmp     \rx, #OMAP4UART3        @ only on 44xx
+               cmp     \rp, #OMAP4UART3        @ only on 44xx
                beq     43f                     @ configure OMAP4UART3
-               cmp     \rx, #OMAP3UART4        @ only on 36xx
+               cmp     \rp, #OMAP3UART4        @ only on 36xx
                beq     34f                     @ configure OMAP3UART4
-               cmp     \rx, #OMAP4UART4        @ only on 44xx
+               cmp     \rp, #OMAP4UART4        @ only on 44xx
                beq     44f                     @ configure OMAP4UART4
-               cmp     \rx, #ZOOM_UART         @ only on zoom2/3
+               cmp     \rp, #ZOOM_UART         @ only on zoom2/3
                beq     95f                     @ configure ZOOM_UART
 
                /* Configure the UART offset from the phys/virt base */
-21:            mov     \rx, #UART_OFFSET(OMAP2_UART1_BASE)     @ omap2/3/4
+21:            mov     \rp, #UART_OFFSET(OMAP2_UART1_BASE)     @ omap2/3/4
                b       98f
-22:            mov     \rx, #UART_OFFSET(OMAP2_UART2_BASE)     @ omap2/3/4
+22:            mov     \rp, #UART_OFFSET(OMAP2_UART2_BASE)     @ omap2/3/4
                b       98f
-23:            mov     \rx, #UART_OFFSET(OMAP2_UART3_BASE)
+23:            mov     \rp, #UART_OFFSET(OMAP2_UART3_BASE)
                b       98f
-33:            mov     \rx, #UART_OFFSET(OMAP3_UART1_BASE)
-               add     \rx, \rx, #0x00fb0000
-               add     \rx, \rx, #0x00006000           @ OMAP3_UART3_BASE
+33:            mov     \rp, #UART_OFFSET(OMAP3_UART1_BASE)
+               add     \rp, \rp, #0x00fb0000
+               add     \rp, \rp, #0x00006000           @ OMAP3_UART3_BASE
                b       98f
-34:            mov     \rx, #UART_OFFSET(OMAP3_UART1_BASE)
-               add     \rx, \rx, #0x00fb0000
-               add     \rx, \rx, #0x00028000           @ OMAP3_UART4_BASE
+34:            mov     \rp, #UART_OFFSET(OMAP3_UART1_BASE)
+               add     \rp, \rp, #0x00fb0000
+               add     \rp, \rp, #0x00028000           @ OMAP3_UART4_BASE
                b       98f
-43:            mov     \rx, #UART_OFFSET(OMAP4_UART3_BASE)
+43:            mov     \rp, #UART_OFFSET(OMAP4_UART3_BASE)
                b       98f
-44:            mov     \rx, #UART_OFFSET(OMAP4_UART4_BASE)
+44:            mov     \rp, #UART_OFFSET(OMAP4_UART4_BASE)
                b       98f
-95:            ldr     \rx, =ZOOM_UART_BASE
-               mrc     p15, 0, \tmp, c1, c0
-               tst     \tmp, #1                @ MMU enabled?
-               ldreq   \tmp, =__virt_to_phys(omap_uart_phys)
-               ldrne   \tmp, =omap_uart_phys
-               str     \rx, [\tmp, #0]
-               ldr     \rx, =ZOOM_UART_VIRT
-               ldreq   \tmp, =__virt_to_phys(omap_uart_virt)
-               ldrne   \tmp, =omap_uart_virt
-               str     \rx, [\tmp, #0]
-               mov     \rx, #(UART_LSR << ZOOM_PORT_SHIFT)
-               ldreq   \tmp, =__virt_to_phys(omap_uart_lsr)
-               ldrne   \tmp, =omap_uart_lsr
-               str     \rx, [\tmp, #0]
+95:            ldr     \rp, =ZOOM_UART_BASE
+               mrc     p15, 0, \rv, c1, c0
+               tst     \rv, #1                 @ MMU enabled?
+               ldreq   \rv, =__virt_to_phys(omap_uart_phys)    @ MMU not enabled
+               ldrne   \rv, =omap_uart_phys    @ MMU enabled
+               str     \rp, [\rv, #0]
+               ldr     \rp, =ZOOM_UART_VIRT
+               add     \rv, \rv, #4            @ omap_uart_virt
+               str     \rp, [\rv, #0]
+               mov     \rp, #(UART_LSR << ZOOM_PORT_SHIFT)
+               add     \rv, \rv, #4            @ omap_uart_lsr
+               str     \rp, [\rv, #0]
                b       10b
 
                /* Store both phys and virt address for the uart */
-98:            add     \rx, \rx, #0x48000000   @ phys base
-               mrc     p15, 0, \tmp, c1, c0
-               tst     \tmp, #1                @ MMU enabled?
-               ldreq   \tmp, =__virt_to_phys(omap_uart_phys)
-               ldrne   \tmp, =omap_uart_phys
-               str     \rx, [\tmp, #0]
-               sub     \rx, \rx, #0x48000000   @ phys base
-               add     \rx, \rx, #0xfa000000   @ virt base
-               ldreq   \tmp, =__virt_to_phys(omap_uart_virt)
-               ldrne   \tmp, =omap_uart_virt
-               str     \rx, [\tmp, #0]
-               mov     \rx, #(UART_LSR << OMAP_PORT_SHIFT)
-               ldreq   \tmp, =__virt_to_phys(omap_uart_lsr)
-               ldrne   \tmp, =omap_uart_lsr
-               str     \rx, [\tmp, #0]
+98:            add     \rp, \rp, #0x48000000   @ phys base
+               mrc     p15, 0, \rv, c1, c0
+               tst     \rv, #1                 @ MMU enabled?
+               ldreq   \rv, =__virt_to_phys(omap_uart_phys)    @ MMU not enabled
+               ldrne   \rv, =omap_uart_phys    @ MMU enabled
+               str     \rp, [\rv, #0]
+               sub     \rp, \rp, #0x48000000   @ phys base
+               add     \rp, \rp, #0xfa000000   @ virt base
+               add     \rv, \rv, #4            @ omap_uart_virt
+               str     \rp, [\rv, #0]
+               mov     \rp, #(UART_LSR << OMAP_PORT_SHIFT)
+               add     \rv, \rv, #4            @ omap_uart_lsr
+               str     \rp, [\rv, #0]
 
                b       10b
 99:
@@ -131,9 +130,9 @@ omap_uart_lsr:      .word   0
 
                .macro  busyuart,rd,rx
 1001:          mrc     p15, 0, \rd, c1, c0
-               tst     \rd, #1         @ MMU enabled?
-               ldreq   \rd, =__virt_to_phys(omap_uart_lsr)
-               ldrne   \rd, =omap_uart_lsr
+               tst     \rd, #1                 @ MMU enabled?
+               ldreq   \rd, =__virt_to_phys(omap_uart_lsr)     @ MMU not enabled
+               ldrne   \rd, =omap_uart_lsr     @ MMU enabled
                ldr     \rd, [\rd, #0]
                ldrb    \rd, [\rx, \rd]
                and     \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
index 91e0e39bb23f1602a98068234c28268f262e455c..5e3bf5b68aecae6da23e23fdd4f204a3602e991d 100644 (file)
 
 #include <mach/orion5x.h>
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =ORION5X_REGS_PHYS_BASE
-       ldrne   \rx, =ORION5X_REGS_VIRT_BASE
-       orr     \rx, \rx, #0x00012000
+       .macro  addruart, rp, rv
+       ldr     \rp, =ORION5X_REGS_PHYS_BASE
+       ldr     \rv, =ORION5X_REGS_VIRT_BASE
+       orr     \rp, \rp, #0x00012000
+       orr     \rv, \rv, #0x00012000
        .endm
 
 #define UART_SHIFT     2
index 6ca8bd30bf46f32dd0e55c9284b0962242596dff..931afebaf06439fc78dc4192ce8f58f416d0a2b1 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               mov     \rx, #0x00090000
-               addeq   \rx, \rx, #0x40000000
-               addne   \rx, \rx, #0xf4000000
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00090000
+               add     \rv, \rp, #0xf4000000   @ virtual
+               add     \rp, \rp, #0x40000000   @ physical
                .endm
 
 #define UART_SHIFT     2
index 01cf81393fe2d5e25787ea87b375aa510e754f2c..7d5c75125d658cd6dcb26e11ed6640254ee13382 100644 (file)
 
 #include "hardware.h"
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x40000000                @ physical
-               movne   \rx, #io_p2v(0x40000000)        @ virtual
-               orr     \rx, \rx, #0x00100000
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00100000
+               orr     \rv, \rp, #io_p2v(0x40000000)   @ virtual
+               orr     \rp, \rp, #0x40000000           @ physical
                .endm
 
 #define UART_SHIFT     2
index 86622289b74e97950cabe4817bfaa5fc1f378e12..90b687cbe04ef2cad3fcdf023963062233cb67f7 100644 (file)
 #error "Unknown RealView platform"
 #endif
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx,      #0x10000000
-               movne   \rx,      #0xfb000000   @ virtual base
-               orr     \rx, \rx, #DEBUG_LL_UART_OFFSET
+               .macro  addruart, rp, rv
+               mov     \rp, #DEBUG_LL_UART_OFFSET
+               orr     \rv, \rp, #0xfb000000   @ virtual base
+               orr     \rp, \rp, #0x10000000   @ physical base
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index 6fc8d66395dc373d48935ec26c7364da1561ca90..85effffdc2b2a08f372f3a578e0c9e065d0ff3f8 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x03000000
-               movne   \rx, #0xe0000000
-               orr     \rx, \rx, #0x00010000
-               orr     \rx, \rx, #0x00000fe0
+               .macro  addruart, rp, rv
+               mov     \rp, #0x00010000
+               orr     \rp, \rp, #0x00000fe0
+               orr     \rv, \rp, #0xe0000000   @ virtual
+               orr     \rp, \rp, #0x03000000   @ physical
                .endm
 
 #define UART_SHIFT     2
index 0eef78b4a6ed6fa24cddf346dfe55afeaf28a2e8..5882deaa56bebcf36a0b9bc073fddd964d36f2a0 100644 (file)
 #define S3C2410_UART1_OFF (0x4000)
 #define SHIFT_2440TXF (14-9)
 
-       .macro addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C24XX_PA_UART
-               ldrne   \rx, = S3C24XX_VA_UART
+       .macro addruart, rp, rv
+               ldr     \rp, = S3C24XX_PA_UART
+               ldr     \rv, = S3C24XX_VA_UART
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index 239476b81f3b4fd643410401fad18c1b646739ef..0c5a73805560f664684a3692d23f8cf44749ea82 100644 (file)
 #include <mach/map.h>
 #include <plat/regs-serial.h>
 
-       .macro addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C24XX_PA_UART
-               ldrne   \rx, = S3C24XX_VA_UART
+       .macro addruart, rp, rv
+               ldr     \rp, = S3C24XX_PA_UART
+               ldr     \rv, = S3C24XX_VA_UART
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index f9ab5d26052a38762c1559b51dbe1d46ab7786cc..a29e70550c70849ec7a8c271cb50d6684eee52da 100644 (file)
         * aligned and add in the offset when we load the value here.
         */
 
-       .macro addruart, rx, rtmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C_PA_UART
-               ldrne   \rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
+       .macro addruart, rp, rv
+               ldr     \rp, = S3C_PA_UART
+               ldr     \rv, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index bb6536147ffb0bd7c55c95d8eb796401824ceeb7..e2213205d780bbdfdb0083d49747b632ebbf445b 100644 (file)
 #include <mach/map.h>
 #include <plat/regs-serial.h>
 
-       .macro addruart, rx, rtmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C_PA_UART
-               ldrne   \rx, = S3C_VA_UART
+       .macro addruart, rp, rv
+               ldr     \rp, = S3C_PA_UART
+               ldr     \rv, = S3C_VA_UART
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index 70e02e91ee3c99602b2864f5a07cd8da820f8d32..b2ba95ddf8e06a0259288804160cc255bd18f8e6 100644 (file)
         * aligned and add in the offset when we load the value here.
         */
 
-       .macro addruart, rx, rtmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C_PA_UART
-               ldrne   \rx, = S3C_VA_UART
+       .macro addruart, rp, rv
+               ldr     \rp, = S3C_PA_UART
+               ldr     \rv, = S3C_VA_UART
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index 7872f5c3dfc24271fb1853d8a6e86a7ad79ff051..169fe654a59eac3c2dfd91cf33c0d29d1fc8e50c 100644 (file)
         * aligned and add in the offset when we load the value here.
         */
 
-       .macro addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C_PA_UART
-               ldrne   \rx, = S3C_VA_UART
+       .macro addruart, rp, rv
+               ldr     \rp, = S3C_PA_UART
+               ldr     \rv, = S3C_VA_UART
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index 6fb3893486bec83100c03c0cc9df3c969d3bf9fe..b0d920c474d3f4b501004ec8ef058c49bc66b002 100644 (file)
         * aligned and add in the offset when we load the value here.
         */
 
-       .macro addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1
-               ldreq   \rx, = S3C_PA_UART
-               ldrne   \rx, = S3C_VA_UART
+       .macro addruart, rp, rv
+               ldreq   \rp, = S3C_PA_UART
+               ldrne   \rv, = S3C_VA_UART
 #if CONFIG_DEBUG_S3C_UART != 0
-               add     \rx, \rx, #(0x10000 * CONFIG_DEBUG_S3C_UART)
+               add     \rp, \rp, #(0x10000 * CONFIG_DEBUG_S3C_UART)
+               add     \rv, \rv, #(0x10000 * CONFIG_DEBUG_S3C_UART)
 #endif
        .endm
 
index 336adccea54232ef50f7b43367f824c26bc20163..0cd0fc9635b6b3e2afb8668a43bb9a8389b9bbb1 100644 (file)
 */
 #include <mach/hardware.h>
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x80000000        @ physical base address
-               movne   \rx, #0xf8000000        @ virtual address
+               .macro  addruart, rp, rv
+               mrc     p15, 0, \rp, c1, c0
+               tst     \rp, #1                 @ MMU enabled?
+               moveq   \rp, #0x80000000        @ physical base address
+               movne   \rp, #0xf8000000        @ virtual address
 
                @ We probe for the active serial port here, coherently with
                @ the comment in arch/arm/mach-sa1100/include/mach/uncompress.h.
                @ We assume r1 can be clobbered.
 
                @ see if Ser3 is active
-               add     \rx, \rx, #0x00050000
-               ldr     r1, [\rx, #UTCR3]
-               tst     r1, #UTCR3_TXE
+               add     \rp, \rp, #0x00050000
+               ldr     \rv, [\rp, #UTCR3]
+               tst     \rv, #UTCR3_TXE
 
                @ if Ser3 is inactive, then try Ser1
-               addeq   \rx, \rx, #(0x00010000 - 0x00050000)
-               ldreq   r1, [\rx, #UTCR3]
-               tsteq   r1, #UTCR3_TXE
+               addeq   \rp, \rp, #(0x00010000 - 0x00050000)
+               ldreq   \rv, [\rp, #UTCR3]
+               tsteq   \rv, #UTCR3_TXE
 
                @ if Ser1 is inactive, then try Ser2
-               addeq   \rx, \rx, #(0x00030000 - 0x00010000)
-               ldreq   r1, [\rx, #UTCR3]
-               tsteq   r1, #UTCR3_TXE
+               addeq   \rp, \rp, #(0x00030000 - 0x00010000)
+               ldreq   \rv, [\rp, #UTCR3]
+               tsteq   \rv, #UTCR3_TXE
+
+               @ clear top bits, and generate both phys and virt addresses
+               lsl     \rp, \rp, #8
+               lsr     \rp, \rp, #8
+               orr     \rv, \rp, #0xf8000000   @ virtual
+               orr     \rp, \rp, #0x80000000   @ physical
 
-               @ if all ports are inactive, then there is nothing we can do
-               moveq   pc, lr
                .endm
 
                .macro  senduart,rd,rx
index 5ea24d4d1ba6e176985b16076b48412952de9aec..a473f55dc71fef28a2cbdafb5291d7ccf488ef24 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mov     \rx, #0xe0000000
-               orr     \rx, \rx, #0x000003f8
+               .macro  addruart, rp, rv
+               mov     \rp, #0xe0000000
+               orr     \rp, \rp, #0x000003f8
+               mov     \rv, \rp
                .endm
 
                .macro  senduart,rd,rx
index 55a39564b43c476e2002b806a8bdff6f6e7c6f44..8ea3bffb4e009f39b56b2262a762b8b28131c814 100644 (file)
 
 #include <mach/io.h>
 
-       .macro  addruart,rx, tmp
-        mrc     p15, 0, \rx, c1, c0
-        tst     \rx, #1                 @ MMU enabled?
-        ldreq   \rx, =IO_APB_PHYS       @ physical
-        ldrne   \rx, =IO_APB_VIRT        @ virtual
+       .macro  addruart, rp, rv
+        ldreq   \rp, =IO_APB_PHYS       @ physical
+        ldrne   \rv, =IO_APB_VIRT        @ virtual
 #if defined(CONFIG_TEGRA_DEBUG_UART_NONE)
 #error "A debug UART must be selected in the kernel config to use DEBUG_LL"
 #elif defined(CONFIG_TEGRA_DEBUG_UARTA)
-        orr     \rx, \rx, #0x6000
+        orr     \rp, \rp, #0x6000
+        orr     \rv, \rv, #0x6000
 #elif defined(CONFIG_TEGRA_DEBUG_UARTB)
-       ldr     \tmp, =0x6040
-        orr     \rx, \rx, \tmp
+        orr     \rp, \rp, #0x6000
+       orr     \rp, \rp, #0x40
+        orr     \rv, \rv, #0x6000
+       orr     \rv, \rv, #0x40
 #elif defined(CONFIG_TEGRA_DEBUG_UARTC)
-        orr     \rx, \rx, #0x6200
+        orr     \rp, \rp, #0x6200
+        orr     \rv, \rv, #0x6200
 #elif defined(CONFIG_TEGRA_DEBUG_UARTD)
-        orr     \rx, \rx, #0x6300
+        orr     \rp, \rp, #0x6300
+        orr     \rv, \rv, #0x6300
 #elif defined(CONFIG_TEGRA_DEBUG_UARTE)
-        orr     \rx, \rx, #0x6400
+        orr     \rp, \rp, #0x6400
+        orr     \rv, \rv, #0x6400
 #endif
        .endm
 
index 92c12420256ffdc518d8a4102198e42365039032..df715707bead4144f2650974a0c8998145757877 100644 (file)
  */
 #include <mach/hardware.h>
 
-       .macro  addruart, rx, tmp
+       .macro  addruart, rp, rv
        /* If we move the address using MMU, use this. */
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                 @ MMU enabled?
-       ldreq   \rx,      = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address
-       ldrne   \rx,      = U300_SLOW_PER_VIRT_BASE @ MMU on, virtual address
-       orr     \rx, \rx, #0x00003000
+       ldr     \rp,      = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address
+       ldr     \rv,      = U300_SLOW_PER_VIRT_BASE @ MMU on, virtual address
+       orr     \rp, \rp, #0x00003000
+       orr     \rv, \rv, #0x00003000
        .endm
 
 #include <asm/hardware/debug-pl01x.S>
index c5203b7ea5521596f929bde20cd35708a2419e5c..be7c0f14e310abed1fd65267f07142beda12ee0c 100644 (file)
 #define UX500_UART(n)  __UX500_UART(n)
 #define UART_BASE      UX500_UART(CONFIG_UX500_DEBUG_UART)
 
-       .macro  addruart, rx, tmp
-       mrc     p15, 0, \rx, c1, c0
-       tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =UART_BASE                         @ no, physical address
-       ldrne   \rx, =IO_ADDRESS(UART_BASE)             @ yes, virtual address
+       .macro  addruart, rp, rv
+       ldr     \rp, =UART_BASE                         @ no, physical address
+       ldr     \rv, =IO_ADDRESS(UART_BASE)             @ yes, virtual address
        .endm
 
 #include <asm/hardware/debug-pl01x.S>
index 6fea7199c626742d4e39afcaadecd5e32ad39e99..eb2cf7dc5c4410e2b92f13a9e508a2b7bdd2bff5 100644 (file)
  *
 */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx,      #0x10000000
-               movne   \rx,      #0xf1000000   @ virtual base
-               orr     \rx, \rx, #0x001F0000
-               orr     \rx, \rx, #0x00001000
+               .macro  addruart, rp, rv
+               mov     \rp,      #0x001F0000
+               orr     \rp, \rp, #0x00001000
+               orr     \rv, \rp, #0xf1000000   @ virtual base
+               orr     \rp, \rp,  #0x10000000  @ physical base
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index 5167e2aceeba9f8a070db5c8b91b3c0936f4f59f..050d65e02a42a9dc4e6923bde6eb474a9a7da41a 100644 (file)
 
 #define DEBUG_LL_UART_OFFSET   0x00009000
 
-               .macro  addruart,rx,tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx,      #0x10000000
-               movne   \rx,      #0xf8000000   @ virtual base
-               orr     \rx, \rx, #DEBUG_LL_UART_OFFSET
+               .macro  addruart,rp,rv
+               mov     \rp, #DEBUG_LL_UART_OFFSET
+               orr     \rv, \rp, #0xf8000000   @ virtual base
+               orr     \rp, \rp, #0x10000000   @ physical base
                .endm
 
 #include <asm/hardware/debug-pl01x.S>
index 25606409aabcfb7de02a3dbce55e7221b68d2ece..d56213fb901ba14e54be3a1dba0963b42ffc1183 100644 (file)
 #define UART_PADDR     MXC91231_UART2_BASE_ADDR
 #define UART_VADDR     MXC91231_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
 #endif
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               ldreq   \rx, =UART_PADDR        @ physical
-               ldrne   \rx, =UART_VADDR        @ virtual
+               .macro  addruart, rp, rv
+               ldr     \rp, =UART_PADDR        @ physical
+               ldr     \rv, =UART_VADDR        @ virtual
                .endm
 
                .macro  senduart,rd,rx
index 37fa593884ee64d345add30e2ca9738e238e3511..e91270e4f640329ce1424b1ad7c37a89dead7626 100644 (file)
 #include <linux/amba/serial.h>
 #include <mach/spear.h>
 
-               .macro  addruart, rx
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                                 @ MMU enabled?
-               moveq   \rx, #SPEAR_DBG_UART_BASE               @ Physical base
-               movne   \rx, #VA_SPEAR_DBG_UART_BASE            @ Virtual base
+               .macro  addruart, rp, rv
+               mov     \rp, #SPEAR_DBG_UART_BASE               @ Physical base
+               mov     \rv, #VA_SPEAR_DBG_UART_BASE            @ Virtual base
                .endm
 
                .macro  senduart, rd, rx
index 1b9348bf0e4926b542bea6d1bfcc4a9cd2e29440..d3a0985c96817f1dfd9471d7ab2a0f2d13644b48 100644 (file)
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-               .macro  addruart, rx, tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x80000000        @ physical base address
-               addeq   \rx, \rx, #0x00070000
-               movne   \rx, #0xf0000000        @ virtual base
-               addne   \rx, \rx, #0x00070000
+               .macro  addruart, rp, rv
+               mov     \rp,      #0x00070000
+               add     \rv, \rp, #0xf0000000   @ virtual base
+               add     \rp, \rp, #0x80000000   @ physical base
                .endm
 
                .macro  senduart,rd,rx
index 97537845df64f314abf35c3493b2ccd39c60bb47..7662f736e42be770b3e91d5b1ab5976696f0bf6e 100644 (file)
@@ -9,12 +9,11 @@
  *
  */
 
-               .macro  addruart,rx,tmp
-               mrc     p15, 0, \rx, c1, c0
-               tst     \rx, #1                 @ MMU enabled?
-               moveq   \rx, #0x90000000        @ physical base address
-               movne   \rx, #0xF1000000        @ virtual base
-               orr     \rx, \rx, #0x00007000   @ UART0
+               .macro  addruart, rp, rv
+               moveq   \rp, #0x90000000        @ physical base address
+               movne   \rv, #0xF1000000        @ virtual base
+               orr     \rp, \rp, #0x00007000   @ UART0
+               orr     \rv, \rv, #0x00007000   @ UART0
                .endm
 
                .macro  senduart,rd,rx