[PATCH v5 2/5] serial: lpuart: use ipg clk for i.MX7ULP
Peng Fan
peng.fan at nxp.com
Fri Apr 12 14:34:56 CEST 2024
> Subject: Re: [PATCH v5 2/5] serial: lpuart: use ipg clk for i.MX7ULP
>
> Hi Peng,
>
> On Thu, Apr 11, 2024 at 12:23 AM Peng Fan (OSS) <peng.fan at oss.nxp.com>
> wrote:
> >
> > From: Peng Fan <peng.fan at nxp.com>
> >
> > To i.MX7ULP compatible lpuart, there is only ipg clk, no per clk.
> > So add a devtype check for i.MX7ULP.
> >
> > Signed-off-by: Peng Fan <peng.fan at nxp.com>
> > ---
> > drivers/serial/serial_lpuart.c | 28 +++++++++++++++++++---------
> > 1 file changed, 19 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/serial/serial_lpuart.c
> > b/drivers/serial/serial_lpuart.c index ce08a6b4486..891352293f9 100644
> > --- a/drivers/serial/serial_lpuart.c
> > +++ b/drivers/serial/serial_lpuart.c
> > @@ -111,11 +111,18 @@ u32 __weak get_lpuart_clk(void) #if
> > CONFIG_IS_ENABLED(CLK) static int get_lpuart_clk_rate(struct udevice
> > *dev, u32 *clk) {
> > + struct lpuart_serial_plat *plat = dev_get_plat(dev);
> > struct clk per_clk;
>
> You ignored my previous comment. Here I go again:
>
> Please rename 'per_clk' to 'clk'.
Sorry for that. I will fix in v6.
>
> > ulong rate;
> > int ret;
> > + char *name;
> > +
> > + if (plat->devtype == DEV_MX7ULP)
> > + name = "ipg";
> > + else
> > + name = "per";
> >
> > - ret = clk_get_by_name(dev, "per", &per_clk);
> > + ret = clk_get_by_name(dev, name, &per_clk);
>
> ... because it is confusing that per_clk can be ipg or per clock.
Yeah.
>
> > if (ret) {
> > dev_err(dev, "Failed to get per clk: %d\n", ret);
>
> And then also change the error message to "clk".
Fix in v6.
Thanks,
Peng.
More information about the U-Boot
mailing list