Commit e020fe34 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Nicolas Pitre

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: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
Tested-by: default avatarKevin Hilman <khilman@ti.com>
parent fa808a1b
...@@ -50,21 +50,20 @@ davinci_uart_virt: .word 0 ...@@ -50,21 +50,20 @@ davinci_uart_virt: .word 0
mrc p15, 0, \rp, c1, c0 mrc p15, 0, \rp, c1, c0
tst \rp, #1 @ MMU enabled? tst \rp, #1 @ MMU enabled?
/* Copy uart phys address from decompressor uart info */ and \rp, pc, #0xff000000
ldr \rv, =DAVINCI_UART_INFO_OFS
add \rp, \rp, \rv
ldreq \rv, =davinci_uart_v2p(davinci_uart_phys) ldreq \rv, =davinci_uart_v2p(davinci_uart_phys)
ldrne \rv, =davinci_uart_phys ldrne \rv, =davinci_uart_phys
ldreq \rp, =DAVINCI_UART_INFO
ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO) /* Copy uart phys address from decompressor uart info */
ldr \rp, [\rp, #0] ldr \tmp, [\rp, #0]
str \rp, [\rv] str \tmp, [\rv, #0]
/* Copy uart virt address from decompressor uart info */ /* Copy uart virt address from decompressor uart info */
ldreq \rv, =davinci_uart_v2p(davinci_uart_virt) ldr \tmp, [\rp, #4]
ldrne \rv, =davinci_uart_virt str \tmp, [\rv, #4]
ldreq \rp, =DAVINCI_UART_INFO
ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
ldr \rp, [\rp, #4]
str \rp, [\rv]
b 10b b 10b
99: 99:
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
* macros in debug-macro.S. * macros in debug-macro.S.
* *
* This area sits just below the page tables (see arch/arm/kernel/head.S). * This area sits just below the page tables (see arch/arm/kernel/head.S).
* We define it as a relative offset from start of usable RAM.
*/ */
#define DAVINCI_UART_INFO (PLAT_PHYS_OFFSET + 0x3ff8) #define DAVINCI_UART_INFO_OFS 0x3ff8
#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
......
...@@ -43,7 +43,12 @@ static inline void flush(void) ...@@ -43,7 +43,12 @@ static inline void flush(void)
static inline void set_uart_info(u32 phys, void * __iomem virt) static inline void set_uart_info(u32 phys, void * __iomem virt)
{ {
u32 *uart_info = (u32 *)(DAVINCI_UART_INFO); /*
* Get address of some.bss variable and round it down
* a la CONFIG_AUTO_ZRELADDR.
*/
u32 ram_start = (u32)&uart & 0xf8000000;
u32 *uart_info = (u32 *)(ram_start + DAVINCI_UART_INFO_OFS);
uart = (u32 *)phys; uart = (u32 *)phys;
uart_info[0] = phys; uart_info[0] = phys;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment