Skip to content

Commit

Permalink
Revert "[nrf fromlist] drivers: clock_control: nrf2: add support for …
Browse files Browse the repository at this point in the history
…global hfsll clock"

This reverts commit 5227b68.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
  • Loading branch information
bjarki-andreasen authored and jukkar committed Dec 13, 2024
1 parent 99faf47 commit 5ec4304
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 330 deletions.
1 change: 0 additions & 1 deletion drivers/clock_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RENESAS_RA_CGC clock_cont
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AMBIQ clock_control_ambiq.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_PWM clock_control_pwm.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RPI_PICO clock_control_rpi_pico.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF2_GLOBAL_HSFLL clock_control_nrf2_global_hsfll.c)

if(CONFIG_CLOCK_CONTROL_NRF2)
zephyr_library_sources(clock_control_nrf2_common.c)
Expand Down
27 changes: 0 additions & 27 deletions drivers/clock_control/Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -193,31 +193,4 @@ config CLOCK_CONTROL_NRF2_NRFS_CLOCK_TIMEOUT_MS
int "Timeout waiting for nrfs clock service callback in milliseconds"
default 1000

config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL
bool "Clock control for global HSFLL"
depends on NRFS_GDFS_SERVICE_ENABLED
default y

if CLOCK_CONTROL_NRF2_GLOBAL_HSFLL

config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_TIMEOUT_MS
int "Frequency request timeout in milliseconds"
default 10000

config CLOCK_CONTROL_NRF2_GLOBAL_HSFLL_REQ_LOW_FREQ
bool "Request LOW frequency on init"
default y
help
The GDFS service will default to HIGH frequency until it receives
a lower frequency request. The NRF2 clock controller drivers
expect the clock to be initialized to their lowest frequency, so
we need to send a request on init to align GDFS with the NRF2
clock controller driver.

This initial request can be disabled to prevent a potentially
unnecessary HIGH -> LOW -> HIGH cycle given some module will
request a HIGH frequency on init anyway.

endif # CLOCK_CONTROL_NRF2_GLOBAL_HSFLL

endif # CLOCK_CONTROL_NRF2
302 changes: 0 additions & 302 deletions drivers/clock_control/clock_control_nrf2_global_hsfll.c

This file was deleted.

14 changes: 14 additions & 0 deletions drivers/clock_control/clock_control_nrf2_hsfll.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "clock_control_nrf2_common.h"
#include <zephyr/devicetree.h>
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
#include <hal/nrf_hsfll.h>

#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL);
Expand Down Expand Up @@ -182,6 +183,18 @@ static int api_cancel_or_release_hsfll(const struct device *dev,
#endif
}

static int api_get_rate_hsfll(const struct device *dev,
clock_control_subsys_t sys,
uint32_t *rate)
{
ARG_UNUSED(dev);
ARG_UNUSED(sys);

*rate = nrf_hsfll_clkctrl_mult_get(NRF_HSFLL) * MHZ(16);

return 0;
}

static int hsfll_init(const struct device *dev)
{
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
Expand All @@ -208,6 +221,7 @@ static struct nrf_clock_control_driver_api hsfll_drv_api = {
.std_api = {
.on = api_nosys_on_off,
.off = api_nosys_on_off,
.get_rate = api_get_rate_hsfll,
},
.request = api_request_hsfll,
.release = api_release_hsfll,
Expand Down

0 comments on commit 5ec4304

Please sign in to comment.