Skip to contentSkip to conversation

Convert Pico-Pi i.MX7D to DM

RFC New Joris Offouga 4 participants 35 messages Jan 20, 2019 – Feb 14, 2019 9 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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 at 30a70000
Out:   serial at 30a70000
Err:   serial at 30a70000

Net:
Warning: ethernet at 30be0000 using MAC address from ROM
eth0: ethernet at 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
Signature · 1 line
2.7.4
#1 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi

---
 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
arch/arm/dts/imx7d-pico-pi.dts new file +93 -0
new file mode 100644
index 0000000..66ca590
@@ -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 at a {
+		#sound-dai-cells = <0>;
+		reg = <0x0a>;
+		compatible = "fsl,sgtl5000";
+		clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+		VDDA-supply = <&reg_2p5v>;
+		VDDIO-supply = <&reg_vref_1v8>;
+	};
+};
+
+&i2c4 {
+	polytouch: touchscreen at 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
arch/arm/dts/imx7d-pico.dtsi new file +588 -0

589 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 2 lines · Joris Offouga

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

#3 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :

Quoted 11 lines · Joris Offouga
Quoted 3 lines

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

Quoted 6 lines

---
bod
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#4 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 13 lines · jorisoffouga

Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :

Quoted 11 lines · Joris Offouga
Quoted 3 lines

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.

Quoted 6 lines

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.

#5 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 14 lines · Bryan O'Donoghue
Quoted 11 lines · jorisoffouga
Quoted 7 lines · Bryan O'Donoghue
Quoted 5 lines · Joris Offouga

This patch imports the Linux kernel base board imx7d-pico.dtsi and specific dts for imx7d-pico-pi

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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

#6 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 16 lines · Offouga Joris
Quoted 16 lines · Bryan O'Donoghue
Quoted 13 lines · jorisoffouga
Quoted 9 lines · Bryan O'Donoghue
Quoted 5 lines · Joris Offouga

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.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CABymUCNVGCJEQ-fxOYdp-deKLyP9nknfhYNrGZe8R_4wUQf3jg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CABymUCNaiAcb0uiVfcCfBkSVv7zbQiEnF1XXbnENgL7J9uO+yg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CABymUCOuXMYEvOaxsCe--5+WL4A_TC6jNUHYMqpxJ7k-8Y8AdA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CABymUCNyko5QP__=Og77uk2_3R9CEVkcGPKsbjbX_S1VF5BXJA@mail.gmail.com

#16 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 47 lines · Jun Nie
Quoted 42 lines · Joris Offouga <[email protected]> 于2019年1月25日周五 下午8:27写道:
Quoted 41 lines
Quoted 33 lines · Jun Nie
Quoted 28 lines · Joris Offouga <[email protected]> 于2019年1月24日周四 下午9:07写道:
Quoted 28 lines · Jun Nie

Joris Offouga <[email protected]> 于2019年1月24日周四 下午6:30写道:

Quoted 13 lines · Jun Nie
Quoted 13 lines
Quoted 13 lines
Quoted 9 lines

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!"

The result before DM conversion is :

PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Did you have this problem with the warp7 ?

No.

Jun - do you see the above error on the pico ?

No. The only line I see about PMIC is:
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11

Jun

Yes it is the line that appears before the conversion

Jun - do you have the pico board ?

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

Can you help me with the conversion ?

Joris

OK, I can try it. Where can I find a git branch with these patches?

Non, fork the repo and I create a branch on my repo you go?

If you have a preference, tell me

Right, you create a branch, I will clone and test on it.

Quoted 8 lines
Quoted 3 lines

I create a branch pico-imx7d/convert_dm on my github repo :

https://github.com/jorisoffouga/u-boot/tree/pico-imx7d/convert_dm

Hi Joris,

I burn u-boot.img to offset 69KB, but SPL does not boot into u-boot according to log. Not sure

Hi Jun

You have the same behavior as me. For the spl I think it should copy Otavio and Fabio who put it in place.

Quoted 42 lines

U-Boot SPL 2019.01-00273-g3006f29-dirty (Jan 27 2019 - 22:19:00 +0800) Trying to boot from MMC1

If I replace SPL with DCD file for early initilization, I see below log. Suppose it is due to i2c failure.

4474 U-Boot 2019.01-00274-gca08248-dirty (Jan 27 2019 - 22:28:17 +0800) 4475
4476 CPU: Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
4477 CPU: Commercial temperature grade (0C to 95C) at 27C
4478 Reset cause: POR
4479 Model: TechNexion PICO-IMX7D Board and PI baseboard 4480 Board: i.MX7D PICOSOM
4481 DRAM: 512 MiB
4482 read error from device: 9df54458 register: 0x3!
4483 PMIC: PFUZE3000 DEV_ID=0x0 REV_ID=0xfffffffb
4484 read error from device: 9df54458 register: 0x69!
4485 write error to device: 9df54458 register: 0x23!
4486 write error to device: 9df54458 register: 0x31!
4487 write error to device: 9df54458 register: 0x21!
4488 write error to device: 9df54458 register: 0x2f!
4489 read error from device: 9df54458 register: 0x2e!
4490 write error to device: 9df54458 register: 0x2e!
4491 MMC: FSL_SDHC: 2, FSL_SDHC: 1, FSL_SDHC: 0
4492 Loading Environment from MMC... OK

4493 In:    serial at 30a70000
4494 Out:   serial at 30a70000
4495 Err:   serial at 30a70000
4496 Net:   gpio at 30250000: dir_output: error: gpio GPIO6_11 not reserved

4497 gpio at 30250000: set_value: error: gpio GPIO6_11 not reserved 4498 Board Net Initialization Failed
4499 No ethernet found.
4500 Hit any key to stop autoboot: 2 ^H^H^H 1 ^H^H^H 0 4501 Saving Environment to MMC... Writing to MMC(0)... OK 4502 switch to partitions #0, OK
4503 mmc0(part 0) is current device
4504 Scanning mmc 0:1...
4505 Found U-Boot script /boot.scr
4506 830 bytes read in 3 ms (269.5 KiB/s)
4507 ## Executing script at 80800000

Quoted 1 line

Jun

Joris

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Jun

Joris

Quoted 4 lines
Quoted 4 lines

Joris

Quoted 1 line

Jun

reviewer
#17 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

In reply to Bryan O'Donoghue

Hi Bryan and Joris,

Quoted 9 lines · Bryan O'Donoghue

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?

#18 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Hi Fabio

Quoted 41 lines · Fabio Estevam

Hi Bryan and Joris,

Quoted 9 lines · Bryan O'Donoghue

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
Quoted 1 line

Are you sure the PMIC problem happens prior to the DM conversion?

The PMIC problem occurs after the dm conversion

#19 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 1 line · Offouga Joris

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.

Signature · 3 lines
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
#20 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 10 lines · Otavio Salvador
Quoted 3 lines · Offouga Joris

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 ?

Quoted 5 lines
Signature · 4 lines
-- 
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
#21 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Quoted 9 lines · Offouga Joris
Quoted 7 lines · Otavio Salvador
Quoted 2 lines · Offouga Joris

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 ;-)

