tina linux怎么把摄像头的接口由mipi改为hispi
-
有没有指导文档 或者参考例程
-
转接芯片:安森美MT9J003,然后SoC 编写转接芯片的MIPI程序
-
@yuzukitsuru 啥意思 还要转接芯片?我现在用的CMOS模组就是MT9J003,这个CMOS是HISPI输出,开发板是用imx317,由imx317切换到MT9J003,我按照Tina Linux Camera
开发指南.pdf 上面说的进行了修改,但是这个上面没有描述修改到HISPI的内容 -
HISPI与MIPI完全不是一个接口,怎么可能修改到HISPI,除非芯片支持HISPI接口,不然只能用转接芯片或者FPGA实现一个
-
@yuzukitsuru 这位大哥 你把我说迷糊了。首先V536支持HiSPi,其次难道你的意思是V536上面MIPI和HiSPi不是共用引脚吗?
-
@jinxiangwzh 早说是V536,我还以为是V853,sys_config配置为hispi驱动就行了,把mipi-csi-used设置0,找到hispi的used打开就行
-
@yuzukitsuru 好,,唉唉。。。让你吓死了
-
@yuzukitsuru 没找到你说的,我目前找到的关于hispi的撇脂只有这个
static int sensor_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { struct sensor_info *info = to_state(sd); cfg->type = V4L2_MBUS_HISPI; if (info->isp_wdr_mode == ISP_DOL_WDR_MODE) cfg->flags = 0 | V4L2_MBUS_SUBLVDS_4_LANE | V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1; else cfg->flags = 0 | V4L2_MBUS_SUBLVDS_4_LANE | V4L2_MBUS_CSI2_CHANNEL_0; return 0; }
-
设置对应的含义为:
> status是vin驱动的总开关,对应的是media设备,使用vin时必须设为okay; > csi_top是vin模块的时钟,实际使用时可以根据sensor的帧率和分辨率来设置; > csi_isp是isp模块时钟,实际使用时可以根据sensor的帧率和分辨率来设置; > work_mode: 0:online mode 1:offline mode, 根据使用需求配置; > flash0_type: 0:FLASH_RELATING, 1:FLASH_EN_INDEPEND, 2:FLASH_POWER > flash0_en: flash enable gpio, type = 0 of 1 > flash0_mode: flash mode gpio, type = 0 of 1 > flash0_flvdd: flash module io power handle string, pmu power supply, type = 2 > flash0_flvdd_vol: flash module io power voltage, pmu power supply, type = 2 > status: 是否使用flash, disable代表关,okay代表开 > actuator0_name: vcm name > actuator0_slave: vcm iic slave address > actuator0_af_pwdn: vcm power down gpio > actuator0_afvdd: vcm power handle string, pmu power supply > actuator0_afvdd_vol: vcm power voltage, pmu power supply > status: vcm if used, disable代表关,okay代表开 > device_type: sensor type > sensor0_mname: sensor name > sensor0_twi_cci_id:sensor所使用的twi或者cci的id。 > sensor0_twi_addr:sensor的twi地址 > sensor0_mclk_id:sensor所使用的mclk的id。 > sensor0_pos:sensor的位置,前置还是后置,主要用在平板上。 > sensor0_isp_used: not use isp 1:use isp > sensor0_fmt: 0:yuv 1:bayer raw rgb > sensor0_stby_mode: not shut down power at standby 1:shut down power at standby > sensor0_vflip: flip in vertical direction 0:disable 1:enable > sensor0_hflip: flip in horizontal direction 0:disable 1:enable > sensor0_iovdd-supply: camera module io power handle string, pmu power supply > sensor0_iovdd_vol: camera module io power voltage, pmu power supply > sensor0_avdd-supply: camera module analog power handle string, pmu power supply > sensor0_avdd_vol: camera module analog power voltage, pmu power supply > sensor0_dvdd-supply: camera module core power handle string, pmu power supply > sensor0_dvdd_vol: camera module core power voltage, pmu power supply > sensor0_power_en: camera module power enable gpio > sensor0_reset: camera module reset gpio > sensor0_pwdn: camera module pwdn gpio > sensor0_sm_hs: camera module sm_hs gpio > sensor0_sm_vs: camera module sm_vs gpio > status: open or close sensor device > flash/actautor/sensor节点用于对应的外设的开关和配置。这些节点的配置一般需要参考对应方案的原理图和外设的data sheet来完成。 > vinc0_csi_sel:表示该pipeline上parser的id,必须配置,且为有效id。 > vinc0_mipi_sel:表示该pipeline上mipi(sublvds/hispi)的id,不使用时配置为0xff。 > vinc0_isp_sel:表示该pipeline上isp的id,必须配置,当isp为空时,这个isp只是表示路由不做isp的效果处理。 > vinc0_isp_tx_ch表示该pipeline上isp的ch,必须配置,默认为0。当sensor是bt656多通道或者WDR出RAW时,该ch可以配置0~3的值。 > vinc0_tdm_rx_sel: 表示该pipeline上tdm rx的ch,必须配置,默认为0。当不使用tdm功能时,配置为0xff; > vinc0_rear_sensor_sel表示该pipeline上使用的后置sensor的id。 > vinc0_front_sensor_sel 表示该pipeline上使用的前置sensor的id。 > vinc0_sensor_list表示是否使用sensor_list来时适配不同的模组,1表示使用,0表示不使用。 > work_mode: 0:online mode 1:offline mode, 根据使用需求配置;只有vinc0/4/8/12可以配置。 > status: vipp的使能开关,okay or disable。
这里提供的是使用设备树方案的配置名称,对于使用 sys_config.fex 的方案可以对照这里的设备树检查,配置项差别不大。hispi与mipi软件上只需要修改sensor驱动,不需要修改 V4L2框架,更不需要读写寄存器。具体方法参考 《Linux_MIPI_CSI_开发指南.pdf》(需要FAE提供)。
这里提供设备树的配置:
&vind0 { csi_top = <336000000>; csi_isp = <300000000>; status = "okay"; tdm0:tdm@0 { work_mode = <0>; }; isp00:isp@0 { work_mode = <0>; }; scaler00:scaler@0 { work_mode = <0>; }; scaler10:scaler@4 { work_mode = <0>; }; scaler20:scaler@8 { work_mode = <0>; }; scaler30:scaler@12 { work_mode = <0>; }; actuator0:actuator@0 { device_type = "actuator0"; actuator0_name = "ad5820_act"; actuator0_slave = <0x18>; actuator0_af_pwdn = <>; actuator0_afvdd = "afvcc-csi"; actuator0_afvdd_vol = <2800000>; status = "disabled"; }; flash0:flash@0 { device_type = "flash0"; flash0_type = <2>; flash0_en = <>; flash0_mode = <>; flash0_flvdd = ""; flash0_flvdd_vol = <>; status = "disabled"; }; sensor0:sensor@0 { device_type = "sensor0"; sensor0_mname = "gc2053_mipi"; sensor0_twi_cci_id = <1>; sensor0_twi_addr = <0x6e>; sensor0_mclk_id = <0>; sensor0_pos = "rear"; sensor0_isp_used = <1>; sensor0_fmt = <1>; sensor0_stby_mode = <0>; sensor0_vflip = <0>; sensor0_hflip = <0>; sensor0_iovdd-supply = <®_aldo2>; sensor0_iovdd_vol = <1800000>; sensor0_avdd-supply = <®_bldo2>; sensor0_avdd_vol = <2800000>; sensor0_dvdd-supply = <®_dldo2>; sensor0_dvdd_vol = <1200000>; sensor0_power_en = <>; sensor0_reset = <&pio PA 18 1 0 1 0>; sensor0_pwdn = <&pio PA 19 1 0 1 0>; sensor0_sm_hs = <>; sensor0_sm_vs = <>; flash_handle = <&flash0>; act_handle = <&actuator0>; status = "okay"; }; sensor1:sensor@1 { device_type = "sensor1"; sensor1_mname = "imx386_mipi_2"; sensor1_twi_cci_id = <0>; sensor1_twi_addr = <0x20>; sensor1_mclk_id = <1>; sensor1_pos = "front"; sensor1_isp_used = <1>; sensor1_fmt = <1>; sensor1_stby_mode = <0>; sensor1_vflip = <0>; sensor1_hflip = <0>; sensor1_iovdd-supply = <®_aldo2>; sensor1_iovdd_vol = <1800000>; sensor1_avdd-supply = <®_bldo2>; sensor1_avdd_vol = <2800000>; sensor1_dvdd-supply = <®_dldo2>; sensor1_dvdd_vol = <1200000>; sensor1_power_en = <>; sensor1_reset = <&pio PA 20 1 0 1 0>; sensor1_pwdn = <&pio PA 21 1 0 1 0>; sensor1_sm_hs = <>; sensor1_sm_vs = <>; flash_handle = <>; act_handle = <>; status = "okay"; }; vinc00:vinc@0 { vinc0_csi_sel = <0>; vinc0_mipi_sel = <0>; vinc0_isp_sel = <0>; vinc0_isp_tx_ch = <0>; vinc0_tdm_rx_sel = <0>; vinc0_rear_sensor_sel = <0>; vinc0_front_sensor_sel = <0>; vinc0_sensor_list = <0>; work_mode = <0x0>; status = "okay"; }; vinc01:vinc@1 { vinc1_csi_sel = <2>; vinc1_mipi_sel = <0xff>; vinc1_isp_sel = <1>; vinc1_isp_tx_ch = <1>; vinc1_tdm_rx_sel = <1>; vinc1_rear_sensor_sel = <0>; vinc1_front_sensor_sel = <0>; vinc1_sensor_list = <0>; status = "disabled"; }; vinc02:vinc@2 { vinc2_csi_sel = <2>; vinc2_mipi_sel = <0xff>; vinc2_isp_sel = <2>; vinc2_isp_tx_ch = <2>; vinc2_tdm_rx_sel = <2>; vinc2_rear_sensor_sel = <0>; vinc2_front_sensor_sel = <0>; vinc2_sensor_list = <0>; status = "disabled"; }; vinc03:vinc@3 { vinc3_csi_sel = <0>; vinc3_mipi_sel = <0xff>; vinc3_isp_sel = <0>; vinc3_isp_tx_ch = <0>; vinc3_tdm_rx_sel = <0>; vinc3_rear_sensor_sel = <1>; vinc3_front_sensor_sel = <1>; vinc3_sensor_list = <0>; status = "disabled"; }; ………… };
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号