Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest: Adding nRF Services library #70245

Merged
merged 3 commits into from
May 15, 2024

Conversation

Rafal-Nordic
Copy link
Contributor

@Rafal-Nordic Rafal-Nordic commented Mar 14, 2024

Adding nRF Services library to the hal-nordic repo

Depends on zephyrproject-rtos/docker-image#181

Copy link

Hello @Rafal-Nordic, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@zephyrbot
Copy link
Collaborator

zephyrbot commented Mar 14, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff

Note: This message is automatically posted and updated by the Manifest GitHub Action.

modules/hal_nordic/nrfs/CMakeLists.txt Show resolved Hide resolved
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_NRFS)
if(CONFIG_NRFS_LOCAL_DOMAIN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMakeLists.txt in the hal/nordic/nrfs is not included.

diff --git a/modules/hal_nordic/nrfs/CMakeLists.txt b/modules/hal_nordic/nrfs/CMakeLists.txt
index a4edc6be513..eec370cf9b1 100644
--- a/modules/hal_nordic/nrfs/CMakeLists.txt
+++ b/modules/hal_nordic/nrfs/CMakeLists.txt
@@ -2,6 +2,8 @@
 # SPDX-License-Identifier: Apache-2.0
 
 if(CONFIG_NRFS)
+    add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR}/nrfs nrfs)
+
     if(CONFIG_NRFS_LOCAL_DOMAIN)
         zephyr_sources_ifdef(CONFIG_NRFS_BACKEND_IPC_SERVICE_EXTENDED
                             backends/nrfs_backend_ipc_service.c)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMakeLists are now completely reorganized.

Comment on lines 86 to 84
config USB_SERVICE_ENABLED
bool "USB service"
depends on NRFS_HAS_USB_SERVICE
default y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must not be anything prefixed with USB_ or USB_SERVICE_ or have prompt "USB service" that is not part of the USB support in Zephyr. You need to find another short and concise name for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

help
This option enables the nRF Services library

config NRFS_LOCAL_DOMAIN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is LOCAL_DOMAIN? Is there also REMOTE_DOMAIN?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are local and global domains in this SoC architecture

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Local domain" name comes from Product Specification and is commonly used in the MDK. nrf54H20 has the following local domains:

  • App core
  • Rad core
  • Secure domain

help
This option enables the nRF Services Local Domain libraries

config NRFS_BACKEND_IPC_SERVICE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can NRFS be use without IPC?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to provide custom implementation of the backend layer. The default one supported by Nordic is the IPC Service.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SysCtrl supports only IPC_SERVICE backend protocol today, but other domains use also other protocols, so I don't exclude that in the future additional protocols will be supported.

Comment on lines 16 to 20
config NRFS_BACKEND_IPC_SERVICE_EXTENDED
bool "Zephyr IPC service backend for NRFS with additional buffering."

config NRFS_BACKEND_IPC_SERVICE_LITE
bool "Use IPC service directly by NRFS"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two backends and what are the differences?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that "standard" version doesn't make sense anymore. I'll remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

};

