Skip to content

Commit d74f0b8

Browse files
Rafal-Nordic57300
authored andcommitted
[nrf fromlist] manifest: Adding nRF Services library
Upstream PR: zephyrproject-rtos/zephyr#70245 Adding nRF Services library to the hal-nordic repo Signed-off-by: Rafal Dyla <[email protected]> (cherry picked from commit dd46b6976708e3632230280ce973b94a86b40251)
1 parent c668865 commit d74f0b8

File tree

21 files changed

+1463
-3
lines changed

21 files changed

+1463
-3
lines changed

boards/arm/nrf54h20dk_nrf54h20/nrf54h20dk_nrf54h20-memory_map.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
shared_ram20_region: memory@2f88f000 {
7373
compatible = "nordic,owned-memory";
7474
reg = <0x2f88f000 DT_SIZE_K(4)>;
75-
status = "disabled";
75+
status = "okay";
7676
perm-read;
7777
perm-write;
7878
#address-cells = <1>;

boards/arm/nrf54h20dk_nrf54h20/nrf54h20dk_nrf54h20_cpuapp.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
sw1 = &button1;
3939
sw2 = &button2;
4040
sw3 = &button3;
41+
ipc-to-cpusys = &cpuapp_cpusys_ipc;
4142
};
4243

4344
buttons {
@@ -129,6 +130,10 @@
129130
status = "okay";
130131
};
131132

133+
&cpusys_vevif{
134+
status = "okay";
135+
};
136+
132137
&cpusec_cpuapp_ipc {
133138
mbox-names = "tx", "rx";
134139
tx-region = <&cpuapp_cpusec_ipc_shm>;
@@ -145,6 +150,7 @@ ipc0: &cpuapp_cpurad_ipc {
145150
};
146151

147152
&cpuapp_cpusys_ipc {
153+
status = "okay";
148154
mbox-names = "rx", "tx";
149155
tx-region = <&cpuapp_cpusys_ipc_shm>;
150156
rx-region = <&cpusys_cpuapp_ipc_shm>;

boards/arm/nrf54h20dk_nrf54h20/nrf54h20dk_nrf54h20_cpurad.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
};
3030

3131
aliases {
32+
ipc-to-cpusys = &cpurad_cpusys_ipc;
3233
resetinfo = &cpurad_resetinfo;
3334
};
3435

@@ -58,6 +59,10 @@
5859
status = "okay";
5960
};
6061

