1 /* arch/arm/mach-omap2/include/mach/debug-macro.S
3 * Debugging macro include header
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
14 #include <linux/serial_reg.h>
16 #include <plat/serial.h>
18 .macro addruart, rx, tmp
19 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1 @ MMU enabled?
21 #ifdef CONFIG_ARCH_OMAP2
22 moveq \rx, #0x48000000 @ physical base address
23 movne \rx, #0xfa000000 @ virtual base
24 orr \rx, \rx, #0x0006a000
25 #ifdef CONFIG_OMAP_LL_DEBUG_UART2
26 add \rx, \rx, #0x00002000 @ UART 2
28 #ifdef CONFIG_OMAP_LL_DEBUG_UART3
29 add \rx, \rx, #0x00004000 @ UART 3
32 #elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
33 moveq \rx, #0x48000000 @ physical base address
34 movne \rx, #0xfa000000 @ virtual base
35 orr \rx, \rx, #0x0006a000
36 #ifdef CONFIG_OMAP_LL_DEBUG_UART2
37 add \rx, \rx, #0x00002000 @ UART 2
39 #ifdef CONFIG_OMAP_LL_DEBUG_UART3
40 add \rx, \rx, #0x00fb0000 @ UART 3
41 add \rx, \rx, #0x00006000
51 1001: ldrb \rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
52 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
53 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)