Firefly开源社区

打印 上一主题 下一主题

rk3288-reload在ubuntu/linux下适配DVP接口摄像头驱动问题

31

积分

0

威望

0

贡献

技术小白

积分
31

rk3288-reload在ubuntu/linux下适配DVP接口摄像头驱动问题

发表于 2016-8-11 17:44:57      浏览:12769 | 回复:4        打印      只看该作者   [复制链接] 楼主
本帖最后由 CallMeBroYang 于 2016-8-11 19:50 编辑

问题:
接上官方的DVP接口s5k4ecgx摄像头,上电开机,/dev/下找不到video设备。

这里要发下牢骚:官方什么时候可以出ubuntu/linux下直接支持rk3288 dvp接口摄像头的内核,也省得每个人都花时间做适配。

用的ubuntu镜像版本:FireFly-RK3288-Reload_Ubuntu14.04_201603111814

已进行操作如下:
1、
https://bitbucket.org/T-Firefly/firenow-lollipop/commits/branch/Firefly-RK3288上下载 android5.1 sdk 最新的内核
git pull bitbucket Firefly-RK3288:Firefly-RK3288
make firefly-rk3288-reload-linux_defconfig

make menuconfig;加上cif选项

2、
从fireprime的内核中,把 ./drivers/media/video/s5k4ec.c,复制过来并修改修改Makefile
参照fireprime的内核,修改./include/media/v4l2-chip-ident.h,添加相关宏
参照fireprime的内核,修改./arch/arm/mach-rockchip/rk_camera.c
在./arch/arm/boot/dts下修改rk3288-cif-sensor.dts,添加
14      s5k4ec{
15              status = "okay";
16              is_front = <0>;
17              //rockchip,power_pmu_name1 = "rk818_ldo4";/*cif 2.8v */
18              //rockchip,power_pmu_voltage1 = <2800000>;
19              //rockchip,power_pmu_name2 = "rk818_ldo8";/* cif 1.8v */
20              //rockchip,power_pmu_voltage2 = <1800000>;
21              rockchip,powerdown = <&gpio3 GPIO_B4 GPIO_ACTIVE_HIGH>;
22              pwdn_active = <0>;
23              tchip,rst = <&gpio2 GPIO_B7 GPIO_ACTIVE_LOW>;
24              //rockchip,power = <&gpio3 GPIO_D7 GPIO_ACTIVE_HIGH>;
25              //pwr_active = <PWR_ACTIVE_HIGH>;
26              #rockchip,reset = <>;
27              #rst_active = <>;
28              flash_attach = <1>;
29              rockchip,flash = <&gpio2 GPIO_C6 GPIO_ACTIVE_HIGH>;   //不知道怎么修改
30              flash_active = <GPIO_ACTIVE_LOW>;
31              #rockchip,af = <>;
32              mir = <0>;
33              resolution = <0x500000>;
34              powerup_sequence = <s5k4ec_PWRSEQ_DEFAULT>;
35              orientation = <0>;
36              i2c_add = <s5k4ec_I2C_ADDR>;
37              i2c_rata = <20000>;
38              i2c_chl = <3>;
39              cif_chl = <0>;
40              mclk_rate = <24>;
41      };

修改
arch/arm/boot/dts/firefly-rk3288-reload-linux.dts@@ -1,6 +1,7 @@
/dts-v1/;

#include "rk3288.dtsi"
+#include "rk3288-cif-sensor.dtsi"
#include "lcd-box.dtsi"
#include <dt-bindings/input/input.h>

@@ -191,6 +192,10 @@
     };
};

+&rk3288_cif_sensor {
+        status = "okay";
+};
+


3、
make -j8 firefly-rk3288-reload-linux.img
从官方镜像的linux-boot.img提取initrd.img,并与新编译的kernel压缩
mkbootimg --kernel arch/arm/boot/zImage --ramdisk initrd.img -o kernel-boot.img

4、
kernel-boot.img下载到boot分区,resource.img下载到resource分区,
开机后进入系统,还是找不到video设备

内核打印信息:
[    1.834056] Key type dns_resolver registered
[    1.834179] rk_cam_cif(3053):rk312x-camera version: v0.2.0  Zoom by ipp
[    1.834455] rockchip-pinctrl ff770000.pinctrl: pin gpio2-11 already requested by ff910000.isp; cannot claim for ff950000.cif
[    1.834477] rockchip-pinctrl ff770000.pinctrl: pin-75 (ff950000.cif) status -22
[    1.834490] rockchip-pinctrl ff770000.pinctrl: could not request pin 75 on device rockchip-pinctrl
[    1.834504] rk_cif ff950000.cif: Error applying setting, reverse things back
[    1.834517] rk_cif ff950000.cif: rk_camera_cif_iomux:could not set cif_pin_all pins
[    1.834700] soc-camera-pdrv s5k4ec_back_3: Probing s5k4ec_back_3



