blob: 21e0f077268cd69e9e889e0004f4fabb7e6a6297 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/* 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 */
Uwe Kleine-König4e41db82010-01-25 18:23:04 +010013#define IMX_NEEDS_DEPRECATED_SYMBOLS
Russell Kinga09e64f2008-08-05 16:14:15 +010014
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020015#ifdef CONFIG_ARCH_MX1
16#include <mach/mx1.h>
17#define UART_PADDR UART1_BASE_ADDR
18#define UART_VADDR IO_ADDRESS(UART1_BASE_ADDR)
19#endif
Russell Kinga09e64f2008-08-05 16:14:15 +010020
Sascha Hauer8c25c362009-06-04 11:32:12 +020021#ifdef CONFIG_ARCH_MX25
22#ifdef UART_PADDR
23#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
24#endif
25#include <mach/mx25.h>
26#define UART_PADDR UART1_BASE_ADDR
27#define UART_VADDR MX25_AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
28#endif
29
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020030#ifdef CONFIG_ARCH_MX2
31#ifdef UART_PADDR
32#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
Russell Kinga09e64f2008-08-05 16:14:15 +010033#endif
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020034#include <mach/mx2x.h>
35#define UART_PADDR UART1_BASE_ADDR
36#define UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
Russell Kinga09e64f2008-08-05 16:14:15 +010037#endif
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020038
39#ifdef CONFIG_ARCH_MX3
40#ifdef UART_PADDR
41#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
Russell Kinga09e64f2008-08-05 16:14:15 +010042#endif
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020043#include <mach/mx3x.h>
44#define UART_PADDR UART1_BASE_ADDR
45#define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
Russell Kinga09e64f2008-08-05 16:14:15 +010046#endif
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020047
Dmitriy Taychenachevfd6ac7b2009-07-31 20:29:22 +090048#ifdef CONFIG_ARCH_MXC91231
49#ifdef UART_PADDR
50#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
51#endif
52#include <mach/mxc91231.h>
53#define UART_PADDR MXC91231_UART2_BASE_ADDR
54#define UART_VADDR MXC91231_AIPS1_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
55#endif
Russell Kinga09e64f2008-08-05 16:14:15 +010056 .macro addruart,rx
57 mrc p15, 0, \rx, c1, c0
58 tst \rx, #1 @ MMU enabled?
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020059 ldreq \rx, =UART_PADDR @ physical
60 ldrne \rx, =UART_VADDR @ virtual
Russell Kinga09e64f2008-08-05 16:14:15 +010061 .endm
62
63 .macro senduart,rd,rx
64 str \rd, [\rx, #0x40] @ TXDATA
65 .endm
66
67 .macro waituart,rd,rx
68 .endm
69
70 .macro busyuart,rd,rx
711002: ldr \rd, [\rx, #0x98] @ SR2
72 tst \rd, #1 << 3 @ TXDC
73 beq 1002b @ wait until transmit done
74 .endm