summaryrefslogtreecommitdiff
path: root/bsp/drivers/fe300prci/fe300prci_driver.h
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-02-02 09:56:52 -0800
committerMegan Wachs <megan@sifive.com>2017-02-02 09:56:52 -0800
commit2579554bb17038dffa9af57649c1e83e614efbc6 (patch)
tree2417afa19395af72f7491ebeb80d0a28e1a87f30 /bsp/drivers/fe300prci/fe300prci_driver.h
parentaa8db702f0f35cc3d5db9b0d16763c231032a074 (diff)
prci: Simplify the targeted f_cpu function by measuring HFROSC frequency first, then using it as the PLL source. This is also safer as it is less risk of using PLL out of its range.
Diffstat (limited to 'bsp/drivers/fe300prci/fe300prci_driver.h')
-rw-r--r--bsp/drivers/fe300prci/fe300prci_driver.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/bsp/drivers/fe300prci/fe300prci_driver.h b/bsp/drivers/fe300prci/fe300prci_driver.h
index 243e6de..7100f46 100644
--- a/bsp/drivers/fe300prci/fe300prci_driver.h
+++ b/bsp/drivers/fe300prci/fe300prci_driver.h
@@ -54,15 +54,23 @@ void PRCI_use_pll(int refsel, int bypass,
void PRCI_use_default_clocks();
/* This routine will adjust the HFROSC trim
- * as the PLL clock source, measure the resulting
- * frequency, and attempt to get close to the requested
- * frequency. It returns the actual measured frequency.
+ * while using HFROSC as the clock source,
+ * measure the resulting frequency, then
+ * use it as the PLL clock source,
+ * in an attempt to get over, under, or close to the
+ * requested frequency. It returns the actual measured
+ * frequency.
*
* Note that the requested frequency must be within the
* range supported by the PLL so not all values are
* achievable with this function, and not all
- * are guaranteed to actually work.
+ * are guaranteed to actually work. The PLL
+ * is rated higher than the hardware.
+ *
+ * There is no check on the desired f_cpu frequency, it
+ * is up to the user to specify something reasonable.
*/
+
uint32_t PRCI_set_hfrosctrim_for_f_cpu(uint32_t f_cpu, PRCI_freq_target target);
__END_DECLS