Details
- Reviewers
kp mhorne - Group Reviewers
riscv - Commits
- rG7f59cce2d43d: sifive_prci: Add support for the FU740 PRCI
rG589d8a78a57b: sifive_prci: Add support for the FU740 PRCI
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/riscv/sifive/sifive_prci.c | ||
---|---|---|
230 | Where does the bias of 2 come from? | |
236 | From the clock schematic in the fu740 manual, pcieauxclk is not the child of hfpclk, but rather hfclk. I think the distinction would matter if we ever allow setting the pll clock frequency. | |
360–362 | A lot of blank lines here... maybe lose this one? | |
369 | So, is the generic clk_div class insufficient somehow? |
sys/riscv/sifive/sifive_prci.c | ||
---|---|---|
230 | Short answer: I used the Linux driver to infer the meaning of the register, as the manual is rather lacking in detail (though at least it documents this register unlike some of the others which are undocumented yet referred to by the Linux driver...) The more elaborate answer is you can sort of infer this from the diagram. clktxclk is 0-250MHz and pclk is 0-125MHz, with pclk being clktxclk/N (ignoring buffers). Given the reset value of hfpclk_div is 0, that implies that 0 must mean 2 (as 250/125), and thus all values have an implicit +2 when used. | |
236 | That's a good point, I suspect I just copied this from the divisor clock and failed to notice the subtle difference. Are we fine to assume the name of the clock in the device tree here, or do we need to make it dynamic?.. | |
360–362 | This was to mirror the style in prci_clk_pll_recalc, which I quite like as it separates out the MMIO from the normal calculation from the locking. | |
369 | By default the real divisor is used, and you can also set a flag to have it start from 0, but there's no option to have a bias other than 0/1. |