-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Nrfx 6118 add icbmsg to egpio #17321
base: main
Are you sure you want to change the base?
Nrfx 6118 add icbmsg to egpio #17321
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 96c541d9ea7d26a448389d59b1f9b838c823683e more detailssdk-nrf:
Github labels
List of changed files detected by CI (17)
Outputs:ToolchainVersion: 3dd8985b56 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
7323ad8
to
7ff5196
Compare
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicks. Additionally please resolve complaints from CI.
snippets/emulated-gpio/icbmsg/boards/nrf54l15dk_nrf54l15_cpuapp.conf
Outdated
Show resolved
Hide resolved
6ef0952
to
5cc9ee1
Compare
8a96d41
to
7796285
Compare
Rebased on main, ready for review |
@nordicjm can you take a look? |
There's 6 commits, so surely this needs a rebase? |
@nordicjm It's already rebased on main, I forgot to update the description comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need some clarification regarding the icbmsg backend and overlays / snippet.
ipc { | ||
ipc0: ipc0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like some more information on this.
Other boards, such as nrf54h20dk, nrf5340dk, thingy53, are defining default ipc nodes, which can then have the status changed from disabled
to okay
.
Any reason the nrf54l15dk doesn't define a default (perhaps disabled) ipc node ?
Examples upstream:
https:/zephyrproject-rtos/zephyr/blob/main/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-ipc_conf.dtsi
https:/zephyrproject-rtos/zephyr/blob/1726443d9d2584bc6adb7fd08d63a5fc645ce09a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts#L159
Or at SoC level, like the nrf5340:
https:/zephyrproject-rtos/zephyr/blob/1726443d9d2584bc6adb7fd08d63a5fc645ce09a/dts/arm/nordic/nrf5340_cpunet.dtsi#L349-L350
https:/zephyrproject-rtos/zephyr/blob/1726443d9d2584bc6adb7fd08d63a5fc645ce09a/dts/arm/nordic/nrf5340_cpuapp.dtsi#L110-L111
@gmarull perhaps you have some input regarding this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that H20 has established strict resource allocation scheme (in this case VEVIF/BELLBOARD channels and shared memory) due to complexity and security architecture.
Meanwhile, L15 has only two CPUs with access to all resources by default, so it is up to developer to decide what to use. It is much closer to 53's case - I'm not aware what was the reasoning behind those defaults.
@hubertmis can you comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meanwhile, L15 has only two CPUs with access to all resources by default, so it is up to developer to decide what to use.
but in current case, you are asking every sample to create the overlay and decide on the ram allocation.
Which in most case will result in users looking for a template like this file, and start copying that around.
If the board provide a sane set of defaults, then a sample should be a to just set the node to enabled and not worry about other parts.
Users with special need can still adjust memory allocation as they find fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejlmand, can we change that in a follow-up PR? I wouldn't want to change it here since this PR only adds another backend to eGPIO. If I were to move the definition of the IPC node to board or soc dts, I would also have to modify overlays for other eGPIO backends (mbox and icmsg), which is not the topic of this PR.
@hubertmis, can you share your opinion on where the IPC definition should be placed?
@@ -0,0 +1,14 @@ | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are seeing too many SoC specific snippets for cases where either a more generic naming / approach could have been used, so I would like some more details regarding the use-cases this is intended for.
Could this snippet be more generic / useful in more cases where a backend is to be changed to icbmsg, but for other transport, in short eGPIO is used as transport for nRF54l15 but other transport could be used on other SoCs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I understand, the approach would be to rework this snippet to into two - one for generic "use icbmsg backend" and another for eGPIO specific stuff (which would also make other eGPIO snippets leaner). Then user would select a combination if two snippets when building eGPIO for given backend. Is that correct?
The issue I see with making this more generic is we specify here IDs of VEVIF channels and buffer sizes. Those might not be applicable to generic cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see another problem with separating backend from SDP used(eGPIO here): there is a possibility, that some SDPs will not support all backends, for example, icbmsg could be excluded due to being too "heavy". But that probably could be resolved by adding an if statement and error message in some CMake file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I understand, the approach would be to rework this snippet to into two - one for generic "use icbmsg backend" and another for eGPIO specific stuff (which would also make other eGPIO snippets leaner). Then user would select a combination if two snippets when building eGPIO for given backend. Is that correct?
I was actually considering still a single snippet.
The snippet being intended for ipc, and for ipc we can support different backends, in this case this snippet is for the icbmsg.
Generally the transport between the cores are more or less decided by the SoC design.
Thus a single snippet for ipc-icbmsg
where the board / SoC part of the snippet decides how which overlay files to use.
That would allow sharing an ipc-icbmsg
across multi-core SoC, like nRF5340, nrf54h20, nrf54l15.
https://docs.zephyrproject.org/latest/build/snippets/writing.html#board-specific-settings
Note, it's also possible to match on board qualifier, such as nrf54l15/cpuflpr
or nrf5340/cpunet
to match SoC, regardless of the board.
As for eGPIO
, then if that should always be there for a ipc-icbmsg
backend, then it can be a (forced) part of the snippet.
But iiuc then the eGPIO is just an example on how to do a SDP, but another sample / user might want to do something else, correct ?
If eGPIO is just an example, then it probably live best by itself as a sample, but if it is required for icbmsg, then I do think it can be part of a generic ipc-icbmsg
snippet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejlmand Let me know if I understand you correctly: you want the same overlay to be applied when we are using a specific backend, for example, icbmsg, regardless of what SDP is being used, right? So that, if we add an implementation of another SDP, we wouldn't have to create another folder and copy overlays for the backends, just use the existing ones. Right now this would come down to renaming emulated-gpio
folder to sdp
and moving emulated-gpio.overlay
into a commonplace (for example, just into the folder renamed to sdp
). Am I right?
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
&cpuflpr_vpr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this overlay is always being applied regardless of the board being built for.
This is not a good use of snippet, as it ties the snippet hard to the board in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my understanding is correct, that was the point: to have this overlay applied to every build with SDP, no matter what board is used. FLPR has to be turned on because it emulates a peripheral. If a board does not have FLPR, the build will fail, as it should, because a peripheral cannot be emulated (at least that is the assumption behind SDP).
@jaz1-nordic could you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a general snippet that may have been enabled on every board. This snippet applies only and exclusively to software-defined peripherals and, as the name suggests, is used to add and enable egpio
on the cpuflpr
core. Additionally, it is applied by sysbuild
mechanisms for specific, previously selected boards. Not directly. The only thing I can find fault with is the naming of cpuflpr_vpr
, which may vary depending on the board/SoC. So maybe move the entire code to an overlay file for a specific board?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing I can find fault with is the naming of cpuflpr_vpr, which may vary depending on the board/SoC.
I checked, and nRF54H20 is the only other platform, that also has FLPR defined in dts and it also uses cpuflpr_vpr
name. So it should not be a problem.
7796285
to
5ff8a49
Compare
5ff8a49
to
310054a
Compare
310054a
to
30cc54d
Compare
snippets/emulated-gpio/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp.overlay
Outdated
Show resolved
Hide resolved
@nrfconnect/ncs-co-drivers please, review |
Move division of SRAM to backends' overlays so that it would be possible to have different FLPR SRAM size for each backend. Signed-off-by: Magdalena Pastula <[email protected]>
Add icbmsg as a possible backend for eGPIO. Signed-off-by: Magdalena Pastula <[email protected]>
Add icbmsg as possible backend for eGPIO. Signed-off-by: Magdalena Pastula <[email protected]>
Add icbmsg as possible backend for eGPIO. Signed-off-by: Magdalena Pastula <[email protected]>
Add icbmsg as possible backend for eGPIO. Signed-off-by: Magdalena Pastula <[email protected]>
Add option of ICBMSG as a backend for eGPIO. Signed-off-by: Magdalena Pastula <[email protected]>
Add eGPIO testcase with icbmsg backend. Signed-off-by: Magdalena Pastula <[email protected]>
Add test case for eGPIO using icbmsg backend. Signed-off-by: Magdalena Pastula <[email protected]>
30cc54d
to
96c541d
Compare
Based on #16592, please, review only the last 5 commits.Rebased on main.
PRs that affect this one:
#17669(aligned)#17173(aligned)