[linux] porting cvitek asic chips.

1. update cv182x/cv183x configuration file
	2. update cv181x/cv180x configuration file
	3. update clk driver for cvitek
	4. update dma driver for cvitek
	5. update soc driver for cvitek
	6. porting cvitek ion driver from kernel-4.19
	7. compatible with riscv

Change-Id: Icff9fafe0ebe7d6bab824bbadb952e08bdc66c19
This commit is contained in:
wangliang.wang
2023-03-09 14:38:25 +08:00
committed by sam.xiang
parent 4bc998a131
commit 4f810186ab
2062 changed files with 544892 additions and 2134 deletions

View File

@ -431,6 +431,7 @@ typedef struct elf64_shdr {
#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
#define NT_RISCV_VECTOR 0x900 /* RISC-V vector registers */
/* Note types with note name "GNU" */
#define NT_GNU_PROPERTY_TYPE_0 5

View File

@ -71,6 +71,7 @@ struct i2c_msg {
__u16 flags;
#define I2C_M_RD 0x0001 /* read data, from slave to master */
/* I2C_M_RD is guaranteed to be 0x0001! */
#define I2C_M_WRSTOP 0x0002 /* if allow stop between msg. */
#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
#define I2C_M_DMA_SAFE 0x0200 /* the buffer of this message is DMA safe */
/* makes only sense in kernelspace */

View File

@ -153,6 +153,16 @@
/* S5C73M3 sensor specific interleaved UYVY and JPEG */
#define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001
/* CVITEK RGBIR specific formats */
#define MEDIA_BUS_FMT_CVI_BAYER_GRGBI_1x12 0x5101
#define MEDIA_BUS_FMT_CVI_BAYER_RGBGI_1x12 0x5102
#define MEDIA_BUS_FMT_CVI_BAYER_GBGRI_1x12 0x5103
#define MEDIA_BUS_FMT_CVI_BAYER_BGRGI_1x12 0x5104
#define MEDIA_BUS_FMT_CVI_BAYER_IGRGB_1x12 0x5105
#define MEDIA_BUS_FMT_CVI_BAYER_IRGBG_1x12 0x5106
#define MEDIA_BUS_FMT_CVI_BAYER_IBGRG_1x12 0x5107
#define MEDIA_BUS_FMT_CVI_BAYER_IGBGR_1x12 0x5108
/* HSV - next is 0x6002 */
#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001

View File

@ -566,5 +566,63 @@ struct UVC_FRAME_MJPEG(n) { \
__le32 dwFrameInterval[n]; \
} __attribute__ ((packed))
/* Frame Based Payload - 3.1.1. Frame Based Video Format Descriptor */
struct uvc_format_framebased {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__u8 bFormatIndex;
__u8 bNumFrameDescriptors;
__u8 guidFormat[16];
__u8 bBitsPerPixel;
__u8 bDefaultFrameIndex;
__u8 bAspectRatioX;
__u8 bAspectRatioY;
__u8 bmInterfaceFlags;
__u8 bCopyProtect;
__u8 bVariableSize;
} __attribute__((__packed__));
#define UVC_DT_FORMAT_FRAMEBASED_SIZE 28
/* Frame Based Payload - 3.1.2. Frame Based Video Frame Descriptor */
struct uvc_frame_framebased {
__u8 bLength;
__u8 bDescriptorType;
__u8 bDescriptorSubType;
__u8 bFrameIndex;
__u8 bmCapabilities;
__u16 wWidth;
__u16 wHeight;
__u32 dwMinBitRate;
__u32 dwMaxBitRate;
__u32 dwDefaultFrameInterval;
__u8 bFrameIntervalType;
__u32 dwBytesPerLine;
__u32 dwFrameInterval[];
} __attribute__((__packed__));
#define UVC_DT_FRAME_FRAMEBASED_SIZE(n) (26+4*(n))
#define UVC_FRAME_FRAMEBASED(n) \
uvc_frame_framebased_##n
#define DECLARE_UVC_FRAME_FRAMEBASED(n) \
struct UVC_FRAME_FRAMEBASED(n) { \
__u8 bLength; \
__u8 bDescriptorType; \
__u8 bDescriptorSubType; \
__u8 bFrameIndex; \
__u8 bmCapabilities; \
__u16 wWidth; \
__u16 wHeight; \
__u32 dwMinBitRate; \
__u32 dwMaxBitRate; \
__u32 dwDefaultFrameInterval; \
__u8 bFrameIntervalType; \
__u32 dwBytesPerLine; \
__u32 dwFrameInterval[n]; \
} __attribute__ ((packed))
#endif /* __LINUX_USB_VIDEO_H */

View File

@ -1110,6 +1110,10 @@ static inline __u64 v4l2_timeval_to_ns(const struct timeval *tv)
#define V4L2_BUF_FLAG_LAST 0x00100000
/* request_fd is valid */
#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
/* cvitek define buf from isp_fe_0 */
#define V4L2_BUF_FLAG_FRAME_ISP_0 0x00200000
/* cvitek define buf from isp_fe_1 */
#define V4L2_BUF_FLAG_FRAME_ISP_1 0x00400000
/**
* struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor