首页 > 其他分享 >RV1126新增驱动IMX415 SENSOR,实现v4l2抓图

RV1126新增驱动IMX415 SENSOR,实现v4l2抓图

时间:2023-07-05 18:26:49浏览次数:68  
标签:lvds mipi 抓图 stream RV1126 IMX415 Stepwise 64x64 3864x2192

RV1126新增驱动IMX415 SENSOR,实现v4l2抓图。

1:内核dts修改

 

&csi_dphy0 {

status = "okay";

ports {

#address-cells = <1>;

#size-cells = <0>;

port@0 {

reg = <0>;

#address-cells = <1>;

#size-cells = <0>;

mipi_in_ucam0: endpoint@1 {

reg = <1>;

remote-endpoint = <&ucam_out0>;

data-lanes = <1 2 3 4>;

};

};

port@1 {

reg = <1>;

#address-cells = <1>;

#size-cells = <0>;

csidphy0_out: endpoint@0 {

reg = <0>;

remote-endpoint = <&mipi_csi2_input>;

};

};

};

};

 

&i2c1 {

status = "okay";

clock-frequency = <400000>;

imx415: imx415@1a {

compatible = "sony,imx415";

reg = <0x1a>;

clocks = <&cru CLK_MIPICSI_OUT>;

clock-names = "xvclk";

power-domains = <&power RV1126_PD_VI>;

pinctrl-names = "rockchip,camera_default";

pinctrl-0 = <&mipicsi_clk0>;

avdd-supply = <&vcc3v3_sys>;

dovdd-supply = <&vcc_1v8>;

dvdd-supply = <&vcc_dvdd>;

/* reset is always pulled high in v10 */

reset-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;

rockchip,camera-module-index = <1>;

rockchip,camera-module-facing = "front";

rockchip,camera-module-name = "YT10092";

rockchip,camera-module-lens-name = "IR0147-50IRC-8M-F20";

ir-cut = <&cam_ircut0>;

flash-leds = <&flash_ir>;

port {

ucam_out0: endpoint {

remote-endpoint = <&mipi_in_ucam0>;

data-lanes = <1 2 3 4>;

};

};

};

};

2:Makefile修改

obj-$(CONFIG_VIDEO_IMX415)+= imx415.o

 

3:Kconfig修改

config VIDEO_IMX415

4:驱动对应的宏开关打开

 

以上修改后,重新编译内核。重新总体编译。

 

5:单板启动注册成功

 

[root@RV1126_RV1109:/]

Media controllerAPI version 4.19.111

 

Media deviceinformation

------------------------

driver rkcif

model rkcif_mipi_lvds

serial

bus info

hw revision 0x0

driverversion 4.19.111

 

Device topology

- entity 1:stream_cif_mipi_id0 (1 pad, 4 links)

type Node subtype V4L flags 0

device node name /dev/video0

pad0: Sink

<-"rockchip-mipi-csi2":1 [ENABLED]

<-"rockchip-mipi-csi2":2 []

<-"rockchip-mipi-csi2":3 []

<-"rockchip-mipi-csi2":4 []

 

- entity 5:stream_cif_mipi_id1 (1 pad, 4 links)

type Node subtype V4L flags 0

device node name /dev/video1

pad0: Sink

<-"rockchip-mipi-csi2":1 []

<- "rockchip-mipi-csi2":2[ENABLED]

<-"rockchip-mipi-csi2":3 []

<-"rockchip-mipi-csi2":4 []

 

- entity 9:stream_cif_mipi_id2 (1 pad, 4 links)

type Node subtype V4L flags 0

device node name /dev/video2

pad0: Sink

<-"rockchip-mipi-csi2":1 []

<-"rockchip-mipi-csi2":2 []

<-"rockchip-mipi-csi2":3 [ENABLED]

<-"rockchip-mipi-csi2":4 []

 

- entity 13:stream_cif_mipi_id3 (1 pad, 4 links)

type Node subtype V4L flags 0

device node name /dev/video3

pad0: Sink

<-"rockchip-mipi-csi2":1 []

<-"rockchip-mipi-csi2":2 []

<-"rockchip-mipi-csi2":3 []

<-"rockchip-mipi-csi2":4 [ENABLED]

 

