2 * Debugging macro for DaVinci
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
13 * Jan 2009 Chaithrika U S Added senduart, busyuart, waituart
14 * macros, based on debug-8250.S file
15 * but using 32-bit accesses required for
16 * some davinci devices.
19 #include <linux/serial_reg.h>
21 #include <mach/serial.h>
25 #if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0)
26 #define UART_BASE DAVINCI_UART0_BASE
27 #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1)
28 #define UART_BASE DA8XX_UART1_BASE
29 #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2)
30 #define UART_BASE DA8XX_UART2_BASE
31 #elif defined(CONFIG_DEBUG_DAVINCI_TNETV107X_UART1)
32 #define UART_BASE TNETV107X_UART2_BASE
33 #define UART_VIRTBASE TNETV107X_UART2_VIRT
35 #error "Select a specifc port for DEBUG_LL"
39 #define UART_VIRTBASE IO_ADDRESS(UART_BASE)
42 .macro addruart, rp, rv, tmp
44 ldr \rv, =UART_VIRTBASE
48 str \rd, [\rx, #UART_TX << UART_SHIFT]
52 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
53 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
54 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
60 1001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
61 tst \rd, #UART_MSR_CTS