[U-Boot] [RFC 0/9] Convert Pico-Pi i.MX7D to DM

Hi all,
Pinctrl, GPIO, I2C, MMC, ETH are converted.
Convert PMIC is the same of warp7 but i have a some erros, si this log : U-Boot SPL 2019.01-00197-ga524e5d-dirty (Jan 20 2019 - 21:09:49 +0100) Trying to boot from USB SDP SDP: initialize... SDP: handle requests... Downloading file of size 556397 to 0x877fffc0... done Jumping to header at 0x877fffc0 Header Tag is not an IMX image
U-Boot 2019.01-00197-ga524e5d-dirty (Jan 20 2019 - 21:09:49 +0100)
CPU: Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz) CPU: Commercial temperature grade (0C to 95C) at 43C Reset cause: POR Model: TechNexion PICO-IMX7D Board and PI baseboard Board: i.MX7D PICOSOM DRAM: 512 MiB read error from device: 9df65458 register: 0x3! PMIC: PFUZE3000 DEV_ID=0x0 REV_ID=0xfffffffb read error from device: 9df65458 register: 0x69! write error to device: 9df65458 register: 0x23! write error to device: 9df65458 register: 0x31! write error to device: 9df65458 register: 0x21! write error to device: 9df65458 register: 0x2f! read error from device: 9df65458 register: 0x2e! write error to device: 9df65458 register: 0x2e! MMC: FSL_SDHC: 2, FSL_SDHC: 1, FSL_SDHC: 0 Loading Environment from MMC... OK In: serial@30a70000 Out: serial@30a70000 Err: serial@30a70000 Net: Warning: ethernet@30be0000 using MAC address from ROM eth0: ethernet@30be0000 Hit any key to stop autoboot: 0
USB is convert but update u-boot with dfu log a error :
=> dfu 0 mmc 0 Request would exceed designated area! #Deferred dfu_flush() failed!=>
Thanks a advance for your help.
Best Regards,
Joris Offouga
Joris Offouga (9): Arm: dts: imx7d-pico: Import Linux pico-pi dts Arm: imx7d-pico: Add DT file hooks pico-pi-imx7d: defconfig Enable DM gpio pinctrl and pinctrl_imx7 arm: imx7d-pico-pi: Convert to DM MMC initialization pico-pi-imx7d: defconfig: Switch to DM for I2C pico-imx7d-pico: defconfig: Switch to DM for UART pico-imx7d: Convert to DM PMIC arm: pico-pi-imx7d: Convert to DM USB pico-imx7d: Convert to DM Ethernet
arch/arm/dts/Makefile | 3 +- arch/arm/dts/imx7d-pico-pi.dts | 102 ++++++ arch/arm/dts/imx7d-pico.dtsi | 588 +++++++++++++++++++++++++++++++ board/technexion/pico-imx7d/pico-imx7d.c | 105 +----- configs/pico-pi-imx7d_defconfig | 17 +- include/configs/pico-imx7d.h | 11 - 6 files changed, 726 insertions(+), 100 deletions(-) create mode 100644 arch/arm/dts/imx7d-pico-pi.dts create mode 100644 arch/arm/dts/imx7d-pico.dtsi

