1/* 2 * arch/arm/include/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 .macro addruart, rp, rv, tmp 13 ldr \rp, =CONFIG_DEBUG_UART_PHYS 14 ldr \rv, =CONFIG_DEBUG_UART_VIRT 15 .endm 16 17#define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT 18 19 .macro senduart,rd,rx 20 strb \rd, [\rx, #UART_TX << UART_SHIFT] 21 .endm 22 23 .macro busyuart,rd,rx 241002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] 25 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE 26 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE 27 bne 1002b 28 .endm 29 30 .macro waituart,rd,rx 31#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL 321001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] 33 tst \rd, #UART_MSR_CTS 34 beq 1001b 35#endif 36 .endm 37