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>
26 davinci_uart_phys: .word 0
27 davinci_uart_virt: .word 0
30 .macro addruart, rp, rv, tmp
32 /* Use davinci_uart_phys/virt if already configured */
33 10: adr \rp, 99f @ get effective addr of 99f
34 ldr \rv, [\rp] @ get absolute addr of 99f
35 sub \rv, \rv, \rp @ offset between the two
36 ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys
37 sub \tmp, \rp, \rv @ make it effective
38 ldr \rp, [\tmp, #0] @ davinci_uart_phys
39 ldr \rv, [\tmp, #4] @ davinci_uart_virt
40 cmp \rp, #0 @ is port configured?
42 bne 100f @ already configured
44 /* Check the debug UART address set in uncompress.h */
45 and \rp, pc, #0xff000000
46 ldr \rv, =DAVINCI_UART_INFO_OFS
49 /* Copy uart phys address from decompressor uart info */
53 /* Copy uart virt address from decompressor uart info */
61 .word davinci_uart_phys
68 str \rd, [\rx, #UART_TX << UART_SHIFT]
72 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
73 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
74 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
80 1001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
81 tst \rd, #UART_MSR_CTS