1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * arch/arm/include/debug/8250.S
5 * Copyright (C) 1994-2013 Russell King
7 #include <linux/serial_reg.h>
9 .macro addruart, rp, rv, tmp
10 ldr \rp, =CONFIG_DEBUG_UART_PHYS
11 ldr \rv, =CONFIG_DEBUG_UART_VIRT
14 #ifdef CONFIG_DEBUG_UART_8250_WORD
15 .macro store, rd, rx:vararg
21 .macro load, rd, rx:vararg
26 .macro store, rd, rx:vararg
30 .macro load, rd, rx:vararg
35 #define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT
38 store \rd, [\rx, #UART_TX << UART_SHIFT]
42 1002: load \rd, [\rx, #UART_LSR << UART_SHIFT]
43 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
44 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
48 .macro waituarttxrdy,rd,rx
51 .macro waituartcts,rd,rx
52 1001: load \rd, [\rx, #UART_MSR << UART_SHIFT]
53 tst \rd, #UART_MSR_CTS