ARM: chiliboard: move towards driver model and device-tree boot
cover ARM: chiliboard: move towards driver model and device-tree boot
Hi,
Currently on master branch we are no longer able to boot Linux on chiliboard. This is due to issue described at [1]. This series makes the boot to Linux working once again.
This patch moves board support code to use driver model where possible and device-tree bot. As part of that we import DTS files from Linux v4.19.
[1] https://lists.denx.de/pipermail/u-boot/2018-November/348558.html
Marcin Niestroj (4):
ARM: dts: am335x-chili*: add chiliSOM and chiliboard DTS files
ARM: dts: am335x-chiliboard: add /chosen/stdout-path
ARM: chiliboard: move towards driver model and device-tree boot
ARM: chiliboard: remove dead !CONFIG_DM_SERIAL code
arch/arm/dts/Makefile | 3 +- arch/arm/dts/am335x-chiliboard-u-boot.dtsi | 11 ++ arch/arm/dts/am335x-chiliboard.dts | 200 +++++++++++++++++++++ arch/arm/dts/am335x-chilisom.dtsi | 178 ++++++++++++++++++ board/grinn/chiliboard/board.c | 61 ------- configs/chiliboard_defconfig | 12 +- 6 files changed, 401 insertions(+), 64 deletions(-) create mode 100644 arch/arm/dts/am335x-chiliboard-u-boot.dtsi create mode 100644 arch/arm/dts/am335x-chiliboard.dts create mode 100644 arch/arm/dts/am335x-chilisom.dtsi
Signature · 1 line
2.19.1
PATCH 1/4 ARM: dts: am335x-chili*: add chiliSOM and chiliboard DTS files
Import chiliSOM and chiliboard dts files from Linux v4.19. They will be used after transition to driver model and device-tree based boot.
--- arch/arm/dts/Makefile | 3 +- arch/arm/dts/am335x-chiliboard.dts | 200 +++++++++++++++++++++++++++++ arch/arm/dts/am335x-chilisom.dtsi | 178 +++++++++++++++++++++++++ 3 files changed, 380 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/am335x-chiliboard.dts create mode 100644 arch/arm/dts/am335x-chilisom.dtsi
arch/arm/dts/Makefile +2 -1
@@ -187,7 +187,8 @@ dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb \ am335x-icev2.dtb \ am335x-pxm50.dtb \ am335x-rut.dtb \ - am335x-pdu001.dtb + am335x-pdu001.dtb \ + am335x-chiliboard.dtb dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb \ am43x-epos-evm.dtb \ am437x-idk-evm.dtb \
arch/arm/dts/am335x-chiliboard.dts new file +200 -0
200 lines not on this page · raw message
arch/arm/dts/am335x-chilisom.dtsi new file +178 -0
178 lines not on this page · raw message
Signature · 1 line
2.19.1
PATCH 1/4 ARM: dts: am335x-chili*: add chiliSOM and chiliboard DTS files
Quoted 4 lines · Marcin Niestroj
Import chiliSOM and chiliboard dts files from Linux v4.19. They will be used after transition to driver model and device-tree based boot.
Signed-off-by Marcin Niestroj <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/fee72910/attachment.sig>
PATCH 1/4 ARM: dts: am335x-chili*: add chiliSOM and chiliboard DTS files
In reply to Marcin NiestrojQuoted 5 lines · Marcin Niestroj
Import chiliSOM and chiliboard dts files from Linux v4.19. They will be used after transition to driver model and device-tree based boot.
Signed-off-by Marcin Niestroj <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181127/b653c644/attachment.sig>
PATCH 2/4 ARM: dts: am335x-chiliboard: add /chosen/stdout-path
In reply to Marcin NiestrojAdd that node path in u-boot overlay dtsi file for now to keep am335x-chiliboard.dts in sync with Linux.
--- arch/arm/dts/am335x-chiliboard-u-boot.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 arch/arm/dts/am335x-chiliboard-u-boot.dtsi
arch/arm/dts/am335x-chiliboard-u-boot.dtsi new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ or X11 +/* + * Copyright (C) 2018 Grinn Sp. z o.o. -- http://www.grinn-global.com/ + * Author: Marcin Niestroj <[email protected]> + */ + +/ { + chosen { + stdout-path = &uart0; + }; +};
Signature · 1 line
2.19.1
PATCH 2/4 ARM: dts: am335x-chiliboard: add /chosen/stdout-path
Quoted 4 lines · Marcin Niestroj
Add that node path in u-boot overlay dtsi file for now to keep
am335x-chiliboard.dtsin sync with Linux.Signed-off-by Marcin Niestroj <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/5b8de72b/attachment.sig>
PATCH 2/4 ARM: dts: am335x-chiliboard: add /chosen/stdout-path
In reply to Marcin NiestrojQuoted 5 lines · Marcin Niestroj
Add that node path in u-boot overlay dtsi file for now to keep
am335x-chiliboard.dtsin sync with Linux.Signed-off-by Marcin Niestroj <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181127/3bdc69f2/attachment.sig>
PATCH 3/4 ARM: chiliboard: move towards driver model and device-tree boot
In reply to Marcin NiestrojThis patch mostly enables DM drivers in board defconfig and all their dependencies. Additionally we remove ethernet platform data, as all details are in device-tree now.
--- board/grinn/chiliboard/board.c | 53 ---------------------------------- configs/chiliboard_defconfig | 12 ++++++-- 2 files changed, 10 insertions(+), 55 deletions(-)
board/grinn/chiliboard/board.c +0 -53
@@ -150,56 +150,3 @@ int board_late_init(void) return 0; }#endif - -#if !defined(CONFIG_DM_ETH ) && defined(CONFIG_DRIVER_TI_CPSW ) && \ - !defined(CONFIG_SPL_BUILD ) -static void cpsw_control (int enabled) -{ -/* VTP can be added here */ - -return ; -} - -static struct cpsw_slave_data cpsw_slaves[] = { - { - .slave_reg_ofs =0x208 , - .sliver_reg_ofs =0xd80 , - .phy_addr =0 , - } -}; - -static struct cpsw_platform_data cpsw_data = { - .mdio_base =CPSW_MDIO_BASE , - .cpsw_base =CPSW_BASE , - .mdio_div =0xff , - .channels =8 , - .cpdma_reg_ofs =0x800 , - .slaves =1 , - .slave_data = cpsw_slaves, - .ale_reg_ofs =0xd00 , - .ale_entries =1024 , - .host_port_reg_ofs =0x108 , - .hw_stats_reg_ofs =0x900 , - .bd_ram_ofs =0x2000 , - .mac_control = (1 <<5 ), - .control = cpsw_control, - .host_port_num =0 , - .version =CPSW_CTRL_VERSION_2 , -}; - -int board_eth_init (bd_t *bis) -{ -int rv, n =0 ; - -writel (RMII_MODE_ENABLE |RMII_CHIPCKL_ENABLE , &cdev->miisel); - cpsw_slaves[0 ].phy_if =PHY_INTERFACE_MODE_RMII ; - - rv =cpsw_register (&cpsw_data); -if (rv <0 ) -printf ("Error %d registering CPSW switch\n" , rv); -else - n += rv; - -return n; -} -#endif
configs/chiliboard_defconfig +10 -2
@@ -29,19 +29,27 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nand0=8000000.nand" CONFIG_MTDPARTS_DEFAULT="mtdparts=8000000.nand:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)" +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="am335x-chiliboard" CONFIG_ENV_IS_IN_MMC=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_DM_GPIO=y +CONFIG_MISC=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y -CONFIG_DRIVER_TI_CPSW=y +CONFIG_DM_ETH=y CONFIG_MII=y +CONFIG_DRIVER_TI_CPSW=y CONFIG_SPI=y CONFIG_OMAP3_SPI=y +CONFIG_TIMER=y +CONFIG_OMAP_TIMER=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_MUSB_HOST=y CONFIG_USB_MUSB_DSPS=y +CONFIG_USB_MUSB_TI=y CONFIG_USB_STORAGE=y CONFIG_FAT_WRITE=y CONFIG_LZO=y -CONFIG_OF_LIBFDT=y
Signature · 1 line
2.19.1
PATCH 3/4 ARM: chiliboard: move towards driver model and device-tree boot
Quoted 5 lines · Marcin Niestroj
This patch mostly enables DM drivers in board defconfig and all their dependencies. Additionally we remove ethernet platform data, as all details are in device-tree now.
Signed-off-by Marcin Niestroj <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/c20d9679/attachment.sig>
PATCH 3/4 ARM: chiliboard: move towards driver model and device-tree boot
In reply to Marcin NiestrojQuoted 6 lines · Marcin Niestroj
This patch mostly enables DM drivers in board defconfig and all their dependencies. Additionally we remove ethernet platform data, as all details are in device-tree now.
Signed-off-by Marcin Niestroj <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181127/469adc4e/attachment.sig>
PATCH 4/4 ARM: chiliboard: remove dead !CONFIG_DM_SERIAL code
In reply to Marcin NiestrojDM_SERIAL is selected by TARGET_CHILIBOARD, so there is no reason to keep code that will not be built. Remove it.
--- board/grinn/chiliboard/board.c | 8 -------- 1 file changed, 8 deletions(-)
board/grinn/chiliboard/board.c +0 -8
@@ -19,7 +19,6 @@#include <environment.h> #include <errno.h> #include <miiphy.h> -#include <serial.h> #include <spl.h> #include <watchdog.h>
@@ -69,13 +68,6 @@ static void enable_board_pin_mux(void) }#endif /* CONFIG_SKIP_LOWLEVEL_INIT */ -#ifndef CONFIG_DM_SERIAL -struct serial_device *default_serial_console (void ) -{ -return &eserial1_device; -} -#endif -#ifndef CONFIG_SKIP_LOWLEVEL_INIT void set_uart_mux_conf (void ) {
Signature · 1 line
2.19.1
PATCH 4/4 ARM: chiliboard: remove dead !CONFIG_DM_SERIAL code
Quoted 4 lines · Marcin Niestroj
DM_SERIALis selected byTARGET_CHILIBOARD, so there is no reason to keep code that will not be built. Remove it.Signed-off-by Marcin Niestroj <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/142d2778/attachment.sig>
PATCH 4/4 ARM: chiliboard: remove dead !CONFIG_DM_SERIAL code
In reply to Marcin NiestrojQuoted 5 lines · Marcin Niestroj
DM_SERIALis selected byTARGET_CHILIBOARD, so there is no reason to keep code that will not be built. Remove it.Signed-off-by Marcin Niestroj <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181127/1fe28e62/attachment.sig>