This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi
Signed-off-by: Joris Offouga offougajoris@gmail.com --- arch/arm/dts/imx7d-pico-pi.dts | 93 +++++++ arch/arm/dts/imx7d-pico.dtsi | 588 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 681 insertions(+) create mode 100644 arch/arm/dts/imx7d-pico-pi.dts create mode 100644 arch/arm/dts/imx7d-pico.dtsi
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts new file mode 100644 index 0000000..66ca590 --- /dev/null +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// +// Copyright 2017 NXP + +#include "imx7d-pico.dtsi" + +/ { + model = "TechNexion PICO-IMX7D Board and PI baseboard"; + compatible = "technexion,imx7d-pico-pi", "fsl,imx7d"; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_leds>; + + led { + label = "gpio-led"; + gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; + }; + }; + + 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 = <&sgtl5000>; + clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + }; + }; +}; + +&i2c1 { + sgtl5000: codec@a { + #sound-dai-cells = <0>; + reg = <0x0a>; + compatible = "fsl,sgtl5000"; + clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + VDDA-supply = <®_2p5v>; + VDDIO-supply = <®_vref_1v8>; + }; +}; + +&i2c4 { + polytouch: touchscreen@38 { + compatible = "edt,edt-ft5x06"; + reg = <0x38>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_touchscreen>; + interrupt-parent = <&gpio2>; + interrupts = <13 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + }; +}; + +&iomuxc { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hog>; + + pinctrl_hog: hoggrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA00__GPIO2_IO0 0x14 + MX7D_PAD_EPDC_DATA01__GPIO2_IO1 0x14 + MX7D_PAD_EPDC_DATA02__GPIO2_IO2 0x14 + MX7D_PAD_EPDC_DATA03__GPIO2_IO3 0x14 + MX7D_PAD_EPDC_DATA05__GPIO2_IO5 0x14 + MX7D_PAD_EPDC_DATA12__GPIO2_IO12 0x14 + MX7D_PAD_EPDC_DATA07__GPIO2_IO7 0x14 + >; + }; + + pinctrl_gpio_leds: gpioledsgrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA06__GPIO2_IO6 0x14 + >; + }; + + pinctrl_touchscreen: touchscreengrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA04__GPIO2_IO4 0x14 + MX7D_PAD_EPDC_DATA13__GPIO2_IO13 0x14 + >; + }; + +}; \ No newline at end of file diff --git a/arch/arm/dts/imx7d-pico.dtsi b/arch/arm/dts/imx7d-pico.dtsi new file mode 100644 index 0000000..d0c589b --- /dev/null +++ b/arch/arm/dts/imx7d-pico.dtsi @@ -0,0 +1,588 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// +// Copyright 2017 NXP + +/dts-v1/; + +#include "imx7d.dtsi" + +/ { + /* Will be filled by the bootloader */ + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0>; + }; + + reg_wlreg_on: regulator-wlreg_on { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_reg_wlreg_on>; + regulator-name = "wlreg_on"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio4 16 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + reg_2p5v: regulator-2p5v { + compatible = "regulator-fixed"; + regulator-name = "2P5V"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "3P3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + reg_usb_otg1_vbus: regulator-usb-otg1-vbus { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg1_pwr>; + compatible = "regulator-fixed"; + regulator-name = "usb_otg1_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio4 5 GPIO_ACTIVE_LOW>; + }; + + reg_usb_otg2_vbus: regulator-usb-otg2-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_otg2_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + reg_vref_1v8: regulator-vref-1v8 { + compatible = "regulator-fixed"; + regulator-name = "vref-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + usdhc2_pwrseq: usdhc2_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&clks IMX7D_CLKO2_ROOT_DIV>; + clock-names = "ext_clock"; + }; +}; + +&clks { + assigned-clocks = <&clks IMX7D_CLKO2_ROOT_SRC>, + <&clks IMX7D_CLKO2_ROOT_DIV>; + assigned-clock-parents = <&clks IMX7D_CKIL>; + assigned-clock-rates = <0>, <32768>; +}; + +&ecspi3 { + cs-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ecspi3>; + status = "okay"; +}; + +&fec1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_enet1>; + assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>, + <&clks IMX7D_ENET1_TIME_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; + assigned-clock-rates = <0>, <100000000>; + phy-mode = "rgmii"; + phy-handle = <ðphy0>; + fsl,magic-packet; + phy-reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>; + status = "okay"; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethphy0: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + status = "okay"; + }; + }; +}; + +&flexcan1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_can1>; + status = "okay"; +}; + +&flexcan2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_can2>; + status = "okay"; +}; + +&i2c1 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + status = "okay"; +}; + +&i2c2 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + status = "okay"; +}; + +&i2c4 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4>; + status = "okay"; + + pmic: pfuze3000@8 { + compatible = "fsl,pfuze3000"; + reg = <0x08>; + + regulators { + sw1a_reg: sw1a { + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <3300000>; + 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 = <1800000>; + 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; + }; + }; + }; +}; + +&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>, <24576000>; + status = "okay"; +}; + + +&pwm1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm1>; + status = "okay"; +}; + +&pwm2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm2>; + status = "okay"; +}; + +&pwm3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm3>; + status = "okay"; +}; + +&pwm4 { /* Backlight */ + status = "okay"; +}; + +&uart5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart5>; + assigned-clocks = <&clks IMX7D_UART5_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + status = "okay"; +}; + +&uart6 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart6>; + assigned-clocks = <&clks IMX7D_UART6_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>; + uart-has-rtscts; + status = "okay"; +}; + +&uart7 { /* Bluetooth */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart7>; + assigned-clocks = <&clks IMX7D_UART7_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + uart-has-rtscts; + status = "okay"; +}; + +&usbotg1 { + vbus-supply = <®_usb_otg1_vbus>; + dr_mode = "otg"; + status = "okay"; +}; + +&usbotg2 { + vbus-supply = <®_usb_otg2_vbus>; + dr_mode = "host"; + status = "okay"; +}; + +&usdhc1 { + pinctrl-names = "default", "state_100mhz", "state_200mhz"; + pinctrl-0 = <&pinctrl_usdhc1>; + pinctrl-1 = <&pinctrl_usdhc1_100mhz>; + pinctrl-2 = <&pinctrl_usdhc1_200mhz>; + cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; + bus-width = <4>; + tuning-step = <2>; + vmmc-supply = <®_3p3v>; + wakeup-source; + no-1-8-v; + keep-power-in-suspend; + status = "okay"; +}; + +&usdhc2 { /* Wifi SDIO */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_wifi_clk>; + no-1-8-v; + non-removable; + keep-power-in-suspend; + wakeup-source; + vmmc-supply = <®_wlreg_on>; + mmc-pwrseq = <&usdhc2_pwrseq>; + 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_ecspi3: ecspi3grp { + fsl,pins = < + MX7D_PAD_I2C1_SCL__ECSPI3_MISO 0x2 + MX7D_PAD_I2C1_SDA__ECSPI3_MOSI 0x2 + MX7D_PAD_I2C2_SCL__ECSPI3_SCLK 0x2 + MX7D_PAD_I2C2_SDA__GPIO4_IO11 0x14 + >; + }; + + pinctrl_i2c1: i2c1grp { + fsl,pins = < + MX7D_PAD_UART1_TX_DATA__I2C1_SDA 0x4000007f + MX7D_PAD_UART1_RX_DATA__I2C1_SCL 0x4000007f + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX7D_PAD_UART2_TX_DATA__I2C2_SDA 0x4000007f + MX7D_PAD_UART2_RX_DATA__I2C2_SCL 0x4000007f + >; + }; + + pinctrl_enet1: enet1grp { + fsl,pins = < + MX7D_PAD_SD2_CD_B__ENET1_MDIO 0x3 + MX7D_PAD_SD2_WP__ENET1_MDC 0x3 + MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC 0x1 + MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 0x1 + MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 0x1 + MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2 0x1 + MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3 0x1 + MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x1 + MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC 0x1 + MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x1 + MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x1 + MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2 0x1 + MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3 0x1 + MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x1 + MX7D_PAD_SD3_RESET_B__GPIO6_IO11 0x1 /* Ethernet reset */ + >; + }; + + pinctrl_can1: can1frp { + fsl,pins = < + MX7D_PAD_SAI1_RX_DATA__FLEXCAN1_RX 0x59 + MX7D_PAD_SAI1_TX_BCLK__FLEXCAN1_TX 0x59 + >; + }; + + pinctrl_can2: can2frp { + fsl,pins = < + MX7D_PAD_SAI1_TX_SYNC__FLEXCAN2_RX 0x59 + MX7D_PAD_SAI1_TX_DATA__FLEXCAN2_TX 0x59 + >; + }; + + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX7D_PAD_SAI1_RX_BCLK__I2C4_SDA 0x4000007f + MX7D_PAD_SAI1_RX_SYNC__I2C4_SCL 0x4000007f + >; + }; + + pinctrl_pwm1: pwm1 { + fsl,pins = < + MX7D_PAD_GPIO1_IO08__PWM1_OUT 0x7f + >; + }; + + pinctrl_pwm2: pwm2 { + fsl,pins = < + MX7D_PAD_GPIO1_IO09__PWM2_OUT 0x7f + >; + }; + + pinctrl_pwm3: pwm3 { + fsl,pins = < + MX7D_PAD_GPIO1_IO10__PWM3_OUT 0x7f + >; + }; + + pinctrl_reg_wlreg_on: regregongrp { + fsl,pins = < + MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16 0x59 + >; + }; + + pinctrl_sai1: sai1grp { + fsl,pins = < + MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK 0x1f + MX7D_PAD_ENET1_CRS__SAI1_TX_SYNC 0x1f + MX7D_PAD_ENET1_COL__SAI1_TX_DATA0 0x30 + MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0 0x1f + >; + }; + + pinctrl_uart5: uart5grp { + fsl,pins = < + MX7D_PAD_I2C4_SDA__UART5_DCE_TX 0x79 + MX7D_PAD_I2C4_SCL__UART5_DCE_RX 0x79 + >; + }; + + pinctrl_uart6: uart6grp { + fsl,pins = < + MX7D_PAD_EPDC_DATA08__UART6_DCE_RX 0x79 + MX7D_PAD_EPDC_DATA09__UART6_DCE_TX 0x79 + MX7D_PAD_EPDC_DATA10__UART6_DCE_RTS 0x79 + MX7D_PAD_EPDC_DATA11__UART6_DCE_CTS 0x79 + >; + }; + + pinctrl_uart7: uart7grp { + fsl,pins = < + MX7D_PAD_ECSPI2_MOSI__UART7_DCE_TX 0x79 + MX7D_PAD_ECSPI2_SCLK__UART7_DCE_RX 0x79 + MX7D_PAD_ECSPI2_SS0__UART7_DCE_CTS 0x79 + MX7D_PAD_ECSPI2_MISO__UART7_DCE_RTS 0x79 + >; + }; + + pinctrl_usbotg1_pwr: usbotg_pwr { + fsl,pins = < + MX7D_PAD_UART3_TX_DATA__GPIO4_IO5 0x14 + >; + }; + + 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_SD1_CD_B__GPIO5_IO0 0x15 + >; + }; + + pinctrl_usdhc1_100mhz: usdhc1grp_100mhz { + fsl,pins = < + MX7D_PAD_SD1_CMD__SD1_CMD 0x5a + MX7D_PAD_SD1_CLK__SD1_CLK 0x1a + MX7D_PAD_SD1_DATA0__SD1_DATA0 0x5a + MX7D_PAD_SD1_DATA1__SD1_DATA1 0x5a + MX7D_PAD_SD1_DATA2__SD1_DATA2 0x5a + MX7D_PAD_SD1_DATA3__SD1_DATA3 0x5a + MX7D_PAD_SD1_CD_B__GPIO5_IO0 0x15 + >; + }; + + pinctrl_usdhc1_200mhz: usdhc1grp_200mhz { + fsl,pins = < + MX7D_PAD_SD1_CMD__SD1_CMD 0x5b + MX7D_PAD_SD1_CLK__SD1_CLK 0x1b + MX7D_PAD_SD1_DATA0__SD1_DATA0 0x5b + MX7D_PAD_SD1_DATA1__SD1_DATA1 0x5b + MX7D_PAD_SD1_DATA2__SD1_DATA2 0x5b + MX7D_PAD_SD1_DATA3__SD1_DATA3 0x5b + MX7D_PAD_SD1_CD_B__GPIO5_IO0 0x15 + >; + }; + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < + MX7D_PAD_SD2_CMD__SD2_CMD 0x59 + MX7D_PAD_SD2_CLK__SD2_CLK 0x19 + MX7D_PAD_SD2_DATA0__SD2_DATA0 0x59 + MX7D_PAD_SD2_DATA1__SD2_DATA1 0x59 + MX7D_PAD_SD2_DATA2__SD2_DATA2 0x59 + MX7D_PAD_SD2_DATA3__SD2_DATA3 0x59 + >; + }; + + 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 + >; + }; + + 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 + >; + }; + + 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 + >; + }; +}; + +&iomuxc_lpsr { + pinctrl_wifi_clk: wificlkgrp { + fsl,pins = < + MX7D_PAD_LPSR_GPIO1_IO03__CCM_CLKO2 0x7d + >; + }; + + pinctrl_wdog: wdoggrp { + fsl,pins = < + MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x74 + >; + }; +}; \ No newline at end of file

