Convert i.MX7 WaRP7 ports to DM
Subsystems (2)
v3 cover Convert i.MX7 WaRP7 ports to DM
V3-Resend:
- Looks like this set got lost in the ether, resending.
V3:
- Fix Lucas' mail address "Auer, Lucas" makes git send-mail choke
V2:
- Add review-by as indicated - Peng Fan
- Squash commit 4 and 5 from v1 - Peng Fan
- Leave usdhc1 intact because of alias of mmc0 to usdhc3 - Bryan
- Add correction for spelling mistake in imx7d-pinfunc.h - Lukas Auer
- Imports imx7s-warp7.dts from kernel unmodified as a result of #1 - Bryan
V1:
This series does a minimal conversion of WaRP7 and the BL33 version of WaRP7 to the DM.
Pinctrl, GPIO, I2C, Regulators, PMIC and MMC are converted. Later patches will convert USB and UART.
Bryan O'Donoghue (8):
arm: dts: imx7: Correct spelling mistake in GPIO name
arm: dts: imx7s-warp: Import Linux warp7 dts
arm: imx7s-warp: Add DT file hooks
arm: imx7s-warp: Convert to DM MMC initialization
arm: dts: imx7s-warp: Create alias for mmc0 to &usdhc3
warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports
warp7: defconfig: Switch to DM for I2C
arm: imx7s-warp: Convert to DM PMIC
arch/arm/dts/Makefile | 3 +- arch/arm/dts/imx7d-pinfunc.h | 6 +- arch/arm/dts/imx7s-warp.dts | 442 +++++++++++++++++++++++++++++++++++ board/warp7/warp7.c | 85 +------ configs/warp7_bl33_defconfig | 14 +- configs/warp7_defconfig | 14 +- include/configs/warp7.h | 8 - 7 files changed, 484 insertions(+), 88 deletions(-) create mode 100644 arch/arm/dts/imx7s-warp.dts
Signature · 1 line
2.20.0
PATCH RESEND v3 1/8 arm: dts: imx7: Correct spelling mistake in GPIO name
As pointed out by Lucas WDOD1_WDOG_ANY should be WDOG1_WDOG_ANY. Once corrected we can import the latest kernel DTS unmodified.
--- arch/arm/dts/imx7d-pinfunc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/dts/imx7d-pinfunc.h +3 -3
@@ -17,9 +17,9 @@#define MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0 0x0000 0x0030 0x0000 0x0 0x0#define MX7D_PAD_LPSR_GPIO1_IO00__PWM4_OUT 0x0000 0x0030 0x0000 0x1 0x0 -#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG_ANY 0x0000 0x0030 0x0000 0x2 0x0 -#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG_B 0x0000 0x0030 0x0000 0x3 0x0 -#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG__RST_B_DEB 0x0000 0x0030 0x0000 0x4 0x0 +#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_ANY 0x0000 0x0030 0x0000 0x2 0x0 +#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x0000 0x0030 0x0000 0x3 0x0 +#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG__RST_B_DEB 0x0000 0x0030 0x0000 0x4 0x0#define MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1 0x0004 0x0034 0x0000 0x0 0x0#define MX7D_PAD_LPSR_GPIO1_IO01__PWM1_OUT 0x0004 0x0034 0x0000 0x1 0x0#define MX7D_PAD_LPSR_GPIO1_IO01__CCM_ENET_REF_CLK3 0x0004 0x0034 0x0000 0x2 0x0
Signature · 1 line
2.20.0
PATCH RESEND v3 1/8 arm: dts: imx7: Correct spelling mistake in GPIO name
Quoted 4 lines
As pointed out by Lucas
WDOD1_WDOG_ANYshould beWDOG1_WDOG_ANY. Once corrected we can import the latest kernel DTS unmodified.Signed-off-by Bryan O'Donoghue <[email protected]>Reported-by Lukas Auer <[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 =====================================================================
PATCH RESEND v3 2/8 arm: dts: imx7s-warp: Import Linux warp7 dts
In reply to Bryan O'DonoghueThis patch imports the Linux kernel warp7 dts as at upstream kernel commit cf76c364a1e1.
--- arch/arm/dts/imx7s-warp.dts | 438 ++++++++++++++++++++++++++++++++++++ 1 file changed, 438 insertions(+) create mode 100644 arch/arm/dts/imx7s-warp.dts
arch/arm/dts/imx7s-warp.dts new file +438 -0
@@ -0,0 +1,438 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (C) 2016 NXP Semiconductors. + * Author: Fabio Estevam <[email protected]> + */ + +/dts-v1/; + +#include <dt-bindings/input/input.h> +#include "imx7s.dtsi" + +/ { + model = "Warp i.MX7 Board"; + compatible = "warp,imx7s-warp", "fsl,imx7s"; + + memory at 80000000 { + reg = <0x80000000 0x20000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-0 = <&pinctrl_gpio>; + autorepeat; + + back { + label = "Back"; + gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; + linux,code = <KEY_BACK>; + wakeup-source; + }; + }; + + reg_brcm: regulator-brcm { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio5 10 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_brcm_reg>; + regulator-name = "brcm_reg"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + startup-delay-us = <200000>; + }; + + reg_bt: regulator-bt { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_bt_reg>; + enable-active-high; + gpio = <&gpio5 17 GPIO_ACTIVE_HIGH>; + regulator-name = "bt_reg"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "imx7-sgtl5000"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,cpu { + sound-dai = <&sai1>; + }; + + dailink_master: simple-audio-card,codec { + sound-dai = <&codec>; + clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + }; + }; +}; + +&clks { + assigned-clocks = <&clks IMX7D_PLL_AUDIO_POST_DIV>; + assigned-clock-rates = <884736000>; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + status = "okay"; + + pmic: pfuze3000 at 8 { + compatible = "fsl,pfuze3000"; + reg = <0x08>; + + regulators { + sw1a_reg: sw1a { + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <1475000>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <6250>; + }; + + /* use sw1c_reg to align with pfuze100/pfuze200 */ + sw1c_reg: sw1b { + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <1475000>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <6250>; + }; + + sw2_reg: sw2 { + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1850000>; + regulator-boot-on; + regulator-always-on; + }; + + sw3a_reg: sw3 { + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1650000>; + regulator-boot-on; + regulator-always-on; + }; + + swbst_reg: swbst { + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5150000>; + }; + + snvs_reg: vsnvs { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + regulator-always-on; + }; + + vref_reg: vrefddr { + regulator-boot-on; + regulator-always-on; + }; + + vgen1_reg: vldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen2_reg: vldo2 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1550000>; + }; + + vgen3_reg: vccsd { + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen4_reg: v33 { + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen5_reg: vldo3 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen6_reg: vldo4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; + }; +}; + +&i2c2 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + status = "okay"; +}; + +&i2c3 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3>; + status = "okay"; +}; + +&i2c4 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4>; + status = "okay"; + + codec: sgtl5000 at a { + #sound-dai-cells = <0>; + reg = <0x0a>; + compatible = "fsl,sgtl5000"; + clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai1_mclk>; + VDDA-supply = <&vgen4_reg>; + VDDIO-supply = <&vgen4_reg>; + VDDD-supply = <&vgen2_reg>; + }; + + mpl3115 at 60 { + compatible = "fsl,mpl3115"; + reg = <0x60>; + }; +}; + +&sai1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai1>; + assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>, + <&clks IMX7D_SAI1_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>; + assigned-clock-rates = <0>, <36864000>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart1>; + assigned-clocks = <&clks IMX7D_UART1_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + status = "okay"; +}; + +&uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart3>; + assigned-clocks = <&clks IMX7D_UART3_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + uart-has-rtscts; + status = "okay"; +}; + +&uart6 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart6>; + assigned-clocks = <&clks IMX7D_UART6_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + fsl,dte-mode; + status = "okay"; +}; + +&usbotg1 { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usdhc1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc1>; + bus-width = <4>; + keep-power-in-suspend; + no-1-8-v; + non-removable; + vmmc-supply = <®_brcm>; + status = "okay"; +}; + +&usdhc3 { + pinctrl-names = "default", "state_100mhz", "state_200mhz"; + pinctrl-0 = <&pinctrl_usdhc3>; + pinctrl-1 = <&pinctrl_usdhc3_100mhz>; + pinctrl-2 = <&pinctrl_usdhc3_200mhz>; + assigned-clocks = <&clks IMX7D_USDHC3_ROOT_CLK>; + assigned-clock-rates = <400000000>; + bus-width = <8>; + no-1-8-v; + fsl,tuning-step = <2>; + non-removable; + status = "okay"; +}; + +&wdog1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdog>; + fsl,ext-reset-output; + status = "okay"; +}; + +&iomuxc { + pinctrl_brcm_reg: brcmreggrp { + fsl,pins = < + MX7D_PAD_SD2_WP__GPIO5_IO10 0x14 /* WL_REG_ON */ + >; + }; + + pinctrl_bt_reg: btreggrp { + fsl,pins = < + MX7D_PAD_SD2_DATA3__GPIO5_IO17 0x14 /* BT_REG_ON */ + >; + }; + + pinctrl_gpio: gpiogrp { + fsl,pins = < + MX7D_PAD_ENET1_RGMII_RD1__GPIO7_IO1 0x14 + >; + }; + + pinctrl_i2c1: i2c1grp { + fsl,pins = < + MX7D_PAD_I2C1_SDA__I2C1_SDA 0x4000007f + MX7D_PAD_I2C1_SCL__I2C1_SCL 0x4000007f + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX7D_PAD_I2C2_SDA__I2C2_SDA 0x4000007f + MX7D_PAD_I2C2_SCL__I2C2_SCL 0x4000007f + >; + }; + + pinctrl_i2c3: i2c3grp { + fsl,pins = < + MX7D_PAD_I2C3_SDA__I2C3_SDA 0x4000007f + MX7D_PAD_I2C3_SCL__I2C3_SCL 0x4000007f + >; + }; + + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX7D_PAD_I2C4_SCL__I2C4_SCL 0x4000007f + MX7D_PAD_I2C4_SDA__I2C4_SDA 0x4000007f + >; + }; + + pinctrl_sai1: sai1grp { + fsl,pins = < + MX7D_PAD_SAI1_RX_DATA__SAI1_RX_DATA0 0x1f + MX7D_PAD_SAI1_TX_BCLK__SAI1_TX_BCLK 0x1f + MX7D_PAD_SAI1_TX_SYNC__SAI1_TX_SYNC 0x1f + MX7D_PAD_SAI1_TX_DATA__SAI1_TX_DATA0 0x30 + >; + }; + + pinctrl_sai1_mclk: sai1mclkgrp { + fsl,pins = < + MX7D_PAD_SAI1_MCLK__SAI1_MCLK 0x1f + >; + }; + + pinctrl_uart1: uart1grp { + fsl,pins = < + MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX 0x79 + MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX 0x79 + >; + }; + + pinctrl_uart3: uart3grp { + fsl,pins = < + MX7D_PAD_UART3_TX_DATA__UART3_DCE_TX 0x79 + MX7D_PAD_UART3_RX_DATA__UART3_DCE_RX 0x79 + MX7D_PAD_UART3_CTS_B__UART3_DCE_CTS 0x79 + MX7D_PAD_UART3_RTS_B__UART3_DCE_RTS 0x79 + >; + }; + + pinctrl_uart6: uart6grp { + fsl,pins = < + MX7D_PAD_ECSPI1_MOSI__UART6_DTE_RX 0x79 + MX7D_PAD_ECSPI1_SCLK__UART6_DTE_TX 0x79 + >; + }; + + pinctrl_usdhc1: usdhc1grp { + fsl,pins = < + MX7D_PAD_SD1_CMD__SD1_CMD 0x59 + MX7D_PAD_SD1_CLK__SD1_CLK 0x19 + MX7D_PAD_SD1_DATA0__SD1_DATA0 0x59 + MX7D_PAD_SD1_DATA1__SD1_DATA1 0x59 + MX7D_PAD_SD1_DATA2__SD1_DATA2 0x59 + MX7D_PAD_SD1_DATA3__SD1_DATA3 0x59 + MX7D_PAD_SD2_RESET_B__GPIO5_IO11 0x14 /* WL_HOST_WAKE */ + >; + }; + + pinctrl_usdhc3: usdhc3grp { + fsl,pins = < + MX7D_PAD_SD3_CMD__SD3_CMD 0x59 + MX7D_PAD_SD3_CLK__SD3_CLK 0x19 + MX7D_PAD_SD3_DATA0__SD3_DATA0 0x59 + MX7D_PAD_SD3_DATA1__SD3_DATA1 0x59 + MX7D_PAD_SD3_DATA2__SD3_DATA2 0x59 + MX7D_PAD_SD3_DATA3__SD3_DATA3 0x59 + MX7D_PAD_SD3_DATA4__SD3_DATA4 0x59 + MX7D_PAD_SD3_DATA5__SD3_DATA5 0x59 + MX7D_PAD_SD3_DATA6__SD3_DATA6 0x59 + MX7D_PAD_SD3_DATA7__SD3_DATA7 0x59 + MX7D_PAD_SD3_RESET_B__SD3_RESET_B 0x19 + >; + }; + + pinctrl_usdhc3_100mhz: usdhc3grp_100mhz { + fsl,pins = < + MX7D_PAD_SD3_CMD__SD3_CMD 0x5a + MX7D_PAD_SD3_CLK__SD3_CLK 0x1a + MX7D_PAD_SD3_DATA0__SD3_DATA0 0x5a + MX7D_PAD_SD3_DATA1__SD3_DATA1 0x5a + MX7D_PAD_SD3_DATA2__SD3_DATA2 0x5a + MX7D_PAD_SD3_DATA3__SD3_DATA3 0x5a + MX7D_PAD_SD3_DATA4__SD3_DATA4 0x5a + MX7D_PAD_SD3_DATA5__SD3_DATA5 0x5a + MX7D_PAD_SD3_DATA6__SD3_DATA6 0x5a + MX7D_PAD_SD3_DATA7__SD3_DATA7 0x5a + MX7D_PAD_SD3_RESET_B__SD3_RESET_B 0x1a + >; + }; + + pinctrl_usdhc3_200mhz: usdhc3grp_200mhz { + fsl,pins = < + MX7D_PAD_SD3_CMD__SD3_CMD 0x5b + MX7D_PAD_SD3_CLK__SD3_CLK 0x1b + MX7D_PAD_SD3_DATA0__SD3_DATA0 0x5b + MX7D_PAD_SD3_DATA1__SD3_DATA1 0x5b + MX7D_PAD_SD3_DATA2__SD3_DATA2 0x5b + MX7D_PAD_SD3_DATA3__SD3_DATA3 0x5b + MX7D_PAD_SD3_DATA4__SD3_DATA4 0x5b + MX7D_PAD_SD3_DATA5__SD3_DATA5 0x5b + MX7D_PAD_SD3_DATA6__SD3_DATA6 0x5b + MX7D_PAD_SD3_DATA7__SD3_DATA7 0x5b + MX7D_PAD_SD3_RESET_B__SD3_RESET_B 0x1b + >; + }; +}; + +&iomuxc_lpsr { + pinctrl_wdog: wdoggrp { + fsl,pins = < + MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x74 + >; + }; +};
Signature · 1 line
2.20.0
PATCH RESEND v3 2/8 arm: dts: imx7s-warp: Import Linux warp7 dts
Quoted 7 lines
This patch imports the Linux kernel warp7 dts as at upstream kernel commit
cf76c364a1e1.Signed-off-by Bryan O'Donoghue <[email protected]>Cc Albert Aribaud <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
PATCH RESEND v3 3/8 arm: imx7s-warp: Add DT file hooks
In reply to Bryan O'DonoghueThis patch adds DT file hooks for imx7s-warp.dtb to the warp7 and warp7_bl33 builds.
--- arch/arm/dts/Makefile | 3 ++- configs/warp7_bl33_defconfig | 3 ++- configs/warp7_defconfig | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/dts/Makefile +2 -1
@@ -460,7 +460,8 @@ dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb dtb-$(CONFIG_MX7) += imx7-colibri.dtb \ imx7d-sdb.dtb \ - imx7d-sdb-qspi.dtb + imx7d-sdb-qspi.dtb \ + imx7s-warp.dtb dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
configs/warp7_bl33_defconfig +2 -1
@@ -20,6 +20,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y CONFIG_CMD_FS_GENERIC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DFU_MMC=y
@@ -37,5 +38,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_ETHER=y CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" -CONFIG_OF_LIBFDT=y CONFIG_OPTEE_TZDRAM_SIZE=0x2000000 +CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
configs/warp7_defconfig +2 -1
@@ -29,6 +29,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y CONFIG_CMD_FS_GENERIC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DFU_MMC=y
@@ -47,8 +48,8 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_ETHER=y CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" -CONFIG_OF_LIBFDT=y CONFIG_OPTEE_LOAD_ADDR=0x84000000 CONFIG_OPTEE_TZDRAM_SIZE=0x3000000 CONFIG_OPTEE_TZDRAM_BASE=0x9d000000 CONFIG_BOOTM_OPTEE=y +CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
Signature · 1 line
2.20.0
PATCH RESEND v3 3/8 arm: imx7s-warp: Add DT file hooks
Quoted 8 lines
This patch adds DT file hooks for imx7s-warp.dtb to the warp7 and
warp7_bl33builds.Signed-off-by Bryan O'Donoghue <[email protected]>Reviewed-by Peng Fan <[email protected]>Cc Albert Aribaud <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
PATCH RESEND v3 4/8 arm: imx7s-warp: Convert to DM MMC initialization
In reply to Bryan O'DonoghueConverts from fixed initialization of MMC to DM initialization of MMC.
--- board/warp7/warp7.c | 34 ---------------------------------- configs/warp7_bl33_defconfig | 1 + configs/warp7_defconfig | 1 + 3 files changed, 2 insertions(+), 34 deletions(-)
board/warp7/warp7.c +0 -34
@@ -30,8 +30,6 @@ DECLARE_GLOBAL_DATA_PTR;#define UART_PAD_CTRL (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \ PAD_CTL_HYS) -#define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ - PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU47KOHM)#define I2C_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
@@ -74,43 +72,11 @@ static iomux_v3_cfg_t const uart1_pads[] = { MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL), }; -static iomux_v3_cfg_t const usdhc3_pads[] = { -MX7D_PAD_SD3_CLK__SD3_CLK |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_CMD__SD3_CMD |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA0__SD3_DATA0 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA1__SD3_DATA1 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA2__SD3_DATA2 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA3__SD3_DATA3 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA4__SD3_DATA4 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA5__SD3_DATA5 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA6__SD3_DATA6 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_DATA7__SD3_DATA7 |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -MX7D_PAD_SD3_RESET_B__SD3_RESET_B |MUX_PAD_CTRL (USDHC_PAD_CTRL ), -}; -static void setup_iomux_uart (void ) {imx_iomux_v3_setup_multiple_pads (uart1_pads,ARRAY_SIZE (uart1_pads)); }; -static struct fsl_esdhc_cfg usdhc_cfg[1 ] = { - {USDHC3_BASE_ADDR }, -}; - -int board_mmc_getcd (struct mmc *mmc) -{ -/* Assume uSDHC3 emmc is always present */ -return 1 ; -} - -int board_mmc_init (bd_t *bis) -{ -imx_iomux_v3_setup_multiple_pads (usdhc3_pads,ARRAY_SIZE (usdhc3_pads)); - usdhc_cfg[0 ].sdhc_clk =mxc_get_clock (MXC_ESDHC3_CLK ); - -return fsl_esdhc_initialize (bis, &usdhc_cfg[0 ]); -} -int board_early_init_f (void ) {setup_iomux_uart ();
configs/warp7_bl33_defconfig +1 -0
@@ -24,6 +24,7 @@ CONFIG_OF_CONTROL=y CONFIG_CMD_FS_GENERIC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DFU_MMC=y +CONFIG_DM_MMC=y CONFIG_FSL_ESDHC=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y
configs/warp7_defconfig +1 -0
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y CONFIG_CMD_FS_GENERIC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DFU_MMC=y +CONFIG_DM_MMC=y CONFIG_FSL_ESDHC=y CONFIG_OPTEE=y CONFIG_USB=y
Signature · 1 line
2.20.0
PATCH RESEND v3 4/8 arm: imx7s-warp: Convert to DM MMC initialization
Quoted 6 lines
Converts from fixed initialization of MMC to DM initialization of MMC.
Signed-off-by Bryan O'Donoghue <[email protected]>Cc Albert Aribaud <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
PATCH RESEND v3 5/8 arm: dts: imx7s-warp: Create alias for mmc0 to &usdhc3
In reply to Bryan O'DonoghueThis patch sets up an alias for mmc0 to usdhc3.
Before the DM conversion only usdhc3 was enabled and therefore it appeared as MMC 0 to u-boot. After enabling MMC DM though usdhc3 defaults to MMC 2, which left unattended would drive changes to existing warp7 bootscripts and environment variables that rely on mmc 0.
Setup the alias of mmc0 and usdhc3 so that existing warp7 boot code will work unmodified.
--- arch/arm/dts/imx7s-warp.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/imx7s-warp.dts +4 -0
@@ -17,6 +17,10 @@ reg = <0x80000000 0x20000000>; }; + aliases { + mmc0 = &usdhc3; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-0 = <&pinctrl_gpio>;
Signature · 1 line
2.20.0
PATCH RESEND v3 5/8 arm: dts: imx7s-warp: Create alias for mmc0 to &usdhc3
Quoted 7 lines
This patch sets up an alias for mmc0 to usdhc3.
Before the DM conversion only usdhc3 was enabled and therefore it appeared as MMC 0 to u-boot. After enabling MMC DM though usdhc3 defaults to MMC 2, which left unattended would drive changes to existing warp7 bootscripts and environment variables that rely on mmc 0.
Setup the alias of mmc0 and usdhc3 so that existing warp7 boot code will work unmodified.
Quoted 5 lines
Signed-off-by Bryan O'Donoghue <[email protected]>Cc Albert Aribaud <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
PATCH RESEND v3 6/8 warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports
In reply to Bryan O'DonoghueSwitches on the IMX7 pinctrl driver for the warp7 and warp7_bl33 ports, necessary to convert over to DM for this board.
It is necessary to switch on pinctrl and GPIO in one go.
--- configs/warp7_bl33_defconfig | 3 +++ configs/warp7_defconfig | 3 +++ 2 files changed, 6 insertions(+)
configs/warp7_bl33_defconfig +3 -0
@@ -41,3 +41,6 @@ CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" CONFIG_OPTEE_TZDRAM_SIZE=0x2000000 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp" +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX7=y +CONFIG_DM_GPIO=y
configs/warp7_defconfig +3 -0
@@ -54,3 +54,6 @@ CONFIG_OPTEE_TZDRAM_SIZE=0x3000000 CONFIG_OPTEE_TZDRAM_BASE=0x9d000000 CONFIG_BOOTM_OPTEE=y CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp" +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX7=y +CONFIG_DM_GPIO=y
Signature · 1 line
2.20.0
PATCH RESEND v3 6/8 warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports
Quoted 7 lines
Switches on the IMX7 pinctrl driver for the warp7 and
warp7_bl33ports, necessary to convert over to DM for this board.
It is necessary to switch on pinctrl and GPIO in one go.Signed-off-by Bryan O'Donoghue <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
PATCH RESEND v3 7/8 warp7: defconfig: Switch to DM for I2C
In reply to Bryan O'DonoghueThis commit switches to DM I2C for warp7 and warp7_bl33 defconfigs.
--- board/warp7/warp7.c | 24 ------------------------ configs/warp7_bl33_defconfig | 1 + configs/warp7_defconfig | 1 + include/configs/warp7.h | 2 -- 4 files changed, 2 insertions(+), 26 deletions(-)
board/warp7/warp7.c +0 -24
@@ -31,26 +31,6 @@ DECLARE_GLOBAL_DATA_PTR;#define UART_PAD_CTRL (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \ PAD_CTL_HYS) -#define I2C_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ - PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM) - -#ifdef CONFIG_SYS_I2C_MXC -#define PC MUX_PAD_CTRL(I2C_PAD_CTRL) -/* I2C1 for PMIC */ -static struct i2c_pads_info i2c_pad_info1 = { - .scl = { - .i2c_mode =MX7D_PAD_I2C1_SCL__I2C1_SCL |PC , - .gpio_mode =MX7D_PAD_I2C1_SCL__GPIO4_IO8 |PC , - .gp =IMX_GPIO_NR (4 ,8 ), - }, - .sda = { - .i2c_mode =MX7D_PAD_I2C1_SDA__I2C1_SDA |PC , - .gpio_mode =MX7D_PAD_I2C1_SDA__GPIO4_IO9 |PC , - .gp =IMX_GPIO_NR (4 ,9 ), - }, -}; -#endif -int dram_init (void ) { gd->ram_size =PHYS_SDRAM_SIZE ;
@@ -130,10 +110,6 @@ int board_init(void)/* address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ; -#ifdef CONFIG_SYS_I2C_MXC -setup_i2c (0 ,CONFIG_SYS_I2C_SPEED ,0x7f , &i2c_pad_info1); -#endif -return 0 ; }
configs/warp7_bl33_defconfig +1 -0
@@ -44,3 +44,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp" CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y
configs/warp7_defconfig +1 -0
@@ -57,3 +57,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp" CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y
include/configs/warp7.h +0 -2
@@ -126,9 +126,7 @@ (CONFIG_SYS_INIT_RAM_ADDR +CONFIG_SYS_INIT_SP_OFFSET ) /* I2C configs */ -#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 #define CONFIG_SYS_I2C_SPEED 100000/* PMIC */
Signature · 1 line
2.20.0
PATCH RESEND v3 7/8 warp7: defconfig: Switch to DM for I2C
Quoted 6 lines
This commit switches to DM I2C for warp7 and
warp7_bl33defconfigs.Signed-off-by Bryan O'Donoghue <[email protected]>Reviewed-by Peng Fan <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
PATCH RESEND v3 8/8 arm: imx7s-warp: Convert to DM PMIC
In reply to Bryan O'DonoghueThis patch converts the warp7 and warp7_bl33 board ports over to using the DM PMIC model.
--- board/warp7/warp7.c | 27 +++++++++++---------------- configs/warp7_bl33_defconfig | 6 ++++++ configs/warp7_defconfig | 6 ++++++ include/configs/warp7.h | 6 ------ 4 files changed, 23 insertions(+), 22 deletions(-)
board/warp7/warp7.c +11 -16
@@ -64,29 +64,24 @@ int board_early_init_f(void)return 0 ; } -#ifdef CONFIG_POWER -#define I2C_PMIC 0 -static struct pmic *pfuze; +#ifdef CONFIG_DM_PMIC int power_init_board (void ) { -int ret; -unsigned int reg, rev_id; +struct udevice *dev; +int ret, dev_id, rev_id; - ret =power_pfuze3000_init (I2C_PMIC ); -if (ret) + ret =pmic_get ("pfuze3000" , &dev); +if (ret == -ENODEV ) +return 0 ; +if (ret !=0 )return ret; - pfuze =pmic_get ("PFUZE3000" ); - ret =pmic_probe (pfuze); -if (ret) -return ret; - -pmic_reg_read (pfuze,PFUZE3000_DEVICEID , ®); -pmic_reg_read (pfuze,PFUZE3000_REVID , &rev_id); -printf ("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n" , reg, rev_id); + dev_id =pmic_reg_read (dev,PFUZE3000_DEVICEID ); + rev_id =pmic_reg_read (dev,PFUZE3000_REVID ); +printf ("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n" , dev_id, rev_id);/* disable Low Power Mode during standby mode */ -pmic_reg_write (pfuze,PFUZE3000_LDOGCTL ,0x1 ); +pmic_clrsetbits (dev,PFUZE3000_LDOGCTL ,0 ,1 );return 0 ; }
configs/warp7_bl33_defconfig +6 -0
@@ -45,3 +45,9 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_PFUZE100=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_PFUZE100=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y
configs/warp7_defconfig +6 -0
@@ -58,3 +58,9 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_PFUZE100=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_PFUZE100=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y
include/configs/warp7.h +0 -6
@@ -129,12 +129,6 @@#define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000 -/* PMIC */ -#define CONFIG_POWER -#define CONFIG_POWER_I2C -#define CONFIG_POWER_PFUZE3000 -#define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08 -/* environment organization */ #define CONFIG_ENV_SIZE SZ_8K
Signature · 1 line
2.20.0
PATCH RESEND v3 8/8 arm: imx7s-warp: Convert to DM PMIC
Quoted 7 lines
This patch converts the warp7 and
warp7_bl33board ports over to using the DM PMIC model.Signed-off-by Bryan O'Donoghue <[email protected]>Reviewed-by Peng Fan <[email protected]>Cc Peng Fan <[email protected]>Cc Fabio Estevam <[email protected]>Cc Stefano Babic <[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 =====================================================================
Fabio Estevam
reviewerv3 cover Convert i.MX7 WaRP7 ports to DM
In reply to Bryan O'DonoghueHi Bryan,
Quoted 21 lines · Bryan O'Donoghue
V3-Resend:
- Looks like this set got lost in the ether, resending.V3:
- Fix Lucas' mail address "Auer, Lucas" makes git send-mail chokeV2:
- Add review-by as indicated - Peng Fan
- Squash commit 4 and 5 from v1 - Peng Fan
- Leave usdhc1 intact because of alias of mmc0 to usdhc3 - Bryan
- Add correction for spelling mistake inimx7d-pinfunc.h- Lukas Auer
- Importsimx7s-warp7.dtsfrom kernel unmodified as a result of #1 - BryanV1:
This series does a minimal conversion of WaRP7 and the BL33 version of WaRP7 to the DM.Pinctrl, GPIO, I2C, Regulators, PMIC and MMC are converted. Later patches will convert USB and UART.
Quoted 9 lines
Bryan O'Donoghue (8):
arm: dts: imx7: Correct spelling mistake in GPIO name
arm: dts: imx7s-warp: Import Linux warp7 dts
arm: imx7s-warp: Add DT file hooks
arm: imx7s-warp: Convert to DM MMC initialization
arm: dts: imx7s-warp: Create alias for mmc0 to &usdhc3
warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports
warp7: defconfig: Switch to DM for I2C
arm: imx7s-warp: Convert to DM PMIC
Looks good, thanks: