Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remoteproc: implement rproc_virtio_read_config/rproc_virtio_write_config #171

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions lib/remoteproc/remoteproc_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,37 @@ static uint32_t rproc_virtio_negotiate_features(struct virtio_device *vdev,
static void rproc_virtio_read_config(struct virtio_device *vdev,
uint32_t offset, void *dst, int length)
{
(void)vdev;
(void)offset;
(void)dst;
(void)length;
struct remoteproc_virtio *rpvdev;
struct fw_rsc_vdev *vdev_rsc;
struct metal_io_region *io;
char *config;

rpvdev = metal_container_of(vdev, struct remoteproc_virtio, vdev);
vdev_rsc = rpvdev->vdev_rsc;
config = (char *)(&vdev_rsc->vring[vdev->vrings_num]);
io = rpvdev->vdev_rsc_io;
metal_io_block_read(io,
metal_io_virt_to_offset(io, config + offset),
dst, length);
}

#ifndef VIRTIO_SLAVE_ONLY
static void rproc_virtio_write_config(struct virtio_device *vdev,
uint32_t offset, void *src, int length)
{
(void)vdev;
(void)offset;
(void)src;
(void)length;
struct remoteproc_virtio *rpvdev;
struct fw_rsc_vdev *vdev_rsc;
struct metal_io_region *io;
char *config;

rpvdev = metal_container_of(vdev, struct remoteproc_virtio, vdev);
vdev_rsc = rpvdev->vdev_rsc;
config = (char *)(&vdev_rsc->vring[vdev->vrings_num]);
io = rpvdev->vdev_rsc_io;
metal_io_block_write(io,
metal_io_virt_to_offset(io, config + offset),
src, length);
rpvdev->notify(rpvdev->priv, vdev->notifyid);
}

static void rproc_virtio_reset_device(struct virtio_device *vdev)
Expand Down