- entity 17:rockchip-mipi-csi2 (5 pads, 17 links)

type V4L2 subdev subtype Unknownflags 0

device node name /dev/v4l-subdev1

pad0: Sink

[fmt:SGBRG10_1X10/3864x2192field:none

crop.bounds:(12,16)/3840x2160

crop:(12,16)/3840x2160]

<-"rockchip-mipi-dphy-rx":1 [ENABLED]

pad1: Source

[fmt:SGBRG10_1X10/3864x2192field:none

crop.bounds:(12,16)/3840x2160

crop:(12,16)/3840x2160]

->"stream_cif_mipi_id0":0 [ENABLED]

->"stream_cif_mipi_id1":0 []

-> "stream_cif_mipi_id2":0 []

->"stream_cif_mipi_id3":0 []

pad2: Source

[fmt:SGBRG10_1X10/3864x2192field:none

crop.bounds:(12,16)/3840x2160

crop:(12,16)/3840x2160]

-> "stream_cif_mipi_id0":0 []

->"stream_cif_mipi_id1":0 [ENABLED]

->"stream_cif_mipi_id2":0 []

->"stream_cif_mipi_id3":0 []

pad3: Source

[fmt:SGBRG10_1X10/3864x2192field:none

crop.bounds:(12,16)/3840x2160

crop:(12,16)/3840x2160]

->"stream_cif_mipi_id0":0 []

->"stream_cif_mipi_id1":0 []

->"stream_cif_mipi_id2":0 [ENABLED]

-> "stream_cif_mipi_id3":0[]

pad4: Source

[fmt:SGBRG10_1X10/3864x2192field:none

crop.bounds:(12,16)/3840x2160

crop:(12,16)/3840x2160]

->"stream_cif_mipi_id0":0 []

-> "stream_cif_mipi_id1":0[]

->"stream_cif_mipi_id2":0 []

->"stream_cif_mipi_id3":0 [ENABLED]

 

- entity 23:rockchip-mipi-dphy-rx (2 pads, 2 links)

type V4L2 subdev subtype Unknownflags 0

device node name /dev/v4l-subdev2

pad0: Sink

[fmt:SGBRG10_1X10/3864x2192@10000/300000 field:none

crop.bounds:(12,16)/3840x2160]

<- "m01_f_imx4151-001a":0 [ENABLED]

pad1: Source

[fmt:SGBRG10_1X10/3864x2192@10000/300000field:none

crop.bounds:(12,16)/3840x2160]

->"rockchip-mipi-csi2":0 [ENABLED]

 

- entity 28:rkcif-mipi-luma (0 pad, 0 link)

type Node subtype V4L flags 0

device node name /dev/video4

 

- entity 31:m01_f_imx415 1-001a (1 pad, 1 link)

type V4L2 subdev subtype Sensorflags 0

device node name /dev/v4l-subdev3

pad0: Source

[fmt:SGBRG10_1X10/3864x2192@10000/300000 field:none

crop.bounds:(12,16)/3840x2160]

->"rockchip-mipi-dphy-rx":0 [ENABLED]

 

- entity 35:m01_f_ircut (0 pad, 0 link)

type V4L2 subdev subtype Lens flags1

device node name /dev/v4l-subdev4

 

 

[root@RV1126_RV1109:/]#

ioctl:VIDIOC_ENUM_FMT

Type: Video Capture Multiplanar

 

[0]: 'NV16' (Y/CbCr 4:2:2)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[1]: 'NV61' (Y/CrCb 4:2:2)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[2]: 'NV12' (Y/CbCr 4:2:0)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[3]: 'NV21' (Y/CrCb 4:2:0)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[4]: 'YUYV' (YUYV 4:2:2)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[5]: 'YVYU' (YVYU 4:2:2)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[6]: 'UYVY' (UYVY 4:2:2)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[7]: 'VYUY' (VYUY 4:2:2)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[8]: 'RGB3' (24-bit RGB 8-8-8)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[9]: 'RGBP' (16-bit RGB 5-6-5)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[10]: 'BGRH' (18-bit BGRX 6-6-6-14)

Size: Stepwise 64x64 - 3864x2192 withstep 8/8

