luckfox-pico-sdk/sysdrv/source/kernel/include/linux/rpmsg/rockchip_rpmsg.h
luckfox-eng29 8f34c2760d project:build.sh: Added fastboot support; custom modifications to U-Boot and kernel implemented using patches.
project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between
the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door
for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more
usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp:
Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for
compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem.
sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device
tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately.
sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick
boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades.
sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for
fastboot.

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
2024-10-14 09:47:04 +08:00

44 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2022 Rockchip Electronics Co., Ltd.
*/
#ifndef ROCKCHIP_RPMSG_H
#define ROCKCHIP_RPMSG_H
/* rpmsg flag bit definition
* bit 0: Set 1 to indicate remote processor is ready
* bit 1: Set 1 to use reserved memory region as shared DMA pool
* bit 2: Set 1 to use cached share memory as vring buffer
*/
#define RPMSG_REMOTE_IS_READY BIT(0)
#define RPMSG_SHARED_DMA_POOL BIT(1)
#define RPMSG_CACHED_VRING BIT(2)
#define RPMSG_VIRTIO_RPMSG_F_NS BIT(0)
#define RPMSG_BUF_PAYLOAD_SIZE (496UL)
/* rpmsg buffer size is formed by payload size and struct rpmsg_hdr */
#define RPMSG_BUF_SIZE (RPMSG_BUF_PAYLOAD_SIZE + 16UL)
/* rpmsg buffer count for each direction */
#define RPMSG_BUF_COUNT (64UL)
/* rpmsg endpoint size is equal to rpmsg buffer size */
#define RPMSG_EPT_SIZE RPMSG_BUF_SIZE
#define RPMSG_MAX_INSTANCE_NUM (12U)
#define RPMSG_MAX_LINK_ID (0xFFU)
#define RPMSG_MBOX_MAGIC (0x524D5347U)
/* Linux requires the ALIGN to 0x1000(4KB) */
#define RPMSG_VRING_ALIGN (0x1000UL)
/* contains pool of descriptors and two circular buffers */
#define RPMSG_VRING_SIZE (0x8000UL)
/* size of 2 * RPMSG_VRING_SIZE */
#define RPMSG_VRING_OVERHEAD (2UL * RPMSG_VRING_SIZE)
/* link_id: 4 bit master cpu_id and 4 bit remote_id */
#define RPMSG_GET_M_CPU_ID(link_id) (((link_id) & 0xF0U) >> 4U)
#define RPMSG_GET_R_CPU_ID(link_id) ((link_id) & 0xFU)
#endif /* ROCKCHIP_RPMSG_H */