blob: 25606409aabcfb7de02a3dbce55e7221b68d2ece [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>
Eric Bénard7e688f02010-07-16 15:09:06 +020026#define UART_PADDR MX25_UART1_BASE_ADDR
27#define UART_VADDR MX25_AIPS1_IO_ADDRESS(MX25_UART1_BASE_ADDR)
Sascha Hauer8c25c362009-06-04 11:32:12 +020028#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
Amit Kucheria438caa32010-02-04 12:09:40 -080048#ifdef CONFIG_ARCH_MX5
49#ifdef UART_PADDR
50#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
51#endif
52#include <mach/mx51.h>
53#define UART_PADDR MX51_UART1_BASE_ADDR
54#define UART_VADDR MX51_AIPS1_IO_ADDRESS(MX51_UART1_BASE_ADDR)
55#endif
56
Dmitriy Taychenachevfd6ac7b2009-07-31 20:29:22 +090057#ifdef CONFIG_ARCH_MXC91231
58#ifdef UART_PADDR
59#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
60#endif
61#include <mach/mxc91231.h>
62#define UART_PADDR MXC91231_UART2_BASE_ADDR
Uwe Kleine-König9ea07ec2010-01-13 18:07:11 +010063#define UART_VADDR MXC91231_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
Dmitriy Taychenachevfd6ac7b2009-07-31 20:29:22 +090064#endif
Tony Lindgren4e6d4882010-02-01 23:26:53 +010065 .macro addruart, rx, tmp
Russell Kinga09e64f2008-08-05 16:14:15 +010066 mrc p15, 0, \rx, c1, c0
67 tst \rx, #1 @ MMU enabled?
Sascha Hauerccc1a6f2009-06-04 13:45:37 +020068 ldreq \rx, =UART_PADDR @ physical
69 ldrne \rx, =UART_VADDR @ virtual
Russell Kinga09e64f2008-08-05 16:14:15 +010070 .endm
71
72 .macro senduart,rd,rx
73 str \rd, [\rx, #0x40] @ TXDATA
74 .endm
75
76 .macro waituart,rd,rx
77 .endm
78
79 .macro busyuart,rd,rx
801002: ldr \rd, [\rx, #0x98] @ SR2
81 tst \rd, #1 << 3 @ TXDC
82 beq 1002b @ wait until transmit done
83 .endm