We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sysctl_cpu_set_freq
sysctl_clock_get_freq
I'm not sure whether the implemention of sysctl_cpu_set_freq is right.
Not sure
In sysctl_cpu_set_freq, we set the pll0 like this:
sysctl_pll_set_freq(SYSCTL_PLL0, (sysctl->clk_sel0.aclk_divider_sel + 1) * 2 * freq);
So PLL0_freq = (sysctl->clk_sel0.aclk_divider_sel + 1) * 2 * CPU_FREQ, ie. CPU_FREQ = PLL0_freq / (2 * (sysctl->clk_sel0.aclk_divider_sel + 1))
PLL0_freq = (sysctl->clk_sel0.aclk_divider_sel + 1) * 2 * CPU_FREQ
CPU_FREQ = PLL0_freq / (2 * (sysctl->clk_sel0.aclk_divider_sel + 1))
But in sysctl_clock_get_freq:
case SYSCTL_CLOCK_CPU: // ... source = sysctl_clock_source_get_freq(SYSCTL_SOURCE_PLL0) / (2ULL << sysctl_clock_get_threshold(SYSCTL_THRESHOLD_ACLK));
sysctl_clock_get_threshold(SYSCTL_THRESHOLD_ACLK) eval to sysctl->clk_sel0.aclk_divider_sel here
sysctl_clock_get_threshold(SYSCTL_THRESHOLD_ACLK)
sysctl->clk_sel0.aclk_divider_sel
So we have: CPU_FREQ = PLL0_freq / (2 << sysctl->clk_sel0.aclk_divider_sel)
CPU_FREQ = PLL0_freq / (2 << sysctl->clk_sel0.aclk_divider_sel)
Which is obviously different with the first fomula.
Did I missunderstood these code?
master
NA
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm not sure whether the implemention of
sysctl_cpu_set_freq
is right.Expected behavior
Not sure
Actual behavior
Not sure
Code
In
sysctl_cpu_set_freq
, we set the pll0 like this:So
PLL0_freq = (sysctl->clk_sel0.aclk_divider_sel + 1) * 2 * CPU_FREQ
, ie.CPU_FREQ = PLL0_freq / (2 * (sysctl->clk_sel0.aclk_divider_sel + 1))
But in
sysctl_clock_get_freq
:sysctl_clock_get_threshold(SYSCTL_THRESHOLD_ACLK)
eval tosysctl->clk_sel0.aclk_divider_sel
hereSo we have:
CPU_FREQ = PLL0_freq / (2 << sysctl->clk_sel0.aclk_divider_sel)
Which is obviously different with the first fomula.
Did I missunderstood these code?
Document version
master
Hardware
NA
System
NA
The text was updated successfully, but these errors were encountered: