ARM: debug: provide 8250 debug uart phys/virt address configuration options
[deliverable/linux.git] / arch / arm / include / asm / hardware / debug-8250.S
1 /*
2 * arch/arm/include/asm/hardware/debug-8250.S
3 *
4 * Copyright (C) 1994-2013 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10 #include <linux/serial_reg.h>
11
12 #ifdef CONFIG_DEBUG_UART_PHYS
13 .macro addruart, rp, rv, tmp
14 ldr \rp, =CONFIG_DEBUG_UART_PHYS
15 ldr \rv, =CONFIG_DEBUG_UART_VIRT
16 .endm
17 #endif
18
19 #ifndef UART_SHIFT
20 #define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT
21 #endif
22
23 .macro senduart,rd,rx
24 strb \rd, [\rx, #UART_TX << UART_SHIFT]
25 .endm
26
27 .macro busyuart,rd,rx
28 1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT]
29 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
30 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
31 bne 1002b
32 .endm
33
34 .macro waituart,rd,rx
35 #ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
36 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
37 tst \rd, #UART_MSR_CTS
38 beq 1001b
39 #endif
40 .endm
This page took 0.040989 seconds and 5 git commands to generate.