Re: [PATCH 0/2] Extending PLL LUT for i.MX8MP Samsung HDMI PHY

From: Dominique Martinet
Date: Tue Sep 10 2024 - 21:28:00 EST


Adam Ford wrote on Tue, Sep 10, 2024 at 08:16:04PM -0500:
> > That aside, I see no problem with this, just one meta-comment about
> > adding a link to the script in an external repo: I see some other
> > drivers have python scripts in their trees e.g.
> > drivers/comedi/drivers/ni_routing/tools/*py
> > drivers/gpu/drm/ci/xfails/update-xfails.py
> > drivers/gpu/drm/msm/registers/gen_header.py
> >
> > would it make sense to commit the script here instead of linking to a
> > repo that might be lost in the future?
> >
> > I'm not quite sure what policy the linux repo has here, so leaving that
> > as an open question.
>
> Is there a reason this couldn't be coded in C and used to expand my
> integer calculator series? With that, we could drop the lookup table.

Quoting a previous mail from Frieder:
> I will clean things up a bit and then share what I have. I hope that this
> allows anyone to calculate parameters for their non-standard displays if
> required.
>
> If someone feels extra motivated they could try to calculate the fractional
> parameters at runtime. However I'm not sure that this is feasible. The
> numerical computation of a large number of parameters is quite heavy and it's
> probably not easy to strip the algorithm down to something that can be run on
> the target without too much overhead.

Trying a random frequency with the algorithm he has implemented it
easily takes 10 seconds to run on my imx8mp board, so even if we asssume
C is 3-4 times faster I think the current algorithm is too slow for
runtime and it makes more sense to extended the LUT to me (as long as
the values can be & are checked at least once, which we now can)

The current algorithm brute-forces its way through so there could be a
better way of computing the fractional part of the divider, but I'm not
sure it's worth the effort at this point; I guess it's a good
intellectual challenge though so someone might do it in the future.

--
Dominique