3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
5 * Author: Brian Swetland <swetland@google.com>
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
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.
18 .macro addruart, rp, rv, tmp
19 ldr \rp, =CONFIG_DEBUG_UART_PHYS
20 ldr \rv, =CONFIG_DEBUG_UART_VIRT
23 .macro senduart, rd, rx
24 ARM_BE8(rev \rd, \rd )
25 @ Write the 1 character to UARTDM_TF
29 .macro waituart, rd, rx
30 @ check for TX_EMT in UARTDM_SR
32 ARM_BE8(rev \rd, \rd )
35 @ wait for TXREADY in UARTDM_ISR
36 1001: ldr \rd, [\rx, #0x14]
37 ARM_BE8(rev \rd, \rd )
41 @ Clear TX_READY by writing to the UARTDM_CR register
43 ARM_BE8(rev \rd, \rd )
45 @ Write 0x1 to NCF register
47 ARM_BE8(rev \rd, \rd )
49 @ UARTDM reg. Read to induce delay
53 .macro busyuart, rd, rx