1 /* arch/arm/mach-imx/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.
13 #include <mach/hardware.h>
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_UART)
28 #define UART_PADDR MX6Q_UART4_BASE_ADDR
31 #define UART_VADDR IMX_IO_ADDRESS(UART_PADDR)
33 .macro addruart, rp, rv, tmp
34 ldr \rp, =UART_PADDR @ physical
35 ldr \rv, =UART_VADDR @ virtual
39 str \rd, [\rx, #0x40] @ TXDATA
46 1002: ldr \rd, [\rx, #0x98] @ SR2
47 tst \rd, #1 << 3 @ TXDC
48 beq 1002b @ wait until transmit done