ARM: liteboard: move towards driver model and device-tree boot
Subsystems (2)
cover ARM: liteboard: move towards driver model and device-tree boot
Hi,
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.20.
One minor patch here is to use random ethaddr in order to make network usable on that board by default.
This is a resend of patches [1]. Everything was rebased on master.
[1] https://lists.denx.de/pipermail/u-boot/2018-November/348624.html
Marcin Niestroj (3):
ARM: dts: imx6ul-lite*: add DTS files for liteSOM and liteboard
ARM: liteboard: move towards driver model and device-tree boot
ARM: liteboard: use random ethaddr
arch/arm/dts/Makefile | 3 +- arch/arm/dts/imx6ul-liteboard.dts | 151 ++++++++++++++++++++++++++++++ arch/arm/dts/imx6ul-litesom.dtsi | 82 ++++++++++++++++ board/grinn/liteboard/board.c | 36 ------- configs/liteboard_defconfig | 12 ++- 5 files changed, 246 insertions(+), 38 deletions(-) create mode 100644 arch/arm/dts/imx6ul-liteboard.dts create mode 100644 arch/arm/dts/imx6ul-litesom.dtsi
Signature · 1 line
2.20.1
PATCH RESEND 1/3 ARM: dts: imx6ul-lite*: add DTS files for liteSOM and liteboard
Import liteSOM and liteboard dts files from Linux v4.20. They will be used after transition to driver model and device-tree based boot.
--- arch/arm/dts/Makefile | 3 +- arch/arm/dts/imx6ul-liteboard.dts | 151 ++++++++++++++++++++++++++++++ arch/arm/dts/imx6ul-litesom.dtsi | 82 ++++++++++++++++ 3 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/imx6ul-liteboard.dts create mode 100644 arch/arm/dts/imx6ul-litesom.dtsi
arch/arm/dts/Makefile +2 -1
@@ -456,7 +456,8 @@ dtb-$(CONFIG_MX6UL) += \ imx6ul-isiot-nand.dtb \ imx6ul-opos6uldev.dtb \ imx6ul-14x14-evk.dtb \ - imx6ul-9x9-evk.dtb + imx6ul-9x9-evk.dtb \ + imx6ul-liteboard.dtb dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
arch/arm/dts/imx6ul-liteboard.dts new file +151 -0
151 lines not on this page · raw message
arch/arm/dts/imx6ul-litesom.dtsi new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH RESEND 1/3 ARM: dts: imx6ul-lite*: add DTS files for liteSOM and liteboard
Quoted 3 lines
Import liteSOM and liteboard dts files from Linux v4.20. They will be used after transition to driver model and device-tree based boot.
Signed-off-by Marcin Niestroj <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
A message that is not in the archive (sent off-list or not yet received): 9d5c4f983d3f2633@fake-msgid
PATCH RESEND 1/3 ARM: dts: imx6ul-lite*: add DTS files for liteSOM and liteboard
Quoted 5 lines · sbabic at denx.de
Quoted 3 lines
Import liteSOM and liteboard dts files from Linux v4.20. They will be used after transition to driver model and device-tree based boot.
Signed-off-by Marcin Niestroj <[email protected]>Applied to u-boot-imx, master, thanks !
Thanks!
What about patches 2 and 3?
Quoted 3 lines
Best regards,
Stefano Babic
Signature · 2 lines
Best regards, Marcin Niestrój
PATCH RESEND 2/3 ARM: liteboard: 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 USB code that is on longer executed after enabling CONFIG_DM_USB. Enable CONFIG_PINCTRL, so we can get rid of ethernet pin configuration.
--- board/grinn/liteboard/board.c | 36 ----------------------------------- configs/liteboard_defconfig | 11 ++++++++++- 2 files changed, 10 insertions(+), 37 deletions(-)
board/grinn/liteboard/board.c +0 -36
@@ -24,8 +24,6 @@#include <mmc.h> #include <netdev.h> #include <spl.h> -#include <usb.h> -#include <usb/ehci-ci.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -63,26 +61,6 @@ static iomux_v3_cfg_t const sd_pads[] = { MX6_PAD_UART1_RTS_B__GPIO1_IO19 | MUX_PAD_CTRL(NO_PAD_CTRL), }; -#ifdef CONFIG_FEC_MXC -static iomux_v3_cfg_t const fec1_pads[] = { -MX6_PAD_GPIO1_IO06__ENET1_MDIO |MUX_PAD_CTRL (MDIO_PAD_CTRL ), -MX6_PAD_GPIO1_IO07__ENET1_MDC |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_TX_DATA0__ENET1_TDATA00 |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_TX_DATA1__ENET1_TDATA01 |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_TX_EN__ENET1_TX_EN |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 |MUX_PAD_CTRL (ENET_CLK_PAD_CTRL ), -MX6_PAD_ENET1_RX_DATA0__ENET1_RDATA00 |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_RX_DATA1__ENET1_RDATA01 |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_RX_ER__ENET1_RX_ER |MUX_PAD_CTRL (ENET_PAD_CTRL ), -MX6_PAD_ENET1_RX_EN__ENET1_RX_EN |MUX_PAD_CTRL (ENET_PAD_CTRL ), -}; - -static void setup_iomux_fec (void ) -{ -imx_iomux_v3_setup_multiple_pads (fec1_pads,ARRAY_SIZE (fec1_pads)); -} -#endif -static void setup_iomux_uart (void ) {imx_iomux_v3_setup_multiple_pads (uart1_pads,ARRAY_SIZE (uart1_pads));
@@ -180,13 +158,6 @@ void board_late_mmc_init(void)#endif #ifdef CONFIG_FEC_MXC -int board_eth_init (bd_t *bis) -{ -setup_iomux_fec (); - -return fecmxc_initialize (bis); -} -static int setup_fec (void ) {struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR ;
@@ -207,13 +178,6 @@ static int setup_fec(void) }#endif -#ifdef CONFIG_USB_EHCI_MX6 -int board_usb_phy_mode (int port) -{ -return USB_INIT_HOST ; -} -#endif -int board_early_init_f (void ) {setup_iomux_uart ();
configs/liteboard_defconfig +10 -1
@@ -29,10 +29,19 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="imx6ul-liteboard" CONFIG_ENV_IS_IN_MMC=y +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_MMC=y CONFIG_FSL_ESDHC=y CONFIG_PHYLIB=y +CONFIG_DM_ETH=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y +CONFIG_DM_REGULATOR=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_STORAGE=y -CONFIG_OF_LIBFDT=y
Signature · 1 line
2.20.1
PATCH RESEND 3/3 ARM: liteboard: use random ethaddr
In reply to Marcin NiestrojThere is no ethaddr assigned to each board, so we need to use random value in order to use network.
--- configs/liteboard_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/liteboard_defconfig +1 -0
@@ -32,6 +32,7 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="imx6ul-liteboard" CONFIG_ENV_IS_IN_MMC=y +CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y CONFIG_DM_MMC=y
Signature · 1 line
2.20.1