Skip to content

Commit

Permalink
manifest: Adding nRF Services library
Browse files Browse the repository at this point in the history
Adding nRF Services library to the hal-nordic repo

Signed-off-by: Rafal Dyla <[email protected]>
  • Loading branch information
Rafal-Nordic committed Apr 30, 2024
1 parent 262af56 commit dd46b69
Show file tree
Hide file tree
Showing 19 changed files with 1,464 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
shared_ram20_region: memory@2f88f000 {
compatible = "nordic,owned-memory";
reg = <0x2f88f000 DT_SIZE_K(4)>;
status = "disabled";
status = "okay";
perm-read;
perm-write;
#address-cells = <1>;
Expand Down
6 changes: 6 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
sw1 = &button1;
sw2 = &button2;
sw3 = &button3;
ipc-to-cpusys = &cpuapp_cpusys_ipc;
};

buttons {
Expand Down Expand Up @@ -115,6 +116,10 @@
status = "okay";
};

&cpusys_vevif{
status = "okay";
};

&cpusec_cpuapp_ipc {
mbox-names = "tx", "rx";
tx-region = <&cpuapp_cpusec_ipc_shm>;
Expand All @@ -131,6 +136,7 @@ ipc0: &cpuapp_cpurad_ipc {
};

&cpuapp_cpusys_ipc {
status = "okay";
mbox-names = "rx", "tx";
tx-region = <&cpuapp_cpusys_ipc_shm>;
rx-region = <&cpusys_cpuapp_ipc_shm>;
Expand Down
8 changes: 8 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
zephyr,shell-uart = &uart135;
zephyr,bt-hci-ipc = &ipc0;
};
aliases {
ipc-to-cpusys = &cpurad_cpusys_ipc;
};
};

&shared_ram3x_region {
Expand All @@ -49,6 +52,10 @@
status = "okay";
};

&cpusys_vevif{
status = "okay";
};

