Page MenuHomeFreeBSD

clk_div: Add a div lookup table
ClosedPublic

Authored by manu on Dec 8 2016, 12:05 PM.
Tags
Referenced Files
Unknown Object (File)
Fri, Apr 26, 7:29 AM
Unknown Object (File)
Sat, Apr 20, 2:27 PM
Unknown Object (File)
Sat, Apr 20, 2:10 PM
Unknown Object (File)
Mar 26 2024, 1:36 PM
Unknown Object (File)
Mar 15 2024, 1:55 PM
Unknown Object (File)
Mar 15 2024, 1:51 PM
Unknown Object (File)
Feb 11 2024, 3:47 PM
Unknown Object (File)
Jan 9 2024, 5:42 AM
Subscribers

Details

Summary

Some clocks on SoC have a diff between the value written in the register and the real divider. Add a table that where we can lookup the real value of the divider.
Allwinner have those and since I'm pretty sure that it's kinda standard make it generic.

Test Plan

Tested on Allwinner H3 which have a div table for APB1.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu retitled this revision from to clk_div: Add a div lookup table .
manu updated this object.
manu edited the test plan for this revision. (Show Details)
manu added a reviewer: mmel.
manu set the repository for this revision to rS FreeBSD src repository - subversion.
manu added a project: ARM.
manu added a subscriber: ARM.
mmel edited edge metadata.

See a small inline comment.
Also, please use full diff (-U9999999) next time. The full context is exceptionally easier for review.

sys/dev/extres/clk/clk_div.c
137 ↗(On Diff #22757)

Panic (or report error) here if divider value is not found in table. Although we have check for divider == 0 in clknode_div_recalc(), it's better to report problem immediately...

This revision is now accepted and ready to land.Dec 9 2016, 4:56 AM
sys/dev/extres/clk/clk_div.c
137 ↗(On Diff #22757)

I didn't put a warn because of the check in recalc but I guess a panic in init would be better

This revision was automatically updated to reflect the committed changes.