FAQ on RK35xx Platform/zh
RK35xx平台的板卡多元化,因此常常需要进行驱动移植。驱动移植的方法参考github上驱动源码的说明。此处,我们列出客户在将我们的驱动移植到不同的板卡时经常遇到的问题和解决方法。
rkcif-mipi-lvds2: ERROR: csi size err, intstat:0x1000000, lastline:0!!
- 常见平台:
飞凌OK3588-C、临滴LKD3588 平台,使用MV和RAW系列相机时遇到。
- 问题原因:
kernel的rkcif驱动中缺少MV系列相机所支持的数据格式。
- 解决方案:
kernel\drivers\media\platform\rockchip\cif\capture.c
文件中,增加对MEDIA_BUS_FMT_Y8_1X8、MEDIA_BUS_FMT_Y10_1X10、MEDIA_BUS_FMT_Y12_1X12三种数据格式的支持。
主要涉及到的函数如下:
static unsigned char get_data_type(u32 pixelformat, u8 cmd_mode_en)
{
switch (pixelformat) {
/* csi raw8 */
case MEDIA_BUS_FMT_SBGGR8_1X8:
case MEDIA_BUS_FMT_SGBRG8_1X8:
case MEDIA_BUS_FMT_SGRBG8_1X8:
case MEDIA_BUS_FMT_SRGGB8_1X8:
case MEDIA_BUS_FMT_Y8_1X8:
return 0x2a;
/* csi raw10 */
case MEDIA_BUS_FMT_SBGGR10_1X10:
case MEDIA_BUS_FMT_SGBRG10_1X10:
case MEDIA_BUS_FMT_SGRBG10_1X10:
case MEDIA_BUS_FMT_SRGGB10_1X10:
case MEDIA_BUS_FMT_Y10_1X10:
return 0x2b;
/* csi raw12 */
case MEDIA_BUS_FMT_SBGGR12_1X12:
case MEDIA_BUS_FMT_SGBRG12_1X12:
case MEDIA_BUS_FMT_SGRBG12_1X12:
case MEDIA_BUS_FMT_SRGGB12_1X12:
case MEDIA_BUS_FMT_Y12_1X12:
return 0x2c;
/* csi uyvy 422 */
case MEDIA_BUS_FMT_UYVY8_2X8:
case MEDIA_BUS_FMT_VYUY8_2X8:
case MEDIA_BUS_FMT_YUYV8_2X8:
case MEDIA_BUS_FMT_YVYU8_2X8:
return 0x1e;
case MEDIA_BUS_FMT_RGB888_1X24: {
if (cmd_mode_en) /* dsi command mode*/
return 0x39;
else /* dsi video mode */
return 0x3e;
}
case MEDIA_BUS_FMT_EBD_1X8:
return 0x12;
case MEDIA_BUS_FMT_SPD_2X8:
return 0x2f;
default:
return 0x2b;
}
}