Skip to content

Commit 950382c

Browse files
TomasGalbickaNXPaescolar
authored andcommitted
samples: ipc: static_vrings add NXP boards support
This commit adds support for these NXP Multi-core boards for IPC static_vrings sample using OpenAmp lib: - lpcxpresso55s69 - mimxrt1160_evk - mimxrt1170_evk - mimxrt1170_evkb Signed-off-by: Tomas Galbicka <[email protected]>
1 parent bd699d0 commit 950382c

22 files changed

+777
-4
lines changed
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
22
# Copyright (c) 2021 Carlo Caione <[email protected]>
3+
# Copyright 2024 NXP
34
#
45
# SPDX-License-Identifier: Apache-2.0
56
#
@@ -8,12 +9,24 @@ cmake_minimum_required(VERSION 3.20.0)
89

910
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
1011

11-
if(NOT CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP)
12+
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/../remote/zephyr)
13+
14+
if(NOT (CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR
15+
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR
16+
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR
17+
CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7
18+
)
19+
)
1220
message(FATAL_ERROR "${BOARD} is not supported for this sample")
1321
endif()
1422

1523
project(ipc_service)
1624

25+
if(CONFIG_INCLUDE_REMOTE_DIR)
26+
target_include_directories(zephyr_interface
27+
INTERFACE ${REMOTE_ZEPHYR_DIR}/include/public)
28+
endif()
29+
1730
target_sources(app PRIVATE src/main.c)
1831

1932
include(ExternalProject)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2024 NXP
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
source "Kconfig.zephyr"
6+
7+
config INCLUDE_REMOTE_DIR
8+
bool "Include remote core header directory"
9+
help
10+
Include remote build header files. Can be used if primary image
11+
needs to be aware of size or base address of secondary image

samples/subsys/ipc/ipc_service/static_vrings/Kconfig.sysbuild

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2023 Nordic Semiconductor ASA
2+
# Copyright 2024 NXP
23
#
34
# SPDX-License-Identifier: Apache-2.0
45

@@ -7,3 +8,7 @@ source "share/sysbuild/Kconfig"
78
config NET_CORE_BOARD
89
string
910
default "nrf5340dk/nrf5340/cpunet" if $(BOARD) = "nrf5340dk"
11+
default "lpcxpresso55s69/lpc55s69/cpu1" if $(BOARD) = "lpcxpresso55s69"
12+
default "mimxrt1160_evk/mimxrt1166/cm4" if $(BOARD) = "mimxrt1160_evk"
13+
default "mimxrt1170_evk/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evk"
14+
default "mimxrt1170_evkb/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evkb"

samples/subsys/ipc/ipc_service/static_vrings/README.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,42 @@ Building the application for nrf5340dk/nrf5340/cpuapp
2020
:goals: debug
2121
:west-args: --sysbuild
2222

