Merge branch 'next/cross-platform' of git://git.linaro.org/people/arnd/arm-soc
[pandora-kernel.git] / arch / arm / plat-mxc / include / mach / debug-macro.S
1 /* arch/arm/mach-imx/include/mach/debug-macro.S
2  *
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 #include <mach/hardware.h>
14
15 #ifdef CONFIG_DEBUG_IMX1_UART
16 #define UART_PADDR      MX1_UART1_BASE_ADDR
17 #elif defined (CONFIG_DEBUG_IMX25_UART)
18 #define UART_PADDR      MX25_UART1_BASE_ADDR
19 #elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
20 #define UART_PADDR      MX2x_UART1_BASE_ADDR
21 #elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
22 #define UART_PADDR      MX3x_UART1_BASE_ADDR
23 #elif defined (CONFIG_DEBUG_IMX51_UART)
24 #define UART_PADDR      MX51_UART1_BASE_ADDR
25 #elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
26 #define UART_PADDR      MX53_UART1_BASE_ADDR
27 #endif
28
29 #define UART_VADDR      IMX_IO_ADDRESS(UART_PADDR)
30
31                 .macro  addruart, rp, rv, tmp
32                 ldr     \rp, =UART_PADDR        @ physical
33                 ldr     \rv, =UART_VADDR        @ virtual
34                 .endm
35
36                 .macro  senduart,rd,rx
37                 str     \rd, [\rx, #0x40]       @ TXDATA
38                 .endm
39
40                 .macro  waituart,rd,rx
41                 .endm
42
43                 .macro  busyuart,rd,rx
44 1002:           ldr     \rd, [\rx, #0x98]       @ SR2
45                 tst     \rd, #1 << 3            @ TXDC
46                 beq     1002b                   @ wait until transmit done
47                 .endm