1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2003-2005 SAN People
5 * Debugging macro include header
8 #define AT91_DBGU_SR (0x14) /* Status Register */
9 #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */
10 #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */
11 #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */
13 .macro addruart, rp, rv, tmp
14 ldr \rp, =CONFIG_DEBUG_UART_PHYS @ System peripherals (phys address)
15 ldr \rv, =CONFIG_DEBUG_UART_VIRT @ System peripherals (virt address)
19 strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register
22 .macro waituarttxrdy,rd,rx
23 1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register
24 tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit
28 .macro waituartcts,rd,rx
32 1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register
33 tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete