Skip to content

Commit 0e770c6

Browse files
Karl Zhanggalak
Karl Zhang
authored andcommitted
samples: openamp: Add support for Musca A
Musca A is a dual core SoC with both cores are CM33. Add openAMP to support on it. Signed-off-by: Karl Zhang <[email protected]>
1 parent 88c3679 commit 0e770c6

File tree

7 files changed

+39
-5
lines changed

7 files changed

+39
-5
lines changed

samples/subsys/ipc/openamp/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ if("${BOARD}" STREQUAL "lpcxpresso54114_m4")
1212
elseif("${BOARD}" STREQUAL "mps2_an521")
1313
set(QEMU_EXTRA_FLAGS "-device;loader,file=${REMOTE_ZEPHYR_DIR}/zephyr.elf")
1414
set(BOARD_REMOTE "mps2_an521_nonsecure")
15+
elseif("${BOARD}" STREQUAL "v2m_musca")
16+
set(BOARD_REMOTE "v2m_musca_nonsecure")
1517
else()
1618
message(FATAL_ERROR "${BOARD} was not supported for this sample")
1719
endif()

samples/subsys/ipc/openamp/README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ Building the application for mps2_an521
2626
:board: mps2_an521
2727
:goals: debug
2828

29+
Building the application for v2m_musca
30+
**************************************
31+
32+
.. zephyr-app-commands::
33+
:zephyr-app: samples/subsys/ipc/openamp
34+
:board: v2m_musca
35+
:goals: debug
36+
2937
Open a serial terminal (minicom, putty, etc.) and connect the board with the
3038
following settings:
3139

samples/subsys/ipc/openamp/remote/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ cmake_minimum_required(VERSION 3.13.1)
66
#
77

88
if(("${BOARD}" STREQUAL "lpcxpresso54114_m0")
9-
OR "${BOARD}" STREQUAL "mps2_an521_nonsecure")
9+
OR "${BOARD}" STREQUAL "mps2_an521_nonsecure"
10+
OR "${BOARD}" STREQUAL "v2m_musca_nonsecure")
1011
message(INFO " ${BOARD} compile as slave in this sample")
1112
else()
1213
message(FATAL_ERROR "${BOARD} was not supported for this sample")

samples/subsys/ipc/openamp/remote/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ static u32_t virtio_get_features(struct virtio_device *vdev)
7373

7474
static void virtio_notify(struct virtqueue *vq)
7575
{
76-
#if defined(CONFIG_SOC_MPS2_AN521)
76+
#if defined(CONFIG_SOC_MPS2_AN521) || \
77+
defined(CONFIG_SOC_V2M_MUSCA_A)
7778
u32_t current_core = sse_200_platform_get_cpu_id();
7879

7980
ipm_send(ipm_handle, 0, current_core ? 0 : 1, 0, 1);

samples/subsys/ipc/openamp/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sample:
44
name: OpenAMP example integration
55
tests:
66
sample.ipc.openamp:
7-
platform_whitelist: lpcxpresso54114_m4 mps2_an521
7+
platform_whitelist: lpcxpresso54114_m4 mps2_an521 v2m_musca
88
tags: ipm
99
harness: console
1010
harness_config:

samples/subsys/ipc/openamp/src/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ static void virtio_set_features(struct virtio_device *vdev,
8484

8585
static void virtio_notify(struct virtqueue *vq)
8686
{
87-
#if defined(CONFIG_SOC_MPS2_AN521)
87+
#if defined(CONFIG_SOC_MPS2_AN521) || \
88+
defined(CONFIG_SOC_V2M_MUSCA_A)
8889
u32_t current_core = sse_200_platform_get_cpu_id();
8990

9091
ipm_send(ipm_handle, 0, current_core ? 0 : 1, 0, 1);
@@ -286,7 +287,8 @@ void main(void)
286287
(k_thread_entry_t)app_task,
287288
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
288289

289-
#if defined(CONFIG_SOC_MPS2_AN521)
290+
#if defined(CONFIG_SOC_MPS2_AN521) || \
291+
defined(CONFIG_SOC_V2M_MUSCA_A)
290292
wakeup_cpu1();
291293
k_sleep(500);
292294
#endif /* #if defined(CONFIG_SOC_MPS2_AN521) */
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2019 Linaro Limited
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
/*
10+
* shared memory reserved for the inter-processor communication
11+
*/
12+
zephyr,ipc_shm = &sramx;
13+
zephyr,ipc = &mhu0;
14+
};
15+
16+
sramx: memory@20018000 {
17+
compatible = "mmio-sram";
18+
reg = <0x20018000 0x8000>;
19+
};
20+
};

0 commit comments

Comments
 (0)