zephyr/samples/subsys/ipc/openamp/common.h
Karl Zhang 742f55a998 samples: openamp: Remove exclusive compile of openAMP
Add configuable shared memory address for openAMP samples. There is a
plan to add more platforms supported for openAMP in zephyr.

Each platform can specify the shared memory address and device by
device tree and add it's support in openAMP samples.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-26 06:10:07 -05:00

28 lines
717 B
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
* Copyright (c) 2018-2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef COMMON_H__
#define COMMON_H__
#define VDEV_START_ADDR CONFIG_OPENAMP_IPC_SHM_BASE_ADDRESS
#define VDEV_SIZE CONFIG_OPENAMP_IPC_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"
#define VRING_COUNT 2
#define VRING_RX_ADDRESS (VDEV_START_ADDR + SHM_SIZE - VDEV_STATUS_SIZE)
#define VRING_TX_ADDRESS (VDEV_START_ADDR + SHM_SIZE)
#define VRING_ALIGNMENT 4
#define VRING_SIZE 16
#endif