[PATCH] power: pmic: rk8xx: Workaround pmic failure when probed before relocation
Simon Glass
sjg at chromium.org
Fri Aug 5 18:48:26 CEST 2022
Hi Michal,
On Fri, 5 Aug 2022 at 05:32, Michal Suchanek <msuchanek at suse.de> wrote:
>
> When the sysreset is added as child of the pmic the pmic is probed
> before relocation. That probe fails, and subsequent attempts to probe
> after reloaction fail as well.
>
> As a workaround do not bind the sysreset before relocation.
>
> Signed-off-by: Michal Suchanek <msuchanek at suse.de>
> ---
> drivers/power/pmic/rk8xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
> index a239a18674..d12263c4f2 100644
> --- a/drivers/power/pmic/rk8xx.c
> +++ b/drivers/power/pmic/rk8xx.c
> @@ -131,7 +131,7 @@ static int rk8xx_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
>
> static int rk8xx_bind(struct udevice *dev)
> {
> - if (CONFIG_IS_ENABLED(SYSRESET)) {
> + if (CONFIG_IS_ENABLED(SYSRESET) && (gd->flags & GD_FLG_RELOC)) {
> device_bind_driver(dev, "rk8xx_sysreset",
> "rk8xx_sysreset", NULL);
> }
> --
> 2.37.1
>
I think it is OK to avoid starting a device before relocation, or make
that device do something different. I really don't like the binding
being optional though...we have the 'u-boot,dm-pre-reloc' for that.
But missing from your commit message is exactly what fails?
Regards,
Simon
More information about the U-Boot
mailing list