On 20/01/2019 21:18, Joris Offouga wrote:
This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi
I recommend including the upstream Linux SHA in the commit log to make it easier to validate against and also if any changes/bugfixes go in upstream makes it easier to cherry-pick onto the local dts in u-boot.
--- bod

Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :
On 20/01/2019 21:18, Joris Offouga wrote:
This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi
I recommend including the upstream Linux SHA in the commit log to make it easier to validate against and also if any changes/bugfixes go in upstream makes it easier to cherry-pick onto the local dts in u-boot.
Indeed, i add to v2.
I have a problem with pmic, can you watch the patch corresponding to the pmic ?
https://patchwork.ozlabs.org/patch/1028229/
Best regards,
Joris Offouga
bod _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

On 21/01/2019 10:34, jorisoffouga wrote:
Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :
On 20/01/2019 21:18, Joris Offouga wrote:
This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi
I recommend including the upstream Linux SHA in the commit log to make it easier to validate against and also if any changes/bugfixes go in upstream makes it easier to cherry-pick onto the local dts in u-boot.
Indeed, i add to v2.
I have a problem with pmic, can you watch the patch corresponding to the pmic ?
Let me add Jun, he's better place than me to help with this.

Le 21 janv. 2019 à 11:58, Bryan O'Donoghue bryan.odonoghue@linaro.org a écrit :
On 21/01/2019 10:34, jorisoffouga wrote:
Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :
On 20/01/2019 21:18, Joris Offouga wrote: This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi
I recommend including the upstream Linux SHA in the commit log to make it easier to validate against and also if any changes/bugfixes go in upstream makes it easier to cherry-pick onto the local dts in u-boot.
Indeed, i add to v2. I have a problem with pmic, can you watch the patch corresponding to the pmic ? https://patchwork.ozlabs.org/patch/1028229/
Let me add Jun, he's better place than me to help with this.
Thanks , i'm waiting for this help Joris