Signature · 3 lines
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
#22 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Le 31/01/2019 à 13:39, Otavio Salvador a écrit :

Quoted 11 lines · Offouga Joris
Quoted 7 lines
Quoted 6 lines · Otavio Salvador
Quoted 2 lines · Offouga Joris

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

Quoted 1 line
reviewer
#23 lore raw

RFC 1/9 Arm: dts: imx7d-pico: Import Linux pico-pi dts

Hi Joris,

Quoted 5 lines · Joris Offouga

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!

#24 lore raw

RFC 2/9 Arm: imx7d-pico: Add DT file hooks

In reply to Joris Offouga

This patch adds DT file hooks for imx7d-pico-pi.dtb

---
 arch/arm/dts/Makefile           | 3 ++-
 configs/pico-pi-imx7d_defconfig | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/dts/Makefile +2 -1
index b2ca87d..5c87877 100644
@@ -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
 
configs/pico-pi-imx7d_defconfig +2 -1
index 8e48ba7..ce43393 100644
@@ -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
Signature · 1 line
2.7.4
#25 lore raw

RFC 3/9 pico-pi-imx7d: defconfig Enable DM gpio pinctrl and pinctrl_imx7

In reply to Joris Offouga

This patch is necessary for convert pico-pi-imx7 to dm driver model

---
 configs/pico-pi-imx7d_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/pico-pi-imx7d_defconfig +3 -0
index ce43393..80f5739 100644
@@ -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
Signature · 1 line
2.7.4
reviewer
#26 lore raw

RFC 3/9 pico-pi-imx7d: defconfig Enable DM gpio pinctrl and pinctrl_imx7

Quoted 6 lines · Joris Offouga

This patch is necessary for convert pico-pi-imx7 to dm driver model

---
 configs/pico-pi-imx7d_defconfig | 3 +++

