From 7aafe9783b420c53993ab3661974a3a9b768a9f6 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 6 May 2024 13:13:48 +0200 Subject: [PATCH 01/17] Revert "[nrf fromlist] drivers: timer: grtc: Update GRTC driver" This reverts commit 8a5c578ffa948a1b0cbd8242f631c946f54d1fce. A newer revision will be re-applied from the PR. Signed-off-by: Grzegorz Swiderski --- drivers/timer/Kconfig.nrf_grtc | 13 +--- drivers/timer/nrf_grtc_timer.c | 87 ++++++++++++++++++++------ modules/hal_nordic/nrfx/CMakeLists.txt | 15 +---- 3 files changed, 70 insertions(+), 45 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index 444d13aab31..442c524fd19 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -40,20 +40,9 @@ config NRF_GRTC_TIMER_CLOCK_MANAGEMENT the GRTC. Usually this is only needed by the processor that is starting the SYSCOUNTER, but can be shared by multiple processors in the system. -config NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY +config NRF_GRTC_SLEEP_MINIMUM_LATENCY int default 1000 depends on NRF_GRTC_SLEEP_ALLOWED - help - The value (in us) ensures that the wakeup event will not fire - too early. In other words, applying SYSCOUNTER sleep state for less than - NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY period makes no sense. - -config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE - bool - default y if NRF_GRTC_START_SYSCOUNTER - help - This feature prevents the SYSCOUNTER to sleep when any core is in - active state. endif # NRF_GRTC_TIMER diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 51f00687e7e..3ed746e692a 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -29,6 +29,12 @@ #define CHAN_COUNT NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS #define EXT_CHAN_COUNT (CHAN_COUNT - 1) +/* The reset value of waketime is 1, which doesn't seem to work. + * It's being looked into, but for the time being use 4. + * Timeout must always be higher than waketime, so setting that to 5. + */ +#define WAKETIME (4) +#define TIMEOUT (WAKETIME + 1) #ifndef GRTC_SYSCOUNTERL_VALUE_Msk #define GRTC_SYSCOUNTERL_VALUE_Msk GRTC_SYSCOUNTER_SYSCOUNTERL_VALUE_Msk @@ -49,6 +55,9 @@ #define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK) +/* The maximum SYSCOUNTERVALID settling time equals 1x32k cycles + 20x1MHz cycles. */ +#define GRTC_SYSCOUNTERVALID_SETTLE_MAX_TIME_US 51 + #if defined(CONFIG_TEST) const int32_t z_sys_timer_irq_for_test = DT_IRQN(GRTC_NODE); #endif @@ -69,6 +78,36 @@ static nrfx_grtc_channel_t system_clock_channel_data = { __ASSERT_NO_MSG((NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK & (1UL << (chan))) && \ ((chan) != system_clock_channel_data.channel)) +static inline void grtc_active_set(void) +{ +#if defined(NRF_GRTC_HAS_SYSCOUNTER_ARRAY) && (NRF_GRTC_HAS_SYSCOUNTER_ARRAY == 1) + nrfy_grtc_sys_counter_active_set(NRF_GRTC, true); + while (!nrfy_grtc_sys_conter_ready_check(NRF_GRTC)) { + } +#else + nrfy_grtc_sys_counter_active_state_request_set(NRF_GRTC, true); + k_busy_wait(GRTC_SYSCOUNTERVALID_SETTLE_MAX_TIME_US); +#endif +} + +static inline void grtc_wakeup(void) +{ + if (IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { + grtc_active_set(); + } +} + +static inline void grtc_sleep(void) +{ + if (IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { +#if defined(NRF_GRTC_HAS_SYSCOUNTER_ARRAY) && (NRF_GRTC_HAS_SYSCOUNTER_ARRAY == 1) + nrfy_grtc_sys_counter_active_set(NRF_GRTC, false); +#else + nrfy_grtc_sys_counter_active_state_request_set(NRF_GRTC, false); +#endif + } +} + static inline uint64_t counter_sub(uint64_t a, uint64_t b) { return (a - b); @@ -77,7 +116,10 @@ static inline uint64_t counter_sub(uint64_t a, uint64_t b) static inline uint64_t counter(void) { uint64_t now; + + grtc_wakeup(); nrfx_grtc_syscounter_get(&now); + grtc_sleep(); return now; } @@ -99,8 +141,10 @@ static inline uint64_t get_comparator(uint32_t chan) static void system_timeout_set(uint64_t value) { if (value <= NRF_GRTC_SYSCOUNTER_CCADD_MASK) { + grtc_wakeup(); nrfx_grtc_syscounter_cc_relative_set(&system_clock_channel_data, value, true, NRFX_GRTC_CC_RELATIVE_SYSCOUNTER); + grtc_sleep(); } else { nrfx_grtc_syscounter_cc_absolute_set(&system_clock_channel_data, value + counter(), true); @@ -329,7 +373,6 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ uint64_t capt_time; - nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -340,10 +383,8 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ return -EBUSY; } - result = nrfx_grtc_syscounter_cc_value_read(chan, &capt_time); - if (result != NRFX_SUCCESS) { - return -EPERM; - } + + capt_time = nrfy_grtc_sys_counter_cc_get(NRF_GRTC, chan); __ASSERT_NO_MSG(capt_time < COUNTER_SPAN); @@ -358,22 +399,16 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) nrfx_err_t err_code; static uint8_t systemoff_channel; uint64_t now = counter(); - nrfx_grtc_sleep_config_t sleep_cfg; /* Minimum time that ensures valid execution of system-off procedure. */ - uint32_t minimum_latency_us; + uint32_t minimum_latency_us = nrfy_grtc_waketime_get(NRF_GRTC) + + nrfy_grtc_timeout_get(NRF_GRTC) + + CONFIG_NRF_GRTC_SLEEP_MINIMUM_LATENCY; uint32_t chan; int ret; - nrfx_grtc_sleep_configuration_get(&sleep_cfg); - minimum_latency_us = (sleep_cfg.waketime + sleep_cfg.timeout) * USEC_PER_SEC / 32768 + - CONFIG_NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY; - sleep_cfg.auto_mode = false; - nrfx_grtc_sleep_configure(&sleep_cfg); - if (minimum_latency_us > wake_time_us) { return -EINVAL; } - k_spinlock_key_t key = k_spin_lock(&lock); err_code = nrfx_grtc_channel_alloc(&systemoff_channel); @@ -382,9 +417,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) return -ENOMEM; } (void)nrfx_grtc_syscounter_cc_int_disable(systemoff_channel); - ret = compare_set(systemoff_channel, - now + wake_time_us * sys_clock_hw_cycles_per_sec() / USEC_PER_SEC, NULL, - NULL); + ret = compare_set(systemoff_channel, now + wake_time_us, NULL, NULL); if (ret < 0) { k_spin_unlock(&lock, key); return ret; @@ -400,7 +433,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) } /* Make sure that wake_time_us was not triggered yet. */ - if (nrfx_grtc_syscounter_compare_event_check(systemoff_channel)) { + if (nrfy_grtc_sys_counter_compare_event_check(NRF_GRTC, systemoff_channel)) { k_spin_unlock(&lock, key); return -EINVAL; } @@ -411,7 +444,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) MAX_CC_LATCH_WAIT_TIME_US; k_busy_wait(wait_time); #if NRF_GRTC_HAS_CLKSEL - nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO); + nrfy_grtc_clksel_set(NRF_GRTC, NRF_GRTC_CLKSEL_LFXO); #endif k_spin_unlock(&lock, key); return 0; @@ -452,9 +485,16 @@ static int sys_clock_driver_init(void) #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && \ (defined(NRF_GRTC_HAS_CLKSEL) && (NRF_GRTC_HAS_CLKSEL == 1)) /* Use System LFCLK as the low-frequency clock source. */ - nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFCLK); + nrfy_grtc_clksel_set(NRF_GRTC, NRF_GRTC_CLKSEL_LFCLK); #endif +#if defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) + /* SYSCOUNTER needs to be turned off before initialization. */ + nrfy_grtc_sys_counter_set(NRF_GRTC, false); + nrfy_grtc_timeout_set(NRF_GRTC, TIMEOUT); + nrfy_grtc_waketime_set(NRF_GRTC, WAKETIME); +#endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ + IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_grtc_irq_handler, 0, 0); err_code = nrfx_grtc_init(0); @@ -467,6 +507,9 @@ static int sys_clock_driver_init(void) if (err_code != NRFX_SUCCESS) { return err_code == NRFX_ERROR_NO_MEM ? -ENOMEM : -EPERM; } + if (IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { + nrfy_grtc_sys_counter_auto_mode_set(NRF_GRTC, false); + } #else err_code = nrfx_grtc_channel_alloc(&system_clock_channel_data.channel); if (err_code != NRFX_SUCCESS) { @@ -474,6 +517,10 @@ static int sys_clock_driver_init(void) } #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ + if (!IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { + grtc_active_set(); + } + int_mask = NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { system_timeout_set(CYC_PER_TICK); diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index adce870fc3a..463c4790743 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -127,19 +127,8 @@ if(CONFIG_NRFX_TWI OR CONFIG_NRFX_TWIM) zephyr_library_sources(${SRC_DIR}/nrfx_twi_twim.c) endif() -if (CONFIG_NRF_GRTC_TIMER) - if (CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) - zephyr_library_compile_definitions(NRF_GRTC_HAS_EXTENDED=1) - endif() - if (CONFIG_NRF_GRTC_SLEEP_ALLOWED) - zephyr_compile_definitions(NRFX_GRTC_CONFIG_SLEEP_ALLOWED=1) - endif() - if (CONFIG_NRF_GRTC_TIMER_AUTO_KEEP_ALIVE) - zephyr_compile_definitions(NRFX_GRTC_CONFIG_AUTOEN=1) - endif() - if (CONFIG_NRF_GRTC_START_SYSCOUNTER) - zephyr_compile_definitions(NRFX_GRTC_CONFIG_AUTOSTART=1) - endif() +if (CONFIG_NRF_GRTC_TIMER AND CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) + zephyr_library_compile_definitions(NRF_GRTC_HAS_EXTENDED=1) endif() # Inject HAL "CONFIG_NFCT_PINS_AS_GPIOS" definition if user requests to From 227888bf3e90ecc5956ed09eb33b95f3b2b6ab7a Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Fri, 10 May 2024 14:16:23 +0200 Subject: [PATCH 02/17] Revert "[nrf fromtree] dts: nordic: add EXMIF peripheral description to nRF54H20" This reverts commit 3be1bc01f4d44bde6fe3ae0cea56458e2341525e. To be re-applied in the correct git history order. Signed-off-by: Grzegorz Swiderski --- dts/bindings/spi/nordic,nrf-exmif.yaml | 12 ------------ dts/common/nordic/nrf54h20.dtsi | 13 ------------- 2 files changed, 25 deletions(-) delete mode 100644 dts/bindings/spi/nordic,nrf-exmif.yaml diff --git a/dts/bindings/spi/nordic,nrf-exmif.yaml b/dts/bindings/spi/nordic,nrf-exmif.yaml deleted file mode 100644 index d2b8815046b..00000000000 --- a/dts/bindings/spi/nordic,nrf-exmif.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic External Memory Interface (EXMIF) - -compatible: "nordic,nrf-exmif" - -include: snps,designware-spi.yaml - -properties: - reg: - required: true diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 92f2576e733..7d5a64d0a83 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -300,19 +300,6 @@ #size-cells = <1>; ranges = <0x0 0x5f000000 0x1000000>; - exmif: spi@95000 { - compatible = "nordic,nrf-exmif", "snps,designware-spi"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x95000 0x500 0x95500 0xb00>; - reg-names = "wrapper", "core"; - interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; - clock-frequency = ; - fifo-depth = <32>; - max-xfer-size = <16>; - status = "disabled"; - }; - cpusec_bellboard: mailbox@99000 { reg = <0x99000 0x1000>; status = "disabled"; From 40ce4c09626f4e9d7869dcc4990002bc58e26c6f Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Tue, 16 Apr 2024 10:49:38 +0200 Subject: [PATCH 03/17] [nrf fromtree] modules: hal_nordic: Fix NRF_GRTC_HAS_EXTENDED This definition is used in nrfx header files, so it shouldn't be added using `zephyr_library_compile_definitions()`. This would cause the GRTC driver to fail the build when CONFIG_NRF_GRTC_START_SYSCOUNTER=y. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 35e418f4690643ed6dddbfe189d36a52dcc04d76) --- modules/hal_nordic/nrfx/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 463c4790743..540ec4e0b30 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -128,7 +128,7 @@ if(CONFIG_NRFX_TWI OR CONFIG_NRFX_TWIM) endif() if (CONFIG_NRF_GRTC_TIMER AND CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) - zephyr_library_compile_definitions(NRF_GRTC_HAS_EXTENDED=1) + zephyr_compile_definitions(NRF_GRTC_HAS_EXTENDED=1) endif() # Inject HAL "CONFIG_NFCT_PINS_AS_GPIOS" definition if user requests to From 74ab1382e79a46bf68a20e09bec25ac23b5b05eb Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Tue, 9 Apr 2024 12:57:27 +0200 Subject: [PATCH 04/17] [nrf fromtree] dts: nordic: nrf54h20: Add SysCtrl VEVIF node Add a VEVIF node to be used for communicating with SysCtrl (cpusys). This is the only part of the SysCtrl VPR exposed to local domains. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 163cacbe4ba4c04c3d1b8e867760223e0e2b0869) --- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 1 + dts/arm/nordic/nrf54h20_cpurad.dtsi | 1 + dts/common/nordic/nrf54h20.dtsi | 9 +++++++++ dts/riscv/nordic/nrf54h20_cpuppr.dtsi | 1 + 4 files changed, 12 insertions(+) diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index d82c69262c0..9d011019f4a 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -10,6 +10,7 @@ cpu: &cpuapp {}; systick: &cpuapp_systick {}; nvic: &cpuapp_nvic {}; cpuppr_vevif: &cpuppr_vevif_remote {}; +cpusys_vevif: &cpusys_vevif_remote {}; /delete-node/ &cpuppr; /delete-node/ &cpurad; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 4bdaf76e348..2a62845dc89 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -10,6 +10,7 @@ cpu: &cpurad {}; systick: &cpurad_systick {}; nvic: &cpurad_nvic {}; cpuppr_vevif: &cpuppr_vevif_remote {}; +cpusys_vevif: &cpusys_vevif_remote {}; /delete-node/ &cpuapp; /delete-node/ &cpuapp_peripherals; diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 7d5a64d0a83..671292d1010 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -318,6 +318,15 @@ #mbox-cells = <1>; }; + cpusys_vevif_remote: mailbox@8c8000 { + compatible = "nordic,nrf-vevif-remote"; + reg = <0x8c8000 0x1000>; + status = "disabled"; + #mbox-cells = <1>; + nordic,tasks = <32>; + nordic,tasks-mask = <0xfffff0ff>; + }; + ipct120: ipct@8d1000 { compatible = "nordic,nrf-ipct-global"; reg = <0x8d1000 0x1000>; diff --git a/dts/riscv/nordic/nrf54h20_cpuppr.dtsi b/dts/riscv/nordic/nrf54h20_cpuppr.dtsi index d74147bc04b..6f90cbf3e6a 100644 --- a/dts/riscv/nordic/nrf54h20_cpuppr.dtsi +++ b/dts/riscv/nordic/nrf54h20_cpuppr.dtsi @@ -9,6 +9,7 @@ cpu: &cpuppr {}; clic: &cpuppr_clic {}; cpuppr_vevif: &cpuppr_vevif_local {}; +cpusys_vevif: &cpusys_vevif_remote {}; /delete-node/ &cpuapp; /delete-node/ &cpuapp_peripherals; From 51f1389152566f7cf7aa6cc591dde0cce3794cd2 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Tue, 9 Apr 2024 12:57:27 +0200 Subject: [PATCH 05/17] [nrf fromtree] boards: nordic: nrf54h20dk: Add IPC configuration for SysCtrl Add the default `zephyr,ipc-icmsg` nodes for communication with Application and Radiocore. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 711abcd444291063290708b9afaac8f15ce1191b) --- .../nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi | 14 ++++++++++++++ .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 11 +++++++++-- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts | 2 ++ .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 11 +++++++++-- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi index 539e80d149a..944dd7fb6ab 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi @@ -27,11 +27,25 @@ <&cpurad_bellboard 12>; }; + cpuapp_cpusys_ipc: ipc-2-12 { + compatible = "zephyr,ipc-icmsg"; + status = "disabled"; + mboxes = <&cpuapp_bellboard 6>, + <&cpusys_vevif 12>; + }; + cpuapp_cpuppr_ipc: ipc-2-13 { compatible = "zephyr,ipc-icmsg"; status = "disabled"; mboxes = <&cpuapp_bellboard 13>, <&cpuppr_vevif 12>; }; + + cpurad_cpusys_ipc: ipc-3-12 { + compatible = "zephyr,ipc-icmsg"; + status = "disabled"; + mboxes = <&cpurad_bellboard 6>, + <&cpusys_vevif 18>; + }; }; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 7f2f918b0b9..24d161420d6 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -11,6 +11,7 @@ #include "nrf54h20dk_nrf54h20-ipc_conf.dtsi" #include "nrf54h20dk_nrf54h20-pinctrl.dtsi" +/delete-node/ &cpurad_cpusys_ipc; /delete-node/ &cpusec_cpurad_ipc; / { @@ -120,8 +121,8 @@ status = "okay"; interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>; interrupt-names = "irq0"; - /* irq0: 0: cpuapp-cpusec, 13: cpuapp-cpuppr, 18: cpuapp-cpurad */ - nordic,interrupt-mapping = <0x00042001 0>; + /* irq0: 0: cpuapp-cpusec, 6: cpuapp-cpusys, 13: cpuapp-cpuppr, 18: cpuapp-cpurad */ + nordic,interrupt-mapping = <0x00042041 0>; }; &cpurad_bellboard { @@ -143,6 +144,12 @@ ipc0: &cpuapp_cpurad_ipc { rx-blocks = <32>; }; +&cpuapp_cpusys_ipc { + mbox-names = "rx", "tx"; + tx-region = <&cpuapp_cpusys_ipc_shm>; + rx-region = <&cpusys_cpuapp_ipc_shm>; +}; + &cpuapp_cpuppr_ipc { mbox-names = "rx", "tx"; tx-region = <&cpuapp_cpuppr_ipc_shm>; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts index 4cfad97323e..80b690839d7 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts @@ -12,6 +12,8 @@ #include "nrf54h20dk_nrf54h20-pinctrl.dtsi" /delete-node/ &cpuapp_cpurad_ipc; +/delete-node/ &cpuapp_cpusys_ipc; +/delete-node/ &cpurad_cpusys_ipc; /delete-node/ &cpusec_cpuapp_ipc; /delete-node/ &cpusec_cpurad_ipc; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index d72aa791091..cb69b5ce3a6 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -12,6 +12,7 @@ #include "nrf54h20dk_nrf54h20-pinctrl.dtsi" /delete-node/ &cpuapp_cpuppr_ipc; +/delete-node/ &cpuapp_cpusys_ipc; /delete-node/ &cpusec_cpuapp_ipc; / { @@ -46,8 +47,8 @@ status = "okay"; interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>; interrupt-names = "irq0"; - /* irq0: 0: cpurad-cpusec, 12: cpurad-cpuapp */ - nordic,interrupt-mapping = <0x00001001 0>; + /* irq0: 0: cpurad-cpusec, 6: cpurad-cpusys, 12: cpurad-cpuapp */ + nordic,interrupt-mapping = <0x00001041 0>; }; &cpuapp_bellboard { @@ -69,6 +70,12 @@ ipc0: &cpuapp_cpurad_ipc { rx-blocks = <32>; }; +&cpurad_cpusys_ipc { + mbox-names = "rx", "tx"; + tx-region = <&cpurad_cpusys_ipc_shm>; + rx-region = <&cpusys_cpurad_ipc_shm>; +}; + &cpurad_dma_region { status = "okay"; }; From 616feee47d30413f0767472e2b1bedfc3de9f201 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Thu, 18 Apr 2024 16:14:46 +0200 Subject: [PATCH 06/17] [nrf fromtree] drivers/timer grtc: Fix for ISR prototype Interrupt handlers are expected to have a pototype void (const void*) but nrfx_grtc_irq_handler has just a void(void) (with no input parameter). Fix it by using a trampoline. Signed-off-by: Alberto Escolar Piedras (cherry picked from commit 8e20b80575b888468136dc2efbb230f66930b941) --- drivers/timer/nrf_grtc_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 3ed746e692a..7f6ae02bceb 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -495,7 +495,8 @@ static int sys_clock_driver_init(void) nrfy_grtc_waketime_set(NRF_GRTC, WAKETIME); #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ - IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_grtc_irq_handler, 0, 0); + IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, + nrfx_grtc_irq_handler, 0); err_code = nrfx_grtc_init(0); if (err_code != NRFX_SUCCESS) { From fe08313ec29f79cb3c345063ce70a09848705b2b Mon Sep 17 00:00:00 2001 From: Lukasz Stepnicki Date: Thu, 18 Apr 2024 13:16:32 +0200 Subject: [PATCH 07/17] [nrf fromtree] soc: nordic: vpr: fix soc isr sw stacking. Fixed order of mepc and _mcause in esf for 32bit stacking. Added missing stack pointer alignement bit support.' Signed-off-by: Lukasz Stepnicki (cherry picked from commit 37e3449a393710df6339bd97cfc73679c63546ca) --- soc/nordic/common/vpr/soc_context.h | 14 ++++++++++-- soc/nordic/common/vpr/soc_isr_stacking.h | 29 +++++++++++++++++++++--- soc/nordic/common/vpr/soc_offsets.h | 4 +++- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/soc/nordic/common/vpr/soc_context.h b/soc/nordic/common/vpr/soc_context.h index 8cd0d1e5094..9735057e792 100644 --- a/soc/nordic/common/vpr/soc_context.h +++ b/soc/nordic/common/vpr/soc_context.h @@ -6,7 +6,17 @@ #ifndef SOC_RISCV_NORDIC_NRF_COMMON_VPR_SOC_CONTEXT_H_ #define SOC_RISCV_NORDIC_NRF_COMMON_VPR_SOC_CONTEXT_H_ -#define SOC_ESF_MEMBERS unsigned long minttresh -#define SOC_ESF_INIT 0 +#define SOC_ESF_MEMBERS \ + unsigned long minttresh; \ + unsigned long sp_align; \ + unsigned long padding0; \ + unsigned long padding1; \ + unsigned long padding2 + +#define SOC_ESF_INIT \ + 0, \ + 0, \ + 0, \ + 0 #endif /* SOC_RISCV_NORDIC_NRF_COMMON_VPR_SOC_CONTEXT_H_ */ diff --git a/soc/nordic/common/vpr/soc_isr_stacking.h b/soc/nordic/common/vpr/soc_isr_stacking.h index d5b139111d0..ff34f9d4e09 100644 --- a/soc/nordic/common/vpr/soc_isr_stacking.h +++ b/soc/nordic/common/vpr/soc_isr_stacking.h @@ -56,8 +56,8 @@ unsigned long a2; \ unsigned long a1; \ unsigned long a0; \ - unsigned long mepc; \ unsigned long _mcause; \ + unsigned long mepc; \ } __aligned(16); #endif /* DT_PROP(VPR_CPU, nordic_bus_width) == 64 */ @@ -79,7 +79,28 @@ * Size of the SW managed part of the ESF in case of interrupt * sizeof(__padding) + ... + sizeof(soc_context) */ -#define ESF_SW_IRQ_SIZEOF (0x10) +#define ESF_SW_IRQ_SIZEOF (0x20) + +/* + * VPR needs aligned(8) SP when doing HW stacking, if this condition is not fulfilled it will move + * SP by additional 4 bytes when HW stacking is done. This will be indicated by LSB bit in stacked + * MEPC. This bit needs to be saved and then restored because zephyr is managing MEPC and doesn't + * know anything about this additional offset. + */ +#define MEPC_SP_ALIGN_BIT_MASK (0x1UL) + +#define STORE_SP_ALIGN_BIT_FROM_MEPC \ + addi t1, sp, __z_arch_esf_t_soc_context_OFFSET; \ + lr t0, __z_arch_esf_t_mepc_OFFSET(sp); \ + andi t0, t0, MEPC_SP_ALIGN_BIT_MASK; \ + sr t0, __soc_esf_t_sp_align_OFFSET(t1) + +#define RESTORE_SP_ALIGN_BIT_TO_MEPC \ + addi t1, sp, __z_arch_esf_t_soc_context_OFFSET; \ + lr t0, __soc_esf_t_sp_align_OFFSET(t1); \ + lr t1, __z_arch_esf_t_mepc_OFFSET(sp); \ + or t2, t1, t0; \ + sr t2, __z_arch_esf_t_mepc_OFFSET(sp) #define SOC_ISR_SW_STACKING \ csrw mscratch, t0; \ @@ -97,9 +118,11 @@ stacking_is_interrupt: \ addi sp, sp, -ESF_SW_IRQ_SIZEOF; \ \ -stacking_keep_going: +stacking_keep_going: \ + STORE_SP_ALIGN_BIT_FROM_MEPC #define SOC_ISR_SW_UNSTACKING \ + RESTORE_SP_ALIGN_BIT_TO_MEPC; \ csrr t0, mcause; \ srli t0, t0, RISCV_MCAUSE_IRQ_POS; \ bnez t0, unstacking_is_interrupt; \ diff --git a/soc/nordic/common/vpr/soc_offsets.h b/soc/nordic/common/vpr/soc_offsets.h index 92d91044e1a..f03f784e864 100644 --- a/soc/nordic/common/vpr/soc_offsets.h +++ b/soc/nordic/common/vpr/soc_offsets.h @@ -6,6 +6,8 @@ #ifndef SOC_RISCV_NORDIC_NRF_COMMON_VPR_SOC_OFFSETS_H_ #define SOC_RISCV_NORDIC_NRF_COMMON_VPR_SOC_OFFSETS_H_ -#define GEN_SOC_OFFSET_SYMS() GEN_OFFSET_SYM(soc_esf_t, minttresh) +#define GEN_SOC_OFFSET_SYMS() \ + GEN_OFFSET_SYM(soc_esf_t, minttresh); \ + GEN_OFFSET_SYM(soc_esf_t, sp_align) #endif /* SOC_RISCV_NORDIC_NRF_COMMON_VPR_SOC_OFFSETS_H_ */ From 6f4c130a473a5755200e684b5546e0f079de1a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Amundsen?= Date: Fri, 19 Apr 2024 09:58:41 +0200 Subject: [PATCH 08/17] [nrf fromtree] dts: nordic: add USBHS node for nrf54h20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing USBHS node to list of global peripherals. Signed-off-by: Håkon Amundsen (cherry picked from commit 5895be5438860f2ca2dd26c02664462324d9c50b) --- dts/common/nordic/nrf54h20.dtsi | 8 ++++++++ soc/nordic/validate_base_addresses.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 671292d1010..0131763ef1e 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -300,6 +300,14 @@ #size-cells = <1>; ranges = <0x0 0x5f000000 0x1000000>; + usbhs: usbhs@86000 { + compatible = "snps,dwc2"; + reg = <0x86000 0x1000>, <0x2f700000 0x40000>; + reg-names = "wrapper", "core"; + interrupts = <134 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + cpusec_bellboard: mailbox@99000 { reg = <0x99000 0x1000>; status = "disabled"; diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 1fa4c87c97b..e83c0ea8dcb 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -308,6 +308,8 @@ CHECK_DT_REG(uart136, NRF_UARTE136); CHECK_DT_REG(uart137, NRF_UARTE137); CHECK_DT_REG(uicr, NRF_UICR); CHECK_DT_REG(usbd, NRF_USBD); +CHECK_DT_REG(usbhs, NRF_USBHS); +CHECK_DT_REG(usbhs_core, NRF_USBHSCORE0); CHECK_DT_REG(usbreg, NRF_USBREGULATOR); CHECK_DT_REG(vmc, NRF_VMC); CHECK_DT_REG(wdt, NRF_WDT0); /* this should be the same node as wdt0 */ From e0a57a854070d1fe206cf2d637e49564ee18537d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Fri, 26 Apr 2024 11:15:33 +0200 Subject: [PATCH 09/17] [nrf fromtree] dts: nordic: add EXMIF peripheral description to nRF54H20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added EXMIF peripheral DTS description and bindings. The peripheral operates as an SPI device. Signed-off-by: Rafał Kuźnia (cherry picked from commit 4d30ccb8788eae9444deb78de1e2a3a6dc187927) --- dts/bindings/spi/nordic,nrf-exmif.yaml | 12 ++++++++++++ dts/common/nordic/nrf54h20.dtsi | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 dts/bindings/spi/nordic,nrf-exmif.yaml diff --git a/dts/bindings/spi/nordic,nrf-exmif.yaml b/dts/bindings/spi/nordic,nrf-exmif.yaml new file mode 100644 index 00000000000..d2b8815046b --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-exmif.yaml @@ -0,0 +1,12 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic External Memory Interface (EXMIF) + +compatible: "nordic,nrf-exmif" + +include: snps,designware-spi.yaml + +properties: + reg: + required: true diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 0131763ef1e..75d112b85e2 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -308,6 +308,19 @@ status = "disabled"; }; + exmif: spi@95000 { + compatible = "nordic,nrf-exmif", "snps,designware-spi"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x95000 0x500 0x95500 0xb00>; + reg-names = "wrapper", "core"; + interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; + clock-frequency = ; + fifo-depth = <32>; + max-xfer-size = <16>; + status = "disabled"; + }; + cpusec_bellboard: mailbox@99000 { reg = <0x99000 0x1000>; status = "disabled"; From de7f6f951956bc8e84a52fad43e3ab850446a055 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Tue, 16 Apr 2024 10:46:32 +0200 Subject: [PATCH 10/17] [nrf fromlist] soc: nordic: nrf54h20: Make HSFLL trims optional Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/71536 If no HSFLL needs trimming, then `trim_hsfll()` should be compiled out. This makes it easier to reuse the rest of `soc.c` out of tree. Furthermore, some HSFLL instances can be trimmed before booting Zephyr, so the FICR client properties in the DT binding should not be required. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 0803dc254b193dd10d94a99ca1289318d483087f) --- dts/bindings/clock/nordic,nrf-hsfll.yaml | 6 ------ soc/nordic/nrf54h/soc.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dts/bindings/clock/nordic,nrf-hsfll.yaml b/dts/bindings/clock/nordic,nrf-hsfll.yaml index 3614d80870f..f1077dbc4f0 100644 --- a/dts/bindings/clock/nordic,nrf-hsfll.yaml +++ b/dts/bindings/clock/nordic,nrf-hsfll.yaml @@ -57,9 +57,3 @@ properties: - 368000000 - 384000000 - 400000000 - - nordic,ficrs: - required: true - - nordic,ficr-names: - required: true diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index df72cdb977b..1ba620473a0 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -55,6 +55,8 @@ static void power_domain_init(void) static int trim_hsfll(void) { +#if defined(HSFLL_NODE) + NRF_HSFLL_Type *hsfll = (NRF_HSFLL_Type *)DT_REG_ADDR(HSFLL_NODE); nrf_hsfll_trim_t trim = { .vsup = sys_read32(FICR_ADDR_GET(HSFLL_NODE, vsup)), @@ -77,6 +79,8 @@ static int trim_hsfll(void) LOG_DBG("NRF_HSFLL->TRIM.COARSE = %d", hsfll->TRIM.COARSE); LOG_DBG("NRF_HSFLL->TRIM.FINE = %d", hsfll->TRIM.FINE); +#endif /* defined(HSFLL_NODE) */ + return 0; } From 033e1a400a741d036a5951cb7fcb425b94abbb0f Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Tue, 16 Apr 2024 10:46:32 +0200 Subject: [PATCH 11/17] [nrf fromlist] soc: nordic: nrf54h20: Use KERNEL_INIT_PRIORITY_DEFAULT Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/71536 Make the SoC initialization priority configurable. Signed-off-by: Grzegorz Swiderski (cherry picked from commit d5442da200a4b1e9ac3a11b4ea16c6a69666729c) --- soc/nordic/nrf54h/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 1ba620473a0..ce5af2e25af 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -111,4 +111,4 @@ void arch_busy_wait(uint32_t time_us) nrfx_coredep_delay_us(time_us); } -SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, 0); +SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); From 495c14e393a59c3100ecd43fe52e8cc574abeaff Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Tue, 16 Apr 2024 10:46:32 +0200 Subject: [PATCH 12/17] [nrf fromlist] soc: nordic: Extend address validation for nRF54H20 Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/71536 Add `CHECK_DT_REG()` entries for a few additional peripheral types: BELLBOARD, CCM, GRTC, HSFLL, UICR, and VPR. For peripheral instances outside of the Global Domain, such as DPPIC020, use domain-specific defines like NRF_RADIOCORE_DPPIC020 when validating. These are always defined by the MDK, while NRF_DPPIC020 isn't guaranteed to exist in those cases. Revise existing macro checks accordingly. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 1750413c7f22a76d504c35a890d31eab469c9850) --- soc/nordic/validate_base_addresses.c | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index e83c0ea8dcb..5c9f31c9c1f 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -37,6 +37,14 @@ #define NRF_QDEC0 NRF_QDEC #endif +#if !defined(NRF_RADIO) && defined(NRF_RADIOCORE_RADIO) +#define NRF_RADIO NRF_RADIOCORE_RADIO +#endif + +#if !defined(NRF_RTC) && defined(NRF_RADIOCORE_RTC) +#define NRF_RTC NRF_RADIOCORE_RTC +#endif + #if !defined(NRF_SWI0) && defined(NRF_SWI_BASE) #define NRF_SWI0 ((0 * 0x1000) + NRF_SWI_BASE) #endif @@ -126,8 +134,13 @@ CHECK_DT_REG(acl, NRF_ACL); CHECK_DT_REG(adc, NODE_ADDRESS(adc, nordic_nrf_adc, NRF_ADC, NRF_SAADC)); +CHECK_DT_REG(cpusec_bellboard, NRF_SECDOMBELLBOARD); +CHECK_DT_REG(cpuapp_bellboard, NRF_APPLICATION_BELLBOARD); +CHECK_DT_REG(cpurad_bellboard, NRF_RADIOCORE_BELLBOARD); CHECK_DT_REG(bprot, NRF_BPROT); CHECK_DT_REG(ccm, NRF_CCM); +CHECK_DT_REG(ccm030, NRF_RADIOCORE_CCM030); +CHECK_DT_REG(ccm031, NRF_RADIOCORE_CCM031); CHECK_DT_REG(clock, NRF_CLOCK); CHECK_DT_REG(comp, NODE_ADDRESS(comp, nordic_nrf_comp, NRF_COMP, NRF_LPCOMP)); CHECK_DT_REG(cryptocell, NRF_CRYPTOCELL); @@ -138,7 +151,7 @@ CHECK_DT_REG(dppic00, NRF_DPPIC00); CHECK_DT_REG(dppic10, NRF_DPPIC10); CHECK_DT_REG(dppic20, NRF_DPPIC20); CHECK_DT_REG(dppic30, NRF_DPPIC30); -CHECK_DT_REG(dppic020, NRF_DPPIC020); +CHECK_DT_REG(dppic020, NRF_RADIOCORE_DPPIC020); CHECK_DT_REG(dppic120, NRF_DPPIC120); CHECK_DT_REG(dppic130, NRF_DPPIC130); CHECK_DT_REG(dppic131, NRF_DPPIC131); @@ -149,7 +162,8 @@ CHECK_DT_REG(dppic135, NRF_DPPIC135); CHECK_DT_REG(dppic136, NRF_DPPIC136); CHECK_DT_REG(ecb, NRF_ECB); CHECK_DT_REG(ecb020, NRF_ECB020); -CHECK_DT_REG(ecb030, NRF_ECB030); +CHECK_DT_REG(ecb030, NRF_RADIOCORE_ECB030); +CHECK_DT_REG(ecb031, NRF_RADIOCORE_ECB031); CHECK_DT_REG(egu0, NRF_EGU0); CHECK_DT_REG(egu1, NRF_EGU1); CHECK_DT_REG(egu2, NRF_EGU2); @@ -158,7 +172,7 @@ CHECK_DT_REG(egu4, NRF_EGU4); CHECK_DT_REG(egu5, NRF_EGU5); CHECK_DT_REG(egu10, NRF_EGU10); CHECK_DT_REG(egu20, NRF_EGU20); -CHECK_DT_REG(egu020, NRF_EGU020); +CHECK_DT_REG(egu020, NRF_RADIOCORE_EGU020); CHECK_DT_REG(ficr, NRF_FICR); CHECK_DT_REG(flash_controller, NRF_NVMC); CHECK_DT_REG(gpio0, NRF_P0); @@ -174,6 +188,9 @@ CHECK_DT_REG(gpiote20, NRF_GPIOTE20); CHECK_DT_REG(gpiote30, NRF_GPIOTE30); CHECK_DT_REG(gpiote130, NRF_GPIOTE130); CHECK_DT_REG(gpiote131, NRF_GPIOTE131); +CHECK_DT_REG(grtc, NRF_GRTC); +CHECK_DT_REG(cpuapp_hsfll, NRF_APPLICATION_HSFLL); +CHECK_DT_REG(cpurad_hsfll, NRF_RADIOCORE_HSFLL); CHECK_I2C_REG(i2c0, 0); CHECK_I2C_REG(i2c1, 1); CHECK_DT_REG(i2c2, NRF_TWIM2); @@ -193,8 +210,8 @@ CHECK_DT_REG(i2c137, NRF_TWIM137); CHECK_DT_REG(i2s0, NRF_I2S0); CHECK_DT_REG(i2s20, NRF_I2S20); CHECK_DT_REG(ipc, NRF_IPC); -CHECK_DT_REG(cpuapp_ipct, NRF_IPCT); -CHECK_DT_REG(cpurad_ipct, NRF_IPCT); +CHECK_DT_REG(cpuapp_ipct, NRF_APPLICATION_IPCT); +CHECK_DT_REG(cpurad_ipct, NRF_RADIOCORE_IPCT); CHECK_DT_REG(ipct120, NRF_IPCT120); CHECK_DT_REG(ipct130, NRF_IPCT130); CHECK_DT_REG(kmu, NRF_KMU); @@ -275,9 +292,9 @@ CHECK_DT_REG(timer21, NRF_TIMER21); CHECK_DT_REG(timer22, NRF_TIMER22); CHECK_DT_REG(timer23, NRF_TIMER23); CHECK_DT_REG(timer24, NRF_TIMER24); -CHECK_DT_REG(timer020, NRF_TIMER020); -CHECK_DT_REG(timer021, NRF_TIMER021); -CHECK_DT_REG(timer022, NRF_TIMER022); +CHECK_DT_REG(timer020, NRF_RADIOCORE_TIMER020); +CHECK_DT_REG(timer021, NRF_RADIOCORE_TIMER021); +CHECK_DT_REG(timer022, NRF_RADIOCORE_TIMER022); CHECK_DT_REG(timer120, NRF_TIMER120); CHECK_DT_REG(timer121, NRF_TIMER121); CHECK_DT_REG(timer130, NRF_TIMER130); @@ -307,11 +324,14 @@ CHECK_DT_REG(uart135, NRF_UARTE135); CHECK_DT_REG(uart136, NRF_UARTE136); CHECK_DT_REG(uart137, NRF_UARTE137); CHECK_DT_REG(uicr, NRF_UICR); +CHECK_DT_REG(cpuapp_uicr, NRF_APPLICATION_UICR); +CHECK_DT_REG(cpurad_uicr, NRF_RADIOCORE_UICR); CHECK_DT_REG(usbd, NRF_USBD); CHECK_DT_REG(usbhs, NRF_USBHS); CHECK_DT_REG(usbhs_core, NRF_USBHSCORE0); CHECK_DT_REG(usbreg, NRF_USBREGULATOR); CHECK_DT_REG(vmc, NRF_VMC); +CHECK_DT_REG(cpuppr_vpr, NRF_VPR130); CHECK_DT_REG(wdt, NRF_WDT0); /* this should be the same node as wdt0 */ CHECK_DT_REG(wdt0, NRF_WDT0); CHECK_DT_REG(wdt1, NRF_WDT1); From 8b17c55f6a7798d62ef30892872b3e5301603d56 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Wed, 17 Apr 2024 13:51:37 +0200 Subject: [PATCH 13/17] [nrf fromlist] dts: nordic: Add RESETINFO Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/71609 Add devicetree nodes for the Reset Information registers on nRF54H20, along with a new binding. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 8fe636b4d583b7f3d119d7e80094e3b5bfa52099) --- dts/bindings/arm/nordic,nrf-resetinfo.yaml | 12 ++++++++++++ dts/common/nordic/nrf54h20.dtsi | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 dts/bindings/arm/nordic,nrf-resetinfo.yaml diff --git a/dts/bindings/arm/nordic,nrf-resetinfo.yaml b/dts/bindings/arm/nordic,nrf-resetinfo.yaml new file mode 100644 index 00000000000..c8585e5897e --- /dev/null +++ b/dts/bindings/arm/nordic,nrf-resetinfo.yaml @@ -0,0 +1,12 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic RESETINFO (Reset Information) + +compatible: "nordic,nrf-resetinfo" + +include: base.yaml + +properties: + reg: + required: true diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 75d112b85e2..faaa9e8e1aa 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -168,6 +168,11 @@ interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>, <65 NRF_DEFAULT_IRQ_PRIORITY>; }; + + cpuapp_resetinfo: resetinfo@1e000 { + compatible = "nordic,nrf-resetinfo"; + reg = <0x1e000 0x1000>; + }; }; cpurad_peripherals: peripheral@53000000 { @@ -188,6 +193,11 @@ nordic,ficr-names = "vsup", "coarse", "fine"; }; + cpurad_resetinfo: resetinfo@1e000 { + compatible = "nordic,nrf-resetinfo"; + reg = <0x1e000 0x1000>; + }; + dppic020: dppic@22000 { compatible = "nordic,nrf-dppic-local"; reg = <0x22000 0x1000>; From d5909d6ba1fd02f98a23476213557ec0a971ce3c Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Tue, 19 Dec 2023 15:25:08 +0100 Subject: [PATCH 14/17] [nrf fromlist] drivers: timer: grtc: Update GRTC driver Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/71688 This commit aligns the GRTC driver to changes introduced in hal_nordic. Some of the features regarding GRTC sleep/wakeup functionality has been modified and moved out to the nrfx driver's code. Signed-off-by: Adam Kondraciuk (cherry picked from commit 88a50aa5ee0a01fe029676b916329dc75ca5deea) --- drivers/timer/Kconfig.nrf_grtc | 13 ++- drivers/timer/nrf_grtc_timer.c | 87 +++++-------------- include/zephyr/drivers/timer/nrf_grtc_timer.h | 1 + modules/hal_nordic/nrfx/CMakeLists.txt | 15 +++- 4 files changed, 46 insertions(+), 70 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index 442c524fd19..444d13aab31 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -40,9 +40,20 @@ config NRF_GRTC_TIMER_CLOCK_MANAGEMENT the GRTC. Usually this is only needed by the processor that is starting the SYSCOUNTER, but can be shared by multiple processors in the system. -config NRF_GRTC_SLEEP_MINIMUM_LATENCY +config NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY int default 1000 depends on NRF_GRTC_SLEEP_ALLOWED + help + The value (in us) ensures that the wakeup event will not fire + too early. In other words, applying SYSCOUNTER sleep state for less than + NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY period makes no sense. + +config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE + bool + default y if NRF_GRTC_START_SYSCOUNTER + help + This feature prevents the SYSCOUNTER to sleep when any core is in + active state. endif # NRF_GRTC_TIMER diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 7f6ae02bceb..7a31cde7bfa 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -29,12 +29,6 @@ #define CHAN_COUNT NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS #define EXT_CHAN_COUNT (CHAN_COUNT - 1) -/* The reset value of waketime is 1, which doesn't seem to work. - * It's being looked into, but for the time being use 4. - * Timeout must always be higher than waketime, so setting that to 5. - */ -#define WAKETIME (4) -#define TIMEOUT (WAKETIME + 1) #ifndef GRTC_SYSCOUNTERL_VALUE_Msk #define GRTC_SYSCOUNTERL_VALUE_Msk GRTC_SYSCOUNTER_SYSCOUNTERL_VALUE_Msk @@ -55,9 +49,6 @@ #define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK) -/* The maximum SYSCOUNTERVALID settling time equals 1x32k cycles + 20x1MHz cycles. */ -#define GRTC_SYSCOUNTERVALID_SETTLE_MAX_TIME_US 51 - #if defined(CONFIG_TEST) const int32_t z_sys_timer_irq_for_test = DT_IRQN(GRTC_NODE); #endif @@ -78,36 +69,6 @@ static nrfx_grtc_channel_t system_clock_channel_data = { __ASSERT_NO_MSG((NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK & (1UL << (chan))) && \ ((chan) != system_clock_channel_data.channel)) -static inline void grtc_active_set(void) -{ -#if defined(NRF_GRTC_HAS_SYSCOUNTER_ARRAY) && (NRF_GRTC_HAS_SYSCOUNTER_ARRAY == 1) - nrfy_grtc_sys_counter_active_set(NRF_GRTC, true); - while (!nrfy_grtc_sys_conter_ready_check(NRF_GRTC)) { - } -#else - nrfy_grtc_sys_counter_active_state_request_set(NRF_GRTC, true); - k_busy_wait(GRTC_SYSCOUNTERVALID_SETTLE_MAX_TIME_US); -#endif -} - -static inline void grtc_wakeup(void) -{ - if (IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { - grtc_active_set(); - } -} - -static inline void grtc_sleep(void) -{ - if (IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { -#if defined(NRF_GRTC_HAS_SYSCOUNTER_ARRAY) && (NRF_GRTC_HAS_SYSCOUNTER_ARRAY == 1) - nrfy_grtc_sys_counter_active_set(NRF_GRTC, false); -#else - nrfy_grtc_sys_counter_active_state_request_set(NRF_GRTC, false); -#endif - } -} - static inline uint64_t counter_sub(uint64_t a, uint64_t b) { return (a - b); @@ -116,10 +77,7 @@ static inline uint64_t counter_sub(uint64_t a, uint64_t b) static inline uint64_t counter(void) { uint64_t now; - - grtc_wakeup(); nrfx_grtc_syscounter_get(&now); - grtc_sleep(); return now; } @@ -141,10 +99,8 @@ static inline uint64_t get_comparator(uint32_t chan) static void system_timeout_set(uint64_t value) { if (value <= NRF_GRTC_SYSCOUNTER_CCADD_MASK) { - grtc_wakeup(); nrfx_grtc_syscounter_cc_relative_set(&system_clock_channel_data, value, true, NRFX_GRTC_CC_RELATIVE_SYSCOUNTER); - grtc_sleep(); } else { nrfx_grtc_syscounter_cc_absolute_set(&system_clock_channel_data, value + counter(), true); @@ -373,6 +329,7 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ uint64_t capt_time; + nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -383,8 +340,10 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ return -EBUSY; } - - capt_time = nrfy_grtc_sys_counter_cc_get(NRF_GRTC, chan); + result = nrfx_grtc_syscounter_cc_value_read(chan, &capt_time); + if (result != NRFX_SUCCESS) { + return -EPERM; + } __ASSERT_NO_MSG(capt_time < COUNTER_SPAN); @@ -399,16 +358,22 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) nrfx_err_t err_code; static uint8_t systemoff_channel; uint64_t now = counter(); + nrfx_grtc_sleep_config_t sleep_cfg; /* Minimum time that ensures valid execution of system-off procedure. */ - uint32_t minimum_latency_us = nrfy_grtc_waketime_get(NRF_GRTC) + - nrfy_grtc_timeout_get(NRF_GRTC) + - CONFIG_NRF_GRTC_SLEEP_MINIMUM_LATENCY; + uint32_t minimum_latency_us; uint32_t chan; int ret; + nrfx_grtc_sleep_configuration_get(&sleep_cfg); + minimum_latency_us = (sleep_cfg.waketime + sleep_cfg.timeout) * USEC_PER_SEC / 32768 + + CONFIG_NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY; + sleep_cfg.auto_mode = false; + nrfx_grtc_sleep_configure(&sleep_cfg); + if (minimum_latency_us > wake_time_us) { return -EINVAL; } + k_spinlock_key_t key = k_spin_lock(&lock); err_code = nrfx_grtc_channel_alloc(&systemoff_channel); @@ -417,7 +382,9 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) return -ENOMEM; } (void)nrfx_grtc_syscounter_cc_int_disable(systemoff_channel); - ret = compare_set(systemoff_channel, now + wake_time_us, NULL, NULL); + ret = compare_set(systemoff_channel, + now + wake_time_us * sys_clock_hw_cycles_per_sec() / USEC_PER_SEC, NULL, + NULL); if (ret < 0) { k_spin_unlock(&lock, key); return ret; @@ -433,7 +400,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) } /* Make sure that wake_time_us was not triggered yet. */ - if (nrfy_grtc_sys_counter_compare_event_check(NRF_GRTC, systemoff_channel)) { + if (nrfx_grtc_syscounter_compare_event_check(systemoff_channel)) { k_spin_unlock(&lock, key); return -EINVAL; } @@ -444,7 +411,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) MAX_CC_LATCH_WAIT_TIME_US; k_busy_wait(wait_time); #if NRF_GRTC_HAS_CLKSEL - nrfy_grtc_clksel_set(NRF_GRTC, NRF_GRTC_CLKSEL_LFXO); + nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO); #endif k_spin_unlock(&lock, key); return 0; @@ -485,16 +452,9 @@ static int sys_clock_driver_init(void) #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && \ (defined(NRF_GRTC_HAS_CLKSEL) && (NRF_GRTC_HAS_CLKSEL == 1)) /* Use System LFCLK as the low-frequency clock source. */ - nrfy_grtc_clksel_set(NRF_GRTC, NRF_GRTC_CLKSEL_LFCLK); + nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFCLK); #endif -#if defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) - /* SYSCOUNTER needs to be turned off before initialization. */ - nrfy_grtc_sys_counter_set(NRF_GRTC, false); - nrfy_grtc_timeout_set(NRF_GRTC, TIMEOUT); - nrfy_grtc_waketime_set(NRF_GRTC, WAKETIME); -#endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ - IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, nrfx_grtc_irq_handler, 0); @@ -508,9 +468,6 @@ static int sys_clock_driver_init(void) if (err_code != NRFX_SUCCESS) { return err_code == NRFX_ERROR_NO_MEM ? -ENOMEM : -EPERM; } - if (IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { - nrfy_grtc_sys_counter_auto_mode_set(NRF_GRTC, false); - } #else err_code = nrfx_grtc_channel_alloc(&system_clock_channel_data.channel); if (err_code != NRFX_SUCCESS) { @@ -518,10 +475,6 @@ static int sys_clock_driver_init(void) } #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ - if (!IS_ENABLED(CONFIG_NRF_GRTC_SLEEP_ALLOWED)) { - grtc_active_set(); - } - int_mask = NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { system_timeout_set(CYC_PER_TICK); diff --git a/include/zephyr/drivers/timer/nrf_grtc_timer.h b/include/zephyr/drivers/timer/nrf_grtc_timer.h index 76fa7b70346..1814202a097 100644 --- a/include/zephyr/drivers/timer/nrf_grtc_timer.h +++ b/include/zephyr/drivers/timer/nrf_grtc_timer.h @@ -169,6 +169,7 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan); * * @retval 0 if the timestamp was successfully caught and read. * @retval -EBUSY if capturing has not been triggered. + * @retval -EPERM if either channel is unavailable or SYSCOUNTER is not running. */ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time); diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 540ec4e0b30..557f3df0cab 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -127,8 +127,19 @@ if(CONFIG_NRFX_TWI OR CONFIG_NRFX_TWIM) zephyr_library_sources(${SRC_DIR}/nrfx_twi_twim.c) endif() -if (CONFIG_NRF_GRTC_TIMER AND CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) - zephyr_compile_definitions(NRF_GRTC_HAS_EXTENDED=1) +if (CONFIG_NRF_GRTC_TIMER) + if (CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) + zephyr_compile_definitions(NRF_GRTC_HAS_EXTENDED=1) + endif() + if (CONFIG_NRF_GRTC_SLEEP_ALLOWED) + zephyr_compile_definitions(NRFX_GRTC_CONFIG_SLEEP_ALLOWED=1) + endif() + if (CONFIG_NRF_GRTC_TIMER_AUTO_KEEP_ALIVE) + zephyr_compile_definitions(NRFX_GRTC_CONFIG_AUTOEN=1) + endif() + if (CONFIG_NRF_GRTC_START_SYSCOUNTER) + zephyr_compile_definitions(NRFX_GRTC_CONFIG_AUTOSTART=1) + endif() endif() # Inject HAL "CONFIG_NFCT_PINS_AS_GPIOS" definition if user requests to From c382cd428df11ee61c62e6554cb7a84af34b6a1d Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 1 Feb 2024 09:46:02 +0100 Subject: [PATCH 15/17] [nrf fromlist] tests: drivers: timer: grtc: Fix GRTC test Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/71688 The `z_nrf_grtc_timer_get_ticks()` function converts system ticks to GRTC ticks. It gets the current system tick to calculate an absolute GRTC value. The same does the test function to provide an argument to be converted. If the system tick occurs between those `sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will take into account the newer tick while the test estimate bases on the old tick value. Due to that the maximum result error is 1 system tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC ticks. Signed-off-by: Adam Kondraciuk (cherry picked from commit 57713428a84d4a86290bae9c636a5d0606b9798f) --- tests/drivers/timer/nrf_grtc_timer/src/main.c | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index 197270cc6a4..e6621316666 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -8,12 +8,15 @@ #include #define GRTC_SLEW_TICKS 10 +#define NUMBER_OF_TRIES 2000 +#define CYC_PER_TICK \ + ((uint64_t)sys_clock_hw_cycles_per_sec() / (uint64_t)CONFIG_SYS_CLOCK_TICKS_PER_SEC) ZTEST(nrf_grtc_timer, test_get_ticks) { k_timeout_t t = K_MSEC(1); - uint64_t exp_ticks = z_nrf_grtc_timer_read() + t.ticks; + uint64_t exp_ticks = z_nrf_grtc_timer_read() + t.ticks * CYC_PER_TICK; int64_t ticks; /* Relative 1ms from now timeout converted to GRTC */ @@ -21,20 +24,26 @@ ZTEST(nrf_grtc_timer, test_get_ticks) zassert_true((ticks >= exp_ticks) && (ticks <= (exp_ticks + GRTC_SLEW_TICKS)), "Unexpected result %" PRId64 " (expected: %" PRId64 ")", ticks, exp_ticks); - /* Absolute timeout 1ms in the past */ - t = Z_TIMEOUT_TICKS(Z_TICK_ABS(sys_clock_tick_get() - K_MSEC(1).ticks)); - - exp_ticks = z_nrf_grtc_timer_read() - K_MSEC(1).ticks; - ticks = z_nrf_grtc_timer_get_ticks(t); - zassert_true((ticks >= exp_ticks) && (ticks <= (exp_ticks + GRTC_SLEW_TICKS)), - "Unexpected result %" PRId64 " (expected: %" PRId64 ")", ticks, exp_ticks); - - /* Absolute timeout 10ms in the future */ - t = Z_TIMEOUT_TICKS(Z_TICK_ABS(sys_clock_tick_get() + K_MSEC(10).ticks)); - exp_ticks = z_nrf_grtc_timer_read() + K_MSEC(10).ticks; - ticks = z_nrf_grtc_timer_get_ticks(t); - zassert_true((ticks >= exp_ticks) && (ticks <= (exp_ticks + GRTC_SLEW_TICKS)), - "Unexpected result %" PRId64 " (expected: %" PRId64 ")", ticks, exp_ticks); + for (uint32_t i = 0; i < NUMBER_OF_TRIES; i++) { + /* Absolute timeout 1ms in the past */ + t = Z_TIMEOUT_TICKS(Z_TICK_ABS(sys_clock_tick_get() - K_MSEC(1).ticks)); + + exp_ticks = z_nrf_grtc_timer_read() - K_MSEC(1).ticks * CYC_PER_TICK; + ticks = z_nrf_grtc_timer_get_ticks(t); + zassert_true((ticks >= (exp_ticks - CYC_PER_TICK + 1)) && + (ticks <= (exp_ticks + GRTC_SLEW_TICKS)), + "Unexpected result %" PRId64 " (expected: %" PRId64 ")", ticks, + exp_ticks); + + /* Absolute timeout 10ms in the future */ + t = Z_TIMEOUT_TICKS(Z_TICK_ABS(sys_clock_tick_get() + K_MSEC(10).ticks)); + exp_ticks = z_nrf_grtc_timer_read() + K_MSEC(10).ticks * CYC_PER_TICK; + ticks = z_nrf_grtc_timer_get_ticks(t); + zassert_true((ticks >= (exp_ticks - CYC_PER_TICK + 1)) && + (ticks <= (exp_ticks + GRTC_SLEW_TICKS)), + "Unexpected result %" PRId64 " (expected: %" PRId64 ")", ticks, + exp_ticks); + } } ZTEST_SUITE(nrf_grtc_timer, NULL, NULL, NULL, NULL, NULL); From 6895e2422b4f39914027582dde81720d1792b998 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Fri, 3 May 2024 10:07:30 +0200 Subject: [PATCH 16/17] [nrf fromlist] boards: nrf54h20dk: Drop shared_ram20_region's compatible Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/72273 Access to this region should no longer be requested via UICR, because it will be statically allocated by secure domain firmware. Signed-off-by: Grzegorz Swiderski (cherry picked from commit d95aa856e98b6561d534cbe36ffc6e87de3deab2) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 91899e2cf86..f67ddfb80bf 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -70,11 +70,7 @@ }; shared_ram20_region: memory@2f88f000 { - compatible = "nordic,owned-memory"; reg = <0x2f88f000 DT_SIZE_K(4)>; - status = "disabled"; - perm-read; - perm-write; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x2f88f000 0x1000>; From f077b64169d8c69ad469488675c6266869a3340e Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Wed, 17 Apr 2024 13:51:37 +0200 Subject: [PATCH 17/17] [nrf noup] boards: nordic: nrf54h20dk: Add aliases for RESETINFO Each local RESETINFO instance can be used in samples. Applied as `noup` because of conflicts. Signed-off-by: Grzegorz Swiderski --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 1 + boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 24d161420d6..136197d2767 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -34,6 +34,7 @@ led2 = &led2; led3 = &led3; pwm-led0 = &pwm_led0; + resetinfo = &cpuapp_resetinfo; sw0 = &button0; sw1 = &button1; sw2 = &button2; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index cb69b5ce3a6..32cda09ff37 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -33,6 +33,10 @@ compatible = "nordic,entropy-prng"; status = "okay"; }; + + aliases { + resetinfo = &cpurad_resetinfo; + }; }; &shared_ram3x_region {