[U-Boot] [PATCH 4/4] arm: rmobile: alt: Migrate serial driver to drivers model

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Mon Dec 22 02:25:40 CET 2014


This adds drivers model support of serial port to Alt board,
and migrate serial port to drivers model.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
---
 board/renesas/alt/alt.c | 14 ++++++++++++++
 configs/alt_defconfig   |  1 +
 include/configs/alt.h   |  3 ---
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index 8cc17e9..c0caeb9 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -8,6 +8,8 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <dm.h>
+#include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
@@ -159,3 +161,15 @@ void reset_cpu(ulong addr)
 	val |= 0x02;
 	i2c_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x13, 1, &val, 1);
 }
+
+static const struct sh_serial_platdata serial_platdata = {
+	.base = SCIF2_BASE,
+	.type = PORT_SCIF,
+	.clk = 14745600,
+	.clk_mode = EXT_CLK,
+};
+
+U_BOOT_DEVICE(alt_serials) = {
+	.name = "serial_sh",
+	.platdata = &serial_platdata,
+};
diff --git a/configs/alt_defconfig b/configs/alt_defconfig
index d722306..19cb7a1 100644
--- a/configs/alt_defconfig
+++ b/configs/alt_defconfig
@@ -1,3 +1,4 @@
 CONFIG_ARM=y
 CONFIG_RMOBILE=y
 CONFIG_TARGET_ALT=y
+CONFIG_DM_SERIAL=y
diff --git a/include/configs/alt.h b/include/configs/alt.h
index 58eac31..01382cf 100644
--- a/include/configs/alt.h
+++ b/include/configs/alt.h
@@ -38,8 +38,6 @@
 
 /* SCIF */
 #define CONFIG_SCIF_CONSOLE
-#define CONFIG_CONS_SCIF2
-#define CONFIG_SCIF_USE_EXT_CLK
 
 /* FLASH */
 #define CONFIG_SPI
@@ -70,7 +68,6 @@
 #define CONFIG_SH_TMU_CLK_FREQ  (CONFIG_SYS_CLK_FREQ / 2) /* EXT / 2 */
 #define CONFIG_PLL1_CLK_FREQ    (CONFIG_SYS_CLK_FREQ * 156 / 2)
 #define CONFIG_P_CLK_FREQ	(CONFIG_PLL1_CLK_FREQ / 24)
-#define CONFIG_SH_SCIF_CLK_FREQ	14745600 /* External Clock */
 
 #define CONFIG_SYS_TMU_CLK_DIV  4
 
-- 
2.1.3



More information about the U-Boot mailing list