23+
Building the application for lpcxpresso55s69/lpc55s69/cpu0
24+
**********************************************************
25+
26+
.. zephyr-app-commands::
27+
:zephyr-app: samples/subsys/ipc/ipc_service/static_vrings
28+
:board: lpcxpresso55s69/lpc55s69/cpu0
29+
:goals: debug
30+
:west-args: --sysbuild
31+
32+
Building the application for mimxrt1160_evk/mimxrt1166/cm7
33+
**********************************************************
34+
35+
.. zephyr-app-commands::
36+
:zephyr-app: samples/subsys/ipc/ipc_service/static_vrings
37+
:board: mimxrt1160_evk/mimxrt1166/cm7
38+
:goals: debug
39+
:west-args: --sysbuild
40+
41+
Building the application for mimxrt1170_evk/mimxrt1176/cm7
42+
**********************************************************
43+
44+
.. zephyr-app-commands::
45+
:zephyr-app: samples/subsys/ipc/ipc_service/static_vrings
46+
:board: mimxrt1170_evk/mimxrt1176/cm7
47+
:goals: debug
48+
:west-args: --sysbuild
49+
50+
Building the application for mimxrt1170_evk@B/mimxrt1176/cm7
51+
************************************************************
52+
53+
.. zephyr-app-commands::
54+
:zephyr-app: samples/subsys/ipc/ipc_service/static_vrings
55+
:board: mimxrt1170_evk@B/mimxrt1176/cm7
56+
:goals: debug
57+
:west-args: --sysbuild
58+
2359
Open a serial terminal (minicom, putty, etc.) and connect the board with the
2460
following settings:
2561

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_SECOND_CORE_MCUX=y
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
8+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
9+
10+
/ {
11+
chosen {
12+
/* Delete ipc chosen property where old IPM mailbox driver bellow is
13+
* configured.
14+
*/
15+
/delete-property/ zephyr,ipc;
16+
/delete-property/ zephyr,ipc_shm;
17+
};
18+
19+
/* Define memory regions for IPC
20+
* Note that shared memory must have specific MPU attributes set.
21+
*/
22+
sram4_ipc0: memory@20040000{
23+
compatible = "zephyr,memory-region", "mmio-sram";
24+
reg = <0x20040000 DT_SIZE_K(8)>;
25+
zephyr,memory-region="SRAM4_IPC0";
26+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
27+
};
28+
29+
sram4_ipc1: memory@20042000{
30+
compatible = "zephyr,memory-region", "mmio-sram";
31+
reg = <0x20042000 DT_SIZE_K(8)>;
32+
zephyr,memory-region="SRAM4_IPC1";
33+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
34+
};
35+
36+
soc {
37+
/* Delete IPM Driver node nxp,lpc-mailbox */
38+
/delete-node/ mailbox@8b000;
39+
40+
/* Attach MBOX driver to Mailbox Unit */
41+
mbox:mailbox0@5008b000 {
42+
compatible = "nxp,mbox-mailbox";
43+
reg = <0x5008b000 0xEC>;
44+
interrupts = <31 0>;
45+
rx-channels = <4>;
46+
#mbox-cells = <1>;
47+
status = "okay";
48+
};
49+
};
50+
51+
ipc {
52+
/delete-node/ ipc0;
53+
54+
ipc0: ipc0 {
55+
compatible = "zephyr,ipc-openamp-static-vrings";
56+
memory-region = <&sram4_ipc0>;
57+
mboxes = <&mbox 0>, <&mbox 1>;
58+
mbox-names = "tx", "rx";
59+
role = "host";
60+
status = "okay";
61+
};
62+
63+
ipc1: ipc1 {
64+
compatible = "zephyr,ipc-openamp-static-vrings";
65+
memory-region = <&sram4_ipc1>;
66+
mboxes = <&mbox 2>, <&mbox 3>;
67+
mbox-names = "tx", "rx";
68+
role = "host";
69+
zephyr,priority = <1 PRIO_COOP>;
70+
zephyr,buffer-size = <128>;
71+
status = "okay";
72+
};
73+
};
74+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_MBOX_NXP_IMX_MU=y
2+
CONFIG_SECOND_CORE_MCUX=y
3+
CONFIG_INCLUDE_REMOTE_DIR=y
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
8+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
9+
10+
/ {
11+
chosen {
12+
/* Delete ipc chosen property where old IPM mailbox driver bellow is
13+
* configured.
14+
*/
15+
/delete-property/ zephyr,ipc;
16+
/delete-property/ zephyr,ipc_shm;
17+
18+
zephyr,console = &lpuart1;
19+
zephyr,shell-uart = &lpuart1;
20+
};
21+
22+
/* Define memory regions for IPC
23+
* Note that shared memory must have specific MPU attributes set.
24+
*/
25+
ocram2_ipc0: memory@202c0000{
26+
compatible = "zephyr,memory-region", "mmio-sram";
27+
reg = <0x202c0000 DT_SIZE_K(32)>;
28+
zephyr,memory-region="OCRAM2_IPC0";
29+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
30+
};
31+
ocram2_ipc1: memory@202c8000{
32+
compatible = "zephyr,memory-region", "mmio-sram";
33+
reg = <0x202c8000 DT_SIZE_K(32)>;
34+
zephyr,memory-region="OCRAM2_IPC1";
35+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
36+
};
37+
38+
soc {
39+
/* Delete IPM Driver node nxp,imx-mu */
40+
/delete-node/ mailbox@40c48000;
41+
42+
/* Attach MBOX driver to MU Unit */
43+
mbox:mbox@40c48000 {
44+
compatible = "nxp,mbox-imx-mu";
45+
reg = <0x40c48000 0x4000>;
46+
interrupts = <118 0>;
47+
rx-channels = <4>;
48+
#mbox-cells = <1>;
49+
status = "okay";
50+
};
51+
};
52+
53+
ipc {
54+
/delete-node/ ipc0;
55+
56+
ipc0: ipc0 {
57+
compatible = "zephyr,ipc-openamp-static-vrings";
58+
memory-region = <&ocram2_ipc0>;
59+
mboxes = <&mbox 0>, <&mbox 1>;
60+
mbox-names = "tx", "rx";
61+
role = "host";
62+
status = "okay";
63+
};
64+
65+
ipc1: ipc1 {
66+
compatible = "zephyr,ipc-openamp-static-vrings";
67+
memory-region = <&ocram2_ipc1>;
68+
mboxes = <&mbox 2>, <&mbox 3>;
69+
mbox-names = "tx", "rx";
70+
role = "host";
71+
zephyr,priority = <1 PRIO_COOP>;
72+
zephyr,buffer-size = <128>;
73+
status = "okay";
74+
};
75+
};
76+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_MBOX_NXP_IMX_MU=y
2+
CONFIG_SECOND_CORE_MCUX=y
3+
CONFIG_INCLUDE_REMOTE_DIR=y
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
8+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
9+
10+
/ {
11+
chosen {
12+
/* Delete ipc chosen property where old IPM mailbox driver bellow is
13+
* configured.
14+
*/
15+
/delete-property/ zephyr,ipc;
16+
/delete-property/ zephyr,ipc_shm;
17+
18+
zephyr,console = &lpuart1;
19+
zephyr,shell-uart = &lpuart1;
20+
};
21+
22+
/* Define memory regions for IPC
23+
* Note that shared memory must have specific MPU attributes set.
24+
*/
25+
ocram2_ipc0: memory@202c0000{
26+
compatible = "zephyr,memory-region", "mmio-sram";
27+
reg = <0x202c0000 DT_SIZE_K(32)>;
28+
zephyr,memory-region="OCRAM2_IPC0";
29+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
30+
};
31+
ocram2_ipc1: memory@202c8000{
32+
compatible = "zephyr,memory-region", "mmio-sram";
33+
reg = <0x202c8000 DT_SIZE_K(32)>;
34+
zephyr,memory-region="OCRAM2_IPC1";
35+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
36+
};
37+
38+
soc {
39+
/* Delete IPM Driver node nxp,imx-mu */
40+
/delete-node/ mailbox@40c48000;
41+
42+
/* Attach MBOX driver to MU Unit */
43+
mbox:mbox@40c48000 {
44+
compatible = "nxp,mbox-imx-mu";
45+
reg = <0x40c48000 0x4000>;
46+
interrupts = <118 0>;
47+
rx-channels = <4>;
48+
#mbox-cells = <1>;
49+
status = "okay";
50+
};
51+
};
52+
53+
ipc {
54+
/delete-node/ ipc0;
55+
56+
ipc0: ipc0 {
57+
compatible = "zephyr,ipc-openamp-static-vrings";
58+
memory-region = <&ocram2_ipc0>;
59+
mboxes = <&mbox 0>, <&mbox 1>;
60+
mbox-names = "tx", "rx";
61+
role = "host";
62+
status = "okay";
63+
};
64+
65+
ipc1: ipc1 {
66+
compatible = "zephyr,ipc-openamp-static-vrings";
67+
memory-region = <&ocram2_ipc1>;
68+
mboxes = <&mbox 2>, <&mbox 3>;
69+
mbox-names = "tx", "rx";
70+
role = "host";
71+
zephyr,priority = <1 PRIO_COOP>;
72+
zephyr,buffer-size = <128>;
73+
status = "okay";
74+
};
75+
};
76+
};

0 commit comments

Comments
 (0)