Skip to content

Commit 03bece0

Browse files
henrikbrixandersennandojve
authored andcommitted
soc: arm: atmel: samv71: enable the UPLL clock
Enable the UTMI PLL (UPLL) clock and add a static definition of its clock frequency. Signed-off-by: Henrik Brix Andersen <[email protected]> Co-authored-by: Gerson Fernando Budke <[email protected]>
1 parent f0fc59f commit 03bece0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

soc/arm/atmel_sam/samv71/soc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ static ALWAYS_INLINE void clock_init(void)
178178
;
179179
}
180180

181+
/* Setup UPLL */
182+
PMC->CKGR_UCKR = CKGR_UCKR_UPLLCOUNT(0x3Fu) | CKGR_UCKR_UPLLEN;
183+
184+
/* Wait for PLL lock */
185+
while (!(PMC->PMC_SR & PMC_SR_LOCKU)) {
186+
;
187+
}
188+
181189
/*
182190
* Final setup of the Master Clock
183191
*/

soc/arm/atmel_sam/samv71/soc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
#define SOC_ATMEL_SAM_MCK_FREQ_HZ \
7575
(SOC_ATMEL_SAM_HCLK_FREQ_HZ / CONFIG_SOC_ATMEL_SAMV71_MDIV)
7676

77+
/** UTMI PLL clock (UPLLCK) Frequency */
78+
#define SOC_ATMEL_SAM_UPLLCK_FREQ_HZ MHZ(480)
79+
7780
#endif /* _ASMLANGUAGE */
7881

7982
#include "pwm_fixup.h"

0 commit comments

Comments
 (0)