diff mbox series

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

Message ID 20191219175942.3915-1-festevam@gmail.com
State Accepted
Commit 7ab832e409258ec3ff6b024815baa02eac71a0e6
Delegated to: Stefano Babic
Headers show
Series [1/2] pfuze: Fix the pmic_get() parameter in the DM case | expand

Commit Message

Fabio Estevam Dec. 19, 2019, 5:59 p.m. UTC
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(-)

Comments

Igor Opaniuk Dec. 20, 2019, 2:30 p.m. UTC | #1
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
Fabio Estevam Dec. 20, 2019, 6 p.m. UTC | #2
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
Stefano Babic Dec. 28, 2019, 10:48 a.m. UTC | #3
> 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
diff mbox series

Patch

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;