aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S31
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
351002: 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
431001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
44 tst \rd, #UART_MSR_CTS
45 beq 1001b
46#endif
47 .endm
48