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

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


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

diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c
index e4f61e1..3f2ed38 100644
--- a/board/phytec/pcm052/pcm052.c
+++ b/board/phytec/pcm052/pcm052.c
@@ -5,12 +5,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>
@@ -513,3 +515,14 @@ int checkboard(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_FSL_LPUART
+static struct lpuart_serial_platdata lpuart_serial_plat = {
+	.base_addr = UART1_BASE,
+};
+
+U_BOOT_DEVICE(lpuart_serial) = {
+	.name	= "serial_lpuart",
+	.platdata = &lpuart_serial_plat,
+};
+#endif
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index b851bba..bd3992f 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -27,13 +27,13 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
+/* UART support */
+#define CONFIG_DM_SERIAL
 #define CONFIG_FSL_LPUART
-#define LPUART_BASE			UART1_BASE
+#define CONFIG_BAUDRATE			115200
 
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_SYS_UART_PORT		(1)
-#define CONFIG_BAUDRATE			115200
 
 #undef CONFIG_CMD_IMLS
 
-- 
2.7.0



More information about the U-Boot mailing list