blob: 8d6da9a39d63429e9d8d04a1ef3b8747bbf7e4dd [file] [log] [blame]
Tony Lindgrenaca59b82009-10-19 17:26:17 -07001/* arch/arm/mach-omap2/include/mach/debug-macro.S
Russell Kinga09e64f2008-08-05 16:14:15 +01002 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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.
11 *
12*/
13
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080014#include <linux/serial_reg.h>
15
16#include <plat/serial.h>
17
Tony Lindgren4e6d4882010-02-01 23:26:53 +010018 .macro addruart, rx, tmp
Russell Kinga09e64f2008-08-05 16:14:15 +010019 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1 @ MMU enabled?
Tony Lindgrenaca59b82009-10-19 17:26:17 -070021#ifdef CONFIG_ARCH_OMAP2
Russell Kinga09e64f2008-08-05 16:14:15 +010022 moveq \rx, #0x48000000 @ physical base address
Santosh Shilimkarb4224b22009-10-19 17:25:55 -070023 movne \rx, #0xfa000000 @ virtual base
Russell Kinga09e64f2008-08-05 16:14:15 +010024 orr \rx, \rx, #0x0006a000
25#ifdef CONFIG_OMAP_LL_DEBUG_UART2
26 add \rx, \rx, #0x00002000 @ UART 2
27#endif
28#ifdef CONFIG_OMAP_LL_DEBUG_UART3
29 add \rx, \rx, #0x00004000 @ UART 3
30#endif
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030031
Santosh Shilimkar44169072009-05-28 14:16:04 -070032#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030033 moveq \rx, #0x48000000 @ physical base address
Santosh Shilimkarb4224b22009-10-19 17:25:55 -070034 movne \rx, #0xfa000000 @ virtual base
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030035 orr \rx, \rx, #0x0006a000
36#ifdef CONFIG_OMAP_LL_DEBUG_UART2
37 add \rx, \rx, #0x00002000 @ UART 2
38#endif
39#ifdef CONFIG_OMAP_LL_DEBUG_UART3
40 add \rx, \rx, #0x00fb0000 @ UART 3
41 add \rx, \rx, #0x00006000
42#endif
Russell Kinga09e64f2008-08-05 16:14:15 +010043#endif
44 .endm
45
46 .macro senduart,rd,rx
47 strb \rd, [\rx]
48 .endm
49
50 .macro busyuart,rd,rx
Tony Lindgren4f2c49f2010-02-15 08:48:53 -0800511001: 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)
Russell Kinga09e64f2008-08-05 16:14:15 +010054 bne 1001b
Russell Kinga09e64f2008-08-05 16:14:15 +010055 .endm
56
57 .macro waituart,rd,rx
58 .endm