调过camera做一个总结
1.在一款RK3128上面实现了一个摄像头:YHX2155


//kernel/arch/arm/boot/dts/rk3128-cif-sensor.dtsi
+++++++
gc2155{
status = "okay";
is_front = <1>;
rockchip,powerdown = <&gpio3 GPIO_B3 GPIO_ACTIVE_HIGH>;
pwdn_active = <gc2155_PWRDN_ACTIVE>;
#rockchip,power = <>;
pwr_active = <PWR_ACTIVE_HIGH>;
#rockchip,reset = <>;
#rst_active = <>;
#rockchip,flash = <>;
#rockchip,af = <>;
mir = <0>;
flash_attach = <1>;
flash_active = <1>;
resolution = <gc2155_FULL_RESOLUTION>;
powerup_sequence = <gc2155_PWRSEQ>;
orientation = <0>;
i2c_add = <gc2155_I2C_ADDR>;
i2c_rata = <100000>;
i2c_chl = <1>;
cif_chl = <0>;
mclk_rate = <24>;
};
gc2145{
is_front = <1>;
rockchip,powerdown = <&gpio3 GPIO_B3 GPIO_ACTIVE_HIGH>;
pwdn_active = <gc2145_PWRDN_ACTIVE>;
pwr_active = <PWR_ACTIVE_HIGH>;
mir = <0>;
flash_attach = <0>;
resolution = <gc2145_FULL_RESOLUTION>;
powerup_sequence = <gc2145_PWRSEQ>;
orientation = <0>;
i2c_add = <gc2145_I2C_ADDR>;
i2c_rata = <100000>;
i2c_chl = <1>;
cif_chl = <0>;
mclk_rate = <24>;
};
参考资料:Camera 使用
//########################################################################//
2.rk3288上点过OV13850



