Add support to route the serial console on the NXP WaRP7 board
to UART6 and the mikroBus.

To use UART6 on the WaRP7 board, I add the following lines to
configs/warp7_defconfig:

+CONFIG_MXC_CONSOLE_NUM=6
+CONFIG_SERIAL_MXC_DTE_MODE=y

Signed-off-by: Ryan Harkin <ryan.har...@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonog...@linaro.org>
---
 board/warp7/Kconfig     | 9 +++++++++
 board/warp7/warp7.c     | 6 ++++++
 include/configs/warp7.h | 8 +++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/board/warp7/Kconfig b/board/warp7/Kconfig
index 61c33fb..5fb4824 100644
--- a/board/warp7/Kconfig
+++ b/board/warp7/Kconfig
@@ -6,4 +6,13 @@ config SYS_BOARD
 config SYS_CONFIG_NAME
        default "warp7"
 
+config MXC_CONSOLE_NUM
+       int "UART used for the console"
+       default 1
+       help
+         The UART used for the console, expressed as a 1-based integer.
+         This is also used to set the console variable passed to the kernel.
+         Currently, only UART1 and UART6 are supported. Specifying a value
+         other than 6 will result in using UART1.
+
 endif
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index d422d63..d345b0e 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -67,6 +67,11 @@ static iomux_v3_cfg_t const uart1_pads[] = {
        MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
+static iomux_v3_cfg_t const uart6_pads[] = {
+       MX7D_PAD_ECSPI1_MOSI__UART6_DTE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+       MX7D_PAD_ECSPI1_SCLK__UART6_DTE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
 static iomux_v3_cfg_t const usdhc3_pads[] = {
        MX7D_PAD_SD3_CLK__SD3_CLK     | MUX_PAD_CTRL(USDHC_PAD_CTRL),
        MX7D_PAD_SD3_CMD__SD3_CMD     | MUX_PAD_CTRL(USDHC_PAD_CTRL),
@@ -84,6 +89,7 @@ static iomux_v3_cfg_t const usdhc3_pads[] = {
 static void setup_iomux_uart(void)
 {
        imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
+       imx_iomux_v3_setup_multiple_pads(uart6_pads, ARRAY_SIZE(uart6_pads));
 };
 
 static struct fsl_esdhc_cfg usdhc_cfg[1] = {
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 11f1bc3..271667d 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -13,7 +13,13 @@
 
 #define PHYS_SDRAM_SIZE                        SZ_512M
 
+#if (CONFIG_MXC_CONSOLE_NUM == 6)
+#define CONFIG_MXC_UART_BASE           UART6_IPS_BASE_ADDR
+#define CONSOLE                                "ttymxc5"
+#else
 #define CONFIG_MXC_UART_BASE           UART1_IPS_BASE_ADDR
+#define CONSOLE                                "ttymxc0"
+#endif
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (35 * SZ_1M)
@@ -31,7 +37,7 @@
        CONFIG_DFU_ENV_SETTINGS \
        "script=boot.scr\0" \
        "image=zImage\0" \
-       "console=ttymxc0\0" \
+       "console=" CONSOLE "\0" \
        "ethact=usb_ether\0" \
        "fdt_high=0xffffffff\0" \
        "initrd_high=0xffffffff\0" \
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to