Page MenuHomeFreeBSD

imx_clk_composite: Fix up clock selection
Needs ReviewPublic

Authored by thj on Sep 25 2024, 2:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 8:36 AM
Unknown Object (File)
Sat, Nov 9, 7:42 PM
Unknown Object (File)
Sat, Oct 26, 7:20 PM
Unknown Object (File)
Oct 18 2024, 8:29 AM
Unknown Object (File)
Oct 16 2024, 4:31 PM
Unknown Object (File)
Sep 30 2024, 1:36 PM
Unknown Object (File)
Sep 28 2024, 1:22 AM
Unknown Object (File)
Sep 26 2024, 9:54 AM
Subscribers

Details

Reviewers
manu
mmel
andrew
Summary

Fix up the clock selection logic so we are more likely to find a best
parent and update the clock register when we have a new clock.

  • imx_clk_composite_find_best returns 0 on sucess, uninvert the test so we don't skip a successful look up.
  • When we do find a new best parent write out the best divisors rather than the last tested ones.
  • Finally, update the clock register to make the change.

If we don't find a new best_parent this still skips doing anything, @mmel I'm
not sure if returnin an error is best here or trying to do a nop update of the
clock and returning the freq in fout.

Test Plan

This doesn't obviously break anything on my test hardware, but it also doesn't
help with any of my current hardware issues which might be clock related. It
has exposed some missing clocks in the imx8mp_ccm driver, which I have a fix
for in my queue.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59592
Build 56479: arc lint + arc unit