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)
Sun, Jun 22, 2:58 PM
Unknown Object (File)
Sat, Jun 21, 10:13 AM
Unknown Object (File)
Mon, Jun 9, 11:06 PM
Unknown Object (File)
Sun, Jun 1, 7:29 PM
Unknown Object (File)
May 31 2025, 11:30 AM
Unknown Object (File)
Apr 26 2025, 9:24 AM
Unknown Object (File)
Apr 19 2025, 3:01 AM
Unknown Object (File)
Apr 14 2025, 10:12 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