1/*
2 * xen/arch/arm/arm32/debug-8250.inc
3 *
4 * 8250 specific debug code
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 */
16
17#include <xen/8250-uart.h>
18
19/*
20 * 8250 UART wait UART to be ready to transmit
21 * rb: register which contains the UART base address
22 * rc: scratch register
23 */
24.macro early_uart_ready rb rc
251:
26        ldr     \rc, [\rb, #(UART_LSR << EARLY_UART_REG_SHIFT)] /* Read LSR */
27        tst     \rc, #UART_LSR_THRE     /* Check Xmit holding register flag */
28        beq     1b                         /* Wait for the UART to be ready */
29.endm
30
31/*
32 * 8250 UART transmit character
33 * rb: register which contains the UART base address
34 * rt: register which contains the character to transmit
35 */
36.macro early_uart_transmit rb rt
37        str   \rt, [\rb, #UART_THR]      /* Write Transmit buffer */
38.endm
39
40/*
41 * Local variables:
42 * mode: ASM
43 * indent-tabs-mode: nil
44 * End:
45 */
46