linux/drivers/remoteproc/remoteproc_virtio.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Remote processor messaging transport (OMAP platform-specific bits)
 *
 * Copyright (C) 2011 Texas Instruments, Inc.
 * Copyright (C) 2011 Google, Inc.
 *
 * Ohad Ben-Cohen <[email protected]>
 * Brian Swetland <[email protected]>
 */

#include <linux/dma-direct.h>
#include <linux/dma-map-ops.h>
#include <linux/dma-mapping.h>
#include <linux/export.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/remoteproc.h>
#include <linux/virtio.h>
#include <linux/virtio_config.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_ring.h>
#include <linux/err.h>
#include <linux/kref.h>
#include <linux/slab.h>

#include "remoteproc_internal.h"

static int copy_dma_range_map(struct device *to, struct device *from)
{}

static struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
{}

static  struct rproc *vdev_to_rproc(struct virtio_device *vdev)
{}

/* kick the remote processor, and let it know which virtqueue to poke at */
static bool rproc_virtio_notify(struct virtqueue *vq)
{}

/**
 * rproc_vq_interrupt() - tell remoteproc that a virtqueue is interrupted
 * @rproc: handle to the remote processor
 * @notifyid: index of the signalled virtqueue (unique per this @rproc)
 *
 * This function should be called by the platform-specific rproc driver,
 * when the remote processor signals that a specific virtqueue has pending
 * messages available.
 *
 * Return: IRQ_NONE if no message was found in the @notifyid virtqueue,
 * and otherwise returns IRQ_HANDLED.
 */
irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int notifyid)
{}
EXPORT_SYMBOL();

static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
				    unsigned int id,
				    void (*callback)(struct virtqueue *vq),
				    const char *name, bool ctx)
{}

static void __rproc_virtio_del_vqs(struct virtio_device *vdev)
{}

static void rproc_virtio_del_vqs(struct virtio_device *vdev)
{}

static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
				 struct virtqueue *vqs[],
				 struct virtqueue_info vqs_info[],
				 struct irq_affinity *desc)
{}

static u8 rproc_virtio_get_status(struct virtio_device *vdev)
{}

static void rproc_virtio_set_status(struct virtio_device *vdev, u8 status)
{}

static void rproc_virtio_reset(struct virtio_device *vdev)
{}

/* provide the vdev features as retrieved from the firmware */
static u64 rproc_virtio_get_features(struct virtio_device *vdev)
{}

static void rproc_transport_features(struct virtio_device *vdev)
{}

static int rproc_virtio_finalize_features(struct virtio_device *vdev)
{}

static void rproc_virtio_get(struct virtio_device *vdev, unsigned int offset,
			     void *buf, unsigned int len)
{}

static void rproc_virtio_set(struct virtio_device *vdev, unsigned int offset,
			     const void *buf, unsigned int len)
{}

static const struct virtio_config_ops rproc_virtio_config_ops =;

/*
 * This function is called whenever vdev is released, and is responsible
 * to decrement the remote processor's refcount which was taken when vdev was
 * added.
 *
 * Never call this function directly; it will be called by the driver
 * core when needed.
 */
static void rproc_virtio_dev_release(struct device *dev)
{}

/**
 * rproc_add_virtio_dev() - register an rproc-induced virtio device
 * @rvdev: the remote vdev
 * @id: the device type identification (used to match it with a driver).
 *
 * This function registers a virtio device. This vdev's partent is
 * the rproc device.
 *
 * Return: 0 on success or an appropriate error value otherwise
 */
static int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
{}

/**
 * rproc_remove_virtio_dev() - remove an rproc-induced virtio device
 * @dev: the virtio device
 * @data: must be null
 *
 * This function unregisters an existing virtio device.
 *
 * Return: 0
 */
static int rproc_remove_virtio_dev(struct device *dev, void *data)
{}

static int rproc_vdev_do_start(struct rproc_subdev *subdev)
{}

static void rproc_vdev_do_stop(struct rproc_subdev *subdev, bool crashed)
{}

static int rproc_virtio_probe(struct platform_device *pdev)
{}

static void rproc_virtio_remove(struct platform_device *pdev)
{}

/* Platform driver */
static struct platform_driver rproc_virtio_driver =;
builtin_platform_driver();