[PATCH V4] clk: clk_versaclock: Add support for versaclock driver

Adam Ford aford173 at gmail.com
Wed Dec 1 20:25:09 CET 2021


On Wed, Dec 1, 2021 at 1:11 PM Sean Anderson <seanga2 at gmail.com> wrote:
>
> Hi Adam,
>
> On 6/4/21 1:26 PM, Adam Ford wrote:
> > +/*
> > + * The device references to the Versaclock point to the head, so xlate needs to
> > + * redirect it to clk_out[idx]
> > + */
> > +static int vc5_clk_out_xlate(struct clk *hw, struct ofnode_phandle_args *args)
> > +{
> > +     unsigned int idx = args->args[0];
> > +
> > +     if (args->args_count != 1) {
> > +             debug("Invaild args_count: %d\n", args->args_count);
> > +             return -EINVAL;
> > +     }
> > +
> > +     hw->id = idx;
> > +
> > +     return 0;
> > +}
>
> Can you explain a bit more why this is needed? I looked it over a few
> times, and I'm not sure what it does differently from
> clk_of_xlate_default.

If memory serves, the indices were starting at 0 instead of 1.  To
match what Lniux does we I need to switch the index to be 1,2,3,4
instead of 0,1,2,3 since there is an OUT0.  It's been a while since I
did this, so I don't fully remember.
If you have good success removing it and using the
clk_of_xlate_default, I'm willing to test it to make sure it doesn't
break my board so we can remove it.

adam
>
> --Sean


More information about the U-Boot mailing list