summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/include/mach/debug_ll.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-23 10:01:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-25 11:52:36 +0200
commit549ccf4d0c6e4235340d2b3cef92c0185956de0e (patch)
tree69538156bab8998e46bb7b209f667b4482079121 /arch/arm/mach-imx/include/mach/debug_ll.h
parent2e6bbb40651af7d197246457a3790e613af3a1c0 (diff)
downloadbarebox-549ccf4d0c6e4235340d2b3cef92c0185956de0e.tar.gz
barebox-549ccf4d0c6e4235340d2b3cef92c0185956de0e.tar.xz
ARM: i.MX: Make debug UART selectable from Kconfig
To make early debugging on i.MX a bit simpler. This uses a similar magic than the kernel does. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/include/mach/debug_ll.h')
-rw-r--r--arch/arm/mach-imx/include/mach/debug_ll.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/arch/arm/mach-imx/include/mach/debug_ll.h b/arch/arm/mach-imx/include/mach/debug_ll.h
index cb6dd039bc..0bb28ee6ea 100644
--- a/arch/arm/mach-imx/include/mach/debug_ll.h
+++ b/arch/arm/mach-imx/include/mach/debug_ll.h
@@ -13,13 +13,31 @@
#include <mach/imx53-regs.h>
#include <mach/imx6-regs.h>
-/* #define IMX_DEBUG_LL_UART_BASE MXxy_UARTx_BASE_ADDR */
-
-#ifndef IMX_DEBUG_LL_UART_BASE
-#warning define IMX_DEBUG_LL_UART_BASE properly for debug_ll
-#define IMX_DEBUG_LL_UART_BASE 0
+#ifdef CONFIG_DEBUG_IMX1_UART
+#define IMX_DEBUG_SOC MX1
+#elif defined CONFIG_DEBUG_IMX21_UART
+#define IMX_DEBUG_SOC MX21
+#elif defined CONFIG_DEBUG_IMX25_UART
+#define IMX_DEBUG_SOC MX25
+#elif defined CONFIG_DEBUG_IMX27_UART
+#define IMX_DEBUG_SOC MX27
+#elif defined CONFIG_DEBUG_IMX31_UART
+#define IMX_DEBUG_SOC MX31
+#elif defined CONFIG_DEBUG_IMX35_UART
+#define IMX_DEBUG_SOC MX35
+#elif defined CONFIG_DEBUG_IMX51_UART
+#define IMX_DEBUG_SOC MX51
+#elif defined CONFIG_DEBUG_IMX53_UART
+#define IMX_DEBUG_SOC MX53
+#elif defined CONFIG_DEBUG_IMX6Q_UART
+#define IMX_DEBUG_SOC MX6
+#else
+#error "unknown i.MX debug uart soc type"
#endif
+#define __IMX_UART_BASE(soc, num) soc##_UART##num##_BASE_ADDR
+#define IMX_UART_BASE(soc, num) __IMX_UART_BASE(soc, num)
+
#define URTX0 0x40 /* Transmitter Register */
#define UCR1 0x80 /* Control Register 1 */
@@ -30,7 +48,8 @@
static inline void PUTC_LL(int c)
{
- void __iomem *base = (void *)IMX_DEBUG_LL_UART_BASE;
+ void __iomem *base = (void *)IMX_UART_BASE(IMX_DEBUG_SOC,
+ CONFIG_DEBUG_IMX_UART_PORT);
if (!base)
return;