On 21/01/2019 12:02, Offouga Joris wrote:
Le 21 janv. 2019 à 11:58, Bryan O'Donoghue bryan.odonoghue@linaro.org a écrit :
On 21/01/2019 10:34, jorisoffouga wrote:
Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :
On 20/01/2019 21:18, Joris Offouga wrote: This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi
I recommend including the upstream Linux SHA in the commit log to make it easier to validate against and also if any changes/bugfixes go in upstream makes it easier to cherry-pick onto the local dts in u-boot.
Indeed, i add to v2. I have a problem with pmic, can you watch the patch corresponding to the pmic ? https://patchwork.ozlabs.org/patch/1028229/
Let me add Jun, he's better place than me to help with this.
Thanks , i'm waiting for this help Joris
Hi Joris,
I've been told that this board exhibits this same problem even without the DM conversion.
"PMIC: PFUZE3000 DEV_ID=0x0 REV_ID=0xfffffffb read error from device: 9df65458 register: 0x69! write error to device: 9df65458 register: 0x23! write error to device: 9df65458 register: 0x31!"
I suggest trying to do a git bisect on the existing non-DM code to root-cause where the error creeps in.
--- bod

Hi Bryan and Joris,
On Wed, Jan 23, 2019 at 7:53 AM Bryan O'Donoghue bryan.odonoghue@linaro.org wrote:
Hi Joris,
I've been told that this board exhibits this same problem even without the DM conversion.
"PMIC: PFUZE3000 DEV_ID=0x0 REV_ID=0xfffffffb read error from device: 9df65458 register: 0x69! write error to device: 9df65458 register: 0x23! write error to device: 9df65458 register: 0x31!"
I cannot reproduce the error here on U-Boot master:
U-Boot SPL 2019.01-00410-g748ad078ee (Jan 30 2019 - 23:02:31 -0200) Trying to boot from MMC1
U-Boot 2019.01-00410-g748ad078ee (Jan 30 2019 - 23:02:31 -0200)
CPU: Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz) CPU: Commercial temperature grade (0C to 95C) at 47C Reset cause: POR Board: i.MX7D PICOSOM I2C: ready DRAM: 512 MiB PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11 MMC: FSL_SDHC: 0 Loading Environment from MMC... OK Video: 800x480x24 In: serial Out: serial Err: serial Net: FEC0 Hit any key to stop autoboot: 0
Are you sure the PMIC problem happens prior to the DM conversion?

Hi Fabio
Le 31 janv. 2019 à 02:16, Fabio Estevam festevam@gmail.com a écrit :
Hi Bryan and Joris,
On Wed, Jan 23, 2019 at 7:53 AM Bryan O'Donoghue bryan.odonoghue@linaro.org wrote:
Hi Joris,
I've been told that this board exhibits this same problem even without the DM conversion.
"PMIC: PFUZE3000 DEV_ID=0x0 REV_ID=0xfffffffb read error from device: 9df65458 register: 0x69! write error to device: 9df65458 register: 0x23! write error to device: 9df65458 register: 0x31!"
I cannot reproduce the error here on U-Boot master:
U-Boot SPL 2019.01-00410-g748ad078ee (Jan 30 2019 - 23:02:31 -0200) Trying to boot from MMC1
U-Boot 2019.01-00410-g748ad078ee (Jan 30 2019 - 23:02:31 -0200)
CPU: Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz) CPU: Commercial temperature grade (0C to 95C) at 47C Reset cause: POR Board: i.MX7D PICOSOM I2C: ready DRAM: 512 MiB PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11 MMC: FSL_SDHC: 0 Loading Environment from MMC... OK Video: 800x480x24 In: serial Out: serial Err: serial Net: FEC0 Hit any key to stop autoboot: 0
Are you sure the PMIC problem happens prior to the DM conversion?
The PMIC problem occurs after the dm conversion

On Thu, Jan 31, 2019 at 1:59 AM Offouga Joris offougajoris@gmail.com wrote:
The PMIC problem occurs after the dm conversion
It'd be good if you could rework the things I commented on the patchset and refresh the patches on top of imx/master so we can all be on same page.

On 31 Jan 2019, at 12:36, Otavio Salvador otavio.salvador@ossystems.com.br wrote:
On Thu, Jan 31, 2019 at 1:59 AM Offouga Joris offougajoris@gmail.com wrote: The PMIC problem occurs after the dm conversion
It'd be good if you could rework the things I commented on the patchset and refresh the patches on top of imx/master so we can all be on same page.
Yes I fix them and I send patche without RFC ?
-- Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750

On Thu, Jan 31, 2019 at 9:54 AM Offouga Joris offougajoris@gmail.com wrote:
On 31 Jan 2019, at 12:36, Otavio Salvador otavio.salvador@ossystems.com.br wrote:
On Thu, Jan 31, 2019 at 1:59 AM Offouga Joris offougajoris@gmail.com wrote: The PMIC problem occurs after the dm conversion
It'd be good if you could rework the things I commented on the patchset and refresh the patches on top of imx/master so we can all be on same page.
Yes I fix them and I send patche without RFC ?
Not yet, we need to fix the PMIC error before sending it. Please fix the branch so we can keep contributing there until it is good to be send here ;-)

