Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[firefly-linux-kernel-4.4.55.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 #elif defined (CONFIG_DEBUG_IMX6Q_UART2)
28 #define UART_PADDR      MX6Q_UART2_BASE_ADDR
29 #elif defined (CONFIG_DEBUG_IMX6Q_UART4)
30 #define UART_PADDR      MX6Q_UART4_BASE_ADDR
31 #endif
32
33 #define UART_VADDR      IMX_IO_ADDRESS(UART_PADDR)
34
35                 .macro  addruart, rp, rv, tmp
36                 ldr     \rp, =UART_PADDR        @ physical
37                 ldr     \rv, =UART_VADDR        @ virtual
38                 .endm
39
40                 .macro  senduart,rd,rx
41                 str     \rd, [\rx, #0x40]       @ TXDATA
42                 .endm
43
44                 .macro  waituart,rd,rx
45                 .endm
46
47                 .macro  busyuart,rd,rx
48 1002:           ldr     \rd, [\rx, #0x98]       @ SR2
49                 tst     \rd, #1 << 3            @ TXDC
50                 beq     1002b                   @ wait until transmit done
51                 .endm