62+
&cpusys_vevif{
63+
status = "okay";
64+
};
65+
6166
&cpusec_cpurad_ipc {
6267
mbox-names = "tx", "rx";
6368
tx-region = <&cpurad_cpusec_ipc_shm>;
@@ -74,6 +79,7 @@ ipc0: &cpuapp_cpurad_ipc {
7479
};
7580

7681
&cpurad_cpusys_ipc {
82+
status = "okay";
7783
mbox-names = "rx", "tx";
7884
tx-region = <&cpurad_cpusys_ipc_shm>;
7985
rx-region = <&cpusys_cpurad_ipc_shm>;

modules/hal_nordic/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
66
endif (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
77

88
add_subdirectory_ifdef(CONFIG_HAS_NRFX nrfx)
9+
add_subdirectory_ifdef(CONFIG_HAS_NRFS nrfs)
910

1011
if(CONFIG_NRF_REGTOOL_GENERATE_UICR)
1112
list(APPEND nrf_regtool_components GENERATE:UICR)
1213
endif()
1314
if(DEFINED nrf_regtool_components)
14-
find_package(nrf-regtool 5.1.0
15+
find_package(nrf-regtool 5.2.0
1516
COMPONENTS ${nrf_regtool_components}
1617
PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool
1718
NO_CMAKE_PATH

modules/hal_nordic/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,5 +235,6 @@ endif # NRF_802154_RADIO_DRIVER || NRF_802154_SERIALIZATION
235235

236236
endmenu # HAS_NORDIC_DRIVERS
237237

238+
rsource "nrfs/Kconfig"
238239
rsource "nrfx/Kconfig"
239240
rsource "Kconfig.nrf_regtool"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library()
5+
6+
if(CONFIG_NRFS)
7+
if(NOT DEFINED NRFS_DIR)
8+
set(NRFS_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfs CACHE PATH "nrfs directory")
9+
endif()
10+
11+
set(INC_DIR ${NRFS_DIR}/include)
12+
set(SRC_DIR ${NRFS_DIR}/src)
13+
set(HELPERS_DIR ${NRFS_DIR}/helpers)
14+
15+
zephyr_include_directories(${INC_DIR})
16+
zephyr_include_directories(${INC_DIR}/services)
17+
zephyr_include_directories(${HELPERS_DIR})
18+
zephyr_include_directories(.)
19+
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backends)
20+
zephyr_include_directories_ifdef(CONFIG_NRFS_DVFS_LOCAL_DOMAIN ${CMAKE_CURRENT_SOURCE_DIR}/dvfs)
21+
22+
zephyr_library_sources(${HELPERS_DIR}/dvfs_oppoint.c)
23+
24+
if(CONFIG_NRFS_LOCAL_DOMAIN)
25+
zephyr_library_sources_ifdef(CONFIG_NRFS_CLOCK_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_clock.c)
26+
zephyr_library_sources_ifdef(CONFIG_NRFS_DIAG_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_diag.c)
27+
zephyr_library_sources_ifdef(CONFIG_NRFS_DVFS_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_dvfs.c)
28+
zephyr_library_sources_ifdef(CONFIG_NRFS_MRAM_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_mram.c)
29+
zephyr_library_sources_ifdef(CONFIG_NRFS_PMIC_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_pmic.c)
30+
zephyr_library_sources_ifdef(CONFIG_NRFS_RESET_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_reset.c)
31+
zephyr_library_sources_ifdef(CONFIG_NRFS_TEMP_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_temp.c)
32+
zephyr_library_sources_ifdef(CONFIG_NRFS_VBUS_DETECTOR_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_usb.c)
33+
zephyr_library_sources(${SRC_DIR}/internal/nrfs_dispatcher.c)
34+
add_subdirectory_ifdef(CONFIG_NRFS_DVFS_LOCAL_DOMAIN dvfs)
35+
36+
if(CONFIG_NRFS_DIAG_SERVICE_ENABLED)
37+
message(WARNING "This service is for Nordic Semiconductor INTERNAL purposes ONLY. Use it with caution due to risk of hardware damage!")
38+
endif()
39+
endif()
40+
zephyr_library_sources_ifdef(CONFIG_NRFS_BACKEND_IPC_SERVICE backends/nrfs_backend_ipc_service.c)
41+
endif()

modules/hal_nordic/nrfs/Kconfig

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config HAS_NRFS
5+
bool
6+
7+
menu "nRF Services"
8+
depends on HAS_NRFS
9+
10+
config NRFS_HAS_CLOCK_SERVICE
11+
bool
12+
13+
config NRFS_HAS_CONST_LATENCY_SERVICE
14+
bool
15+
16+
config NRFS_HAS_DIAG_SERVICE
17+
bool
18+
19+
config NRFS_HAS_DVFS_SERVICE
20+
bool
21+
22+
config NRFS_HAS_MRAM_SERVICE
23+
bool
24+
25+
config NRFS_HAS_PMIC_SERVICE
26+
bool
27+
28+
config NRFS_HAS_RESET_SERVICE
29+
bool
30+
31+
config NRFS_HAS_TEMP_SERVICE
32+
bool
33+
34+
config NRFS_HAS_VBUS_DETECTOR_SERVICE
35+
bool
36+
37+
config NRFS
38+
bool "nRF Services Support"
39+
select NRFS_LOCAL_DOMAIN if (SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD)
40+
depends on HAS_NRFS
41+
help
42+
This option enables the nRF Services library.
43+
44+
if NRFS
45+
46+
config NRFS_LOCAL_DOMAIN
47+
bool "nRF Services Local Domain Support"
48+
select NRFS_BACKEND_IPC_SERVICE
49+
help
50+
This option enables the nRF Services Local Domain libraries.
51+
52+
config NRFS_BACKEND_IPC_SERVICE
53+
bool "IPC service backend for NRFS"
54+
depends on $(dt_alias_enabled,ipc-to-cpusys)
55+
select IPC_SERVICE
56+
select MBOX
57+
select EVENTS
58+
select REBOOT
59+
help
60+
This option enables transport protocol for the NRFS.
61+
62+
config NRFS_DVFS_LOCAL_DOMAIN
63+
bool "Local domain that supports DVFS"
64+
depends on NRFS_LOCAL_DOMAIN
65+
depends on NRFS_HAS_DVFS_SERVICE
66+
default y if NRFS_DVFS_SERVICE_ENABLED
67+
68+
menu "Enabled Services"
69+
70+
module = NRFS
71+
module-str = nRF-Services
72+
source "subsys/logging/Kconfig.template.log_config"
73+
74+
config NRFS_RESET_SERVICE_ENABLED
75+
bool "Reset service"
76+
depends on NRFS_HAS_RESET_SERVICE
77+
78+
config NRFS_MRAM_SERVICE_ENABLED
79+
bool "MRAM latency service"
80+
depends on NRFS_HAS_MRAM_SERVICE
81+
82+
config NRFS_TEMP_SERVICE_ENABLED
83+
bool "Temperature service"
84+
depends on NRFS_HAS_TEMP_SERVICE
85+
default y
86+
87+
config NRFS_VBUS_DETECTOR_SERVICE_ENABLED
88+
bool "VBUS detector for the USB peripheral"
89+
depends on NRFS_HAS_VBUS_DETECTOR_SERVICE
90+
default y
91+
92+
config NRFS_CONST_LATENCY_SERVICE_ENABLED
93+
bool "DPPI constant latency service"
94+
depends on NRFS_HAS_CONST_LATENCY_SERVICE
95+
default y
96+
97+
config NRFS_PMIC_SERVICE_ENABLED
98+
bool "PMIC service"
99+
depends on NRFS_HAS_PMIC_SERVICE
100+
101+
config NRFS_DVFS_SERVICE_ENABLED
102+
bool "DVFS service"
103+
depends on NRFS_HAS_DVFS_SERVICE
104+
default y if SOC_NRF54H20_CPUAPP
105+
106+
config NRFS_DIAG_SERVICE_ENABLED
107+
bool "System Diagnostics service (only for development purposes)"
108+
depends on NRFS_HAS_DIAG_SERVICE
109+
110+
config NRFS_CLOCK_SERVICE_ENABLED
111+
bool "Clock service"
112+
depends on NRFS_HAS_CLOCK_SERVICE
113+
default y
114+
endmenu
115+
116+
rsource "backends/Kconfig"
117+
if NRFS_DVFS_LOCAL_DOMAIN
118+
rsource "dvfs/Kconfig"
119+
endif # NRFS_DVFS_LOCAL_DOMAIN
120+
121+
endif # NRFS
122+
endmenu
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
5+
menu "NRFS backend settings"
6+
7+
module = NRFS_BACKEND
8+
module-str = NRFS backend
9+
source "subsys/logging/Kconfig.template.log_config"
10+
11+
config NRFS_BACKEND_IPC_SERVICE_LITE_INIT_PRIO
12+
int "Initialization priority for NRFS IPC backend"
13+
default 51
14+
help
15+
This should be higher than priority of other drivers/subsystems
16+
used by NRFS backend. For example MBOX_INIT_PRIORITY which is 50.
17+
18+
config NRFS_MAX_BACKEND_PACKET_SIZE
19+
int "Maximum IPC data packet size in bytes"
20+
range 8 128
21+
default 32
22+
23+
config NRFS_BACKEND_TX_MSG_QUEUE_SIZE
24+
int "Size of TX buffer message queue size"
25+
range 1 16
26+
default 8
27+
28+
endmenu

0 commit comments

Comments
 (0)