[11]: 'RGGB' (8-bit Bayer RGRG/GBGB)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[12]: 'GRBG' (8-bit Bayer GRGR/BGBG)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[13]: 'GBRG' (8-bit Bayer GBGB/RGRG)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[14]: 'BA81' (8-bit Bayer BGBG/GRGR)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[15]: 'RG10' (10-bit Bayer RGRG/GBGB)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[16]: 'BA10' (10-bit Bayer GRGR/BGBG)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[17]: 'GB10' (10-bit Bayer GBGB/RGRG)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[18]: 'BG10' (10-bit Bayer BGBG/GRGR)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[19]: 'RG12' (12-bit Bayer RGRG/GBGB)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[20]: 'BA12' (12-bit Bayer GRGR/BGBG)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[21]: 'GB12' (12-bit Bayer GBGB/RGRG)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[22]: 'BG12' (12-bit Bayer BGBG/GRGR)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[23]: 'BYR2' (16-bit Bayer BGBG/GRGR)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[24]: 'Y16 ' (16-bit Greyscale)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[25]: 'GREY' (8-bit Greyscale)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[26]: 'EBD8' (Embedded data 8-bit,compressed)

Size: Stepwise 64x64 -3864x2192 with step 8/8

[27]: 'SPD6' (Shield pix data 16-bit,compressed)

Size: Stepwise 64x64 -3864x2192 with step 8/8

 

 

6:v4l2抓图成功

 

[root@RV1126_RV1109:/]#v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,heigh

t=2160,pixelformat=SGBRG10_1X10\--stream-mmap=3 \--stream-skip=3 \--stream-to=/

tmp/cif888.out\--stream-count=1 \--stream-poll

[ 216.222320] rkcif_mipi_lvds: stream[0] startstreaming

[ 216.222446] rockchip-mipi-csi2ffb10000.mipi-csi2: stream on, src_sd: d2dfee3b, sd_name:rockchip-mipi-dphy-rx

[ 216.222457] rockchip-mipi-csi2ffb10000.mipi-csi2: stream ON

[ 216.222484] rockchip-mipi-dphy-rxff4b0000.csi-dphy: stream on:1

[ 216.222500] rockchip-mipi-dphy-rx:data_rate_mbps 892

[ 216.223557] rockchip-mipi-dphy-rxff4b0000.csi-dphy: stream on:1

<<<[ 216.473292] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.506625] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.539958] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.573304] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.606626] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.639971] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.673278] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.706639] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.739943] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.773291] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.806637] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.839973] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.873305] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.906639] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.939971] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

[ 216.973304] rkcif_mipi_lvds: not activebuffer, skip current frame, mipi/lvds stream[0]

<[ 216.987827] rkcif_mipi_lvds: stream[0] startstopping

[ 217.006837] rockchip-mipi-csi2ffb10000.mipi-csi2: stream off, src_sd: d2dfee3b, sd_name:rockchip-mipi-dphy-rx

[ 217.006906] rockchip-mipi-csi2ffb10000.mipi-csi2: stream OFF

[ 217.006944] rockchip-mipi-dphy-rxff4b0000.csi-dphy: stream on:0

[ 217.008102] rockchip-mipi-dphy-rxff4b0000.csi-dphy: stream on:0

[ 217.009920] rkcif_mipi_lvds: stream[0]stopping finished

 

7:抓图文件查看

[root@RV1126_RV1109:/tmp]#ls -l

total 16512

drwxr-xr-x 2 avahiavahi 40 Jan 1 00:00 avahi-autoipd

-rw-r--r-- 1root root 16588800 Jan 1 00:03 cif888.out

-rw-r--r-- 1root root 66024 Jan 1 00:00 cl_viv_vx_ext.h

drwxr-xr-x 2root root 60 Jan 1 00:00 dbus

-rw-r--r-- 1root root 0 Jan 1 00:00 dnsmasq.leases

---------- 1root root 6 Jan 1 00:00 loglevel

-rw-r--r-- 1root root 25687 Jan 1 00:04 messages

-rw-r--r-- 1root root 204896 Jan 1 00:03 messages.0

-rw-r--r-- 1root root 1349 Jan 1 00:00 mountall.log

