forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
bd699d0
commit 950382c
Showing
22 changed files
with
777 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# | ||
# Copyright (c) 2021 Carlo Caione <[email protected]> | ||
# Copyright 2024 NXP | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
@@ -8,12 +9,24 @@ cmake_minimum_required(VERSION 3.20.0) | |
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
|
||
if(NOT CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP) | ||
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/../remote/zephyr) | ||
|
||
if(NOT (CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR | ||
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR | ||
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR | ||
CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7 | ||
) | ||
) | ||
message(FATAL_ERROR "${BOARD} is not supported for this sample") | ||
endif() | ||
|
||
project(ipc_service) | ||
|
||
if(CONFIG_INCLUDE_REMOTE_DIR) | ||
target_include_directories(zephyr_interface | ||
INTERFACE ${REMOTE_ZEPHYR_DIR}/include/public) | ||
endif() | ||
|
||
target_sources(app PRIVATE src/main.c) | ||
|
||
include(ExternalProject) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2024 NXP | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
source "Kconfig.zephyr" | ||
|
||
config INCLUDE_REMOTE_DIR | ||
bool "Include remote core header directory" | ||
help | ||
Include remote build header files. Can be used if primary image | ||
needs to be aware of size or base address of secondary image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_SECOND_CORE_MCUX=y |
74 changes: 74 additions & 0 deletions
74
samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright 2024 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/ipc_service/static_vrings.h> | ||
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h> | ||
|
||
/ { | ||
chosen { | ||
/* Delete ipc chosen property where old IPM mailbox driver bellow is | ||
* configured. | ||
*/ | ||
/delete-property/ zephyr,ipc; | ||
/delete-property/ zephyr,ipc_shm; | ||
}; | ||
|
||
/* Define memory regions for IPC | ||
* Note that shared memory must have specific MPU attributes set. | ||
*/ | ||
sram4_ipc0: memory@20040000{ | ||
compatible = "zephyr,memory-region", "mmio-sram"; | ||
reg = <0x20040000 DT_SIZE_K(8)>; | ||
zephyr,memory-region="SRAM4_IPC0"; | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>; | ||
}; | ||
|
||
sram4_ipc1: memory@20042000{ | ||
compatible = "zephyr,memory-region", "mmio-sram"; | ||
reg = <0x20042000 DT_SIZE_K(8)>; | ||
zephyr,memory-region="SRAM4_IPC1"; | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>; | ||
}; | ||
|
||
soc { | ||
/* Delete IPM Driver node nxp,lpc-mailbox */ | ||
/delete-node/ mailbox@8b000; | ||
|
||
/* Attach MBOX driver to Mailbox Unit */ | ||
mbox:mailbox0@5008b000 { | ||
compatible = "nxp,mbox-mailbox"; | ||
reg = <0x5008b000 0xEC>; | ||
interrupts = <31 0>; | ||
rx-channels = <4>; | ||
#mbox-cells = <1>; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
ipc { | ||
/delete-node/ ipc0; | ||
|
||
ipc0: ipc0 { | ||
compatible = "zephyr,ipc-openamp-static-vrings"; | ||
memory-region = <&sram4_ipc0>; | ||
mboxes = <&mbox 0>, <&mbox 1>; | ||
mbox-names = "tx", "rx"; | ||
role = "host"; | ||
status = "okay"; | ||
}; | ||
|
||
ipc1: ipc1 { | ||
compatible = "zephyr,ipc-openamp-static-vrings"; | ||
memory-region = <&sram4_ipc1>; | ||
mboxes = <&mbox 2>, <&mbox 3>; | ||
mbox-names = "tx", "rx"; | ||
role = "host"; | ||
zephyr,priority = <1 PRIO_COOP>; | ||
zephyr,buffer-size = <128>; | ||
status = "okay"; | ||
}; | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
samples/subsys/ipc/ipc_service/static_vrings/boards/mimxrt1160_evk_mimxrt1166_cm7.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_MBOX_NXP_IMX_MU=y | ||
CONFIG_SECOND_CORE_MCUX=y | ||
CONFIG_INCLUDE_REMOTE_DIR=y |
76 changes: 76 additions & 0 deletions
76
samples/subsys/ipc/ipc_service/static_vrings/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright 2024 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/ipc_service/static_vrings.h> | ||
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h> | ||
|
||
/ { | ||
chosen { | ||
/* Delete ipc chosen property where old IPM mailbox driver bellow is | ||
* configured. | ||
*/ | ||
/delete-property/ zephyr,ipc; | ||
/delete-property/ zephyr,ipc_shm; | ||
|
||
zephyr,console = &lpuart1; | ||
zephyr,shell-uart = &lpuart1; | ||
}; | ||
|
||
/* Define memory regions for IPC | ||
* Note that shared memory must have specific MPU attributes set. | ||
*/ | ||
ocram2_ipc0: memory@202c0000{ | ||
compatible = "zephyr,memory-region", "mmio-sram"; | ||
reg = <0x202c0000 DT_SIZE_K(32)>; | ||
zephyr,memory-region="OCRAM2_IPC0"; | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>; | ||
}; | ||
ocram2_ipc1: memory@202c8000{ | ||
compatible = "zephyr,memory-region", "mmio-sram"; | ||
reg = <0x202c8000 DT_SIZE_K(32)>; | ||
zephyr,memory-region="OCRAM2_IPC1"; | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>; | ||
}; | ||
|
||
soc { | ||
/* Delete IPM Driver node nxp,imx-mu */ | ||
/delete-node/ mailbox@40c48000; | ||
|
||
/* Attach MBOX driver to MU Unit */ | ||
mbox:mbox@40c48000 { | ||
compatible = "nxp,mbox-imx-mu"; | ||
reg = <0x40c48000 0x4000>; | ||
interrupts = <118 0>; | ||
rx-channels = <4>; | ||
#mbox-cells = <1>; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
ipc { | ||
/delete-node/ ipc0; | ||
|
||
ipc0: ipc0 { | ||
compatible = "zephyr,ipc-openamp-static-vrings"; | ||
memory-region = <&ocram2_ipc0>; | ||
mboxes = <&mbox 0>, <&mbox 1>; | ||
mbox-names = "tx", "rx"; | ||
role = "host"; | ||
status = "okay"; | ||
}; | ||
|
||
ipc1: ipc1 { | ||
compatible = "zephyr,ipc-openamp-static-vrings"; | ||
memory-region = <&ocram2_ipc1>; | ||
mboxes = <&mbox 2>, <&mbox 3>; | ||
mbox-names = "tx", "rx"; | ||
role = "host"; | ||
zephyr,priority = <1 PRIO_COOP>; | ||
zephyr,buffer-size = <128>; | ||
status = "okay"; | ||
}; | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
samples/subsys/ipc/ipc_service/static_vrings/boards/mimxrt1170_evk_mimxrt1176_cm7.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_MBOX_NXP_IMX_MU=y | ||
CONFIG_SECOND_CORE_MCUX=y | ||
CONFIG_INCLUDE_REMOTE_DIR=y |
76 changes: 76 additions & 0 deletions
76
samples/subsys/ipc/ipc_service/static_vrings/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright 2024 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/ipc_service/static_vrings.h> | ||
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h> | ||
|
||
/ { | ||
chosen { | ||
/* Delete ipc chosen property where old IPM mailbox driver bellow is | ||
* configured. | ||
*/ | ||
/delete-property/ zephyr,ipc; | ||
/delete-property/ zephyr,ipc_shm; | ||
|
||
zephyr,console = &lpuart1; | ||
zephyr,shell-uart = &lpuart1; | ||
}; | ||
|
||
/* Define memory regions for IPC | ||
* Note that shared memory must have specific MPU attributes set. | ||
*/ | ||
ocram2_ipc0: memory@202c0000{ | ||
compatible = "zephyr,memory-region", "mmio-sram"; | ||
reg = <0x202c0000 DT_SIZE_K(32)>; | ||
zephyr,memory-region="OCRAM2_IPC0"; | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>; | ||
}; | ||
ocram2_ipc1: memory@202c8000{ | ||
compatible = "zephyr,memory-region", "mmio-sram"; | ||
reg = <0x202c8000 DT_SIZE_K(32)>; | ||
zephyr,memory-region="OCRAM2_IPC1"; | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>; | ||
}; | ||
|
||
soc { | ||
/* Delete IPM Driver node nxp,imx-mu */ | ||
/delete-node/ mailbox@40c48000; | ||
|
||
/* Attach MBOX driver to MU Unit */ | ||
mbox:mbox@40c48000 { | ||
compatible = "nxp,mbox-imx-mu"; | ||
reg = <0x40c48000 0x4000>; | ||
interrupts = <118 0>; | ||
rx-channels = <4>; | ||
#mbox-cells = <1>; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
ipc { | ||
/delete-node/ ipc0; | ||
|
||
ipc0: ipc0 { | ||
compatible = "zephyr,ipc-openamp-static-vrings"; | ||
memory-region = <&ocram2_ipc0>; | ||
mboxes = <&mbox 0>, <&mbox 1>; | ||
mbox-names = "tx", "rx"; | ||
role = "host"; | ||
status = "okay"; | ||
}; | ||
|
||
ipc1: ipc1 { | ||
compatible = "zephyr,ipc-openamp-static-vrings"; | ||
memory-region = <&ocram2_ipc1>; | ||
mboxes = <&mbox 2>, <&mbox 3>; | ||
mbox-names = "tx", "rx"; | ||
role = "host"; | ||
zephyr,priority = <1 PRIO_COOP>; | ||
zephyr,buffer-size = <128>; | ||
status = "okay"; | ||
}; | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
samples/subsys/ipc/ipc_service/static_vrings/boards/mimxrt1170_evk_mimxrt1176_cm7_B.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_MBOX_NXP_IMX_MU=y | ||
CONFIG_SECOND_CORE_MCUX=y | ||
CONFIG_INCLUDE_REMOTE_DIR=y |
Oops, something went wrong.