Loading...
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_UART_PHYS
12 .macro addruart, rp, rv, tmp
13 ldr \rp, =CONFIG_DEBUG_UART_PHYS
14 ldr \rv, =CONFIG_DEBUG_UART_VIRT
15 .endm
16#endif
17
18 .macro senduart,rd,rx
19 strb \rd, [\rx, #UART01x_DR]
20 .endm
21
22 .macro waituartcts,rd,rx
23 .endm
24
25 .macro waituarttxrdy,rd,rx
261001: ldr \rd, [\rx, #UART01x_FR]
27 ARM_BE8( rev \rd, \rd )
28 tst \rd, #UART01x_FR_TXFF
29 bne 1001b
30 .endm
31
32 .macro busyuart,rd,rx
331001: ldr \rd, [\rx, #UART01x_FR]
34 ARM_BE8( rev \rd, \rd )
35 tst \rd, #UART01x_FR_BUSY
36 bne 1001b
37 .endm
1/* arch/arm/include/debug/pl01x.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13#include <linux/amba/serial.h>
14
15#ifdef CONFIG_DEBUG_ZTE_ZX
16#undef UART01x_DR
17#undef UART01x_FR
18#define UART01x_DR 0x04
19#define UART01x_FR 0x14
20#endif
21
22#ifdef CONFIG_DEBUG_UART_PHYS
23 .macro addruart, rp, rv, tmp
24 ldr \rp, =CONFIG_DEBUG_UART_PHYS
25 ldr \rv, =CONFIG_DEBUG_UART_VIRT
26 .endm
27#endif
28
29 .macro senduart,rd,rx
30 strb \rd, [\rx, #UART01x_DR]
31 .endm
32
33 .macro waituart,rd,rx
341001: ldr \rd, [\rx, #UART01x_FR]
35 ARM_BE8( rev \rd, \rd )
36 tst \rd, #UART01x_FR_TXFF
37 bne 1001b
38 .endm
39
40 .macro busyuart,rd,rx
411001: ldr \rd, [\rx, #UART01x_FR]
42 ARM_BE8( rev \rd, \rd )
43 tst \rd, #UART01x_FR_BUSY
44 bne 1001b
45 .endm