drwxr-xr-x 7root root 180 Jan 1 00:00 nginx

-rw-r--r-- 1root root 55 Jan 1 00:00 resolv.conf

drwxr-xr-x 2root root 60 Jan 1 00:00 subsys

drwx------ 2root root 40 Jan 1 00:00 tmp.4soNzzu8dM

 

标签:lvds,mipi,抓图,stream,RV1126,IMX415,Stepwise,64x64,3864x2192
From: https://www.cnblogs.com/kn-zheng/p/17529473.html

相关文章

  • RV1126 —— 配置adc并读取adc通道上传感器数值
    1.adc设备树配置一般来说,rk中已经封装好了标准adc的dts参数属性,我们要做的就是添加自己的adc通道,并引用标准接口即可,不同平台,标准dts中的adc节点名有所不同,其配置属性基本一样。例如:1)adc:adc@ff100000{compatible="rockchip,saradc";......
  • RV1126调试-修改默认调试串口
    背景RK系列的SDK给的默认的调试串口都是uart2/1500000波特率,本次调试设备已经把console调试口改为了uart0,所以需要修改下uboot和内核,然后把波特率设为常用的115200。注:本次调试的SDK版本为原厂的V2.2版本1.uboot修改1)修改rv1126-evb.dts和rv1126-u-boot.dtsi把uart2改成uart......
  • RV1126按键中断驱动和应用调试
     本人使用的调试平台是荣品的rv1126开发板,最近在调试按键中断。经过查看原理图,发现竟然没有一个空闲的IO,所以使用UART1的RX作为按键中断引脚。    驱动部分:     因为UART1原先已经在设备树中已经有了定义,需要将kernel/arch/arm/boot/dts/rongpin/rv1126_11......
  • Windows中使用GDI抓图
    首先在pro文件中添加gdi32QT+=coreguiwinextrasgreaterThan(QT_MAJOR_VERSION,4):QT+=widgetsCONFIG+=c++11#Thefollowingdefinemakesyourcompileremitwarningsifyouuse#anyQtfeaturethathasbeenmarkeddeprecated(theexactwarning......
  • Delphi 抓图后打印这张图片,弹出打印属性框
    如果用窗体.print打印的话,会导致一些控件打印不出来,比如下拉列表,还有打印TChart也会导致只打印TChart的原始状态,而不会打印有数据的TChart所以我就想到了先抓图,后打印抓图后下拉列表和TChart都正常显示了,可是还有一点不好,就是下拉列表中的值是显示......
  • linux rv1126 查看内存使用情况 磁盘使用情况
    0.top命令,47.1表示占用47.1% 0.717与前面的GiB对应,总共0.717GB运行内存 1、cat/proc/meminfo内存映射文件 2、free-m  3、磁盘使用情况df-h ......
  • rv1126 获取图像数据,实现图像裁剪、缩放、旋转【RK_MPI API接口】
    前言刚接触RK平台,目前正在学习探索阶段,欢迎朋友们一起讨论,指出文章错误和可以优化的地方;如果想参照文中描述进行编译、执行程序,请先参考阅读rv1126SDK编译和rv1126数据流;版本说明,测试使用SDK版本是2020-0912版本,文中记录的问题,可能在新版本已经解决;文中使用的接口函数,可能老版本......
  • RV1126新增驱动IMX415 SENSOR,实现v4l2抓图
    RV1126新增驱动IMX415SENSOR,实现v4l2抓图。1:内核dts修改 &csi_dphy0{status="okay";ports{#address-cells=<1>;#size-cells=<0>;port@0{reg=<0>;#address-cells=<1>;#size-cells=<0>;mipi_in_ucam0:endpoint@1......
  • 如何首次编译RV1126的U-Boot
    一、获取U-Boot源码TB-RV1126Ds:gitclonehttps://github.com/rockchip-toybrick/u-boot.git-bnext-dev二、获取rkbin源码下载rkbin到u-boot同级目录:gitcl......
  • RV1126编译过程
    一、编译环境1、目标系统:ubuntu22.04LTS2、投屏器SDK下载:链接:https://pan.baidu.com/s/1OJQafxm38FnbshMEu432Og提取码:o6p3下载下来后,输入命令catrv1126.zip.001r......