[PATCH 1/2] pfuze: Fix the pmic_get() parameter in the DM case

Currently the following hang is observed when booting a imx6sx-sdb board:
U-Boot 2020.01-rc5-00004-g643366bcd5 (Dec 19 2019 - 14:56:23 -0300)
CPU: Freescale i.MX6SX rev1.0 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 32C Reset cause: POR Model: Freescale i.MX6 SoloX SDB RevB Board Board: MX6SX SABRE SDB revA DRAM: 1 GiB initcall sequence bffd8514 failed at call 87804cc0 (err=-19) ### ERROR ### Please RESET the board ###
When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address.
Fix the pmic_get() parameter to fix the boot regression.
Tested on a imx6sx-sdb and imx6q-sabresd boards.
Signed-off-by: Fabio Estevam festevam@gmail.com --- board/freescale/common/pfuze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/freescale/common/pfuze.c b/board/freescale/common/pfuze.c index 03ebe4e7b5..6dca22960b 100644 --- a/board/freescale/common/pfuze.c +++ b/board/freescale/common/pfuze.c @@ -136,7 +136,7 @@ struct udevice *pfuze_common_init(void) int ret; unsigned int reg, dev_id, rev_id;
- ret = pmic_get("pfuze100", &dev); + ret = pmic_get("pfuze100@8", &dev); if (ret == -ENODEV) return NULL;

After the DM conversion the boot SD card is now device 3.
Adjust it so that we can boot the kernel again.
While at it avoid a hardcoded mmc dev inside the finduuid script.
Signed-off-by: Fabio Estevam festevam@gmail.com --- include/configs/mx6sxsabresd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 704d9f3dcb..55aace1c6e 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -54,9 +54,9 @@ "boot_fdt=try\0" \ "ip_dyn=yes\0" \ "videomode=video=ctfb:x:800,y:480,depth:24,pclk:29850,le:89,ri:164,up:23,lo:10,hs:10,vs:10,sync:0,vmode:0\0" \ - "mmcdev=2\0" \ + "mmcdev=3\0" \ "mmcpart=1\0" \ - "finduuid=part uuid mmc 2:2 uuid\0" \ + "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ "root=PARTUUID=${uuid} rootwait rw\0" \ "loadbootscript=" \

After the DM conversion the boot SD card is now device 3. Adjust it so that we can boot the kernel again. While at it avoid a hardcoded mmc dev inside the finduuid script. Signed-off-by: Fabio Estevam festevam@gmail.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

