Skip to content

Commit

Permalink
fixup! boards/hifive1*: rework clock configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Dec 20, 2019
1 parent 0766963 commit f9463e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions boards/hifive1/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ extern "C" {

#if USE_CLOCK_HFXOSC_PLL
#define CLOCK_PLL_R (1) /* Divide input clock by 2, mandatory with HFXOSC */
#define CLOCK_PLL_F (47) /* Multiply REFR by 96, e.g 2 * (47 + 1) */
#define CLOCK_PLL_Q (2) /* Divide VCO by 4, e.g 2^2 */
#define CLOCK_PLL_F (39) /* Multiply REFR by 80, e.g 2 * (39 + 1) */
#define CLOCK_PLL_Q (1) /* Divide VCO by 2, e.g 2^1 */
#define CLOCK_PLL_INPUT_CLOCK (16000000UL)
#define CLOCK_PLL_REFR (CLOCK_PLL_INPUT_CLOCK / (CLOCK_PLL_R + 1))
#define CLOCK_PLL_VCO (CLOCK_PLL_REFR * (2 * (CLOCK_PLL_F + 1)))
#define CLOCK_PLL_OUT (CLOCK_PLL_VCO / (1 << CLOCK_PLL_Q))
#define CLOCK_CORECLOCK (CLOCK_PLL_OUT) /* 192000000Hz with the values used above */
#define CLOCK_CORECLOCK (CLOCK_PLL_OUT) /* 320000000Hz with the values used above */

/* Check PLL settings */
#if CLOCK_PLL_REFR != 8000000
Expand Down
6 changes: 3 additions & 3 deletions boards/hifive1b/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ extern "C" {

#if USE_CLOCK_HFXOSC_PLL
#define CLOCK_PLL_R (1) /* Divide input clock by 2, mandatory with HFXOSC */
#define CLOCK_PLL_F (47) /* Multiply REFR by 96, e.g 2 * (47 + 1) */
#define CLOCK_PLL_Q (2) /* Divide VCO by 4, e.g 2^2 */
#define CLOCK_PLL_F (39) /* Multiply REFR by 80, e.g 2 * (39 + 1) */
#define CLOCK_PLL_Q (1) /* Divide VCO by 2, e.g 2^1 */
#define CLOCK_PLL_INPUT_CLOCK (16000000UL)
#define CLOCK_PLL_REFR (CLOCK_PLL_INPUT_CLOCK / (CLOCK_PLL_R + 1))
#define CLOCK_PLL_VCO (CLOCK_PLL_REFR * (2 * (CLOCK_PLL_F + 1)))
#define CLOCK_PLL_OUT (CLOCK_PLL_VCO / (1 << CLOCK_PLL_Q))
#define CLOCK_CORECLOCK (CLOCK_PLL_OUT) /* 192000000Hz with the values used above */
#define CLOCK_CORECLOCK (CLOCK_PLL_OUT) /* 320000000Hz with the values used above */

/* Check PLL settings */
#if CLOCK_PLL_REFR != 8000000
Expand Down

0 comments on commit f9463e8

Please sign in to comment.