Please also convert configs/pico-imx7d_defconfig and configs/pico-hobbit-imx7d_defconfig

#27 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

In reply to Joris Offouga

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.

---
 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(-)
arch/arm/dts/imx7d-pico-pi.dts +4 -0
index 66ca590..d4aca96 100644
@@ -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";
board/technexion/pico-imx7d/pico-imx7d.c +0 -36
index 53e1469..48e90b0 100644
@@ -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();
configs/pico-pi-imx7d_defconfig +1 -0
index 80f5739..0d1c56b 100644
@@ -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
Signature · 1 line
2.7.4
reviewer
#28 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Quoted 92 lines · Joris Offouga

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.

---
 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(-)
arch/arm/dts/imx7d-pico-pi.dts +4 -0
index 66ca590..d4aca96 100644
@@ -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";
board/technexion/pico-imx7d/pico-imx7d.c +0 -36
index 53e1469..48e90b0 100644
@@ -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();
configs/pico-pi-imx7d_defconfig +0 -0
index 80f5739..0d1c56b 100644

configs/pico-pi-imx7d_defconfig CONFIG_SPL_USB_HOST_SUPPORT=y · line 26

Quoted 4 lines
configs/pico-pi-imx7d_defconfig +1 -0
@@ -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:

#29 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

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

Quoted 103 lines · Fabio Estevam
Quoted 94 lines · Joris Offouga

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.

---

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(-)
arch/arm/dts/imx7d-pico-pi.dts +4 -0
index 66ca590..d4aca96 100644
@@ -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";
board/technexion/pico-imx7d/pico-imx7d.c +0 -36
index 53e1469..48e90b0 100644
@@ -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();
configs/pico-pi-imx7d_defconfig +0 -0
index 80f5739..0d1c56b 100644
@@ -23,6 +23,7 @@ CONFIG_SPL_USB_HOST_SUPPORT=y
Quoted 4 lines

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:

reviewer
#30 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Hi Joris,

Quoted 4 lines · Offouga Joris

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

#31 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Le 14/02/2019 à 13:58, Fabio Estevam a écrit :

Quoted 9 lines

Hi Joris,

Quoted 3 lines · Offouga Joris

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

Quoted 4 lines

Regards,

Fabio Estevam

reviewer
#32 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Hi Joris,

Quoted 1 line · Joris Offouga

Since I do not convert the pmic, I do not convert the i2c either ?

I think it is OK to convert I2C now.

Thanks

#33 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Hi Fabio

Quoted 9 lines · Fabio Estevam

Hi Joris,

Quoted 3 lines · Joris Offouga

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

Quoted 2 lines

Thanks

reviewer
#34 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Hi Joris,

Quoted 1 line · Joris Offouga

it is not possible to convert that i2c and do not convert the pmic. on

Ok, we can skip I2C and PMIC for now.

Quoted 7 lines

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.

#35 lore raw

RFC 4/9 arm: imx7d-pico-pi: Convert to DM MMC initialization

Le 15/02/2019 à 00:08, Fabio Estevam a écrit :

Quoted 7 lines

Hi Joris,

Quoted 1 line · Joris Offouga

it is not possible to convert that i2c and do not convert the pmic. on

Ok, we can skip I2C and PMIC for now.

Quoted 8 lines
Quoted 7 lines

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

Quoted 2 lines

I haven't tried dfu yet on your tree. Will try it tomorrow.

Ok thanks

#36 lore raw

RFC 5/9 pico-pi-imx7d: defconfig: Switch to DM for I2C

In reply to Joris Offouga

This commit switches to DM I2C for pico-pi-imx7d.

---
 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(-)
board/technexion/pico-imx7d/pico-imx7d.c +0 -24
index 48e90b0..cd7d5b1 100644
@@ -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;
 }
 
configs/pico-pi-imx7d_defconfig +1 -0
index 0d1c56b..dd8af7f 100644
@@ -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
include/configs/pico-imx7d.h +0 -5
index 1884c58..82c105b 100644
@@ -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 */
Signature · 1 line
2.7.4
reviewer
#37 lore raw

RFC 5/9 pico-pi-imx7d: defconfig: Switch to DM for I2C

configs/pico-pi-imx7d_defconfig CONFIG_DM_MMC=y · line 30

Quoted 9 lines · Joris Offouga
configs/pico-pi-imx7d_defconfig +1 -0
index 0d1c56b..dd8af7f 100644
@@ -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.

#38 lore raw

RFC 6/9 pico-imx7d-pico: defconfig: Switch to DM for UART

In reply to Joris Offouga

