Skip to content

Commit

Permalink
samples: ipc: openamp: Enable openamp sample for iMX.RT1160 EVK
Browse files Browse the repository at this point in the history
Enable the openamp sample for RT1160EVK. CM4 core has a custom DTS
overlay to use LPUART2 for console information, and use a secondary GPT
timer for the system tick.

Signed-off-by: Daniel DeGrasse <[email protected]>
  • Loading branch information
danieldegrasse authored and carlescufi committed Dec 5, 2022
1 parent b09f2b8 commit 1ff8fb9
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/subsys/ipc/openamp/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ string
default "mps2_an521_remote" if $(BOARD) = "mps2_an521"
default "v2m_musca_b1_ns" if $(BOARD) = "v2m_musca_b1"
default "mimxrt1170_evk_cm4" if $(BOARD) = "mimxrt1170_evk_cm7"
default "mimxrt1160_evk_cm4" if $(BOARD) = "mimxrt1160_evk_cm7"
2 changes: 2 additions & 0 deletions samples/subsys/ipc/openamp/boards/mimxrt1160_evk_cm7.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_INCLUDE_REMOTE_DIR=y
CONFIG_SECOND_CORE_MCUX=y
22 changes: 22 additions & 0 deletions samples/subsys/ipc/openamp/boards/mimxrt1160_evk_cm7.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2022 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
zephyr,ipc_shm = &ocram2_overlay;
};

/* OpenAMP fails with full 512K OCRAM2 memory region as shared memory.
* Define a subset of the OCRAM2 region for demo to use
* Note that shared memory must have specific MPU attributes set.
*/
ocram2_overlay: memory@202c0000{
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x202c0000 DT_SIZE_K(16)>;
zephyr,memory-region="OCRAM2_OVERLAY";
zephyr,memory-region-mpu = "IO";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_BUILD_OUTPUT_INFO_HEADER=y
CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2022 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
/* Switch to lpuart2, since primary core uses lpuart1 */
chosen {
zephyr,console = &lpuart2;
zephyr,shell-uart = &lpuart2;
zephyr,ipc_shm = &ocram2_overlay;
};

soc {
/delete-node/ gpt@400f0000;

/* Replace GPT2 with another GPT kernel timer */
gpt2_hw_timer:gpt@400f0000 {
compatible = "nxp,gpt-hw-timer";
reg = <0x400f0000 0x4000>;
interrupts = <120 0>;
status = "okay";
};
};

/* OpenAMP fails with full 512K OCRAM2 memory region as shared memory.
* Define a subset of the OCRAM2 region for demo to use
* Note that shared memory must have specific MPU attributes set
*/
ocram2_overlay: memory@202c0000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x202c0000 DT_SIZE_K(16)>;
zephyr,memory-region="OCRAM2_OVERLAY";
zephyr,memory-region-mpu = "IO";
};
};

/* Enable secondary LPUART */
&lpuart2 {
status = "okay";
current-speed = <115200>;
};

/* Disable primary GPT timer */
&gpt_hw_timer {
status = "disabled";
};

0 comments on commit 1ff8fb9

Please sign in to comment.