Skip to content

Commit f0fc59f

Browse files
henrikbrixandersennandojve
authored andcommitted
soc: arm: atmel: same70: 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 4730f72 commit f0fc59f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

soc/arm/atmel_sam/same70/soc.c

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

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

soc/arm/atmel_sam/same70/soc.h

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

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

7881
#endif /* _ATMEL_SAME70_SOC_H_ */

0 commit comments

Comments
 (0)