Android:
`- hardware/rockchip/camera
|- Config
| `- cam_board.xml // 摄像头的参数设置
|- CameraHal // 摄像头的 HAL 源码
`- SiliconImage // ISP 库,包括所有支持模组的驱动源码
`- isi/drv/OV13850 // OV13850 模组的驱动源码
`- calib/OV13850.xml // OV13850 模组的调校参数
\\hardware\rockchip\camera\Config\cam_board_rk3288.xml
<CamDevie>
<HardWareInfo>
<Sensor>
<SensorName name="OV13850" ></SensorName>
<ModuleName name="NC" ></ModuleName>
<SensorDevID IDname="CAMSYS_DEVID_SENSOR_1B"></SensorDevID>
<SensorHostDevID busnum="CAMSYS_DEVID_MARVIN" ></SensorHostDevID>
<SensorI2cBusNum busnum="3"></SensorI2cBusNum>
<SensorI2cAddrByte byte="2"></SensorI2cAddrByte>
<SensorI2cRate rate="100000"></SensorI2cRate>
<SensorAvdd name="NC" min="0" max="0" delay="0"></SensorAvdd>
<SensorDvdd name="NC" min="0" max="0" delay="0"></SensorDvdd>
<SensorDovdd name="NC" min="18000000" max="18000000" delay="5000"></SensorDovdd>
<SensorMclk mclk="24000000" delay="1000"></SensorMclk>
<!--SensorGpioPwen ioname="RK30_PIN0_PB1" active="1" delay="1000"></SensorGpioPwen-->
<SensorGpioRst ioname="RK30_PIN5_PB2" active="0" delay="1000"></SensorGpioRst>
<SensorGpioPwdn ioname="RK30_PIN2_PB7" active="0" delay="2000"></SensorGpioPwdn>
<SensorFacing facing="back"></SensorFacing>
<SensorInterface interface="MIPI"></SensorInterface>
<SensorMirrorFlip mirror="0"></SensorMirrorFlip>
<SensorOrientation orientation="0"></SensorOrientation>
<SensorPowerupSequence seq="1234"></SensorPowerupSequence>
<SensorFovParemeter h="60.0" v="60.0"></SensorFovParemeter>
<SensorAWB_Frame_Skip fps="15"></SensorAWB_Frame_Skip>
<SensorPhy phyMode="CamSys_Phy_Mipi" lane="2" phyIndex="0" sensorFmt="CamSys_Fmt_Raw_10b"></SensorPhy>
</Sensor>
<VCM>
<VCMDrvName name="BuiltInSensor"></VCMDrvName>
<VCMName name="NC"></VCMName>
<VCMI2cBusNum busnum="3"></VCMI2cBusNum>
<VCMI2cAddrByte byte="0"></VCMI2cAddrByte>
<VCMI2cRate rate="0"></VCMI2cRate>
<VCMVdd name="NC" min="0" max="0" delay="0"></VCMVdd>
<VCMGpioPower ioname="NC" active="0" delay="1000"></VCMGpioPower>
<VCMGpioPwdn ioname="NC" active="0" delay="0"></VCMGpioPwdn>
<VCMCurrent start="20" rated="80" vcmmax="100" stepmode="13" drivermax="100"></VCMCurrent>
</VCM>
<Flash>
<FlashName name="Internal"></FlashName>
<FlashI2cBusNum busnum="0"></FlashI2cBusNum>
<FlashI2cAddrByte byte="0"></FlashI2cAddrByte>
<FlashI2cRate rate="0"></FlashI2cRate>
<FlashTrigger ioname="NC" active="0"></FlashTrigger>
<FlashEn ioname="NC" active="0"></FlashEn>
<FlashModeType mode="1"></FlashModeType>
<FlashLuminance luminance="0"></FlashLuminance>
<FlashColorTemp colortemp="0"></FlashColorTemp>
</Flash>
</HardWareInfo>
<SoftWareInfo>
<AWB>
<AWB_Auto support="1"></AWB_Auto>
<AWB_Incandescent support="1"></AWB_Incandescent>
<AWB_Fluorescent support="1"></AWB_Fluorescent>
<AWB_Warm_Fluorescent support="1"></AWB_Warm_Fluorescent>
<AWB_Daylight support="1"></AWB_Daylight>
<AWB_Cloudy_Daylight support="1"></AWB_Cloudy_Daylight>
<AWB_Twilight support="1"></AWB_Twilight>
<AWB_Shade support="1"></AWB_Shade>
</AWB>
<Sence>
<Sence_Mode_Auto support="1"></Sence_Mode_Auto>
<Sence_Mode_Action support="1"></Sence_Mode_Action>
<Sence_Mode_Portrait support="1"></Sence_Mode_Portrait>
<Sence_Mode_Landscape support="1"></Sence_Mode_Landscape>
<Sence_Mode_Night support="1"></Sence_Mode_Night>
<Sence_Mode_Night_Portrait support="1"></Sence_Mode_Night_Portrait>
<Sence_Mode_Theatre support="1"></Sence_Mode_Theatre>
<Sence_Mode_Beach support="1"></Sence_Mode_Beach>
<Sence_Mode_Snow support="1"></Sence_Mode_Snow>
<Sence_Mode_Sunset support="1"></Sence_Mode_Sunset>
<Sence_Mode_Steayphoto support="1"></Sence_Mode_Steayphoto>
<Sence_Mode_Pireworks support="1"></Sence_Mode_Pireworks>
<Sence_Mode_Sports support="1"></Sence_Mode_Sports>
<Sence_Mode_Party support="1"></Sence_Mode_Party>
<Sence_Mode_Candlelight support="1"></Sence_Mode_Candlelight>
<Sence_Mode_Barcode support="1"></Sence_Mode_Barcode>
<Sence_Mode_HDR support="1"></Sence_Mode_HDR>
</Sence>
<Effect>
<Effect_None support="1"></Effect_None>
<Effect_Mono support="1"></Effect_Mono>
<Effect_Solarize support="1"></Effect_Solarize>
<Effect_Negative support="1"></Effect_Negative>
<Effect_Sepia support="1"></Effect_Sepia>
<Effect_Posterize support="1"></Effect_Posterize>
<Effect_Whiteboard support="1"></Effect_Whiteboard>
<Effect_Blackboard support="1"></Effect_Blackboard>
<Effect_Aqua support="1"></Effect_Aqua>
</Effect>
<FocusMode>
<Focus_Mode_Auto support="1"></Focus_Mode_Auto>
<Focus_Mode_Infinity support="1"></Focus_Mode_Infinity>
<Focus_Mode_Marco support="1"></Focus_Mode_Marco>
<Focus_Mode_Fixed support="1"></Focus_Mode_Fixed>
<Focus_Mode_Edof support="1"></Focus_Mode_Edof>
<Focus_Mode_Continuous_Video support="1"></Focus_Mode_Continuous_Video>
<Focus_Mode_Continuous_Picture support="1"></Focus_Mode_Continuous_Picture>
</FocusMode>
<FlashMode>
<Flash_Mode_Off support="1"></Flash_Mode_Off>
<Flash_Mode_On support="1"></Flash_Mode_On>
<Flash_Mode_Torch support="1"></Flash_Mode_Torch>
<Flash_Mode_Auto support="1"></Flash_Mode_Auto>
<Flash_Mode_Red_Eye support="1"></Flash_Mode_Red_Eye>
</FlashMode>
<AntiBanding>
<Anti_Banding_Auto support="1"></Anti_Banding_Auto>
<Anti_Banding_50HZ support="1"></Anti_Banding_50HZ>
<Anti_Banding_60HZ support="1"></Anti_Banding_60HZ>
<Anti_Banding_Off support="1"></Anti_Banding_Off>
</AntiBanding>
<HDR support="1"></HDR>
<ZSL support="1"></ZSL>
<DigitalZoom support="1"></DigitalZoom>
<Continue_SnapShot support="1"></Continue_SnapShot>
<InterpolationRes resolution="0"></InterpolationRes>
<PreviewSize width="800" height="600"></PreviewSize>
<Preview_Minimum_FrameRate framerate="0"></Preview_Minimum_FrameRate>
<FaceDetect support="0" MaxNum="0"></FaceDetect>
<DV>
<DV_QCIF name="qcif" width="176" height="144" fps="10" support="1"></DV_QCIF>
<DV_QVGA name="qvga" width="320" height="240" fps="10" support="1"></DV_QVGA>
<DV_CIF name="cif" width="352" height="288" fps="10" support="1"></DV_CIF>
<DV_VGA name="480p" width="640" height="480" fps="10" support="0"></DV_VGA>
<DV_480P name="480p" width="720" height="480" fps="10" support="0"></DV_480P>
<DV_720P name="720p" width="1280" height="720" fps="10" support="1"></DV_720P>
<DV_1080P name="1080p" width="1920" height="1080" fps="10" support="1"></DV_1080P>
</DV>
</SoftWareInfo>
</CamDevie>
然后就点亮ov13850
这里还只是hal1的摄像头,还挺简单的
参考资料:MIPI CSI 使用
//#########################################################################//
3.RK3568点了一个双mipi摄像头

参考资料:Camera 使用
具体流程:MIPI摄像头调试方法
配置好DTS后就
&csi2_dphy_hw {
status = "okay";
};
&csi2_dphy0 {
status = "disabled";
};
&csi2_dphy1 {
status = "okay";
/*
* dphy1 only used for split mode,
* can be used concurrently with dphy2
* full mode and split mode are mutually exclusive
*/
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
dphy1_in: endpoint@1 {
reg = <1>;
remote-endpoint = <&gc2053_out>;
data-lanes = <1 2>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
dphy1_out: endpoint@1 {
reg = <1>;
remote-endpoint = <&isp0_in>;
};
};
};
};
&csi2_dphy2 {
status = "okay";
/*
* dphy2 only used for split mode,
* can be used concurrently with dphy1
* full mode and split mode are mutually exclusive
*/
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
zzzzz#address-cells = <1>;
#size-cells = <0>;
dphy2_in: endpoint@1 {
reg = <1>;
remote-endpoint = <&gc2093_out>;
data-lanes = <1 2>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
dphy2_out: endpoint@1 {
reg = <1>;
remote-endpoint = <&mipi_csi2_input>;
// remote-endpoint = <&isp1_in>;
};
};
};
};
&mipi_csi2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
mipi_csi2_input: endpoint@1 {
reg = <1>;
remote-endpoint = <&dphy2_out>;
data-lanes = <1 2>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in>;
data-lanes = <1 2>;
};
};
};
};
&rkcif_dvp {
status = "okay";
};
&rkcif_mipi_lvds {
status = "okay";
/* parameters for do cif reset detecting:
* index0: monitor mode,
0 for idle,
1 for continue,
2 for trigger,
3 for hotplug (for nextchip)
* index1: the frame id to start timer,
min is 2
* index2: frame num of monitoring cycle
* index3: err time for keep monitoring
after finding out err (ms)
* index4: csi2 err reference val for resetting
*/
rockchip,cif-monitor = <3 2 3 1000 5>;
port {
cif_mipi_in: endpoint {
remote-endpoint = <&mipi_csi2_output>;
data-lanes = <1 2>;
};
};
};
&rkcif {
status = "okay";
};
&rkcif_mmu {
status = "okay";
};
&rkcif_mipi_lvds_sditf {
status = "okay";
port {
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp1_in>;
data-lanes = <1 2>;
};
};
};
&rkisp {
status = "okay";
// max-input = <1920 1080 30>;
};
&rkisp_mmu {
status = "okay";
};
&rkisp_vir0 {
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
isp0_in: endpoint@0 {
reg = <0>;
remote-endpoint = <&dphy1_out>;
};
};
};
&rkisp_vir1 {
status = "okay";
/* gc2093->dphy2->csi2->vicap */
/* vicap sditf->isp_vir1 */
port {
#address-cells = <1>;
#size-cells = <0>;
isp1_in: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi_lvds_sditf>;
};
};
};
&i2c2 {
status = "okay";
clock-frequency = <400000>;
i2c-scl-rising-time-ns = <138>;
i2c-scl-falling-time-ns = <4>;
pinctrl-names = "default";
pinctrl-0 = <&i2c2m1_xfer>;
gc2053: gc2053@37 {
status = "okay";
compatible = "galaxycore,gc2053";
reg = <0x37>;
clocks = <&cru CLK_CIF_OUT>;
clock-names = "xvclk";
power-domains = <&power RK3568_PD_VI>;
pinctrl-names = "default";
pinctrl-0 = <&cif_clk>;
avdd-supply = <&vcc2v8_avdd>;
dovdd-supply = <&vcca_1v8>;
dvdd-supply = <&vcc1v2_dvdd>;
reset-gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_LOW>;
pwdn-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "YT-RV1109-2-V1";
rockchip,camera-module-lens-name = "40IR-2MP-F20";
port {
gc2053_out: endpoint {
remote-endpoint = <&dphy1_in>;
data-lanes = <1 2>;
};
};
};
gc2093: gc2093b@7e{ //RGB
status = "okay";
compatible = "galaxycore,gc2093";
reg = <0x7e>;
clocks = <&pmucru CLK_WIFI>;
clock-names = "xvclk";
pinctrl-names = "default";
pinctrl-0 = <&refclk_pins>;
avdd-supply = <&vcca2v8_image>;
dovdd-supply = <&vcca_1v8>;
dvdd-supply = <&vccio_sd>;
reset-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>;
pwdn-gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
rockchip,camera-module-index = <1>;
rockchip,camera-module-facing = "front";
rockchip,camera-module-name = "YT-RV1109-2-V1";
rockchip,camera-module-lens-name = "40IR-2MP-F20";
port {
gc2093_out: endpoint {
remote-endpoint = <&dphy2_in>;
data-lanes = <1 2>;
};
};
};
};

本文是关于在RK3288芯片上调试OV13850摄像头的总结,首先介绍了在RK3128上使用YHX2155摄像头的经验,接着详细阐述了如何成功点亮OV13850摄像头,采用的是HAL1接口,过程相对简单。此外,还提及了在RK3568上配置双MIPI摄像头的调试流程。

2119

被折叠的 条评论
为什么被折叠?



