aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/include
diff options
context:
space:
mode:
authorJason Wang <jason77.wang@gmail.com>2010-08-02 23:44:18 -0400
committerTony Lindgren <tony@atomide.com>2010-08-04 05:17:53 -0400
commit7e788b4289bb025a96e327c604cb2db92e17108f (patch)
tree6509b18c25f888a60e7222739e5ea5a0be96d639 /arch/arm/mach-omap2/include
parent331d919af416b9b92428947ef8c535a3e24c6b31 (diff)
omap: Fix DEBUG_LL uart to access phys addr when MMU isn't enable
Now we use a memory address to store the debug port info, So we need to read/write this address when we choose DEBUG_LL. When MMU isn't enable(I.E. the begining part of init stage of the linux kernel boot), we need to access physical address instead of virtual address, otherwise the kernel will crash. Signed-off-by: Jason Wang <jason77.wang@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/include')
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S29
1 files changed, 21 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 35b24409a0c8..09331bbbda52 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -36,7 +36,7 @@ omap_uart_lsr: .word 0
36 /* Use omap_uart_phys/virt if already configured */ 36 /* Use omap_uart_phys/virt if already configured */
3710: mrc p15, 0, \rx, c1, c0 3710: mrc p15, 0, \rx, c1, c0
38 tst \rx, #1 @ MMU enabled? 38 tst \rx, #1 @ MMU enabled?
39 ldreq \rx, =omap_uart_phys @ physical base address 39 ldreq \rx, =__virt_to_phys(omap_uart_phys) @ physical base address
40 ldrne \rx, =omap_uart_virt @ virtual base address 40 ldrne \rx, =omap_uart_virt @ virtual base address
41 ldr \rx, [\rx, #0] 41 ldr \rx, [\rx, #0]
42 cmp \rx, #0 @ is port configured? 42 cmp \rx, #0 @ is port configured?
@@ -89,26 +89,36 @@ omap_uart_lsr: .word 0
8944: mov \rx, #UART_OFFSET(OMAP4_UART4_BASE) 8944: mov \rx, #UART_OFFSET(OMAP4_UART4_BASE)
90 b 98f 90 b 98f
9195: ldr \rx, =ZOOM_UART_BASE 9195: ldr \rx, =ZOOM_UART_BASE
92 ldr \tmp, =omap_uart_phys 92 mrc p15, 0, \tmp, c1, c0
93 tst \tmp, #1 @ MMU enabled?
94 ldreq \tmp, =__virt_to_phys(omap_uart_phys)
95 ldrne \tmp, =omap_uart_phys
93 str \rx, [\tmp, #0] 96 str \rx, [\tmp, #0]
94 ldr \rx, =ZOOM_UART_VIRT 97 ldr \rx, =ZOOM_UART_VIRT
95 ldr \tmp, =omap_uart_virt 98 ldreq \tmp, =__virt_to_phys(omap_uart_virt)
99 ldrne \tmp, =omap_uart_virt
96 str \rx, [\tmp, #0] 100 str \rx, [\tmp, #0]
97 mov \rx, #(UART_LSR << ZOOM_PORT_SHIFT) 101 mov \rx, #(UART_LSR << ZOOM_PORT_SHIFT)
98 ldr \tmp, =omap_uart_lsr 102 ldreq \tmp, =__virt_to_phys(omap_uart_lsr)
103 ldrne \tmp, =omap_uart_lsr
99 str \rx, [\tmp, #0] 104 str \rx, [\tmp, #0]
100 b 10b 105 b 10b
101 106
102 /* Store both phys and virt address for the uart */ 107 /* Store both phys and virt address for the uart */
10398: add \rx, \rx, #0x48000000 @ phys base 10898: add \rx, \rx, #0x48000000 @ phys base
104 ldr \tmp, =omap_uart_phys 109 mrc p15, 0, \tmp, c1, c0
110 tst \tmp, #1 @ MMU enabled?
111 ldreq \tmp, =__virt_to_phys(omap_uart_phys)
112 ldrne \tmp, =omap_uart_phys
105 str \rx, [\tmp, #0] 113 str \rx, [\tmp, #0]
106 sub \rx, \rx, #0x48000000 @ phys base 114 sub \rx, \rx, #0x48000000 @ phys base
107 add \rx, \rx, #0xfa000000 @ virt base 115 add \rx, \rx, #0xfa000000 @ virt base
108 ldr \tmp, =omap_uart_virt 116 ldreq \tmp, =__virt_to_phys(omap_uart_virt)
117 ldrne \tmp, =omap_uart_virt
109 str \rx, [\tmp, #0] 118 str \rx, [\tmp, #0]
110 mov \rx, #(UART_LSR << OMAP_PORT_SHIFT) 119 mov \rx, #(UART_LSR << OMAP_PORT_SHIFT)
111 ldr \tmp, =omap_uart_lsr 120 ldreq \tmp, =__virt_to_phys(omap_uart_lsr)
121 ldrne \tmp, =omap_uart_lsr
112 str \rx, [\tmp, #0] 122 str \rx, [\tmp, #0]
113 123
114 b 10b 124 b 10b
@@ -120,7 +130,10 @@ omap_uart_lsr: .word 0
120 .endm 130 .endm
121 131
122 .macro busyuart,rd,rx 132 .macro busyuart,rd,rx
1231001: ldr \rd, =omap_uart_lsr 1331001: mrc p15, 0, \rd, c1, c0
134 tst \rd, #1 @ MMU enabled?
135 ldreq \rd, =__virt_to_phys(omap_uart_lsr)
136 ldrne \rd, =omap_uart_lsr
124 ldr \rd, [\rd, #0] 137 ldr \rd, [\rd, #0]
125 ldrb \rd, [\rx, \rd] 138 ldrb \rd, [\rx, \rd]
126 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE) 139 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)