xref: /linux/arch/arm/include/debug/pl01x.S (revision d2912cb15bdda8ba4a5dd73396ad62641af2f520)
1*d2912cb1SThomas 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
1158d03985SJun Nie#ifdef CONFIG_DEBUG_ZTE_ZX
1258d03985SJun Nie#undef UART01x_DR
1358d03985SJun Nie#undef UART01x_FR
1458d03985SJun Nie#define UART01x_DR     0x04
1558d03985SJun Nie#define UART01x_FR     0x14
1658d03985SJun Nie#endif
1758d03985SJun Nie
184e218b99SRussell King#ifdef CONFIG_DEBUG_UART_PHYS
194e218b99SRussell King		.macro	addruart, rp, rv, tmp
204e218b99SRussell King		ldr	\rp, =CONFIG_DEBUG_UART_PHYS
214e218b99SRussell King		ldr	\rv, =CONFIG_DEBUG_UART_VIRT
224e218b99SRussell King		.endm
234e218b99SRussell King#endif
244e218b99SRussell King
254e218b99SRussell King		.macro	senduart,rd,rx
264e218b99SRussell King		strb	\rd, [\rx, #UART01x_DR]
274e218b99SRussell King		.endm
284e218b99SRussell King
294e218b99SRussell King		.macro	waituart,rd,rx
304e218b99SRussell King1001:		ldr	\rd, [\rx, #UART01x_FR]
3176e3faf1SBen Dooks ARM_BE8(	rev	\rd, \rd )
324e218b99SRussell King		tst	\rd, #UART01x_FR_TXFF
334e218b99SRussell King		bne	1001b
344e218b99SRussell King		.endm
354e218b99SRussell King
364e218b99SRussell King		.macro	busyuart,rd,rx
374e218b99SRussell King1001:		ldr	\rd, [\rx, #UART01x_FR]
3876e3faf1SBen Dooks ARM_BE8(	rev	\rd, \rd )
394e218b99SRussell King		tst	\rd, #UART01x_FR_BUSY
404e218b99SRussell King		bne	1001b
414e218b99SRussell King		.endm
42