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

Nrfx 6118 add icbmsg to egpio #17321

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions applications/sdp/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(emulated_gpio)

target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG app PRIVATE src/nrfe_icmsg.c)
target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICBMSG app PRIVATE src/nrfe_icmsg.c)
target_sources_ifdef(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX app PRIVATE src/nrfe_mbox.c)
target_sources(app PRIVATE src/main.c)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
ipc {
ipc0: ipc0 {
compatible = "zephyr,ipc-icbmsg";
tx-region = <&sram_tx>;
rx-region = <&sram_rx>;
tx-blocks = <18>;
rx-blocks = <16>;
mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>;
mbox-names = "rx", "tx";
status = "okay";
};
};
};
4 changes: 3 additions & 1 deletion applications/sdp/gpio/include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <zephyr/kernel.h>
#include <drivers/gpio/nrfe_gpio.h>

#if !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG) && !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX)
#if !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG) && \
!defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX) && \
!defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICBMSG)
#error "Define communication backend type"
#endif

Expand Down
13 changes: 13 additions & 0 deletions applications/sdp/gpio/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ tests:
- CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG=y
- CONFIG_IPC_SERVICE=y
- CONFIG_IPC_SERVICE_BACKEND_ICMSG=y

applications.sdp.egpio_icbmsg:
sysbuild: true
build_only: true
platform_allow: nrf54l15dk/nrf54l15/cpuflpr
tags: ci_build sysbuild
extra_args:
EXTRA_DTC_OVERLAY_FILE="./boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay"
extra_configs:
- CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICBMSG=y
- CONFIG_IPC_SERVICE=y
- CONFIG_IPC_SERVICE_BACKEND_ICBMSG=y
- CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1
11 changes: 11 additions & 0 deletions cmake/sysbuild/sdp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ function(egpio_update_kconfig)
endif()
sysbuild_cache_set(VAR ${DEFAULT_IMAGE}_SNIPPET APPEND REMOVE_DUPLICATES "emulated-gpio-icmsg")
message(STATUS "eGPIO: Using ICMSG backend")
elseif(SB_CONFIG_ICBMSG_BACKEND)
foreach(image ${PRE_CMAKE_IMAGES})
set_config_bool(${image} CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICBMSG y)
endforeach()
set_config_bool(flpr_egpio CONFIG_IPC_SERVICE y)
set_config_bool(flpr_egpio CONFIG_IPC_SERVICE_BACKEND_ICBMSG y)
if(DEFINED SB_CONFIG_SOC_NRF54L15)
sysbuild_cache_set(VAR flpr_egpio_EXTRA_DTC_OVERLAY_FILE APPEND REMOVE_DUPLICATES "./boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay")
endif()
sysbuild_cache_set(VAR ${DEFAULT_IMAGE}_SNIPPET APPEND REMOVE_DUPLICATES "emulated-gpio-icbmsg")
message(STATUS "eGPIO: Using ICBMSG backend")
endif()
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
zephyr_library_amend()

if(CONFIG_GPIO_NRFE)
if(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG)
if(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG OR CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICBMSG)
zephyr_library_sources(gpio_nrfe_icmsg.c)
elseif(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX)
zephyr_library_sources(gpio_nrfe_mbox.c)
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ config GPIO_NRFE_EGPIO_BACKEND_ICMSG
help
Use ICMSG backend driver for eGPIO.

config GPIO_NRFE_EGPIO_BACKEND_ICBMSG
bool "ICBMsg backend for eGPIO"
help
Use ICBMSG backend driver for eGPIO.

endchoice
4 changes: 3 additions & 1 deletion drivers/gpio/gpio_nrfe.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <drivers/gpio/nrfe_gpio.h>
#include <zephyr/device.h>

#if !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG) && !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX)
#if !defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICMSG) && \
!defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_MBOX) && \
!defined(CONFIG_GPIO_NRFE_EGPIO_BACKEND_ICBMSG)
#error "Configure communication backend type"
#endif

Expand Down
19 changes: 19 additions & 0 deletions scripts/twister/alt/zephyr/samples/basic/blinky/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,22 @@ tests:
regex:
- "LED state: ON"
- "LED state: OFF"

sample.basic.blinky.egpio_icbmsg:
sysbuild: true
platform_allow:
- nrf54l15dk/nrf54l15/cpuapp
integration_platforms:
- nrf54l15dk/nrf54l15/cpuapp
extra_args: blinky_SNIPPET=emulated-gpio-icbmsg
SB_CONFIG_SDP=y
SB_CONFIG_EGPIO_FLPR_APPLICATION=y
SB_CONFIG_PARTITION_MANAGER=n
EXTRA_DTC_OVERLAY_FILE="./boards/nrf54l15dk_nrf54l15_cpuapp_egpio.overlay"
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- "LED state: ON"
- "LED state: OFF"
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
soc {
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;

cpuflpr_code_partition: image@165000 {
/* FLPR core code partition */
reg = <0x165000 DT_SIZE_K(96)>;
};

sram_rx: memory@20018000 {
reg = <0x20018000 0x0800>;
};

sram_tx: memory@20020000 {
reg = <0x20020000 0x0800>;
};
};


cpuflpr_sram_code_data: memory@20028000 {
compatible = "mmio-sram";
reg = <0x20028000 DT_SIZE_K(96)>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x20028000 0x18000>;
};
};

ipc {
ipc0: ipc0 {
compatible = "zephyr,ipc-icbmsg";
tx-region = <&sram_tx>;
rx-region = <&sram_rx>;
tx-blocks = <16>;
rx-blocks = <18>;
mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>;
mbox-names = "rx", "tx";
status = "okay";
};
};
};

&cpuapp_sram {
reg = <0x20000000 DT_SIZE_K(160)>;
ranges = <0x0 0x20000000 0x28000>;
};

&cpuflpr_vpr {
execution-memory = <&cpuflpr_sram_code_data>;
source-memory = <&cpuflpr_code_partition>;
};

&gpio2 {
status = "disabled";
};

&cpuapp_vevif_rx {
status = "okay";
};

&cpuapp_vevif_tx {
status = "okay";
};

&egpio {
status = "okay";
};
17 changes: 17 additions & 0 deletions snippets/emulated-gpio/icbmsg/emulated-gpio.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&cpuflpr_vpr {
status = "okay";

egpio: gpio {
compatible = "nordic,nrf-egpio";
gpio-controller;
#gpio-cells = <0x2>;
ngpios = <0x10>;
status = "disabled";
port = <0x2>;
};
};
14 changes: 14 additions & 0 deletions snippets/emulated-gpio/icbmsg/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

name: emulated-gpio-icbmsg
append:
EXTRA_DTC_OVERLAY_FILE: emulated-gpio.overlay

boards:
nrf54l15dk/nrf54l15/cpuapp:
append:
EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay
5 changes: 5 additions & 0 deletions sysbuild/Kconfig.sdp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ config EGPIO_BACKEND_ICMSG
help
Use ICMSG backend driver for eGPIO.

config EGPIO_BACKEND_ICBMSG
bool "ICBMSG backend for eGPIO"
help
Use ICBMSG backend driver for eGPIO.

endchoice

endif # SDP
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 8005d4e87b9bcba25f441a51f4f5d29b541022b9
revision: pull/2003/head
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down
Loading