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_SOC_IMX1
16 #define UART_PADDR MX1_UART1_BASE_ADDR
19 #ifdef CONFIG_SOC_IMX25
21 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
23 #define UART_PADDR MX25_UART1_BASE_ADDR
26 #if defined(CONFIG_SOC_IMX21) || defined (CONFIG_SOC_IMX27)
28 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
30 #define UART_PADDR MX2x_UART1_BASE_ADDR
33 #if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
35 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
37 #define UART_PADDR MX3x_UART1_BASE_ADDR
40 #ifdef CONFIG_SOC_IMX51
42 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
44 #define UART_PADDR MX51_UART1_BASE_ADDR
47 /* iMX50/53 have same addresses, but not iMX51 */
48 #if defined(CONFIG_SOC_IMX50) || defined(CONFIG_SOC_IMX53)
50 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
52 #define UART_PADDR MX53_UART1_BASE_ADDR
55 #define UART_VADDR IMX_IO_ADDRESS(UART_PADDR)
57 .macro addruart, rp, rv
58 ldr \rp, =UART_PADDR @ physical
59 ldr \rv, =UART_VADDR @ virtual
63 str \rd, [\rx, #0x40] @ TXDATA
70 1002: ldr \rd, [\rx, #0x98] @ SR2
71 tst \rd, #1 << 3 @ TXDC
72 beq 1002b @ wait until transmit done