Skip to content

Commit d153655

Browse files
committed
legacy_apps: zynqmp_r5: init rpmsg vdev with config
Current rpmsg device is not initialized with the config space. Initialze the rpmsg device with the vdev config parameters from the resource table. This configures tx and rx buffer size. Host can read this configuration and configure tx and rx buffer size accordingly. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
1 parent 87a92da commit d153655

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

examples/legacy_apps/machine/xlnx/zynqmp_r5/platform_info.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
362362
void (*rst_cb)(struct virtio_device *vdev),
363363
rpmsg_ns_bind_cb ns_bind_cb)
364364
{
365+
struct remote_resource_table *rsc_tbl;
365366
struct remoteproc *rproc = platform;
366367
struct rpmsg_virtio_device *rpmsg_vdev;
367368
struct virtio_device *vdev;
@@ -371,6 +372,8 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
371372

372373
restore_initial_rsc_table();
373374

375+
rsc_tbl = rproc->rsc_table;
376+
374377
rpmsg_vdev = metal_allocate_memory(sizeof(*rpmsg_vdev));
375378
if (!rpmsg_vdev)
376379
return NULL;
@@ -394,9 +397,9 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
394397

395398
metal_dbg("initializing rpmsg vdev\r\n");
396399
/* RPMsg virtio device can set shared buffers pool argument to NULL */
397-
ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb,
398-
shbuf_io,
399-
&shpool);
400+
ret = rpmsg_init_vdev_with_config(rpmsg_vdev, vdev, ns_bind_cb,
401+
shbuf_io, &shpool,
402+
&rsc_tbl->vdev_config);
400403
if (ret) {
401404
metal_err("failed rpmsg_init_vdev\r\n");
402405
goto err2;

0 commit comments

Comments
 (0)