diff mbox

[U-Boot,v3,1/2] dm: rpi: Move serial to driver model

Message ID 1416890195-20001-2-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Nov. 25, 2014, 4:36 a.m. UTC
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@chromium.org>
---

Changes in v3: None
Changes in v2:
- Adjust header file include to dm/platform_data/...

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

Comments

Stephen Warren Nov. 30, 2014, 3:41 a.m. UTC | #1
On 11/24/2014 09:36 PM, Simon Glass wrote:
> Adjust the configuration to use the driver model version of the pl01x
> serial driver. Add the required platform data.

The series,

Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Simon Glass Dec. 10, 2014, 5:59 p.m. UTC | #2
On 29 November 2014 at 20:41, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 11/24/2014 09:36 PM, Simon Glass wrote:
>> Adjust the configuration to use the driver model version of the pl01x
>> serial driver. Add the required platform data.
>
> The series,
>
> Tested-by: Stephen Warren <swarren@wwwdotorg.org>

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index aaded88..5ebafd7 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -24,6 +24,7 @@ 
 #include <asm/arch/mbox.h>
 #include <asm/arch/sdhci.h>
 #include <asm/global_data.h>
+#include <dm/platform_data/serial_pl01x.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -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.h b/include/configs/rpi.h
index 4d5426e..c94f411 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -34,6 +34,7 @@ 
 #define CONFIG_DM
 #define CONFIG_CMD_DM
 #define CONFIG_DM_GPIO
+#define CONFIG_DM_SERIAL
 
 /* Memory layout */
 #define CONFIG_NR_DRAM_BANKS		1
@@ -51,6 +52,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
@@ -92,9 +94,7 @@ 
 #endif
 
 /* 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