Skip to content

Commit

Permalink
samples: openamp_rsc_table: Add the option to use predefined vring ID
Browse files Browse the repository at this point in the history
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 <alexandru.lastur@nxp.com>
  • Loading branch information
alxlastur authored and carlescufi committed Oct 15, 2024
1 parent 840f13f commit ec2dd19
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
16 changes: 16 additions & 0 deletions lib/open-amp/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ config OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF
help
This option specifies the number of buffer used in a Vring for
interprocessor communication

config OPENAMP_RSC_TABLE_IPM_RX_ID
int "IPM RX channel ID"
default 0
depends on OPENAMP_RSC_TABLE
help
This option specifies the IPM RX channel ID used in a VRING
for interprocessor communication

config OPENAMP_RSC_TABLE_IPM_TX_ID
int "IPM TX channel ID"
default 1
depends on OPENAMP_RSC_TABLE
help
This option specifies the IPM TX channel ID used in a VRING
for interprocessor communication
4 changes: 2 additions & 2 deletions lib/open-amp/resource_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ extern "C" {
#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)

#define VDEV_ID 0xFF
#define VRING0_ID 0 /* (master to remote) fixed to 0 for Linux compatibility */
#define VRING1_ID 1 /* (remote to master) fixed to 1 for Linux compatibility */
#define VRING0_ID CONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID /* (host to remote) */
#define VRING1_ID CONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID /* (remote to host) */

#define VRING_COUNT 2
#define RPMSG_IPU_C0_FEATURES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID=1
CONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID=0

0 comments on commit ec2dd19

Please sign in to comment.