diff options
author | Cyril Chemparathy <cyril@ti.com> | 2010-05-18 12:51:17 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-06-21 15:48:30 -0400 |
commit | dc2eb76c40590a3c080294d1fbd000c8f70d88a9 (patch) | |
tree | 8c7bccdd0eb4dfba763cd19216d8c0a13dfb5d51 /arch/arm/mach-davinci/include/mach/debug-macro.S | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Davinci: generalized debug macros
This patch adopts a debug uart selection similar to the OMAP model. During
the boot process, the uncompress code determines the physical and virtual base
addresses of the board-specific debug uart. These addresses are then passed
on to the in-kernel debug macros through a small chunk of memory placed just
below the page tables (@0x80003ff8).
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/include/mach/debug-macro.S')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/debug-macro.S | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index 3cd93a801d9b..f761dfdb8689 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S | |||
@@ -17,22 +17,50 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/serial_reg.h> | 19 | #include <linux/serial_reg.h> |
20 | |||
21 | #include <asm/memory.h> | ||
22 | |||
23 | #include <mach/serial.h> | ||
24 | |||
20 | #define UART_SHIFT 2 | 25 | #define UART_SHIFT 2 |
21 | 26 | ||
27 | .pushsection .data | ||
28 | davinci_uart_phys: .word 0 | ||
29 | davinci_uart_virt: .word 0 | ||
30 | .popsection | ||
31 | |||
22 | .macro addruart, rx, tmp | 32 | .macro addruart, rx, tmp |
33 | |||
34 | /* Use davinci_uart_phys/virt if already configured */ | ||
35 | 10: mrc p15, 0, \rx, c1, c0 | ||
36 | tst \rx, #1 @ MMU enabled? | ||
37 | ldreq \rx, =__virt_to_phys(davinci_uart_phys) | ||
38 | ldrne \rx, =davinci_uart_virt | ||
39 | ldr \rx, [\rx] | ||
40 | cmp \rx, #0 @ is port configured? | ||
41 | bne 99f @ already configured | ||
42 | |||
23 | mrc p15, 0, \rx, c1, c0 | 43 | mrc p15, 0, \rx, c1, c0 |
24 | tst \rx, #1 @ MMU enabled? | 44 | tst \rx, #1 @ MMU enabled? |
25 | moveq \rx, #0x01000000 @ physical base address | 45 | |
26 | movne \rx, #0xfe000000 @ virtual base | 46 | /* Copy uart phys address from decompressor uart info */ |
27 | #if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx) | 47 | ldreq \tmp, =__virt_to_phys(davinci_uart_phys) |
28 | #error Cannot enable DaVinci and DA8XX platforms concurrently | 48 | ldrne \tmp, =davinci_uart_phys |
29 | #elif defined(CONFIG_MACH_DAVINCI_DA830_EVM) || \ | 49 | ldreq \rx, =DAVINCI_UART_INFO |
30 | defined(CONFIG_MACH_DAVINCI_DA850_EVM) | 50 | ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO) |
31 | orr \rx, \rx, #0x00d00000 @ physical base address | 51 | ldr \rx, [\rx, #0] |
32 | orr \rx, \rx, #0x0000d000 @ of UART 2 | 52 | str \rx, [\tmp] |
33 | #else | 53 | |
34 | orr \rx, \rx, #0x00c20000 @ UART 0 | 54 | /* Copy uart virt address from decompressor uart info */ |
35 | #endif | 55 | ldreq \tmp, =__virt_to_phys(davinci_uart_virt) |
56 | ldrne \tmp, =davinci_uart_virt | ||
57 | ldreq \rx, =DAVINCI_UART_INFO | ||
58 | ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO) | ||
59 | ldr \rx, [\rx, #4] | ||
60 | str \rx, [\tmp] | ||
61 | |||
62 | b 10b | ||
63 | 99: | ||
36 | .endm | 64 | .endm |
37 | 65 | ||
38 | .macro senduart,rd,rx | 66 | .macro senduart,rd,rx |