luckfox-pico-sdk/sysdrv/source/kernel/include/uapi/linux/rk-pcie-ep.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

74 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (c) 2022 Rockchip Electronics Co., Ltd.
*/
#ifndef _UAPI__RK_PCIE_EP_H__
#define _UAPI__RK_PCIE_EP_H__
#include <linux/types.h>
/*
* rockchip pcie driver elbi ioctrl output data
*/
struct pcie_ep_user_data {
__u64 bar0_phys_addr;
__u32 elbi_app_user[11];
};
/*
* rockchip driver cache ioctrl input param
*/
struct pcie_ep_dma_cache_cfg {
__u64 addr;
__u32 size;
};
#define PCIE_EP_OBJ_INFO_MAGIC 0x524B4550
enum pcie_ep_obj_irq_type {
OBJ_IRQ_UNKNOWN,
OBJ_IRQ_DMA,
OBJ_IRQ_USER,
OBJ_IRQ_ELBI,
};
struct pcie_ep_obj_irq_dma_status {
__u32 wr;
__u32 rd;
};
enum pcie_ep_mmap_resource {
PCIE_EP_MMAP_RESOURCE_DBI,
PCIE_EP_MMAP_RESOURCE_BAR0,
PCIE_EP_MMAP_RESOURCE_BAR2,
PCIE_EP_MMAP_RESOURCE_BAR4,
PCIE_EP_MMAP_RESOURCE_MAX,
};
/*
* rockchip ep device information which is store in BAR0
*/
struct pcie_ep_obj_info {
__u32 magic;
__u32 version;
__u8 reserved[0x1F8];
__u32 irq_type_rc; /* Generate in ep isr, valid only for rc, clear in rc */
struct pcie_ep_obj_irq_dma_status dma_status_rc; /* Generate in ep isr, valid only for rc, clear in rc */
__u32 irq_type_ep; /* Generate in ep isr, valid only for ep, clear in ep */
struct pcie_ep_obj_irq_dma_status dma_status_ep; /* Generate in ep isr, valid only for ep, clear in ep */
__u32 obj_irq_user_data; /* OBJ_IRQ_USER userspace data */
};
#define PCIE_BASE 'P'
#define PCIE_DMA_GET_ELBI_DATA _IOR(PCIE_BASE, 0, struct pcie_ep_user_data)
#define PCIE_DMA_CACHE_INVALIDE _IOW(PCIE_BASE, 1, struct pcie_ep_dma_cache_cfg)
#define PCIE_DMA_CACHE_FLUSH _IOW(PCIE_BASE, 2, struct pcie_ep_dma_cache_cfg)
#define PCIE_DMA_IRQ_MASK_ALL _IOW(PCIE_BASE, 3, int)
#define PCIE_DMA_RAISE_MSI_OBJ_IRQ_USER _IOW(PCIE_BASE, 4, int)
#define PCIE_EP_GET_USER_INFO _IOR(PCIE_BASE, 5, struct pcie_ep_user_data)
#define PCIE_EP_SET_MMAP_RESOURCE _IOW(PCIE_BASE, 6, enum pcie_ep_mmap_resource)
#endif