[PATCH 1/5] mmc: fsl_esdhc_imx: Enable AHB/IPG clk
Peng Fan
peng.fan at nxp.com
Tue Oct 1 13:20:49 CEST 2024
> Subject: Re: [PATCH 1/5] mmc: fsl_esdhc_imx: Enable AHB/IPG clk
>
> Hi Peng,
>
> On Mon, Sep 30, 2024 at 2:47 AM Peng Fan (OSS)
> <peng.fan at oss.nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan at nxp.com>
> >
> > Only enable PER clk is not enough, also need to enable AHB/IPG clk.
>
> Currently, the driver is working and now extra clocks need to be turned
> on.
>
> Please provide more details here as to why this is a problem now and it
> wasn't before.
With partition reset supported, when SPL rerun after partition reset,
the mmc clk may already be disabled in linux mmc runtime suspend.
So need to enable all the clks for mmc in SPL/U-boot.
>
> > #if CONFIG_IS_ENABLED(CLK)
> > /* Assigned clock already set clock */
> > + ret = clk_get_by_name(dev, "ipg", &priv->ipg_clk);
> > + if (!ret) {
> > + ret = clk_enable(&priv->ipg_clk);
> > + if (ret) {
> > + printf("Failed to enable ipg_clk\n");
> > + return ret;
> > + }
> > + }
> > +
> > + ret = clk_get_by_name(dev, "ahb", &priv->ahb_clk);
> > + if (!ret) {
> > + ret = clk_enable(&priv->ahb_clk);
> > + if (ret) {
> > + printf("Failed to enable ahb_clk\n");
> > + return ret;
>
> In the case of failure, the previously enabled clock must be disabled.
>
> Would it be better to use clk_enable_bulk() here instead?
I will give a look at this.
Thanks,
Peng.
More information about the U-Boot
mailing list