summaryrefslogtreecommitdiff
path: root/arch/arm/include/debug
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-10-16 22:03:40 +0400
committerOlof Johansson <olof@lixom.net>2012-10-16 22:04:23 +0400
commit4afe30dfc6f2ba538bb1984d421e47ae2de90a7e (patch)
tree2bea7a21542264bbb6b11b6ea5e31139e9ff45f3 /arch/arm/include/debug
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
parentc5a0d4977f00ca18c49d46fdaff4b2cfeaa4eb28 (diff)
downloadlinux-4afe30dfc6f2ba538bb1984d421e47ae2de90a7e.tar.xz
Merge branch 'imx/multi-platform' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/cleanup
From Shawn Guo: "Here is the imx multi-platform support [1] that missed 3.7 merge window. Please pull it for 3.8 and exposing on linux-next. As it touches a lot of files, I send it early, so that people can base their works off it to avoid conflicts." * 'imx/multi-platform' of git://git.linaro.org/people/shawnguo/linux-2.6: (31 commits) ARM: imx: enable multi-platform build ARM: imx: call mxc_device_init() in soc specific function ARM: imx: remove header file mach/irqs.h ARM: imx: include hardware.h rather than mach/hardware.h ARM: imx: move debug macros to include/debug video: imxfb: remove cpu_is_xxx by using platform_device_id mmc: mxcmmc: remove cpu_is_xxx by using platform_device_id media: mx2_camera: remove cpu_is_xxx by using platform_device_id dma: imx-dma: remove cpu_is_xxx by using platform_device_id dma: imx-dma: retrieve MEM and IRQ from resources dma: imx-dma: use devm_kzalloc and devm_request_irq rtc: mxc_rtc: remove cpu_is_xxx by using platform_device_id mtd: mxc_nand: remove cpu_is_xxx by using platform_device_id i2c: imx: remove cpu_is_xxx by using platform_device_id watchdog: imx2_wdt: remove unneeded mach/hardware.h inclusion video: mx3fb: remove unneeded mach/hardware.h inclusion usb: ehci-mxc: remove unneeded mach/hardware.h inclusion ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion dma: imx-sdma: remove unneeded mach/hardware.h inclusion dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/include/debug')
-rw-r--r--arch/arm/include/debug/imx.S62
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 @@
+/* arch/arm/mach-imx/include/mach/debug-macro.S
+ *
+ * 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.
+ *
+ */
+#ifdef CONFIG_DEBUG_IMX1_UART
+#define UART_PADDR 0x00206000
+#elif defined (CONFIG_DEBUG_IMX25_UART)
+#define UART_PADDR 0x43f90000
+#elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
+#define UART_PADDR 0x1000a000
+#elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
+#define UART_PADDR 0x43f90000
+#elif defined (CONFIG_DEBUG_IMX51_UART)
+#define UART_PADDR 0x73fbc000
+#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
+#define UART_PADDR 0x53fbc000
+#elif defined (CONFIG_DEBUG_IMX6Q_UART2)
+#define UART_PADDR 0x021e8000
+#elif defined (CONFIG_DEBUG_IMX6Q_UART4)
+#define UART_PADDR 0x021f0000
+#endif
+
+/*
+ * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
+ * stay sync with that. It's hard to maintain, and should be fixed
+ * globally for multi-platform build to use a fixed virtual address
+ * for low-level debug uart port across platforms.
+ */
+#define IMX_IO_P2V(x) ( \
+ (((x) & 0x80000000) >> 7) | \
+ (0xf4000000 + \
+ (((x) & 0x50000000) >> 6) + \
+ (((x) & 0x0b000000) >> 4) + \
+ (((x) & 0x000fffff))))
+
+#define UART_VADDR IMX_IO_P2V(UART_PADDR)
+
+ .macro addruart, rp, rv, tmp
+ ldr \rp, =UART_PADDR @ physical
+ ldr \rv, =UART_VADDR @ virtual
+ .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