xref: /linux/arch/arm/include/debug/pl01x.S (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
1d2912cb1SThomas Gleixner/* SPDX-License-Identifier: GPL-2.0-only */
24e218b99SRussell King/* arch/arm/include/debug/pl01x.S
34e218b99SRussell King *
44e218b99SRussell King * Debugging macro include header
54e218b99SRussell King *
64e218b99SRussell King *  Copyright (C) 1994-1999 Russell King
74e218b99SRussell King *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
84e218b99SRussell King*/
94e218b99SRussell King#include <linux/amba/serial.h>
104e218b99SRussell King
114e218b99SRussell King#ifdef CONFIG_DEBUG_UART_PHYS
124e218b99SRussell King		.macro	addruart, rp, rv, tmp
134e218b99SRussell King		ldr	\rp, =CONFIG_DEBUG_UART_PHYS
144e218b99SRussell King		ldr	\rv, =CONFIG_DEBUG_UART_VIRT
154e218b99SRussell King		.endm
164e218b99SRussell King#endif
174e218b99SRussell King
184e218b99SRussell King		.macro	senduart,rd,rx
194e218b99SRussell King		strb	\rd, [\rx, #UART01x_DR]
204e218b99SRussell King		.endm
214e218b99SRussell King
22*2c50a570SLinus Walleij		.macro	waituartcts,rd,rx
23*2c50a570SLinus Walleij		.endm
24*2c50a570SLinus Walleij
25*2c50a570SLinus Walleij		.macro	waituarttxrdy,rd,rx
264e218b99SRussell King1001:		ldr	\rd, [\rx, #UART01x_FR]
2776e3faf1SBen Dooks ARM_BE8(	rev	\rd, \rd )
284e218b99SRussell King		tst	\rd, #UART01x_FR_TXFF
294e218b99SRussell King		bne	1001b
304e218b99SRussell King		.endm
314e218b99SRussell King
324e218b99SRussell King		.macro	busyuart,rd,rx
334e218b99SRussell King1001:		ldr	\rd, [\rx, #UART01x_FR]
3476e3faf1SBen Dooks ARM_BE8(	rev	\rd, \rd )
354e218b99SRussell King		tst	\rd, #UART01x_FR_BUSY
364e218b99SRussell King		bne	1001b
374e218b99SRussell King		.endm
38