diff options
author | Jason Wang <jason77.wang@gmail.com> | 2010-08-02 23:44:18 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-08-04 05:17:53 -0400 |
commit | 7e788b4289bb025a96e327c604cb2db92e17108f (patch) | |
tree | 6509b18c25f888a60e7222739e5ea5a0be96d639 /arch/arm/mach-omap1 | |
parent | 331d919af416b9b92428947ef8c535a3e24c6b31 (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-omap1')
-rw-r--r-- | arch/arm/mach-omap1/include/mach/debug-macro.S | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S index e8a8cf36b7f0..671408eb4ab4 100644 --- a/arch/arm/mach-omap1/include/mach/debug-macro.S +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S | |||
@@ -33,7 +33,7 @@ omap_uart_virt: .word 0x0 | |||
33 | /* Use omap_uart_phys/virt if already configured */ | 33 | /* Use omap_uart_phys/virt if already configured */ |
34 | 9: mrc p15, 0, \rx, c1, c0 | 34 | 9: mrc p15, 0, \rx, c1, c0 |
35 | tst \rx, #1 @ MMU enabled? | 35 | tst \rx, #1 @ MMU enabled? |
36 | ldreq \rx, =omap_uart_phys @ physical base address | 36 | ldreq \rx, =__virt_to_phys(omap_uart_phys) @ physical base address |
37 | ldrne \rx, =omap_uart_virt @ virtual base | 37 | ldrne \rx, =omap_uart_virt @ virtual base |
38 | ldr \rx, [\rx, #0] | 38 | ldr \rx, [\rx, #0] |
39 | cmp \rx, #0 @ is port configured? | 39 | cmp \rx, #0 @ is port configured? |
@@ -68,11 +68,15 @@ omap_uart_virt: .word 0x0 | |||
68 | 68 | ||
69 | /* Store both phys and virt address for the uart */ | 69 | /* Store both phys and virt address for the uart */ |
70 | 98: add \rx, \rx, #0xff000000 @ phys base | 70 | 98: add \rx, \rx, #0xff000000 @ phys base |
71 | ldr \tmp, =omap_uart_phys | 71 | mrc p15, 0, \tmp, c1, c0 |
72 | tst \tmp, #1 @ MMU enabled? | ||
73 | ldreq \tmp, =__virt_to_phys(omap_uart_phys) | ||
74 | ldrne \tmp, =omap_uart_phys | ||
72 | str \rx, [\tmp, #0] | 75 | str \rx, [\tmp, #0] |
73 | sub \rx, \rx, #0xff000000 @ phys base | 76 | sub \rx, \rx, #0xff000000 @ phys base |
74 | add \rx, \rx, #0xfe000000 @ virt base | 77 | add \rx, \rx, #0xfe000000 @ virt base |
75 | ldr \tmp, =omap_uart_virt | 78 | ldreq \tmp, =__virt_to_phys(omap_uart_virt) |
79 | ldrne \tmp, =omap_uart_virt | ||
76 | str \rx, [\tmp, #0] | 80 | str \rx, [\tmp, #0] |
77 | b 9b | 81 | b 9b |
78 | 99: | 82 | 99: |