1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2014 Carlo Caione
4 * Carlo Caione <carlo@caione.org>
7 #define MESON_AO_UART_WFIFO 0x0
8 #define MESON_AO_UART_STATUS 0xc
10 #define MESON_AO_UART_TX_FIFO_EMPTY (1 << 22)
11 #define MESON_AO_UART_TX_FIFO_FULL (1 << 21)
13 .macro addruart, rp, rv, tmp
14 ldr \rp, =(CONFIG_DEBUG_UART_PHYS) @ physical
15 ldr \rv, =(CONFIG_DEBUG_UART_VIRT) @ virtual
19 str \rd, [\rx, #MESON_AO_UART_WFIFO]
23 1002: ldr \rd, [\rx, #MESON_AO_UART_STATUS]
24 tst \rd, #MESON_AO_UART_TX_FIFO_EMPTY
28 .macro waituartcts,rd,rx
31 .macro waituarttxrdy,rd,rx
32 1001: ldr \rd, [\rx, #MESON_AO_UART_STATUS]
33 tst \rd, #MESON_AO_UART_TX_FIFO_FULL