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_UART) 28#define UART_PADDR MX6Q_UART4_BASE_ADDR 29#endif 30 31#define UART_VADDR IMX_IO_ADDRESS(UART_PADDR) 32 33 .macro addruart, rp, rv, tmp 34 ldr \rp, =UART_PADDR @ physical 35 ldr \rv, =UART_VADDR @ virtual 36 .endm 37 38 .macro senduart,rd,rx 39 str \rd, [\rx, #0x40] @ TXDATA 40 .endm 41 42 .macro waituart,rd,rx 43 .endm 44 45 .macro busyuart,rd,rx 461002: ldr \rd, [\rx, #0x98] @ SR2 47 tst \rd, #1 << 3 @ TXDC 48 beq 1002b @ wait until transmit done 49 .endm 50