Skip to content

Commit fbd8cff

Browse files
Karl Zhanggalak
Karl Zhang
authored andcommitted
samples: openamp: Add support for Musca B1
Musca B1 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 0e770c6 commit fbd8cff

File tree

7 files changed

+39
-5
lines changed

7 files changed

+39
-5
lines changed

samples/subsys/ipc/openamp/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ elseif("${BOARD}" STREQUAL "mps2_an521")
1414
set(BOARD_REMOTE "mps2_an521_nonsecure")
1515
elseif("${BOARD}" STREQUAL "v2m_musca")
1616
set(BOARD_REMOTE "v2m_musca_nonsecure")
17+
elseif("${BOARD}" STREQUAL "v2m_musca_b1")
18+
set(BOARD_REMOTE "v2m_musca_b1_nonsecure")
1719
else()
1820
message(FATAL_ERROR "${BOARD} was not supported for this sample")
1921
endif()

samples/subsys/ipc/openamp/README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ Building the application for v2m_musca
3434
:board: v2m_musca
3535
:goals: debug
3636

37+
Building the application for v2m_musca_b1
38+
*****************************************
39+
40+
.. zephyr-app-commands::
41+
:zephyr-app: samples/subsys/ipc/openamp
42+
:board: v2m_musca_b1
43+
:goals: debug
44+
3745
Open a serial terminal (minicom, putty, etc.) and connect the board with the
3846
following settings:
3947

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ cmake_minimum_required(VERSION 3.13.1)
77

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

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ static u32_t virtio_get_features(struct virtio_device *vdev)
7474
static void virtio_notify(struct virtqueue *vq)
7575
{
7676
#if defined(CONFIG_SOC_MPS2_AN521) || \
77-
defined(CONFIG_SOC_V2M_MUSCA_A)
77+
defined(CONFIG_SOC_V2M_MUSCA_A) || \
78+
defined(CONFIG_SOC_V2M_MUSCA_B1)
7879
u32_t current_core = sse_200_platform_get_cpu_id();
7980

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

samples/subsys/ipc/openamp/sample.yaml

+1-1
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 v2m_musca
7+
platform_whitelist: lpcxpresso54114_m4 mps2_an521 v2m_musca v2m_musca_b1
88
tags: ipm
99
harness: console
1010
harness_config:

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ static void virtio_set_features(struct virtio_device *vdev,
8585
static void virtio_notify(struct virtqueue *vq)
8686
{
8787
#if defined(CONFIG_SOC_MPS2_AN521) || \
88-
defined(CONFIG_SOC_V2M_MUSCA_A)
88+
defined(CONFIG_SOC_V2M_MUSCA_A) || \
89+
defined(CONFIG_SOC_V2M_MUSCA_B1)
8990
u32_t current_core = sse_200_platform_get_cpu_id();
9091

9192
ipm_send(ipm_handle, 0, current_core ? 0 : 1, 0, 1);
@@ -288,7 +289,8 @@ void main(void)
288289
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
289290

290291
#if defined(CONFIG_SOC_MPS2_AN521) || \
291-
defined(CONFIG_SOC_V2M_MUSCA_A)
292+
defined(CONFIG_SOC_V2M_MUSCA_A) || \
293+
defined(CONFIG_SOC_V2M_MUSCA_B1)
292294
wakeup_cpu1();
293295
k_sleep(500);
294296
#endif /* #if defined(CONFIG_SOC_MPS2_AN521) */
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@20060000 {
17+
compatible = "mmio-sram";
18+
reg = <0x20060000 0x8000>;
19+
};
20+
};

0 commit comments

Comments
 (0)