[U-Boot] [PATCH 4/4] dm: rpi: Move serial to driver model

Simon Glass sjg at chromium.org
Tue Sep 23 01:30:59 CEST 2014


Adjust the configuration to use the driver model version of the pl01x
serial driver. Add the required platform data.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 board/raspberrypi/rpi_b/rpi_b.c | 12 ++++++++++++
 include/configs/rpi_b.h         |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/board/raspberrypi/rpi_b/rpi_b.c b/board/raspberrypi/rpi_b/rpi_b.c
index 447c940..d009abe 100644
--- a/board/raspberrypi/rpi_b/rpi_b.c
+++ b/board/raspberrypi/rpi_b/rpi_b.c
@@ -20,6 +20,7 @@
 #include <fdt_support.h>
 #include <lcd.h>
 #include <mmc.h>
+#include <serial_pl01x.h>
 #include <asm/gpio.h>
 #include <asm/arch/mbox.h>
 #include <asm/arch/sdhci.h>
@@ -36,6 +37,17 @@ U_BOOT_DEVICE(bcm2835_gpios) = {
 	.platdata = &gpio_platdata,
 };
 
+static const struct pl01x_serial_platdata serial_platdata = {
+	.base = 0x20201000,
+	.type = TYPE_PL011,
+	.clock = 3000000,
+};
+
+U_BOOT_DEVICE(bcm2835_serials) = {
+	.name = "serial_pl01x",
+	.platdata = &serial_platdata,
+};
+
 struct msg_get_arm_mem {
 	struct bcm2835_mbox_hdr hdr;
 	struct bcm2835_mbox_tag_get_arm_mem get_arm_mem;
diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index d9475e9..42e3a63 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -35,6 +35,7 @@
 #define CONFIG_DM
 #define CONFIG_CMD_DM
 #define CONFIG_DM_GPIO
+#define CONFIG_DM_SERIAL
 
 /* Memory layout */
 #define CONFIG_NR_DRAM_BANKS		1
@@ -52,6 +53,7 @@
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_MALLOC_LEN		SZ_4M
+#define CONFIG_SYS_MALLOC_F_LEN		(1 << 10)
 #define CONFIG_SYS_MEMTEST_START	0x00100000
 #define CONFIG_SYS_MEMTEST_END		0x00200000
 #define CONFIG_LOADADDR			0x00200000
@@ -83,9 +85,7 @@
 #define CONFIG_BCM2835_SDHCI
 
 /* Console UART */
-#define CONFIG_PL011_SERIAL
-#define CONFIG_PL011_CLOCK		3000000
-#define CONFIG_PL01x_PORTS		{ (void *)0x20201000 }
+#define CONFIG_PL01X_SERIAL
 #define CONFIG_CONS_INDEX		0
 #define CONFIG_BAUDRATE			115200
 
-- 
2.1.0.rc2.206.gedb03e5



More information about the U-Boot mailing list