Le 31/01/2019 à 13:39, Otavio Salvador a écrit :
On Thu, Jan 31, 2019 at 9:54 AM Offouga Joris offougajoris@gmail.com wrote:
On 31 Jan 2019, at 12:36, Otavio Salvador otavio.salvador@ossystems.com.br wrote:
On Thu, Jan 31, 2019 at 1:59 AM Offouga Joris offougajoris@gmail.com wrote: The PMIC problem occurs after the dm conversion
It'd be good if you could rework the things I commented on the patchset and refresh the patches on top of imx/master so we can all be on same page.
Yes I fix them and I send patche without RFC ?
Not yet, we need to fix the PMIC error before sending it. Please fix the branch so we can keep contributing there until it is good to be send here ;-)
I update the branche on my repo :)
https://github.com/jorisoffouga/u-boot/tree/pico-imx7d/convert_dm
The patches on top of u-boot master
Best Regards,
Joris

Hi Joris,
On Thu, Jan 31, 2019 at 1:20 PM Joris Offouga offougajoris@gmail.com wrote:
I update the branche on my repo :)
https://github.com/jorisoffouga/u-boot/tree/pico-imx7d/convert_dm
The patches on top of u-boot master
I tested your series and I was able to reproduce the PMIC error.
I tried to debug it and could not fix the error yet. Also tested the warp7 board, which uses the same PMIC and it has been converted to DM without issues.
Maybe you could resend this series without the PMIC part for now and we can work to add it as soon as we figure it out.
Thanks for your work!

This patch adds DT file hooks for imx7d-pico-pi.dtb
Signed-off-by: Joris Offouga offougajoris@gmail.com --- arch/arm/dts/Makefile | 3 ++- configs/pico-pi-imx7d_defconfig | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index b2ca87d..5c87877 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -462,7 +462,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 \ + imx7d-pico-pi.dtb
dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 8e48ba7..ce43393 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -16,11 +16,13 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd" CONFIG_DEFAULT_FDT_FILE="imx7d-pico-pi.dtb" +CONFIG_DEFAULT_DEVICE_TREE="imx7d-pico-pi" CONFIG_BOUNCE_BUFFER=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_USB_HOST_SUPPORT=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_SDP_SUPPORT=y +CONFIG_OF_CONTROL=y # CONFIG_CMD_BOOTD is not set CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_IMI is not set @@ -57,4 +59,3 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_OF_LIBFDT=y

This patch is necessary for convert pico-pi-imx7 to dm driver model
Signed-off-by: Joris Offouga offougajoris@gmail.com --- configs/pico-pi-imx7d_defconfig | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index ce43393..80f5739 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -23,6 +23,9 @@ CONFIG_SPL_USB_HOST_SUPPORT=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_OF_CONTROL=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX7=y +CONFIG_DM_GPIO=y # CONFIG_CMD_BOOTD is not set CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_IMI is not set

On Sun, Jan 20, 2019 at 7:41 PM Joris Offouga offougajoris@gmail.com wrote:
This patch is necessary for convert pico-pi-imx7 to dm driver model
Signed-off-by: Joris Offouga offougajoris@gmail.com
configs/pico-pi-imx7d_defconfig | 3 +++
Please also convert configs/pico-imx7d_defconfig and configs/pico-hobbit-imx7d_defconfig

Furthermore this patch create un alias for mmc0 to usdch3 because before the convertion he was the only one described in the pico-imx7d.c.
Signed-off-by: Joris Offouga offougajoris@gmail.com --- arch/arm/dts/imx7d-pico-pi.dts | 4 ++++ board/technexion/pico-imx7d/pico-imx7d.c | 36 -------------------------------- configs/pico-pi-imx7d_defconfig | 1 + 3 files changed, 5 insertions(+), 36 deletions(-)
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts index 66ca590..d4aca96 100644 --- a/arch/arm/dts/imx7d-pico-pi.dts +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -8,6 +8,10 @@ model = "TechNexion PICO-IMX7D Board and PI baseboard"; compatible = "technexion,imx7d-pico-pi", "fsl,imx7d";
+ aliases { + mmc0 = &usdhc3; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 53e1469..48e90b0 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -28,9 +28,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 ENET_PAD_CTRL (PAD_CTL_PUS_PU100KOHM | PAD_CTL_DSE_3P3V_49OHM) #define ENET_PAD_CTRL_MII (PAD_CTL_DSE_3P3V_32OHM)
@@ -118,20 +115,6 @@ static iomux_v3_cfg_t const uart5_pads[] = { MX7D_PAD_I2C4_SDA__UART5_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };
-static iomux_v3_cfg_t const usdhc3_emmc_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_GPIO1_IO14__GPIO1_IO14 | MUX_PAD_CTRL(USDHC_PAD_CTRL), -}; - #ifdef CONFIG_FEC_MXC static iomux_v3_cfg_t const fec1_pads[] = { MX7D_PAD_SD2_CD_B__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_MII), @@ -216,25 +199,6 @@ static void setup_iomux_uart(void) imx_iomux_v3_setup_multiple_pads(uart5_pads, ARRAY_SIZE(uart5_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_emmc_pads, ARRAY_SIZE(usdhc3_emmc_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(); diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 80f5739..0d1c56b 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -23,6 +23,7 @@ CONFIG_SPL_USB_HOST_SUPPORT=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_OF_CONTROL=y +CONFIG_DM_MMC=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y

