dm: rpi: Move Raspberry Pi to use driver model
v3 cover dm: rpi: Move Raspberry Pi to use driver model
This series adds driver model support to the GPIO and serial drivers used by Raspberry Pi, and moves Raspberry Pi over to driver model.
This requires adding driver model support to the pl01x serial driver, and replacing the bcm2835 GPIO driver with a driver model version (since there are no longer clients that don't use driver model).
See u-boot-dm.git branch rpi-working for the tree this is based on.
Changes in v3:
- Add new patch to add missing private data size for serial_pl01x
Changes in v2:
- Adjust header file include to dm/platform_data/...
Simon Glass (2):
dm: rpi: Move serial to driver model
dm: serial_pl01x: Add missing private data size
board/raspberrypi/rpi/rpi.c | 12 ++++++++++++ drivers/serial/serial_pl01x.c | 1 + include/configs/rpi.h | 6 +++--- 3 files changed, 16 insertions(+), 3 deletions(-)
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v3 1/2 dm: rpi: Move serial to driver model
Adjust the configuration to use the driver model version of the pl01x serial driver. Add the required platform data.
---
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(-)
board/raspberrypi/rpi/rpi.c +12 -0
@@ -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;
include/configs/rpi.h +3 -3
@@ -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
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v3 1/2 dm: rpi: Move serial to driver model
Quoted 2 lines · Simon Glass
Adjust the configuration to use the driver model version of the pl01x serial driver. Add the required platform data.
The series,
PATCH v3 1/2 dm: rpi: Move serial to driver model
Quoted 7 lines · Stephen Warren
Quoted 2 lines · Simon Glass
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 <[email protected]>
Applied to u-boot-dm.
PATCH v3 2/2 dm: serial_pl01x: Add missing private data size
In reply to Simon GlassThe private data size is missing from the driver, so we store it at 0, which causes problems when something overwrites memory at 0.
Fix this.
---
Changes in v3:
- Add new patch to add missing private data size for serial_pl01x
Changes in v2: None
drivers/serial/serial_pl01x.c | 1 + 1 file changed, 1 insertion(+)
drivers/serial/serial_pl01x.c +1 -0
@@ -348,6 +348,7 @@ U_BOOT_DRIVER(serial_pl01x) = { .probe = pl01x_serial_probe, .ops = &pl01x_serial_ops, .flags = DM_FLAG_PRE_RELOC, + .priv_auto_alloc_size = sizeof(struct pl01x_priv), };#endif
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v3 2/2 dm: serial_pl01x: Add missing private data size
Quoted 5 lines · Simon Glass
The private data size is missing from the driver, so we store it at 0, which causes problems when something overwrites memory at 0.
Fix this.
Quoted 7 lines
Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- Add new patch to add missing private data size forserial_pl01xChanges in v2: None
Applied to u-boot-dm.
Quoted 19 lines
drivers/serial/serial_pl01x.c | 1 + 1 file changed, 1 insertion(+)drivers/serial/serial_pl01x.c +1
-1@@ -348,6 +348,7 @@ U_BOOT_DRIVER(serial_pl01x) = { .probe = pl01x_serial_probe, .ops = &pl01x_serial_ops, .flags = DM_FLAG_PRE_RELOC, + .priv_auto_alloc_size = sizeof(struct pl01x_priv), };#endif --2.1.0.rc2.206.gedb03e5