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 <[email protected]>
  • Loading branch information
alxlastur committed Oct 10, 2024
1 parent ed6a464 commit c55d466
Show file tree
Hide file tree
Showing 3 changed files with 27 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 IPM_RX_CHANNEL_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 IPM_TX_CHANNEL_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
11 changes: 9 additions & 2 deletions lib/open-amp/resource_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ extern "C" {

#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)

#define VDEV_ID 0xFF
#define VDEV_ID 0xFF
#ifdef CONFIG_IPM_RX_CHANNEL_ID
#define VRING0_ID CONFIG_IPM_RX_CHANNEL_ID
#else
#define VRING0_ID 0 /* (master to remote) fixed to 0 for Linux compatibility */
#endif
#ifdef CONFIG_IPM_TX_CHANNEL_ID
#define VRING1_ID CONFIG_IPM_TX_CHANNEL_ID
#else
#define VRING1_ID 1 /* (remote to master) fixed to 1 for Linux compatibility */
#endif

#define VRING_COUNT 2
#define RPMSG_IPU_C0_FEATURES 1

#define VRING_RX_ADDRESS -1 /* allocated by Master processor */
#define VRING_TX_ADDRESS -1 /* allocated by Master processor */
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor */
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_IPM_RX_CHANNEL_ID=1
CONFIG_IPM_TX_CHANNEL_ID=0

0 comments on commit c55d466

Please sign in to comment.