diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-16 10:21:27 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-16 10:21:27 -0500 |
commit | 89a4150331bc07014256714678ce8e9b238fc145 (patch) | |
tree | 3a0358208775f29f9e319b506ce849c5dbdc1a06 /arch/arm/include | |
parent | 77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff) | |
parent | 68b25325a7fd290b5e472bba0df9cbe8c1a81d8f (diff) |
Merge remote-tracking branch 'arm-soc/imx/multiplatform' into x
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/debug/imx.S | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/arch/arm/include/debug/imx.S b/arch/arm/include/debug/imx.S new file mode 100644 index 000000000000..0b65d792f664 --- /dev/null +++ b/arch/arm/include/debug/imx.S | |||
@@ -0,0 +1,62 @@ | |||
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 | #ifdef CONFIG_DEBUG_IMX1_UART | ||
14 | #define UART_PADDR 0x00206000 | ||
15 | #elif defined (CONFIG_DEBUG_IMX25_UART) | ||
16 | #define UART_PADDR 0x43f90000 | ||
17 | #elif defined (CONFIG_DEBUG_IMX21_IMX27_UART) | ||
18 | #define UART_PADDR 0x1000a000 | ||
19 | #elif defined (CONFIG_DEBUG_IMX31_IMX35_UART) | ||
20 | #define UART_PADDR 0x43f90000 | ||
21 | #elif defined (CONFIG_DEBUG_IMX51_UART) | ||
22 | #define UART_PADDR 0x73fbc000 | ||
23 | #elif defined (CONFIG_DEBUG_IMX50_IMX53_UART) | ||
24 | #define UART_PADDR 0x53fbc000 | ||
25 | #elif defined (CONFIG_DEBUG_IMX6Q_UART2) | ||
26 | #define UART_PADDR 0x021e8000 | ||
27 | #elif defined (CONFIG_DEBUG_IMX6Q_UART4) | ||
28 | #define UART_PADDR 0x021f0000 | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to | ||
33 | * stay sync with that. It's hard to maintain, and should be fixed | ||
34 | * globally for multi-platform build to use a fixed virtual address | ||
35 | * for low-level debug uart port across platforms. | ||
36 | */ | ||
37 | #define IMX_IO_P2V(x) ( \ | ||
38 | (((x) & 0x80000000) >> 7) | \ | ||
39 | (0xf4000000 + \ | ||
40 | (((x) & 0x50000000) >> 6) + \ | ||
41 | (((x) & 0x0b000000) >> 4) + \ | ||
42 | (((x) & 0x000fffff)))) | ||
43 | |||
44 | #define UART_VADDR IMX_IO_P2V(UART_PADDR) | ||
45 | |||
46 | .macro addruart, rp, rv, tmp | ||
47 | ldr \rp, =UART_PADDR @ physical | ||
48 | ldr \rv, =UART_VADDR @ virtual | ||
49 | .endm | ||
50 | |||
51 | .macro senduart,rd,rx | ||
52 | str \rd, [\rx, #0x40] @ TXDATA | ||
53 | .endm | ||
54 | |||
55 | .macro waituart,rd,rx | ||
56 | .endm | ||
57 | |||
58 | .macro busyuart,rd,rx | ||
59 | 1002: ldr \rd, [\rx, #0x98] @ SR2 | ||
60 | tst \rd, #1 << 3 @ TXDC | ||
61 | beq 1002b @ wait until transmit done | ||
62 | .endm | ||