diff options
author | Tony Lindgren <tony@atomide.com> | 2011-02-04 15:03:24 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-17 18:27:31 -0500 |
commit | 5b7de4547b388d3949620e21d072e35b6f2638fa (patch) | |
tree | b08ff8f1c45b1c6bad6405dc06e6f028fcf1eeea /arch/arm | |
parent | 72a20e22f49e2dad3180c23980a9df1c63faab0a (diff) |
ARM: 6651/1: omap: Fix DEBUG_LL code for p2v changes
These are needed for CONFIG_ARM_PATCH_PHYS_VIRT to work.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap1/include/mach/debug-macro.S | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap2/include/mach/debug-macro.S | 13 |
2 files changed, 14 insertions, 8 deletions
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S index 6a0fa0462365..62856044eb63 100644 --- a/arch/arm/mach-omap1/include/mach/debug-macro.S +++ b/arch/arm/mach-omap1/include/mach/debug-macro.S | |||
@@ -17,6 +17,9 @@ | |||
17 | 17 | ||
18 | #include <plat/serial.h> | 18 | #include <plat/serial.h> |
19 | 19 | ||
20 | #define omap_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET) | ||
21 | #define omap_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET) | ||
22 | |||
20 | .pushsection .data | 23 | .pushsection .data |
21 | omap_uart_phys: .word 0x0 | 24 | omap_uart_phys: .word 0x0 |
22 | omap_uart_virt: .word 0x0 | 25 | omap_uart_virt: .word 0x0 |
@@ -33,7 +36,7 @@ omap_uart_virt: .word 0x0 | |||
33 | /* Use omap_uart_phys/virt if already configured */ | 36 | /* Use omap_uart_phys/virt if already configured */ |
34 | 9: mrc p15, 0, \rp, c1, c0 | 37 | 9: mrc p15, 0, \rp, c1, c0 |
35 | tst \rp, #1 @ MMU enabled? | 38 | tst \rp, #1 @ MMU enabled? |
36 | ldreq \rp, =__virt_to_phys(omap_uart_phys) @ MMU not enabled | 39 | ldreq \rp, =omap_uart_v2p(omap_uart_phys) @ MMU disabled |
37 | ldrne \rp, =omap_uart_phys @ MMU enabled | 40 | ldrne \rp, =omap_uart_phys @ MMU enabled |
38 | add \rv, \rp, #4 @ omap_uart_virt | 41 | add \rv, \rp, #4 @ omap_uart_virt |
39 | ldr \rp, [\rp, #0] | 42 | ldr \rp, [\rp, #0] |
@@ -46,7 +49,7 @@ omap_uart_virt: .word 0x0 | |||
46 | mrc p15, 0, \rp, c1, c0 | 49 | mrc p15, 0, \rp, c1, c0 |
47 | tst \rp, #1 @ MMU enabled? | 50 | tst \rp, #1 @ MMU enabled? |
48 | ldreq \rp, =OMAP_UART_INFO @ MMU not enabled | 51 | ldreq \rp, =OMAP_UART_INFO @ MMU not enabled |
49 | ldrne \rp, =__phys_to_virt(OMAP_UART_INFO) @ MMU enabled | 52 | ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled |
50 | ldr \rp, [\rp, #0] | 53 | ldr \rp, [\rp, #0] |
51 | 54 | ||
52 | /* Select the UART to use based on the UART1 scratchpad value */ | 55 | /* Select the UART to use based on the UART1 scratchpad value */ |
@@ -73,7 +76,7 @@ omap_uart_virt: .word 0x0 | |||
73 | 98: add \rp, \rp, #0xff000000 @ phys base | 76 | 98: add \rp, \rp, #0xff000000 @ phys base |
74 | mrc p15, 0, \rv, c1, c0 | 77 | mrc p15, 0, \rv, c1, c0 |
75 | tst \rv, #1 @ MMU enabled? | 78 | tst \rv, #1 @ MMU enabled? |
76 | ldreq \rv, =__virt_to_phys(omap_uart_phys) @ MMU not enabled | 79 | ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled |
77 | ldrne \rv, =omap_uart_phys @ MMU enabled | 80 | ldrne \rv, =omap_uart_phys @ MMU enabled |
78 | str \rp, [\rv, #0] | 81 | str \rp, [\rv, #0] |
79 | sub \rp, \rp, #0xff000000 @ phys base | 82 | sub \rp, \rp, #0xff000000 @ phys base |
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S index 6a4d4136002e..6049f465ec84 100644 --- a/arch/arm/mach-omap2/include/mach/debug-macro.S +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S | |||
@@ -19,6 +19,9 @@ | |||
19 | 19 | ||
20 | #define UART_OFFSET(addr) ((addr) & 0x00ffffff) | 20 | #define UART_OFFSET(addr) ((addr) & 0x00ffffff) |
21 | 21 | ||
22 | #define omap_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET) | ||
23 | #define omap_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET) | ||
24 | |||
22 | .pushsection .data | 25 | .pushsection .data |
23 | omap_uart_phys: .word 0 | 26 | omap_uart_phys: .word 0 |
24 | omap_uart_virt: .word 0 | 27 | omap_uart_virt: .word 0 |
@@ -36,7 +39,7 @@ omap_uart_lsr: .word 0 | |||
36 | /* Use omap_uart_phys/virt if already configured */ | 39 | /* Use omap_uart_phys/virt if already configured */ |
37 | 10: mrc p15, 0, \rp, c1, c0 | 40 | 10: mrc p15, 0, \rp, c1, c0 |
38 | tst \rp, #1 @ MMU enabled? | 41 | tst \rp, #1 @ MMU enabled? |
39 | ldreq \rp, =__virt_to_phys(omap_uart_phys) @ MMU not enabled | 42 | ldreq \rp, =omap_uart_v2p(omap_uart_phys) @ MMU disabled |
40 | ldrne \rp, =omap_uart_phys @ MMU enabled | 43 | ldrne \rp, =omap_uart_phys @ MMU enabled |
41 | add \rv, \rp, #4 @ omap_uart_virt | 44 | add \rv, \rp, #4 @ omap_uart_virt |
42 | ldr \rp, [\rp, #0] | 45 | ldr \rp, [\rp, #0] |
@@ -49,7 +52,7 @@ omap_uart_lsr: .word 0 | |||
49 | mrc p15, 0, \rp, c1, c0 | 52 | mrc p15, 0, \rp, c1, c0 |
50 | tst \rp, #1 @ MMU enabled? | 53 | tst \rp, #1 @ MMU enabled? |
51 | ldreq \rp, =OMAP_UART_INFO @ MMU not enabled | 54 | ldreq \rp, =OMAP_UART_INFO @ MMU not enabled |
52 | ldrne \rp, =__phys_to_virt(OMAP_UART_INFO) @ MMU enabled | 55 | ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled |
53 | ldr \rp, [\rp, #0] | 56 | ldr \rp, [\rp, #0] |
54 | 57 | ||
55 | /* Select the UART to use based on the UART1 scratchpad value */ | 58 | /* Select the UART to use based on the UART1 scratchpad value */ |
@@ -94,7 +97,7 @@ omap_uart_lsr: .word 0 | |||
94 | 95: ldr \rp, =ZOOM_UART_BASE | 97 | 95: ldr \rp, =ZOOM_UART_BASE |
95 | mrc p15, 0, \rv, c1, c0 | 98 | mrc p15, 0, \rv, c1, c0 |
96 | tst \rv, #1 @ MMU enabled? | 99 | tst \rv, #1 @ MMU enabled? |
97 | ldreq \rv, =__virt_to_phys(omap_uart_phys) @ MMU not enabled | 100 | ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled |
98 | ldrne \rv, =omap_uart_phys @ MMU enabled | 101 | ldrne \rv, =omap_uart_phys @ MMU enabled |
99 | str \rp, [\rv, #0] | 102 | str \rp, [\rv, #0] |
100 | ldr \rp, =ZOOM_UART_VIRT | 103 | ldr \rp, =ZOOM_UART_VIRT |
@@ -109,7 +112,7 @@ omap_uart_lsr: .word 0 | |||
109 | 98: add \rp, \rp, #0x48000000 @ phys base | 112 | 98: add \rp, \rp, #0x48000000 @ phys base |
110 | mrc p15, 0, \rv, c1, c0 | 113 | mrc p15, 0, \rv, c1, c0 |
111 | tst \rv, #1 @ MMU enabled? | 114 | tst \rv, #1 @ MMU enabled? |
112 | ldreq \rv, =__virt_to_phys(omap_uart_phys) @ MMU not enabled | 115 | ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled |
113 | ldrne \rv, =omap_uart_phys @ MMU enabled | 116 | ldrne \rv, =omap_uart_phys @ MMU enabled |
114 | str \rp, [\rv, #0] | 117 | str \rp, [\rv, #0] |
115 | sub \rp, \rp, #0x48000000 @ phys base | 118 | sub \rp, \rp, #0x48000000 @ phys base |
@@ -131,7 +134,7 @@ omap_uart_lsr: .word 0 | |||
131 | .macro busyuart,rd,rx | 134 | .macro busyuart,rd,rx |
132 | 1001: mrc p15, 0, \rd, c1, c0 | 135 | 1001: mrc p15, 0, \rd, c1, c0 |
133 | tst \rd, #1 @ MMU enabled? | 136 | tst \rd, #1 @ MMU enabled? |
134 | ldreq \rd, =__virt_to_phys(omap_uart_lsr) @ MMU not enabled | 137 | ldreq \rd, =omap_uart_v2p(omap_uart_lsr) @ MMU disabled |
135 | ldrne \rd, =omap_uart_lsr @ MMU enabled | 138 | ldrne \rd, =omap_uart_lsr @ MMU enabled |
136 | ldr \rd, [\rd, #0] | 139 | ldr \rd, [\rd, #0] |
137 | ldrb \rd, [\rx, \rd] | 140 | ldrb \rd, [\rx, \rd] |