Hi Fabio,
On Thu, Dec 19, 2019 at 8:00 PM Fabio Estevam festevam@gmail.com wrote:
Currently the following hang is observed when booting a imx6sx-sdb board:
U-Boot 2020.01-rc5-00004-g643366bcd5 (Dec 19 2019 - 14:56:23 -0300)
CPU: Freescale i.MX6SX rev1.0 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 32C Reset cause: POR Model: Freescale i.MX6 SoloX SDB RevB Board Board: MX6SX SABRE SDB revA DRAM: 1 GiB initcall sequence bffd8514 failed at call 87804cc0 (err=-19) ### ERROR ### Please RESET the board ###
When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address.
Fix the pmic_get() parameter to fix the boot regression.
Tested on a imx6sx-sdb and imx6q-sabresd boards.
Signed-off-by: Fabio Estevam festevam@gmail.com
board/freescale/common/pfuze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/freescale/common/pfuze.c b/board/freescale/common/pfuze.c index 03ebe4e7b5..6dca22960b 100644 --- a/board/freescale/common/pfuze.c +++ b/board/freescale/common/pfuze.c @@ -136,7 +136,7 @@ struct udevice *pfuze_common_init(void) int ret; unsigned int reg, dev_id, rev_id;
ret = pmic_get("pfuze100", &dev);
ret = pmic_get("pfuze100@8", &dev); if (ret == -ENODEV) return NULL;
-- 2.17.1
Reviewed-by: Igor Opaniuk igor.opaniuk@toradex.com
BTW, there're also other potential places with the same problem:
$ grep -ne pmic_get -r ./board/freescale ./board/freescale/mx6sllevk/mx6sllevk.c:60: ret = pmic_get("pfuze100", &dev); ./board/freescale/imx8mq_evk/spl.c:165: p = pmic_get("PFUZE100"); ./board/freescale/mx53loco/mx53loco.c:208: p = pmic_get("DIALOG_PMIC"); ./board/freescale/mx53loco/mx53loco.c:251: p = pmic_get("FSL_PMIC"); ./board/freescale/mx51evk/mx51evk.c:182: p = pmic_get("FSL_PMIC"); ./board/freescale/mx6sxsabreauto/mx6sxsabreauto.c:138: ret = pmic_get("pfuze100", &dev); ./board/freescale/imx8mm_evk/spl.c:90: ret = pmic_get("pmic@4b", &dev); ./board/freescale/common/pfuze.c:60: p = pmic_get("PFUZE100"); ./board/freescale/common/pfuze.c:139: ret = pmic_get("pfuze100", &dev); ./board/freescale/common/mc34vr500.c:35: p = pmic_get("MC34VR500"); ./board/freescale/common/mc34vr500.c:72: p = pmic_get("MC34VR500"); ./board/freescale/mx6slevk/mx6slevk.c:148: ret = pmic_get("pfuze100", &dev); ./board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c:75: ret = pmic_get("pfuze3000", &dev); ./board/freescale/mx31pdk/mx31pdk.c:92: p = pmic_get("FSL_PMIC"); ./board/freescale/mx7dsabresd/mx7dsabresd.c:329: ret = pmic_get("pfuze3000", &dev); ./board/freescale/mx25pdk/mx25pdk.c:145: p = pmic_get("FSL_PMIC"); ./board/freescale/mx35pdk/mx35pdk.c:191: struct pmic *p = pmic_get("FSL_PMIC"); ./board/freescale/mx35pdk/mx35pdk.c:224: p = pmic_get("FSL_PMIC"); ./board/freescale/mx53evk/mx53evk.c:88: p = pmic_get("FSL_PMIC");
Thanks

Hi Igor,
On Fri, Dec 20, 2019 at 11:30 AM Igor Opaniuk igor.opaniuk@gmail.com wrote:
BTW, there're also other potential places with the same problem:
Thanks, only the DM usage needs to be fixed. I will send a series fixing them.
$ grep -ne pmic_get -r ./board/freescale ./board/freescale/mx6sllevk/mx6sllevk.c:60: ret = pmic_get("pfuze100", &dev);
Done.
./board/freescale/mx6sxsabreauto/mx6sxsabreauto.c:138: ret = pmic_get("pfuze100", &dev);
pmic node is not passed in the device tree from U-Boot.
Will sync with the upstream dts and will fix it after 2020.01.
./board/freescale/mx6slevk/mx6slevk.c:148: ret = pmic_get("pfuze100", &dev);
Done.
./board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c:75: ret = pmic_get("pfuze3000", &dev);
No PMIC on this board. Will remove it after 2020.01.
./board/freescale/mx7dsabresd/mx7dsabresd.c:329: ret = pmic_get("pfuze3000", &dev);
Done.
Thanks

Currently the following hang is observed when booting a imx6sx-sdb board: U-Boot 2020.01-rc5-00004-g643366bcd5 (Dec 19 2019 - 14:56:23 -0300) CPU: Freescale i.MX6SX rev1.0 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 32C Reset cause: POR Model: Freescale i.MX6 SoloX SDB RevB Board Board: MX6SX SABRE SDB revA DRAM: 1 GiB initcall sequence bffd8514 failed at call 87804cc0 (err=-19) ### ERROR ### Please RESET the board ### When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address. Fix the pmic_get() parameter to fix the boot regression. Tested on a imx6sx-sdb and imx6q-sabresd boards. Signed-off-by: Fabio Estevam festevam@gmail.com Reviewed-by: Igor Opaniuk igor.opaniuk@toradex.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic
participants (3)
-
Fabio Estevam
-
Igor Opaniuk
-
sbabic@denx.de