static struct ipc_channel_config_t ipc_cpusys_channel_config = {
.ipc_instance = DEVICE_DT_GET(DT_NODELABEL(ipc_to_cpusys)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That finally blocked me, I could not fix it myself quickly. Neither ipc_to_cpusys nor cpuapp_cpusys_ipc seems to exist with all the other things that belong to it. It is like a rocket without a propulsion system. Same for the lite backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, not all required dts files were moved to the upstream repo. I'm checking how to fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented here: #71265

modules/hal_nordic/nrfs/Kconfig Outdated Show resolved Hide resolved
@Rafal-Nordic Rafal-Nordic force-pushed the nrfs_upstreaming branch 2 times, most recently from d3a735d to 101f9e1 Compare May 10, 2024 06:15
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label May 10, 2024
Comment on lines 28 to 32
/**
* @brief Helper function to set bit in state variable.
*
* @param bit_pos bit position in state variable.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, please remove redundant comments / redundant doxygen comments. It does not provide valuable information.

extern "C" {
#endif

struct __NRFS_PACKED ipc_data_packet_t {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use __packed here?

struct __packed ipc_data_packet {

Please remove _t


#define IPC_INIT_DONE_EVENT (0x01)

struct ipc_channel_config_t {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct ipc_channel_config {

_t

Comment on lines 246 to 252
/**
* @brief Task to handle dvfs init procedure.
*
* @param dummy0
* @param dummy1
* @param dummy2
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* Task to handle dvfs init procedure. */

Comment on lines 167 to 170
/**
* @brief Function to set hsfll to highest frequency when switched to ABB.
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* Function to set hsfll to highest frequency when switched to ABB. */

Comment on lines 181 to 187
/**
* @brief DVFS event handler callback function.
*
* @param p_evt event to handle
* @param context context data
*/
void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context)

Comment on lines 109 to 113
/**
* @brief Function handling steps for scaling preparation.
*
* @param oppoint_freq requested frequency oppoint
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* Function handling steps for scaling preparation. */

Comment on lines 90 to 96
/**
* @brief Function to check if current operation is down-scaling
*
* @param target_freq_setting frequency setting target
* @return true down-scaling procedure
* @return false not down-scaling procedure
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* Function to check if current operation is down-scaling */

# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this under if(CONFIG_NRFS) to prevent the following CMake warning:

  No SOURCES given to Zephyr library: modules__hal_nordic__nrfs

when NRFS is not enabled.

@tmon-nordic
Copy link
Contributor

tmon-nordic commented May 13, 2024

When I disabled NRFS_DVFS_SERVICE_ENABLED Kconfig symbol, the build failed with undefined references to nrfs_dvfs_init_prepare_request and nrfs_dvfs_ready_to_scale. There is either some missing dependencies in Kconfig symbols or the Kconfigs are simply incorrect (it shouldn't be possible to get broken builds by disabling Kconfig symbols in menuconfig).

Rafal-Nordic and others added 3 commits May 14, 2024 13:09
Adding nRF Services library to the hal-nordic repo

Signed-off-by: Rafal Dyla <rafal.dyla@nordicsemi.no>
Add driver, together with the corresponding dts binding and node in
the nRF54H20 SoC definiton, for the nRF temperature sensor that cannot
be accessed directly but only through nRF Services (nrfs) layer.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Add a simple test intended primarily for checking the nRF temperature
sensor in its nrfs variant but intentionally was made generic enough
that it should be usable with other temperature sensors (after just
providing an overlay) and could be helpful in development of new
temperature sensor drivers, and possibly extended then if needed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
57300 pushed a commit to 57300/sdk-zephyr that referenced this pull request May 14, 2024
… accessed via nrfs

Upstream PR: zephyrproject-rtos/zephyr#70245

Add driver, together with the corresponding dts binding and node in
the nRF54H20 SoC definiton, for the nRF temperature sensor that cannot
be accessed directly but only through nRF Services (nrfs) layer.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
(cherry picked from commit 8e76ae58fa3cccd1bb520cfced5992d3fe1c8c55)
57300 pushed a commit to 57300/sdk-zephyr that referenced this pull request May 14, 2024
Upstream PR: zephyrproject-rtos/zephyr#70245

Add a simple test intended primarily for checking the nRF temperature
sensor in its nrfs variant but intentionally was made generic enough
that it should be usable with other temperature sensors (after just
providing an overlay) and could be helpful in development of new
temperature sensor drivers, and possibly extended then if needed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
(cherry picked from commit 37f4572b2c21b56322ae5d8779549e40c38ee36a)
@fabiobaltieri fabiobaltieri merged commit 53c350e into zephyrproject-rtos:main May 15, 2024
24 checks passed
Copy link

Hi @Rafal-Nordic!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree area: Process area: RISCV RISCV Architecture (32-bit & 64-bit) area: Sensors Sensors platform: nRF Nordic nRFx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants