diff --git a/examples/zephyr/rpmsg_multi_services/boards/nxp_adsp_imx8m.conf b/examples/zephyr/rpmsg_multi_services/boards/nxp_adsp_imx8m.conf new file mode 100644 index 0000000..1647bfa --- /dev/null +++ b/examples/zephyr/rpmsg_multi_services/boards/nxp_adsp_imx8m.conf @@ -0,0 +1,4 @@ +CONFIG_IPM_IMX_MAX_DATA_SIZE_16=n +CONFIG_IPM_IMX_MAX_DATA_SIZE_4=y +CONFIG_OPENAMP_WITH_DCACHE=y +CONFIG_IPM_IMX_FW_READY_REPLY=y diff --git a/examples/zephyr/rpmsg_multi_services/boards/nxp_adsp_imx8m.overlay b/examples/zephyr/rpmsg_multi_services/boards/nxp_adsp_imx8m.overlay new file mode 100644 index 0000000..56843c4 --- /dev/null +++ b/examples/zephyr/rpmsg_multi_services/boards/nxp_adsp_imx8m.overlay @@ -0,0 +1,24 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + /* + * shared memory reserved for the inter-processor communication + */ + zephyr,ipc_shm = &dspsram3; + zephyr,ipc = &mailbox0; + }; + + dspsram3: memory@942f0000 { + compatible = "mmio-sram"; + reg = <0x942f0000 0x110000>; + }; +}; + +&mailbox0 { + status = "okay"; +}; diff --git a/examples/zephyr/rpmsg_multi_services/prj.conf b/examples/zephyr/rpmsg_multi_services/prj.conf index 3bca152..c7bc963 100644 --- a/examples/zephyr/rpmsg_multi_services/prj.conf +++ b/examples/zephyr/rpmsg_multi_services/prj.conf @@ -1,7 +1,6 @@ CONFIG_KERNEL_BIN_NAME="rpmsg_multi_services" CONFIG_PRINTK=n CONFIG_IPM=y -CONFIG_PLATFORM_SPECIFIC_INIT=n CONFIG_MAIN_STACK_SIZE=1024 CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_OPENAMP=y diff --git a/examples/zephyr/rpmsg_multi_services/src/sample.yaml b/examples/zephyr/rpmsg_multi_services/sample.yaml similarity index 79% rename from examples/zephyr/rpmsg_multi_services/src/sample.yaml rename to examples/zephyr/rpmsg_multi_services/sample.yaml index aabbcbd..fa1efa1 100644 --- a/examples/zephyr/rpmsg_multi_services/src/sample.yaml +++ b/examples/zephyr/rpmsg_multi_services/sample.yaml @@ -1,6 +1,6 @@ sample: description: This app provides an example of how to integrate OpenAMP - with Zephyr in cluding a esource table. + with Zephyr including a resource table. name: OpenAMP with resource table example integration tests: sample.subsys.ipc.openamp_rs_table: @@ -8,4 +8,5 @@ tests: platform_allow: stm32mp157c_dk2 platform_allow: qemu_cortex_r5 platform_allow: kv260_r5 + platform_allow: nxp_adsp_imx8m tags: ipm diff --git a/examples/zephyr/rpmsg_multi_services/src/CMakeLists.txt b/examples/zephyr/rpmsg_multi_services/src/CMakeLists.txt deleted file mode 100644 index 57640da..0000000 --- a/examples/zephyr/rpmsg_multi_services/src/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.20.0) -# Copyright (c) 2020 STMicroelectronics -# -# SPDX-License-Identifier: Apache-2.0 -# - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - -project(openamp_rsc_table_remote) - -# METAL_MAX_DEVICE_REGIONS is used to give the number of memory regions shared -# between processors. By default only one region is defined for the vrings -# and rpmsg buffers. The METAL_MAX_DEVICE_REGIONS has to be redefined to add a -# second region for the resource table. -zephyr_compile_definitions(METAL_MAX_DEVICE_REGIONS=2) - -target_include_directories(app PRIVATE ${LIBMETAL_INCLUDE_DIR} ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR}) - -target_sources(app PRIVATE src/main_remote.c) diff --git a/examples/zephyr/rpmsg_multi_services/src/README.rst b/examples/zephyr/rpmsg_multi_services/src/README.rst deleted file mode 100644 index 313ebb1..0000000 --- a/examples/zephyr/rpmsg_multi_services/src/README.rst +++ /dev/null @@ -1,89 +0,0 @@ -.. _openAMP_rsc_table_sample: - -OpenAMP Sample Application using resource table -############################################### - -Overview -******** - -This application demonstrates how to use OpenAMP with Zephyr based on a resource -table. It is designed to respond to the: - -* `Linux rpmsg client sample `_ -* `Linux rpmsg tty driver `_ - -This sample implementation is compatible with platforms that embed -a Linux kernel OS on the main processor and a Zephyr application on -the co-processor. - -Building the application -************************* - -Zephyr -------- - -.. zephyr-app-commands:: - :zephyr-app: samples/subsys/ipc/openamp_rsc_table - :goals: test - -Linux ------- - -Enable SAMPLE_RPMSG_CLIENT configuration to build and install -the rpmsg_client_sample.ko module on the target. - -Running the sample -******************* - -Zephyr console ---------------- - -Open a serial terminal (minicom, putty, etc.) and connect the board with the -following settings: - -- Speed: 115200 -- Data: 8 bits -- Parity: None -- Stop bits: 1 - -Reset the board. - -Linux console ---------------- - -Open a Linux shell (minicom, ssh, etc.) and insert a module into the Linux Kernel - -.. code-block:: console - - root@linuxshell: insmod rpmsg_client_sample.ko - -Result on Zephyr console on boot --------------------------------- - -The following message will appear on the corresponding Zephyr console: - -.. code-block:: console - - ***** Booting Zephyr OS v#.##.#-####-g########## ***** - Starting application thread! - - OpenAMP demo started - Remote core received message 1: hello world! - Remote core received message 2: hello world! - Remote core received message 3: hello world! - ... - Remote core received message 100: hello world! - OpenAMP demo ended. - - -rpmsg TTY demo on Linux console -------------------------------- - -On the Linux console send a message to Zephyr which answers with the "TTY " prefix. - corresponds to the Zephyr rpmsg-tty endpoint address: - -.. code-block:: console - - $> cat /dev/ttyRPMSG0 & - $> echo "Hello Zephyr" >/dev/ttyRPMSG0 - TTY 0x0401: Hello Zephyr diff --git a/examples/zephyr/rpmsg_multi_services/src/main_remote.c b/examples/zephyr/rpmsg_multi_services/src/main_remote.c index c93dc81..3a5052a 100644 --- a/examples/zephyr/rpmsg_multi_services/src/main_remote.c +++ b/examples/zephyr/rpmsg_multi_services/src/main_remote.c @@ -31,14 +31,13 @@ LOG_MODULE_REGISTER(openamp_rsc_table, LOG_LEVEL_DBG); #define SHM_START_ADDR DT_REG_ADDR(SHM_NODE) #define SHM_SIZE DT_REG_SIZE(SHM_NODE) -#define APP_TASK_STACK_SIZE (512) +#define APP_TASK_STACK_SIZE (1024) #define MAX_TTY_EPT 2 #define MAX_RAW_EPT 2 -/* Add 512 extra bytes for the TTY task stack for the "tx_buff" buffer. */ -#define APP_TTY_TASK_STACK_SIZE (1024) -#define APP_RAW_TASK_STACK_SIZE (1024) +#define APP_TTY_TASK_STACK_SIZE (2048) +#define APP_RAW_TASK_STACK_SIZE (2048) K_THREAD_STACK_DEFINE(thread_mng_stack, APP_TASK_STACK_SIZE); K_THREAD_STACK_DEFINE(thread_rp__client_stack, APP_TASK_STACK_SIZE); diff --git a/examples/zephyr/rpmsg_multi_services/src/prj.conf b/examples/zephyr/rpmsg_multi_services/src/prj.conf deleted file mode 100644 index 77a3794..0000000 --- a/examples/zephyr/rpmsg_multi_services/src/prj.conf +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_KERNEL_BIN_NAME="zephyr_openamp_rsc_table" -CONFIG_PRINTK=n -CONFIG_IPM=y -CONFIG_PLATFORM_SPECIFIC_INIT=n -CONFIG_MAIN_STACK_SIZE=1024 -CONFIG_HEAP_MEM_POOL_SIZE=1024 -CONFIG_OPENAMP=y -CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF=8 -CONFIG_OPENAMP_RSC_TABLE=y -CONFIG_OPENAMP_MASTER=n