On Sun, Jan 20, 2019 at 7:52 PM Joris Offouga offougajoris@gmail.com wrote:
Furthermore this patch create un alias for mmc0 to usdch3 because before the convertion he was the only one described in the pico-imx7d.c.
Signed-off-by: Joris Offouga offougajoris@gmail.com
arch/arm/dts/imx7d-pico-pi.dts | 4 ++++ board/technexion/pico-imx7d/pico-imx7d.c | 36 -------------------------------- configs/pico-pi-imx7d_defconfig | 1 + 3 files changed, 5 insertions(+), 36 deletions(-)
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts index 66ca590..d4aca96 100644 --- a/arch/arm/dts/imx7d-pico-pi.dts +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -8,6 +8,10 @@ model = "TechNexion PICO-IMX7D Board and PI baseboard"; compatible = "technexion,imx7d-pico-pi", "fsl,imx7d";
aliases {
mmc0 = &usdhc3;
};
leds { compatible = "gpio-leds"; pinctrl-names = "default";
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 53e1469..48e90b0 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -28,9 +28,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 ENET_PAD_CTRL (PAD_CTL_PUS_PU100KOHM | PAD_CTL_DSE_3P3V_49OHM) #define ENET_PAD_CTRL_MII (PAD_CTL_DSE_3P3V_32OHM)
@@ -118,20 +115,6 @@ static iomux_v3_cfg_t const uart5_pads[] = { MX7D_PAD_I2C4_SDA__UART5_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };
-static iomux_v3_cfg_t const usdhc3_emmc_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_GPIO1_IO14__GPIO1_IO14 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
#ifdef CONFIG_FEC_MXC static iomux_v3_cfg_t const fec1_pads[] = { MX7D_PAD_SD2_CD_B__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_MII), @@ -216,25 +199,6 @@ static void setup_iomux_uart(void) imx_iomux_v3_setup_multiple_pads(uart5_pads, ARRAY_SIZE(uart5_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_emmc_pads, ARRAY_SIZE(usdhc3_emmc_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(); diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 80f5739..0d1c56b 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -23,6 +23,7 @@ CONFIG_SPL_USB_HOST_SUPPORT=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_OF_CONTROL=y +CONFIG_DM_MMC=y
After converting to the other imx7d pico defconfigs you can add:
Reviewed-by: Fabio Estevam festevam@gmail.com

Hi Fabio
I am preparing the next and I hope to be able to send it soon. give me the instructions to follow and I will add them
Joris
On 14 Feb 2019, at 13:14, Fabio Estevam festevam@gmail.com wrote:
On Sun, Jan 20, 2019 at 7:52 PM Joris Offouga offougajoris@gmail.com wrote:
Furthermore this patch create un alias for mmc0 to usdch3 because before the convertion he was the only one described in the pico-imx7d.c.
Signed-off-by: Joris Offouga offougajoris@gmail.com
arch/arm/dts/imx7d-pico-pi.dts | 4 ++++ board/technexion/pico-imx7d/pico-imx7d.c | 36 -------------------------------- configs/pico-pi-imx7d_defconfig | 1 + 3 files changed, 5 insertions(+), 36 deletions(-)
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts index 66ca590..d4aca96 100644 --- a/arch/arm/dts/imx7d-pico-pi.dts +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -8,6 +8,10 @@ model = "TechNexion PICO-IMX7D Board and PI baseboard"; compatible = "technexion,imx7d-pico-pi", "fsl,imx7d";
aliases {
mmc0 = &usdhc3;
};
leds { compatible = "gpio-leds"; pinctrl-names = "default";
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 53e1469..48e90b0 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -28,9 +28,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 ENET_PAD_CTRL (PAD_CTL_PUS_PU100KOHM | PAD_CTL_DSE_3P3V_49OHM) #define ENET_PAD_CTRL_MII (PAD_CTL_DSE_3P3V_32OHM)
@@ -118,20 +115,6 @@ static iomux_v3_cfg_t const uart5_pads[] = { MX7D_PAD_I2C4_SDA__UART5_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };
-static iomux_v3_cfg_t const usdhc3_emmc_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_GPIO1_IO14__GPIO1_IO14 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
#ifdef CONFIG_FEC_MXC static iomux_v3_cfg_t const fec1_pads[] = { MX7D_PAD_SD2_CD_B__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_MII), @@ -216,25 +199,6 @@ static void setup_iomux_uart(void) imx_iomux_v3_setup_multiple_pads(uart5_pads, ARRAY_SIZE(uart5_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_emmc_pads, ARRAY_SIZE(usdhc3_emmc_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(); diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 80f5739..0d1c56b 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -23,6 +23,7 @@ CONFIG_SPL_USB_HOST_SUPPORT=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_OF_CONTROL=y +CONFIG_DM_MMC=y
After converting to the other imx7d pico defconfigs you can add:
Reviewed-by: Fabio Estevam festevam@gmail.com

Hi Joris,
On Thu, Feb 14, 2019 at 10:15 AM Offouga Joris offougajoris@gmail.com wrote:
Hi Fabio
I am preparing the next and I hope to be able to send it soon. give me the instructions to follow and I will add them
Please check the series I have just sent converting pico-mx6ul boards.
If you have any questions, just let me know.
Regards,
Fabio Estevam

Le 14/02/2019 à 13:58, Fabio Estevam a écrit :
Hi Joris,
On Thu, Feb 14, 2019 at 10:15 AM Offouga Joris offougajoris@gmail.com wrote:
Hi Fabio
I am preparing the next and I hope to be able to send it soon. give me the instructions to follow and I will add them
Please check the series I have just sent converting pico-mx6ul boards.
If you have any questions, just let me know.
Since I do not convert the pmic, I do not convert the i2c either ?
Regards,
Joris Offouga
Regards,
Fabio Estevam

Hi Joris,
On Thu, Feb 14, 2019 at 2:42 PM Joris Offouga offougajoris@gmail.com wrote:
Since I do not convert the pmic, I do not convert the i2c either ?
I think it is OK to convert I2C now.
Thanks

Hi Fabio
On 14 Feb 2019, at 17:48, Fabio Estevam festevam@gmail.com wrote:
Hi Joris,
On Thu, Feb 14, 2019 at 2:42 PM Joris Offouga offougajoris@gmail.com wrote:
Since I do not convert the pmic, I do not convert the i2c either ?
I think it is OK to convert I2C now.
it is not possible to convert that i2c and do not convert the pmic. on the other hand, even without pmic and usb conversion there is always the dfu error when i try to update u-boot via sudo dfu-util -D u-boot-dtb.img -a u-boot .
See this error : Request would exceed designated area! #Deferred dfu_flush() failed!=>
Thanks for your help
Thanks

Hi Joris,
On Thu, Feb 14, 2019 at 8:46 PM Joris Offouga offougajoris@gmail.com wrote:
it is not possible to convert that i2c and do not convert the pmic. on
Ok, we can skip I2C and PMIC for now.
the other hand, even without pmic and usb conversion there is always the dfu error when i try to update u-boot via sudo dfu-util -D u-boot-dtb.img -a u-boot .
See this error : Request would exceed designated area! #Deferred dfu_flush() failed!=>
Do you only see this error after the DM conversion?
I haven't tried dfu yet on your tree. Will try it tomorrow.

Le 15/02/2019 à 00:08, Fabio Estevam a écrit :
Hi Joris,
On Thu, Feb 14, 2019 at 8:46 PM Joris Offouga offougajoris@gmail.com wrote:
it is not possible to convert that i2c and do not convert the pmic. on
Ok, we can skip I2C and PMIC for now.
the other hand, even without pmic and usb conversion there is always the dfu error when i try to update u-boot via sudo dfu-util -D u-boot-dtb.img -a u-boot .
See this error : Request would exceed designated area! #Deferred dfu_flush() failed!=>
Do you only see this error after the DM conversion?
Yes it's only after DM conversion
I haven't tried dfu yet on your tree. Will try it tomorrow.
Ok thanks

This commit switches to DM I2C for pico-pi-imx7d.
Signed-off-by: Joris Offouga offougajoris@gmail.com --- board/technexion/pico-imx7d/pico-imx7d.c | 24 ------------------------ configs/pico-pi-imx7d_defconfig | 1 + include/configs/pico-imx7d.h | 5 ----- 3 files changed, 1 insertion(+), 29 deletions(-)
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 48e90b0..cd7d5b1 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -33,26 +33,6 @@ DECLARE_GLOBAL_DATA_PTR;
#define ENET_RX_PAD_CTRL (PAD_CTL_PUS_PU100KOHM | PAD_CTL_DSE_3P3V_49OHM)
-#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) -/* I2C4 for PMIC */ -static struct i2c_pads_info i2c_pad_info4 = { - .scl = { - .i2c_mode = MX7D_PAD_SAI1_RX_SYNC__I2C4_SCL | PC, - .gpio_mode = MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16 | PC, - .gp = IMX_GPIO_NR(6, 16), - }, - .sda = { - .i2c_mode = MX7D_PAD_SAI1_RX_BCLK__I2C4_SDA | PC, - .gpio_mode = MX7D_PAD_SAI1_RX_BCLK__GPIO6_IO17 | PC, - .gp = IMX_GPIO_NR(6, 17), - }, -}; -#endif - int dram_init(void) { gd->ram_size = imx_ddr_size(); @@ -203,10 +183,6 @@ int board_early_init_f(void) { setup_iomux_uart();
-#ifdef CONFIG_SYS_I2C_MXC - setup_i2c(3, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info4); -#endif - return 0; }
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 0d1c56b..dd8af7f 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -27,6 +27,7 @@ CONFIG_DM_MMC=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y # CONFIG_CMD_BOOTD is not set CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_IMI is not set diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h index 1884c58..82c105b 100644 --- a/include/configs/pico-imx7d.h +++ b/include/configs/pico-imx7d.h @@ -117,12 +117,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_MXC_I2C2 -#define CONFIG_SYS_I2C_MXC_I2C3 -#define CONFIG_SYS_I2C_MXC_I2C4 #define CONFIG_SYS_I2C_SPEED 100000
/* PMIC */

On Sun, Jan 20, 2019 at 7:33 PM Joris Offouga offougajoris@gmail.com wrote:
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 0d1c56b..dd8af7f 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -27,6 +27,7 @@ CONFIG_DM_MMC=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y
Please remove CONFIG_SPL_I2C_SUPPORT=y in order to avoid a build warning.

This commit switches to DM UART for pico-imx7d-pico.
Signed-off-by: Joris Offouga offougajoris@gmail.com --- arch/arm/dts/imx7d-pico-pi.dts | 4 ++++ configs/pico-pi-imx7d_defconfig | 1 + 2 files changed, 5 insertions(+)
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts index d4aca96..806a2f9 100644 --- a/arch/arm/dts/imx7d-pico-pi.dts +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -12,6 +12,10 @@ mmc0 = &usdhc3; };
+ chosen { + stdout-path = &uart5; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index dd8af7f..868abb0 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -28,6 +28,7 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y +CONFIG_DM_SERIAL=y # CONFIG_CMD_BOOTD is not set CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_IMI is not set

On Sun, Jan 20, 2019 at 7:56 PM Joris Offouga offougajoris@gmail.com wrote:
This commit switches to DM UART for pico-imx7d-pico.
Signed-off-by: Joris Offouga offougajoris@gmail.com
arch/arm/dts/imx7d-pico-pi.dts | 4 ++++ configs/pico-pi-imx7d_defconfig | 1 + 2 files changed, 5 insertions(+)
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts index d4aca96..806a2f9 100644 --- a/arch/arm/dts/imx7d-pico-pi.dts +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -12,6 +12,10 @@ mmc0 = &usdhc3; };
chosen {
stdout-path = &uart5;
- };
leds { compatible = "gpio-leds"; pinctrl-names = "default";
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index dd8af7f..868abb0 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -28,6 +28,7 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y +CONFIG_DM_SERIAL=y
After converting the other imx7 pico defconfigs you can add:
Reviewed-by: Fabio Estevam festevam@gmail.com

This patch converts the pico-pi-imx7d to use the DM PMIC model.
Signed-off-by: Joris Offouga offougajoris@gmail.com --- board/technexion/pico-imx7d/pico-imx7d.c | 44 ++++++++++++-------------------- configs/pico-pi-imx7d_defconfig | 6 +++++ include/configs/pico-imx7d.h | 6 ----- 3 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index cd7d5b1..095242d 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -40,47 +40,37 @@ int dram_init(void) return 0; }
-#ifdef CONFIG_POWER -#define I2C_PMIC 3 +#ifdef CONFIG_DM_PMIC int power_init_board(void) { - struct pmic *p; - int ret; - unsigned int reg, rev_id; + struct udevice *dev; + int ret=0, dev_id=0, rev_id=0, reg=0;
- ret = power_pfuze3000_init(I2C_PMIC); - if (ret) - return ret; + ret = pmic_get("pfuze3000", &dev); + if (ret == -ENODEV) + return 0; + if (ret != 0)
- p = pmic_get("PFUZE3000"); - ret = pmic_probe(p); - if (ret) - return ret; - - pmic_reg_read(p, PFUZE3000_DEVICEID, ®); - pmic_reg_read(p, 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_read(p, PFUZE3000_LDOGCTL, ®); - reg |= 0x1; - pmic_reg_write(p, PFUZE3000_LDOGCTL, reg); + pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
/* SW1A/1B mode set to APS/APS */ - reg = 0x8; - pmic_reg_write(p, PFUZE3000_SW1AMODE, reg); - pmic_reg_write(p, PFUZE3000_SW1BMODE, reg); + pmic_reg_write(dev, PFUZE3000_SW1AMODE, 0x8); + pmic_reg_write(dev, PFUZE3000_SW1BMODE, 0x8);
/* SW1A/1B standby voltage set to 1.025V */ - reg = 0xd; - pmic_reg_write(p, PFUZE3000_SW1ASTBY, reg); - pmic_reg_write(p, PFUZE3000_SW1BSTBY, reg); + pmic_reg_write(dev, PFUZE3000_SW1ASTBY, 0xd); + pmic_reg_write(dev, PFUZE3000_SW1BSTBY, 0xd);
/* decrease SW1B normal voltage to 0.975V */ - pmic_reg_read(p, PFUZE3000_SW1BVOLT, ®); + reg = pmic_reg_read(dev, PFUZE3000_SW1BVOLT); reg &= ~0x1f; reg |= PFUZE3000_SW1AB_SETP(975); - pmic_reg_write(p, PFUZE3000_SW1BVOLT, reg); + pmic_reg_write(dev, PFUZE3000_SW1BVOLT, reg);
return 0; } diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 868abb0..24467bd 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -29,6 +29,12 @@ CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y CONFIG_DM_SERIAL=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 # CONFIG_CMD_BOOTD is not set CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_IMI is not set diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h index 82c105b..577cd13 100644 --- a/include/configs/pico-imx7d.h +++ b/include/configs/pico-imx7d.h @@ -120,12 +120,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 - /* FLASH and environment organization */ #define CONFIG_ENV_SIZE SZ_8K

On Sun, Jan 20, 2019 at 8:14 PM Joris Offouga offougajoris@gmail.com wrote:
This patch converts the pico-pi-imx7d to use the DM PMIC model.
Signed-off-by: Joris Offouga offougajoris@gmail.com
board/technexion/pico-imx7d/pico-imx7d.c | 44 ++++++++++++-------------------- configs/pico-pi-imx7d_defconfig | 6 +++++ include/configs/pico-imx7d.h | 6 ----- 3 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index cd7d5b1..095242d 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -40,47 +40,37 @@ int dram_init(void) return 0; }
-#ifdef CONFIG_POWER -#define I2C_PMIC 3 +#ifdef CONFIG_DM_PMIC int power_init_board(void) {
struct pmic *p;
int ret;
unsigned int reg, rev_id;
struct udevice *dev;
int ret=0, dev_id=0, rev_id=0, reg=0;
ret = power_pfuze3000_init(I2C_PMIC);
if (ret)
return ret;
ret = pmic_get("pfuze3000", &dev);
if (ret == -ENODEV)
return 0;
if (ret != 0)
p = pmic_get("PFUZE3000");
ret = pmic_probe(p);
if (ret)
return ret;
pmic_reg_read(p, PFUZE3000_DEVICEID, ®);
pmic_reg_read(p, 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_read(p, PFUZE3000_LDOGCTL, ®);
reg |= 0x1;
pmic_reg_write(p, PFUZE3000_LDOGCTL, reg);
pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
The mask 0 does not look correct. I will fix it in the warp board code as well.
You could simply write: pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 1, 1);
or keep using pmic_reg_read(), modify and pmic_reg_write().

