Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/clock_control/Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ endif # CLOCK_CONTROL_NRF

config CLOCK_CONTROL_NRF2
bool "nRF clock control support"
default y
depends on SOC_SERIES_NRF54HX && !RISCV_CORE_NORDIC_VPR
select ONOFF
select NRFS if HAS_NRFS
Expand Down
16 changes: 8 additions & 8 deletions drivers/clock_control/clock_control_nrf2_hsfll.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1,
"multiple instances not supported");

#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
#include <ld_dvfs_handler.h>

#define FLAG_FREQ_CHANGE_CB_EXPECTED BIT(FLAGS_COMMON_BITS)
Expand Down Expand Up @@ -131,13 +131,13 @@
LOG_ERR("invalid frequency");
return NULL;
}
#endif /* CONFIG_NRFS_HAS_DVFS_SERVICE */
#endif /* CONFIG_NRFS_DVFS_LOCAL_DOMAIN */

static int api_request_hsfll(const struct device *dev,
const struct nrf_clock_spec *spec,
struct onoff_client *cli)
{
#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
struct onoff_manager *mgr = hsfll_find_mgr(dev, spec);

if (mgr) {
Expand All @@ -153,7 +153,7 @@
static int api_release_hsfll(const struct device *dev,
const struct nrf_clock_spec *spec)
{
#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
struct onoff_manager *mgr = hsfll_find_mgr(dev, spec);

if (mgr) {
Expand All @@ -170,7 +170,7 @@
const struct nrf_clock_spec *spec,
struct onoff_client *cli)
{
#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
struct onoff_manager *mgr = hsfll_find_mgr(dev, spec);

if (mgr) {
Expand All @@ -197,7 +197,7 @@

static int hsfll_init(const struct device *dev)
{
#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
struct hsfll_dev_data *dev_data = dev->data;
int rc;

Expand Down Expand Up @@ -228,14 +228,14 @@
.cancel_or_release = api_cancel_or_release_hsfll,
};

#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE
#ifdef CONFIG_NRFS_DVFS_LOCAL_DOMAIN
static struct hsfll_dev_data hsfll_data;
#endif

DEVICE_DT_INST_DEFINE(0, hsfll_init, NULL,
COND_CODE_1(CONFIG_NRFS_HAS_DVFS_SERVICE,
COND_CODE_1(CONFIG_NRFS_DVFS_LOCAL_DOMAIN,
(&hsfll_data),
(NULL)),
NULL,
PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY,
&hsfll_drv_api);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

CONFIG_CLOCK_CONTROL_NRF2=y
CONFIG_CLOCK_CONTROL=y

CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ=320000000
2 changes: 1 addition & 1 deletion samples/boards/nordic/clock_control/configs/fll16m.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

CONFIG_CLOCK_CONTROL_NRF2=y
CONFIG_CLOCK_CONTROL=y

CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=30
2 changes: 1 addition & 1 deletion samples/boards/nordic/clock_control/configs/lfclk.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

CONFIG_CLOCK_CONTROL_NRF2=y
CONFIG_CLOCK_CONTROL=y

CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=20
CONFIG_SAMPLE_CLOCK_PRECISION=1
2 changes: 1 addition & 1 deletion samples/boards/nordic/clock_control/configs/uart135.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

CONFIG_CLOCK_CONTROL_NRF2=y
CONFIG_CLOCK_CONTROL=y

CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=30
10 changes: 4 additions & 6 deletions soc/nordic/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ if SOC_FAMILY_NORDIC_NRF

rsource "*/Kconfig.defconfig"

# If the kernel has timer support, enable clock control
if SYS_CLOCK_EXISTS

# If the kernel has timer support, enable clock control, except for SoCs
# based on the Haltium platform SoCs where clock control is not needed
# for the system timer
config CLOCK_CONTROL
default y if !SOC_SERIES_NRF92X

endif # SYS_CLOCK_EXISTS
default y if SYS_CLOCK_EXISTS && !NRF_PLATFORM_HALTIUM

config SYS_CLOCK_HW_CYCLES_PER_SEC
default 1000000 if NRF_GRTC_TIMER
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/clock_control/nrf_clock_control/prj.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_ZTEST=y

CONFIG_CLOCK_CONTROL_NRF2=y
CONFIG_CLOCK_CONTROL=y
CONFIG_LOG=y
CONFIG_CLOCK_CONTROL_LOG_LEVEL_DBG=y
CONFIG_LOCAL_DOMAIN_DVFS_LIB_LOG_LEVEL_DBG=y
Loading