&cpusec_cpurad_ipc {
mbox-names = "tx", "rx";
tx-region = <&cpurad_cpusec_ipc_shm>;
Expand All @@ -65,6 +72,7 @@ ipc0: &cpuapp_cpurad_ipc {
};

&cpurad_cpusys_ipc {
status = "okay";
mbox-names = "rx", "tx";
tx-region = <&cpurad_cpusys_ipc_shm>;
rx-region = <&cpusys_cpurad_ipc_shm>;
Expand Down
3 changes: 2 additions & 1 deletion modules/hal_nordic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
endif (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)

add_subdirectory_ifdef(CONFIG_HAS_NRFX nrfx)
add_subdirectory_ifdef(CONFIG_HAS_NRFS nrfs)

if(CONFIG_NRF_REGTOOL_GENERATE_UICR)
list(APPEND nrf_regtool_components GENERATE:UICR)
endif()
if(DEFINED nrf_regtool_components)
find_package(nrf-regtool 5.1.0
find_package(nrf-regtool 5.2.0
COMPONENTS ${nrf_regtool_components}
PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool
NO_CMAKE_PATH
Expand Down
1 change: 1 addition & 0 deletions modules/hal_nordic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,6 @@ endif # NRF_802154_RADIO_DRIVER || NRF_802154_SERIALIZATION

endmenu # HAS_NORDIC_DRIVERS

rsource "nrfs/Kconfig"
rsource "nrfx/Kconfig"
rsource "Kconfig.nrf_regtool"
41 changes: 41 additions & 0 deletions modules/hal_nordic/nrfs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

if(CONFIG_NRFS)
if(NOT DEFINED NRFS_DIR)
set(NRFS_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfs CACHE PATH "nrfs directory")
endif()

set(INC_DIR ${NRFS_DIR}/include)
set(SRC_DIR ${NRFS_DIR}/src)
set(HELPERS_DIR ${NRFS_DIR}/helpers)

zephyr_include_directories(${INC_DIR})
zephyr_include_directories(${INC_DIR}/services)
zephyr_include_directories(${HELPERS_DIR})
zephyr_include_directories(.)
zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backends)
zephyr_include_directories_ifdef(CONFIG_NRFS_DVFS_LOCAL_DOMAIN ${CMAKE_CURRENT_SOURCE_DIR}/dvfs)

zephyr_library_sources(${HELPERS_DIR}/dvfs_oppoint.c)

if(CONFIG_NRFS_LOCAL_DOMAIN)
zephyr_library_sources_ifdef(CONFIG_NRFS_CLOCK_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_clock.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_DIAG_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_diag.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_DVFS_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_dvfs.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_MRAM_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_mram.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_PMIC_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_pmic.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_RESET_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_reset.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_TEMP_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_temp.c)
zephyr_library_sources_ifdef(CONFIG_NRFS_VBUS_DETECTOR_SERVICE_ENABLED ${SRC_DIR}/services/nrfs_usb.c)
zephyr_library_sources(${SRC_DIR}/internal/nrfs_dispatcher.c)
add_subdirectory_ifdef(CONFIG_NRFS_DVFS_LOCAL_DOMAIN dvfs)

if(CONFIG_NRFS_DIAG_SERVICE_ENABLED)
message(WARNING "This service is for Nordic Semiconductor INTERNAL purposes ONLY. Use it with caution due to risk of hardware damage!")
endif()
endif()
zephyr_library_sources_ifdef(CONFIG_NRFS_BACKEND_IPC_SERVICE backends/nrfs_backend_ipc_service.c)
endif()
122 changes: 122 additions & 0 deletions modules/hal_nordic/nrfs/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config HAS_NRFS
bool

menu "nRF Services"
depends on HAS_NRFS

config NRFS_HAS_CLOCK_SERVICE
bool

config NRFS_HAS_CONST_LATENCY_SERVICE
bool

config NRFS_HAS_DIAG_SERVICE
bool

config NRFS_HAS_DVFS_SERVICE
bool

config NRFS_HAS_MRAM_SERVICE
bool

config NRFS_HAS_PMIC_SERVICE
bool

config NRFS_HAS_RESET_SERVICE
bool

config NRFS_HAS_TEMP_SERVICE
bool

config NRFS_HAS_VBUS_DETECTOR_SERVICE
bool

config NRFS
bool "nRF Services Support"
select NRFS_LOCAL_DOMAIN if (SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD)
depends on HAS_NRFS
help
This option enables the nRF Services library.

if NRFS

config NRFS_LOCAL_DOMAIN
bool "nRF Services Local Domain Support"
select NRFS_BACKEND_IPC_SERVICE
help
This option enables the nRF Services Local Domain libraries.

config NRFS_BACKEND_IPC_SERVICE
bool "IPC service backend for NRFS"
depends on $(dt_alias_enabled,ipc-to-cpusys)
select IPC_SERVICE
select MBOX
select EVENTS
select REBOOT
help
This option enables transport protocol for the NRFS.

config NRFS_DVFS_LOCAL_DOMAIN
bool "Local domain that supports DVFS"
depends on NRFS_LOCAL_DOMAIN
depends on NRFS_HAS_DVFS_SERVICE
default y if NRFS_DVFS_SERVICE_ENABLED

menu "Enabled Services"

module = NRFS
module-str = nRF-Services
source "subsys/logging/Kconfig.template.log_config"

config NRFS_RESET_SERVICE_ENABLED
bool "Reset service"
depends on NRFS_HAS_RESET_SERVICE

config NRFS_MRAM_SERVICE_ENABLED
bool "MRAM latency service"
depends on NRFS_HAS_MRAM_SERVICE

config NRFS_TEMP_SERVICE_ENABLED
bool "Temperature service"
depends on NRFS_HAS_TEMP_SERVICE
default y

config NRFS_VBUS_DETECTOR_SERVICE_ENABLED
bool "VBUS detector for the USB peripheral"
depends on NRFS_HAS_VBUS_DETECTOR_SERVICE
default y

config NRFS_CONST_LATENCY_SERVICE_ENABLED
bool "DPPI constant latency service"
depends on NRFS_HAS_CONST_LATENCY_SERVICE
default y

config NRFS_PMIC_SERVICE_ENABLED
bool "PMIC service"
depends on NRFS_HAS_PMIC_SERVICE

config NRFS_DVFS_SERVICE_ENABLED
bool "DVFS service"
depends on NRFS_HAS_DVFS_SERVICE
default y if SOC_NRF54H20_CPUAPP

config NRFS_DIAG_SERVICE_ENABLED
bool "System Diagnostics service (only for development purposes)"
depends on NRFS_HAS_DIAG_SERVICE

config NRFS_CLOCK_SERVICE_ENABLED
bool "Clock service"
depends on NRFS_HAS_CLOCK_SERVICE
default y
endmenu

rsource "backends/Kconfig"
if NRFS_DVFS_LOCAL_DOMAIN
rsource "dvfs/Kconfig"
endif # NRFS_DVFS_LOCAL_DOMAIN

endif # NRFS
endmenu
28 changes: 28 additions & 0 deletions modules/hal_nordic/nrfs/backends/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0


menu "NRFS backend settings"

module = NRFS_BACKEND
module-str = NRFS backend
source "subsys/logging/Kconfig.template.log_config"

config NRFS_BACKEND_IPC_SERVICE_LITE_INIT_PRIO
int "Initialization priority for NRFS IPC backend"
default 51
help
This should be higher than priority of other drivers/subsystems
used by NRFS backend. For example MBOX_INIT_PRIORITY which is 50.

config NRFS_MAX_BACKEND_PACKET_SIZE
int "Maximum IPC data packet size in bytes"
range 8 128
default 32

config NRFS_BACKEND_TX_MSG_QUEUE_SIZE
int "Size of TX buffer message queue size"
range 1 16
default 8

endmenu
Loading

0 comments on commit dd46b69

Please sign in to comment.