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 <asm/memory.h>
23 #include <mach/serial.h>
28 davinci_uart_phys: .word 0
29 davinci_uart_virt: .word 0
32 .macro addruart, rx, tmp
34 /* Use davinci_uart_phys/virt if already configured */
35 10: mrc p15, 0, \rx, c1, c0
36 tst \rx, #1 @ MMU enabled?
37 ldreq \rx, =__virt_to_phys(davinci_uart_phys)
38 ldrne \rx, =davinci_uart_virt
40 cmp \rx, #0 @ is port configured?
41 bne 99f @ already configured
43 mrc p15, 0, \rx, c1, c0
44 tst \rx, #1 @ MMU enabled?
46 /* Copy uart phys address from decompressor uart info */
47 ldreq \tmp, =__virt_to_phys(davinci_uart_phys)
48 ldrne \tmp, =davinci_uart_phys
49 ldreq \rx, =DAVINCI_UART_INFO
50 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO)
54 /* Copy uart virt address from decompressor uart info */
55 ldreq \tmp, =__virt_to_phys(davinci_uart_virt)
56 ldrne \tmp, =davinci_uart_virt
57 ldreq \rx, =DAVINCI_UART_INFO
58 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO)
67 str \rd, [\rx, #UART_TX << UART_SHIFT]
71 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
72 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
73 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
79 1001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
80 tst \rd, #UART_MSR_CTS