Skip to content

Commit ec2dd19

Browse files
alxlasturcarlescufi
authored andcommitted
samples: openamp_rsc_table: Add the option to use predefined vring ID
Currently, Zephyr is always sending back notifications to AP (e.g Linux in our case) on channel 0. But this currently doesn't work if Linux uses other channel id for communication. So, add option to use predefined vring ID that can accomodate Linux used ID. Signed-off-by: Alexandru Lastur <[email protected]>
1 parent 840f13f commit ec2dd19

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

lib/open-amp/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,19 @@ config OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF
1818
help
1919
This option specifies the number of buffer used in a Vring for
2020
interprocessor communication
21+
22+
config OPENAMP_RSC_TABLE_IPM_RX_ID
23+
int "IPM RX channel ID"
24+
default 0
25+
depends on OPENAMP_RSC_TABLE
26+
help
27+
This option specifies the IPM RX channel ID used in a VRING
28+
for interprocessor communication
29+
30+
config OPENAMP_RSC_TABLE_IPM_TX_ID
31+
int "IPM TX channel ID"
32+
default 1
33+
depends on OPENAMP_RSC_TABLE
34+
help
35+
This option specifies the IPM TX channel ID used in a VRING
36+
for interprocessor communication

lib/open-amp/resource_table.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ extern "C" {
1717
#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)
1818

1919
#define VDEV_ID 0xFF
20-
#define VRING0_ID 0 /* (master to remote) fixed to 0 for Linux compatibility */
21-
#define VRING1_ID 1 /* (remote to master) fixed to 1 for Linux compatibility */
20+
#define VRING0_ID CONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID /* (host to remote) */
21+
#define VRING1_ID CONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID /* (remote to host) */
2222

2323
#define VRING_COUNT 2
2424
#define RPMSG_IPU_C0_FEATURES 1

samples/subsys/ipc/openamp_rsc_table/boards/imx8mp_evk_mimx8ml8_m7.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ CONFIG_LOG=y
77
CONFIG_LOG_BACKEND_UART=y
88
CONFIG_LOG_DEFAULT_LEVEL=0
99
CONFIG_LOG_MODE_MINIMAL=y
10+
CONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID=1
11+
CONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID=0

0 commit comments

Comments
 (0)