diff options
author | Chaithrika U S <chaithrika@ti.com> | 2009-01-19 03:43:05 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-26 10:18:14 -0400 |
commit | 17eb15704142dc1b302a3f0cd632c426ee326b6d (patch) | |
tree | 48c563fa921c858d4648d485309125beed436395 /arch/arm/mach-davinci/include | |
parent | dc75602628472d7fbc4cb43f010bf0257e95ab71 (diff) |
davinci: use 32-bit accesses for low-level debug macros
This patch defines debug macros for low-level debugging for Davinci
based platforms
Tested on :
- DM644x DaVinci EVM
- DM646X DaVinciHD EVM
- DM355 EVM
This patch attempts to solve the low-level debug issue in DM646x. The
UART on DM646x SoC allows only 32-bit access. The existing
debug-macro.S uses the macros from debug-8250.S file. This led to
garbage serial out in the case of DM646x.
The inclusion of debug-8250.S does not allow for run time fix for this
issue. There are compile time errors due to multiple definitions of
the macros. Also when building a single image for multiple DaVinci
Platforms, the ifdefs cannot be relied upon.
The solution below does not include the debug-8250.S file and defines
the necessary macros. This solution was arrived at after observing
that word access does not affect the low-level debug messages on
DM644x/DM355.
The other approach to this issue is to use the UART module information
available in the peripheral registers to decide the access
mechanism. But this will have to be done for every access of UART
specifically for DM646x. Also this calls for a modification of the
debug-8250.S file.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/debug-macro.S | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index e6c0f0d5d062..de3fc2182b47 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S | |||
@@ -9,6 +9,16 @@ | |||
9 | * or implied. | 9 | * or implied. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* Modifications | ||
13 | * Jan 2009 Chaithrika U S Added senduart, busyuart, waituart | ||
14 | * macros, based on debug-8250.S file | ||
15 | * but using 32-bit accesses required for | ||
16 | * some davinci devices. | ||
17 | */ | ||
18 | |||
19 | #include <linux/serial_reg.h> | ||
20 | #define UART_SHIFT 2 | ||
21 | |||
12 | .macro addruart, rx | 22 | .macro addruart, rx |
13 | mrc p15, 0, \rx, c1, c0 | 23 | mrc p15, 0, \rx, c1, c0 |
14 | tst \rx, #1 @ MMU enabled? | 24 | tst \rx, #1 @ MMU enabled? |
@@ -17,5 +27,22 @@ | |||
17 | orr \rx, \rx, #0x00c20000 @ UART 0 | 27 | orr \rx, \rx, #0x00c20000 @ UART 0 |
18 | .endm | 28 | .endm |
19 | 29 | ||
20 | #define UART_SHIFT 2 | 30 | .macro senduart,rd,rx |
21 | #include <asm/hardware/debug-8250.S> | 31 | str \rd, [\rx, #UART_TX << UART_SHIFT] |
32 | .endm | ||
33 | |||
34 | .macro busyuart,rd,rx | ||
35 | 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] | ||
36 | and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
37 | teq \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
38 | bne 1002b | ||
39 | .endm | ||
40 | |||
41 | .macro waituart,rd,rx | ||
42 | #ifdef FLOW_CONTROL | ||
43 | 1001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT] | ||
44 | tst \rd, #UART_MSR_CTS | ||
45 | beq 1001b | ||
46 | #endif | ||
47 | .endm | ||
48 | |||