Furthermore this patch create a aliase for usb0 to usbotg1. This usb is used for mass storage and dfu.
Signed-off-by: Joris Offouga offougajoris@gmail.com --- arch/arm/dts/imx7d-pico-pi.dts | 1 + configs/pico-pi-imx7d_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/arch/arm/dts/imx7d-pico-pi.dts b/arch/arm/dts/imx7d-pico-pi.dts index 806a2f9..347f165 100644 --- a/arch/arm/dts/imx7d-pico-pi.dts +++ b/arch/arm/dts/imx7d-pico-pi.dts @@ -10,6 +10,7 @@
aliases { mmc0 = &usdhc3; + usb0 = &usbotg1; };
chosen { diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 24467bd..7f5c2e8 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -29,6 +29,7 @@ CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y CONFIG_DM_SERIAL=y +CONFIG_DM_USB=y CONFIG_DM_PMIC=y CONFIG_DM_PMIC_PFUZE100=y CONFIG_DM_REGULATOR=y

Furthermore this patch fix request gpio_direction_ouput with gpio_request require because DM GPIO is enable
Signed-off-by: Joris Offouga offougajoris@gmail.com --- board/technexion/pico-imx7d/pico-imx7d.c | 1 + configs/pico-pi-imx7d_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 095242d..cfe6ce3 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -111,6 +111,7 @@ static void setup_iomux_fec(void) { imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));
+ gpio_request(FEC1_RST_GPIO, "phy_rst"); gpio_direction_output(FEC1_RST_GPIO, 0); udelay(500); gpio_set_value(FEC1_RST_GPIO, 1); diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig index 7f5c2e8..ab34382 100644 --- a/configs/pico-pi-imx7d_defconfig +++ b/configs/pico-pi-imx7d_defconfig @@ -29,6 +29,7 @@ CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y CONFIG_DM_SERIAL=y +CONFIG_DM_ETH=y CONFIG_DM_USB=y CONFIG_DM_PMIC=y CONFIG_DM_PMIC_PFUZE100=y
participants (6)
-
Bryan O'Donoghue
-
Fabio Estevam
-
Joris Offouga
-
jorisoffouga
-
Offouga Joris
-
Otavio Salvador