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 <henrik@brixandersen.dk>
Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is contained in:
Henrik Brix Andersen 2022-05-07 19:57:38 +02:00 committed by Carles Cufí
parent f0fc59f0a2
commit 03bece0b70
2 changed files with 11 additions and 0 deletions

View file

@ -178,6 +178,14 @@ static ALWAYS_INLINE void clock_init(void)
;
}
/* Setup UPLL */
PMC->CKGR_UCKR = CKGR_UCKR_UPLLCOUNT(0x3Fu) | CKGR_UCKR_UPLLEN;
/* Wait for PLL lock */
while (!(PMC->PMC_SR & PMC_SR_LOCKU)) {
;
}
/*
* Final setup of the Master Clock
*/

View file

@ -74,6 +74,9 @@
#define SOC_ATMEL_SAM_MCK_FREQ_HZ \
(SOC_ATMEL_SAM_HCLK_FREQ_HZ / CONFIG_SOC_ATMEL_SAMV71_MDIV)
/** UTMI PLL clock (UPLLCK) Frequency */
#define SOC_ATMEL_SAM_UPLLCK_FREQ_HZ MHZ(480)
#endif /* _ASMLANGUAGE */
#include "pwm_fixup.h"