[U-Boot] [PATCH 2/8] colibri_vf: Update enabling lpuart support with driver model

Bhuvanchandra DV bhuvanchandra.dv at toradex.com
Tue Jan 12 05:28:03 CET 2016


Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv at toradex.com>
---
 board/toradex/colibri_vf/colibri_vf.c | 13 +++++++++++++
 include/configs/colibri_vf.h          |  6 +++---
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c
index c65ccb3..76bc51c 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -8,12 +8,14 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/iomux-vf610.h>
 #include <asm/arch/ddrmc-vf610.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/serial.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <miiphy.h>
@@ -586,3 +588,14 @@ int board_usb_phy_mode(int port)
 	}
 }
 #endif
+
+#ifdef CONFIG_FSL_LPUART
+static struct lpuart_serial_platdata lpuart_serial_plat = {
+	.base_addr = UART0_BASE,
+};
+
+U_BOOT_DEVICE(lpuart_serial) = {
+	.name	= "serial_lpuart",
+	.platdata = &lpuart_serial_plat,
+};
+#endif
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 708c79a..6ecfdb2 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -36,15 +36,15 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
+/* UART support */
+#define CONFIG_DM_SERIAL
 #define CONFIG_FSL_LPUART
-#define LPUART_BASE			UART0_BASE
+#define CONFIG_BAUDRATE			115200
 
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_VERSION_VARIABLE
-#define CONFIG_SYS_UART_PORT		(0)
-#define CONFIG_BAUDRATE			115200
 #define CONFIG_CMD_ASKENV
 
 /* NAND support */
-- 
2.7.0



More information about the U-Boot mailing list