xref: /linux/arch/arm/include/debug/pl01x.S (revision 132db93572821ec2fdf81e354cc40f558faf7e4f)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/* arch/arm/include/debug/pl01x.S
3 *
4 * Debugging macro include header
5 *
6 *  Copyright (C) 1994-1999 Russell King
7 *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8*/
9#include <linux/amba/serial.h>
10
11#ifdef CONFIG_DEBUG_ZTE_ZX
12#undef UART01x_DR
13#undef UART01x_FR
14#define UART01x_DR     0x04
15#define UART01x_FR     0x14
16#endif
17
18#ifdef CONFIG_DEBUG_UART_PHYS
19		.macro	addruart, rp, rv, tmp
20		ldr	\rp, =CONFIG_DEBUG_UART_PHYS
21		ldr	\rv, =CONFIG_DEBUG_UART_VIRT
22		.endm
23#endif
24
25		.macro	senduart,rd,rx
26		strb	\rd, [\rx, #UART01x_DR]
27		.endm
28
29		.macro	waituart,rd,rx
301001:		ldr	\rd, [\rx, #UART01x_FR]
31 ARM_BE8(	rev	\rd, \rd )
32		tst	\rd, #UART01x_FR_TXFF
33		bne	1001b
34		.endm
35
36		.macro	busyuart,rd,rx
371001:		ldr	\rd, [\rx, #UART01x_FR]
38 ARM_BE8(	rev	\rd, \rd )
39		tst	\rd, #UART01x_FR_BUSY
40		bne	1001b
41		.endm
42