diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-09-01 20:32:21 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-09-26 10:11:27 -0400 |
commit | e020fe34f8fc5cb42c2f518ea120005b4d01923d (patch) | |
tree | bd24cc2095fa77cb7d5a89abebf8a089250cd2af /arch/arm/mach-davinci/include | |
parent | fa808a1ba5f9d40ad47c31f63691b1ded03a46f8 (diff) |
ARM: mach-davinci: make DAVINCI_UART_INFO into a relative offset
This is the first step to remove PLAT_PHYS_OFFSET usage from the debug
UART code.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/debug-macro.S | 21 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/serial.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/uncompress.h | 7 |
3 files changed, 18 insertions, 13 deletions
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index 3cf4c1b4f33a..45fff2c61f48 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S | |||
@@ -50,21 +50,20 @@ davinci_uart_virt: .word 0 | |||
50 | mrc p15, 0, \rp, c1, c0 | 50 | mrc p15, 0, \rp, c1, c0 |
51 | tst \rp, #1 @ MMU enabled? | 51 | tst \rp, #1 @ MMU enabled? |
52 | 52 | ||
53 | /* Copy uart phys address from decompressor uart info */ | 53 | and \rp, pc, #0xff000000 |
54 | ldr \rv, =DAVINCI_UART_INFO_OFS | ||
55 | add \rp, \rp, \rv | ||
56 | |||
54 | ldreq \rv, =davinci_uart_v2p(davinci_uart_phys) | 57 | ldreq \rv, =davinci_uart_v2p(davinci_uart_phys) |
55 | ldrne \rv, =davinci_uart_phys | 58 | ldrne \rv, =davinci_uart_phys |
56 | ldreq \rp, =DAVINCI_UART_INFO | 59 | |
57 | ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO) | 60 | /* Copy uart phys address from decompressor uart info */ |
58 | ldr \rp, [\rp, #0] | 61 | ldr \tmp, [\rp, #0] |
59 | str \rp, [\rv] | 62 | str \tmp, [\rv, #0] |
60 | 63 | ||
61 | /* Copy uart virt address from decompressor uart info */ | 64 | /* Copy uart virt address from decompressor uart info */ |
62 | ldreq \rv, =davinci_uart_v2p(davinci_uart_virt) | 65 | ldr \tmp, [\rp, #4] |
63 | ldrne \rv, =davinci_uart_virt | 66 | str \tmp, [\rv, #4] |
64 | ldreq \rp, =DAVINCI_UART_INFO | ||
65 | ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO) | ||
66 | ldr \rp, [\rp, #4] | ||
67 | str \rp, [\rv] | ||
68 | 67 | ||
69 | b 10b | 68 | b 10b |
70 | 99: | 69 | 99: |
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index c9e6ce185a66..e347d88fef91 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
@@ -21,8 +21,9 @@ | |||
21 | * macros in debug-macro.S. | 21 | * macros in debug-macro.S. |
22 | * | 22 | * |
23 | * This area sits just below the page tables (see arch/arm/kernel/head.S). | 23 | * This area sits just below the page tables (see arch/arm/kernel/head.S). |
24 | * We define it as a relative offset from start of usable RAM. | ||
24 | */ | 25 | */ |
25 | #define DAVINCI_UART_INFO (PLAT_PHYS_OFFSET + 0x3ff8) | 26 | #define DAVINCI_UART_INFO_OFS 0x3ff8 |
26 | 27 | ||
27 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) | 28 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) |
28 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) | 29 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) |
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 78d80683cdc2..9dc7cf9664fe 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h | |||
@@ -43,7 +43,12 @@ static inline void flush(void) | |||
43 | 43 | ||
44 | static inline void set_uart_info(u32 phys, void * __iomem virt) | 44 | static inline void set_uart_info(u32 phys, void * __iomem virt) |
45 | { | 45 | { |
46 | u32 *uart_info = (u32 *)(DAVINCI_UART_INFO); | 46 | /* |
47 | * Get address of some.bss variable and round it down | ||
48 | * a la CONFIG_AUTO_ZRELADDR. | ||
49 | */ | ||
50 | u32 ram_start = (u32)&uart & 0xf8000000; | ||
51 | u32 *uart_info = (u32 *)(ram_start + DAVINCI_UART_INFO_OFS); | ||
47 | 52 | ||
48 | uart = (u32 *)phys; | 53 | uart = (u32 *)phys; |
49 | uart_info[0] = phys; | 54 | uart_info[0] = phys; |