[    2.381463] udevd[150]: starting version 175
[    2.423244] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    2.423273] s5k4ec_back_3(rk_cam_sensor:167): write reg(0xfcfc, val:0xd000) failed, try to write again!
[    2.462595] [WLAN_RFKILL]: wifi turn on power. 156
[    2.620004] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    2.620027] s5k4ec_back_3(rk_cam_sensor:167): write reg(0xfcfc, val:0xd000) failed, try to write again!
[    2.620052] s5k4ec_back_3(rk_cam_sensor:385): write array failed!
[    2.620061] s5k4ec_back_3(rk_cam_sensor:669): soft reset failed
[    2.620061]
[    2.669237] mmc2:mmc host rescan start!
[    2.728207] EXT4-fs (mmcblk0p5): 2 orphan inodes deleted
[    2.728221] EXT4-fs (mmcblk0p5): recovery complete
[    2.731094] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[    2.836494] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    2.836519] s5k4ec_back_3(rk_cam_sensor:167): write reg(0x2c, val:0x7000) failed, try to write again!
[    2.920336] mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
[    2.921848] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.923356] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.926072] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[    2.978600] mmc_host mmc2: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    2.980815] mmc2: queuing unknown CIS tuple 0x91 (3 bytes)
[    2.980840] mmc2: new high speed SDIO card at address 0001
[    2.999732] [WLAN_RFKILL]: rockchip_wifi_mac_addr: enter.
[    2.999744] [WLAN_RFKILL]: falsh wifi_custom_mac_addr=[00:00:00:00:00:00]
[    2.999754] [WLAN_RFKILL]: This mac address is not valid, ignored...
[    3.005830] [WLAN_RFKILL]: rockchip_wifi_power: 0
[    3.033284] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    3.033301] s5k4ec_back_3(rk_cam_sensor:167): write reg(0x2c, val:0x7000) failed, try to write again!
[    3.083851] EHCI: rk_ehci_hcd_enable, disable host controller
[    3.112000] [WLAN_RFKILL]: wifi shut off power.
[    3.112011] [WLAN_RFKILL]: rockchip_wifi_ref_voltage: 0
[    3.112021] [WLAN_RFKILL]: rockchip_wifi_ref_voltage: wifi io reference voltage control is disabled.
[    3.230086] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    3.230102] s5k4ec_back_3(rk_cam_sensor:167): write reg(0x2c, val:0x7000) failed, try to write again!
[    3.426883] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    3.426898] s5k4ec_back_3(rk_cam_sensor:167): write reg(0x2e, val:0x1a4) failed, try to write again!
[    3.446577] usb 3-1: new high-speed USB device number 2 using usb20_host
[    3.623685] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    3.623699] s5k4ec_back_3(rk_cam_sensor:167): write reg(0x2e, val:0x1a4) failed, try to write again!
[    3.643567] usb 3-1: New USB device found, idVendor=1a40, idProduct=0101
[    3.643583] usb 3-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.643595] usb 3-1: Product: USB 2.0 Hub [MTT]
[    3.643854] hub 3-1:1.0: USB hub found
[    3.643904] hub 3-1:1.0: 4 ports detected
[    3.820478] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    3.820493] s5k4ec_back_3(rk_cam_sensor:167): write reg(0x2e, val:0x1a4) failed, try to write again!
[    4.017282] rockchip_i2c ff150000.i2c: i2c is not in idle(state = 3)
[    4.017296] s5k4ec_back_3(rk_cam_sensor:333): read reg(0xf12 val:0x0) failed, try to read again!
[    4.017319] s5k4ec_back_3(rk_cam_sensor:716): error: mismatched   pid = 0xffff
[    4.017319]
ules/3.10.0/modules.dep: No such file or directory


请问还需要修改什么地方,
才能让FireFly-RK3288-Reload在ubuntu/linux可以支持DVP接口的s5k4ecgx摄像头?



112433gvzq7jqq70b80uoc.png (30.49 KB, 下载次数: 522)

112433gvzq7jqq70b80uoc.png
回复

使用道具 举报

7

积分

0

威望

0

贡献

游客

积分
7
发表于 2016-11-8 17:30:39        只看该作者  沙发
请问楼主解决问题没有,我也是遇到此问题,我这边是安卓环境,配置完并没有发现 dev下有新设备的出现
回复

使用道具 举报

2965

积分

12

威望

22

贡献

高级创客

Rank: 6Rank: 6

积分
2965
发表于 2016-11-9 11:29:03        只看该作者  板凳
linux底下的dvp接口可以参考这个
http://developer.t-firefly.com/f ... amp;page=1#pid21086
回复

使用道具 举报

459

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
459
发表于 2017-8-31 19:08:40        只看该作者  地板
请问楼主解决了没  我用的是3128能在dev下面找打设备节点,但是通过V4L2读不到数据啊
回复

使用道具 举报

6

积分

0

威望

0

贡献

技术小白

积分
6
发表于 2019-7-15 17:00:54        只看该作者  5#
carter123456 发表于 2017-8-31 19:08
请问楼主解决了没  我用的是3128能在dev下面找打设备节点,但是通过V4L2读不到数据啊

这个好像要用gst吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表