This commit switches to DM UART for pico-imx7d-pico.

---
 arch/arm/dts/imx7d-pico-pi.dts  | 4 ++++
 configs/pico-pi-imx7d_defconfig | 1 +
 2 files changed, 5 insertions(+)
arch/arm/dts/imx7d-pico-pi.dts +4 -0
index d4aca96..806a2f9 100644
@@ -12,6 +12,10 @@
 		mmc0 = &usdhc3;
 	};
 
+	chosen {
+         stdout-path = &uart5;
+    };
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
configs/pico-pi-imx7d_defconfig +1 -0
index dd8af7f..868abb0 100644
@@ -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
Signature · 1 line
2.7.4
reviewer
#39 lore raw

RFC 6/9 pico-imx7d-pico: defconfig: Switch to DM for UART

Quoted 29 lines · Joris Offouga

This commit switches to DM UART for pico-imx7d-pico.

---
 arch/arm/dts/imx7d-pico-pi.dts  | 4 ++++
 configs/pico-pi-imx7d_defconfig | 1 +
 2 files changed, 5 insertions(+)
arch/arm/dts/imx7d-pico-pi.dts +4 -0
index d4aca96..806a2f9 100644
@@ -12,6 +12,10 @@
                mmc0 = &usdhc3;
        };
 
+       chosen {
+         stdout-path = &uart5;
+    };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
configs/pico-pi-imx7d_defconfig +0 -0
index dd8af7f..868abb0 100644

configs/pico-pi-imx7d_defconfig CONFIG_PINCTRL=y · line 31

Quoted 4 lines
configs/pico-pi-imx7d_defconfig +1 -0
@@ -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:

#40 lore raw

RFC 7/9 pico-imx7d: Convert to DM PMIC

In reply to Joris Offouga

This patch converts the pico-pi-imx7d to use the DM PMIC model.

---
 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(-)
board/technexion/pico-imx7d/pico-imx7d.c +17 -27
index cd7d5b1..095242d 100644
@@ -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, &reg);
-	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);
-	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);
+	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;
 }
configs/pico-pi-imx7d_defconfig +6 -0
index 868abb0..24467bd 100644
@@ -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
include/configs/pico-imx7d.h +0 -6
index 82c105b..577cd13 100644
@@ -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
 
Signature · 1 line
2.7.4
reviewer
#41 lore raw

RFC 7/9 pico-imx7d: Convert to DM PMIC

Quoted 44 lines · Joris Offouga

This patch converts the pico-pi-imx7d to use the DM PMIC model.

---
 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(-)
board/technexion/pico-imx7d/pico-imx7d.c +7 -15
index cd7d5b1..095242d 100644
@@ -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, &reg);
-       pmic_reg_read(p, PFUZE3000_REVID, &rev_id);

board/technexion/pico-imx7d/pico-imx7d.c int dram_init(void) · line 59

Quoted 10 lines
board/technexion/pico-imx7d/pico-imx7d.c +4 -4
-       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);
-       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().

#42 lore raw

RFC 8/9 arm: pico-pi-imx7d: Convert to DM USB

In reply to Joris Offouga

Furthermore this patch create a aliase for usb0 to usbotg1. This usb is used for mass storage and dfu.

---
 arch/arm/dts/imx7d-pico-pi.dts  | 1 +
 configs/pico-pi-imx7d_defconfig | 1 +
 2 files changed, 2 insertions(+)
arch/arm/dts/imx7d-pico-pi.dts +1 -0
index 806a2f9..347f165 100644
@@ -10,6 +10,7 @@
 
 	aliases {
 		mmc0 = &usdhc3;
+		usb0 = &usbotg1;
 	};
 
 	chosen {
configs/pico-pi-imx7d_defconfig +1 -0
index 24467bd..7f5c2e8 100644
@@ -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
Signature · 1 line
2.7.4
#43 lore raw

RFC 9/9 pico-imx7d: Convert to DM Ethernet

In reply to Joris Offouga

Furthermore this patch fix request gpio_direction_ouput with gpio_request require because DM GPIO is enable

---
 board/technexion/pico-imx7d/pico-imx7d.c | 1 +
 configs/pico-pi-imx7d_defconfig          | 1 +
 2 files changed, 2 insertions(+)
board/technexion/pico-imx7d/pico-imx7d.c +1 -0
index 095242d..cfe6ce3 100644
@@ -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);
configs/pico-pi-imx7d_defconfig +1 -0
index 7f5c2e8..ab34382 100644
@@ -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
Signature · 1 line
2.7.4