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.
Details
Details
- Reviewers
mmel - Commits
- rS309894: clk_div: Add a div lookup table
Tested on Allwinner H3 which have a div table for APB1.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
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 | 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... |
sys/dev/extres/clk/clk_div.c | ||
---|---|---|
137 | I didn't put a warn because of the check in recalc but I guess a panic in init would be better |