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)
Nov 11 2024, 11:47 AM
Unknown Object (File)
Sep 27 2024, 3:24 PM
Unknown Object (File)
Sep 27 2024, 1:14 PM
Unknown Object (File)
Sep 25 2024, 1:10 AM
Unknown Object (File)
Sep 24 2024, 8:02 PM
Unknown Object (File)
Sep 24 2024, 8:02 PM
Unknown Object (File)
Sep 24 2024, 8:02 PM
Unknown Object (File)
Sep 23 2024, 8:50 PM
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.