zephyr/subsys/ipc/rpmsg_service/rpmsg_backend.h
Hubert Miś b0ec7a63ab ipc: RPMsg service to register multiple endpoints
This patch implements a service that adds multiendpoint
capabilities to RPMsg. Multiple endpoints are intended to be used
when multiple modules need services from a remote processor. Each
module may register one or more RPMsg endpoints.

The implementation separates backend from the service, what
allows to extend this module to support other topologies like
Linux <-> Zephyr.

Co-authored-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-01-19 22:07:09 +01:00

45 lines
1.2 KiB
C

/*
* Copyright (c) 2021, Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SUBSYS_IPC_RPMSG_BACKEND_H
#define ZEPHYR_SUBSYS_IPC_RPMSG_BACKEND_H
#include <openamp/rpmsg_virtio.h>
#ifdef __cplusplus
extern "C" {
#endif
#define VDEV_START_ADDR CONFIG_RPMSG_SERVICE_SHM_BASE_ADDRESS
#define VDEV_SIZE CONFIG_RPMSG_SERVICE_SHM_SIZE
#define VDEV_STATUS_ADDR VDEV_START_ADDR
#define VDEV_STATUS_SIZE 0x400
#define SHM_START_ADDR (VDEV_START_ADDR + VDEV_STATUS_SIZE)
#define SHM_SIZE (VDEV_SIZE - VDEV_STATUS_SIZE)
#define SHM_DEVICE_NAME "sramx.shm"
/*
* @brief Initialize RPMsg backend
*
* @param io Shared memory IO region. This is an output parameter providing
* a pointer to an actual shared memory IO region structure.
* Caller of this function shall pass an address at which the
* pointer to the shared memory IO region structure is stored.
* @param vdev Pointer to the virtio device initialized by this function.
*
* @retval 0 Initialization successful
* @retval <0 Initialization error reported by OpenAMP
*/
int rpmsg_backend_init(struct metal_io_region **io, struct virtio_device *vdev);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_SUBSYS_IPC_RPMSG_BACKEND_H */