debug-macro.S 1.8 KB
Newer Older
1
/* arch/arm/mach-imx/include/mach/debug-macro.S
S
Sascha Hauer 已提交
2 3 4 5 6 7 8 9 10 11 12
 *
 * Debugging macro include header
 *
 *  Copyright (C) 1994-1999 Russell King
 *  Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */
13
#include <mach/hardware.h>
S
Sascha Hauer 已提交
14

15
#ifdef CONFIG_SOC_IMX1
16
#define UART_PADDR	MX1_UART1_BASE_ADDR
17
#endif
18

19
#ifdef CONFIG_SOC_IMX25
S
Sascha Hauer 已提交
20 21 22
#ifdef UART_PADDR
#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
#endif
E
Eric Bénard 已提交
23
#define UART_PADDR	MX25_UART1_BASE_ADDR
S
Sascha Hauer 已提交
24 25
#endif

26
#if defined(CONFIG_SOC_IMX21) || defined (CONFIG_SOC_IMX27)
27 28
#ifdef UART_PADDR
#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
29
#endif
30
#define UART_PADDR	MX2x_UART1_BASE_ADDR
31
#endif
32

33
#if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
34 35
#ifdef UART_PADDR
#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
36
#endif
37
#define UART_PADDR	MX3x_UART1_BASE_ADDR
38
#endif
39

40
#ifdef CONFIG_SOC_IMX51
41 42 43 44 45 46
#ifdef UART_PADDR
#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
#endif
#define UART_PADDR	MX51_UART1_BASE_ADDR
#endif

A
Arnaud Patard (Rtp) 已提交
47 48 49 50 51 52 53 54
/* iMX50/53 have same addresses, but not iMX51 */
#if defined(CONFIG_SOC_IMX50) || defined(CONFIG_SOC_IMX53)
#ifdef UART_PADDR
#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
#endif
#define UART_PADDR	MX53_UART1_BASE_ADDR
#endif

55 56
#define UART_VADDR	IMX_IO_ADDRESS(UART_PADDR)

57
		.macro	addruart, rp, rv, tmp
58 59
		ldr	\rp, =UART_PADDR	@ physical
		ldr	\rv, =UART_VADDR	@ virtual
S
Sascha Hauer 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73
		.endm

		.macro	senduart,rd,rx
		str	\rd, [\rx, #0x40]	@ TXDATA
		.endm

		.macro	waituart,rd,rx
		.endm

		.macro	busyuart,rd,rx
1002:		ldr	\rd, [\rx, #0x98]	@ SR2
		tst	\rd, #1 << 3		@ TXDC
		beq	1002b			@ wait until transmit done
		.endm