arch/nrf91/clock: various fixes for LFCLK

This commit is contained in:
raiden00pl 2023-07-08 12:11:06 +02:00 committed by Alan Carvalho de Assis
parent 6b481e55c9
commit 0267bfe093
3 changed files with 3 additions and 15 deletions

View File

@ -382,9 +382,6 @@ config NRF91_LFCLK_XTAL
config NRF91_LFCLK_RC
bool "Internal RC oscillator"
config NRF91_LFCLK_SYNTH
bool "Synthesized from HFCLK"
endchoice
endif # NRF91_USE_LFCLK

View File

@ -102,8 +102,8 @@
#define CLOCK_LFCLKSRC_SRC_SHIFT (0) /* Bits 0-1: LFRC clock source */
#define CLOCK_LFCLKSRC_SRC_MASK (3 << CLOCK_LFCLKSRC_SRC_SHIFT)
# define CLOCK_LFCLKSRC_SRC_RFU (1 << CLOCK_LFCLKSTAT_SRC_SHIFT)
# define CLOCK_LFCLKSRC_SRC_LFRC (2 << CLOCK_LFCLKSTAT_SRC_SHIFT)
# define CLOCK_LFCLKSRC_SRC_LFXO (3 << CLOCK_LFCLKSTAT_SRC_SHIFT)
# define CLOCK_LFCLKSRC_SRC_RFU (0 << CLOCK_LFCLKSTAT_SRC_SHIFT)
# define CLOCK_LFCLKSRC_SRC_LFRC (1 << CLOCK_LFCLKSTAT_SRC_SHIFT)
# define CLOCK_LFCLKSRC_SRC_LFXO (2 << CLOCK_LFCLKSTAT_SRC_SHIFT)
#endif /* __ARCH_ARM_SRC_NRF91_HARDWARE_NRF91_CLOCK_H */

View File

@ -33,13 +33,8 @@
#include "arm_internal.h"
#include "nrf91_clockconfig.h"
#include "hardware/nrf91_clock.h"
#include "hardware/nrf91_power.h"
#include "hardware/nrf91_gpio.h"
#ifdef CONFIG_NRF91_APPCORE
# include "nrf91_oscconfig.h"
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -78,8 +73,6 @@ void nrf91_clockconfig(void)
#if defined(CONFIG_NRF91_LFCLK_XTAL)
putreg32(CLOCK_LFCLKSRC_SRC_LFXO, NRF91_CLOCK_LFCLKSRC);
#elif defined(CONFIG_NRF91_LFCLK_SYNTH)
putreg32(CLOCK_LFCLKSRC_SRC_LFSYNT, NRF91_CLOCK_LFCLKSRC);
#else
putreg32(CLOCK_LFCLKSRC_SRC_LFRC, NRF91_CLOCK_LFCLKSRC);
#endif
@ -89,8 +82,6 @@ void nrf91_clockconfig(void)
putreg32(0x0, NRF91_CLOCK_EVENTS_LFCLKSTARTED);
putreg32(0x1, NRF91_CLOCK_TASKS_LFCLKSTART);
/* NOTE: Oscillator must be configured on the app core */
while (!getreg32(NRF91_CLOCK_EVENTS_LFCLKSTARTED))
{
/* Wait for LFCLK to be running */