// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2022 Rockchip Electronics Co., Ltd.
*/
#include "rv1106-amp.dtsi"
/ {
chosen {
bootargs = "earlycon=uart8250,mmio32,0xff4c0000 console=ttyFIQ0 root=/dev/mmcblk1p7 rootwait snd_soc_core.prealloc_buffer_size_kbytes=16 coherent_pool=0";
};
acodec_sound: acodec-sound {
compatible = "simple-audio-card";
simple-audio-card,name = "rv-acodec";
simple-audio-card,format = "i2s";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,cpu {
sound-dai = <&i2s0_8ch>;
};
simple-audio-card,codec {
sound-dai = <&acodec>;
};
};
vcc_1v8: vcc-1v8 {
compatible = "regulator-fixed";
regulator-name = "vcc_1v8";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};
vcc_3v3: vcc-3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc_3v3";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
vdd_arm: vdd-arm {
compatible = "regulator-fixed";
regulator-name = "vdd_arm";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <900000>;
regulator-always-on;
regulator-boot-on;
};
leds: leds {
compatible = "gpio-leds";
work_led: work{
gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "activity";
default-state = "on";
};
};
// DHT11
dht11_sensor {
compatible = "dht11";
pinctrl-names = "default";
pinctrl-0 = <&gpio1_pc7>;
dht11@1 {
gpios = <&gpio1 RK_PC7 GPIO_ACTIVE_HIGH>;
label = "dht11";
linux,default-trigger = "humidity";
};
};
};
/***************************** AUDIO ********************************/
&i2s0_8ch {
#sound-dai-cells = <0>;
status = "okay";
};
&acodec {
#sound-dai-cells = <0>;
pa-ctl-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
status = "okay";
};
/***************************** CPU ********************************/
&cpu0 {
cpu-supply = <&vdd_arm>;
};
/***************************** ADC ********************************/
&saradc {
status = "okay";
vref-supply = <&vcc_1v8>;
};
&tsadc {
status = "okay";
};
/***************************** CSI ********************************/
&csi2_dphy_hw {
status = "okay";
};
&csi2_dphy1 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
csi_dphy_input0: endpoint@1 {
reg = <1>;
remote-endpoint = <&ov9281_0_out>;
data-lanes = <1 2>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
csi_dphy_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi_csi2_input>;
};
};
};
};
&csi2_dphy2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
csi_dphy_input1: endpoint@1 {
reg = <1>;
remote-endpoint = <&ov9281_1_out>;
data-lanes = <1 2>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
csi_dphy_output1: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi1_csi2_input>;
};
};
};
};
&i2c3 {
status = "okay";
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c3m2_xfer>;
ov9281_cam1: camera-sensor_cam1@70 {
compatible = "ovti,ov9281";
reg = <0x70>;
pinctrl-names = "default";
clocks = <&cru MCLK_REF_MIPI1>;
clock-names = "xvclk";
rockchip,camera-module-index = <1>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "CMK-OT2115-PC1";
rockchip,camera-module-lens-name = "30IRC-F16";
port {
ov9281_1_out: endpoint {
remote-endpoint = <&csi_dphy_input1>;
data-lanes = <1 2 >;
};
};
};
};
&i2c4 {
status = "okay";
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c4m2_xfer>;
ov9281: camera-sensor@70 {
compatible = "ovti,ov9281";
reg = <0x70>;
pinctrl-names = "default";
clocks = <&cru MCLK_REF_MIPI0>;
clock-names = "xvclk";
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "CMK-OT2115-PC1";
rockchip,camera-module-lens-name = "30IRC-F16";
port {
ov9281_0_out: endpoint {
remote-endpoint = <&csi_dphy_input0>;
data-lanes = <1 2 >;
};
};
};
};
&mipi0_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 = <&csi_dphy_output>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in>;
};
};
};
};
&mipi1_csi2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
mipi1_csi2_input: endpoint@1 {
reg = <1>;
remote-endpoint = <&csi_dphy_output1>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi1_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in1>;
};
};
};
};
&rkcif {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mipi_pins>;
};
&rkcif_mipi_lvds {
status = "okay";
port {
/* MIPI CSI-2 endpoint */
cif_mipi_in: endpoint {
remote-endpoint = <&mipi_csi2_output>;
};
};
};
&rkcif_mipi_lvds_sditf {
status = "okay";
port {
/* MIPI CSI-2 endpoint */
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp_in>;
};
};
};
&rkcif_mipi_lvds1 {
status = "okay";
port {
/* MIPI CSI-2 endpoint */
cif_mipi_in1: endpoint {
remote-endpoint = <&mipi1_csi2_output>;
};
};
};
&rkcif_mipi_lvds1_sditf {
status = "okay";
port {
/* MIPI CSI-2 endpoint */
mipi_lvds1_sditf: endpoint {
remote-endpoint = <&isp_in1>;
};
};
};
&rkisp {
status = "okay";
};
&rkisp_vir0 {
status = "okay";
port@0 {
isp_in: endpoint {
remote-endpoint = <&mipi_lvds_sditf>;
};
};
};
&rkisp_vir1 {
status = "okay";
port@0 {
isp_in1: endpoint {
remote-endpoint = <&mipi_lvds1_sditf>;
};
};
};
/*****************************PINCTRL********************************/
// SPI
&spi0 {
pinctrl-0 = <&spi0m0_clk &spi0m0_miso &spi0m0_mosi &spi0m0_cs0>;
#address-cells = <1>;
#size-cells = <0>;
spidev@0 {
compatible = "rockchip,spidev";
spi-max-frequency = <50000000>;
reg = <0>;
};
fbtft@0{
compatible = "sitronix,st7789v";
reg = <0>;
spi-max-frequency = <20000000>;
fps = <30>;
buswidth = <8>;
debug = <0x7>;
led-gpios = <&gpio2 RK_PB0 GPIO_ACTIVE_LOW>;//BL
dc = <&gpio2 RK_PB1 GPIO_ACTIVE_HIGH>; //DC
reset = <&gpio1 RK_PC3 GPIO_ACTIVE_LOW>; //RES
};
};
// I2C
&i2c0 {
pinctrl-0 = <&i2c0m2_xfer>;
};
&i2c1 {
pinctrl-0 = <&i2c1m0_xfer>;
};
&i2c2 {
pinctrl-0 = <&i2c2m1_xfer>;
};
// &i2c4 {
// pinctrl-0 = <&i2c4m0_xfer>;
// };
// UART
&uart0 {
pinctrl-0 = <&uart0m0_xfer &uart0m1_xfer>;
};
&uart1 {
pinctrl-0 = <&uart1m0_xfer >;
};
&uart3 {
pinctrl-0 = <&uart3m1_xfer>;
};
&uart4 {
pinctrl-0 = <&uart4m1_xfer>;
};
&uart5 {
pinctrl-0 = <&uart5m0_xfer>;
};
// PWM
&pwm0 {
pinctrl-0 = <&pwm0m1_pins>;
};
&pwm2 {
pinctrl-0 = <&pwm2m0_pins>;
};
&pwm3 {
pinctrl-0 = <&pwm3m2_pins>;
};
&pwm4 {
pinctrl-0 = <&pwm4m2_pins>;
};
&pwm5 {
pinctrl-0 = <&pwm5m2_pins>;
};
&pwm6 {
pinctrl-0 = <&pwm6m1_pins &pwm6m2_pins>;
};
&pwm8 {
pinctrl-0 = <&pwm8m1_pins>;
};
&pwm9 {
pinctrl-0 = <&pwm9m1_pins>;
};
&pwm10 {
pinctrl-0 = <&pwm10m2_pins>;
};
&pwm11 {
pinctrl-0 = <&pwm11m1_pins>;
};
&pinctrl {
spi0 {
spi0m0_clk: spi0m0-clk {
rockchip,pins = <1 RK_PC1 4 &pcfg_pull_none>;
};
spi0m0_mosi: spi0m0-mosi {
rockchip,pins = <1 RK_PC2 6 &pcfg_pull_none>;
};
spi0m0_miso: spi0m0-miso {
rockchip,pins = <1 RK_PC3 6 &pcfg_pull_none>;
};
spi0m0_cs0: spi0m0-cs0 {
rockchip,pins = <1 RK_PC0 4 &pcfg_pull_none>;
};
};
gpio1-pc7 {
gpio1_pc7:gpio1-pc7 {
rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
gpio1_pins: gpio1-pins {
rockchip,pins =
/* gpio1 */
<0 RK_PA1 1 &pcfg_pull_none>; /* GPIO功能 */
};
};
RV1106 MAX 双摄配置 两个I2C挂载摄像头
rkisp-vir0: check rkisp_selfpath link or isp input 单独使用I2C3 挂载摄像头出现rkisp-vir0: check rkisp_selfpath link or isp input这个问题应该怎么解决
Last edited by JHD123456789 on 2025-05-13 12:19, edited 1 time in total.
您好,双摄工作时ISP共用同一个VI通道,不能通过v4l2去视频流,需要通过rockit框架获取,相关的命令是 sample_multi_vi
请先确定单摄像头可以正常工作,cif 到 rkisp_vir 的节点也要配置成单摄的,参考我们提供的配置
&csi2_dphy_hw {
status = "okay";
};
&csi2_dphy2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
csi_dphy2_input2: endpoint@2 {
reg = <2>;
remote-endpoint = <&ov9281_1_out>;
data-lanes = <3 4>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
csi_dphy_output1: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi1_csi2_input>;
};
};
};
};
&i2c3 {
status = "okay";
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c3m2_xfer>;
ov9281_1: ov9281_1@70 {
compatible = "ovti,ov9281";
status = "okay";
reg = <0x70>;
pinctrl-names = "default";
pinctrl-0 = <&mipi_refclk_out1>;
pwdn-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
clocks = <&cru MCLK_REF_MIPI1>;
clock-names = "xvclk";
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "CMK-OT2119-PC1";
rockchip,camera-module-lens-name = "30IRC-F16";
port {
ov9281_1_out: endpoint {
remote-endpoint = <&csi_dphy2_input2>;
data-lanes = <3 4 >;
};
};
};
};
&mipi1_csi2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
mipi1_csi2_input: endpoint@1 {
reg = <1>;
remote-endpoint = <&csi_dphy_output1>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi1_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in1>;
};
};
};
};
&rkcif {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mipi_pins>;
};
&rkcif_mipi_lvds_sditf {
status = "okay";
port {
/* MIPI CSI-2 endpoint */
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp_in>;
};
};
};
&rkcif_mipi_lvds1 {
status = "okay";
port {
/* MIPI CSI-2 endpoint */
cif_mipi_in1: endpoint {
remote-endpoint = <&mipi1_csi2_output>;
};
};
};
&rkisp {
status = "okay";
};
&rkisp_vir0 {
status = "okay";
port@0 {
isp_in: endpoint {
remote-endpoint = <&mipi_lvds_sditf>;
};
};
};
配置文件是这样,我用video 1 取CIF 图没问题 ,但是就是不能用video11 过ISP 错误就是 rkisp-vir0: check rkisp_selfpath link or isp input
设备树的配置需要您自己确定,您适配的摄像头不是我们支持的摄像头,我无法保证我的建议不会误导您的开发方向,比较明显的问题就是data-lane的配置不是 3 4 而是 1 2, csi2_dphy1 的 data-lane 对应 MIPI_D0 MIPI_D1, csi2_dphy2 的 data-lane 对应 MIPI_D2 MIPI_D3
感谢你我i2c3 上添加设备跑通了 利用video11 跑数据
[root@luckfox ]# v4l2-ctl --device=/dev/video11 --set-fmt-video=width=640,height=480,pixelformat=NV12 --stream-mmap --stream-to=video50.yuv --stream-count=30
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[root@luckfox ]# v4l2-ctl --device=/dev/video11 --set-fmt-video=width=640,height=480,pixelformat=NV12 --stream-mmap --stream-to=video50.yuv --stream-count=30
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
问题又来了 ,RKLUNCH.SH 他走不了了,无法推流到VLC 上 ,以下是运行RKLUNCH.SH 的错误
RKViChn 12:19:54-675 {prepareRuntime :336} vi version: 1.86, name:vvi
RKViChn 12:19:54-676 {prepareRuntime :337} rockit-ko version: vmpi:fb2eed2be49e
RKViChn 12:19:54-677 {prepareRuntime :338} rockit-ko building: -2023-02-09-11:04:49
RKViChn 12:19:54-677 {prepareRuntime :339} ---------------------------------------------------------
RKViChn 12:19:54-682 {prepareRuntime :358} mb pool create success, MBCnt= 2
cmpi 12:19:54-683 {createRuntime :546} [non-WRAP MODE]: buff size = 1536000
RTIsp3x 12:19:54-687 {ispInitDevice :208} sensor name = m00_b_ov9281 3-0070
RTIsp3x 12:19:54-687 {ispInitDevice :211} sensor_index = 0
RTDeviceV4L2 12:19:54-691 {open :138} open video name(/dev/video11)
RKViChn 12:19:54-691 {setFrameRate :1153} [vi] dev(0) ch(0) illegal param s32SrcFrameRate(0) s32DstFrameRate(0)
RTDeviceV4L2 12:19:54-693 {ispCameraInfo :549} current device:/dev/video11 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0
RTDeviceV4L2 12:19:54-694 {ispInitFormat :726} ioctl VIDIOC_S_FMT OK
RKViChn 12:19:54-695 {start :813} =========== vi Start startRuntime ===========
RTDeviceV4L2 12:19:54-695 {ispStreamOn :440} do ispStreamOn start
RTDeviceV4L2 12:19:54-696 {ispIOCtrl :409} request 1074026002, err resion:Invalid argument err:-1
RTDeviceV4L2 12:19:54-697 {ispStreamOn :489} failed to ioctl stream On(request=1074026002)
[video.c][rkipc_pipe_0_init]:ERROR: create VI error! ret=-1
不好意思 呀 一下问题很多,打扰到你了
你好我按照你的命令来出现以下错误,我两个摄像头取原始数据RAW 都是正确的,摄像头驱动都是好的
[root@luckfox ]# sample_multi_vi -w 400 -h 400 -a /etc/iqfiles/ -n 2 -l 10 -o /data/
#CameraNum: 2
#Output Path: /data/
#IQ Path: /etc/iqfiles/
#Rkaiq XML DirPath: /etc/iqfiles/
#bMultictx: 0
rkaiq log level ff0
CamGroupId:0, cam_id: 0, sensor_name is m00_b_ov9281 4-0070, iqfiles is /etc/iqfiles/
pCamGroupCfg->sns_ent_nm_array[0] is m00_b_ov9281 4-0070
CamGroupId:0, cam_id: 1, sensor_name is m01_b_ov9281 3-0070, iqfiles is /etc/iqfiles/
pCamGroupCfg->sns_ent_nm_array[1] is m01_b_ov9281 3-0070
create camgroup ctx error!
rockit log path (null), log_size = 0, can use export rt_log_path=, export rt_log_size= change
log_file = (nil)
RTVersion 12:00:38-030 {dump :064} ---------------------------------------------------------
RTVersion 12:00:38-033 {dump :065} rockit version: git-8cb4d25b8 Tue Feb 28 11:12:39 2023 +0800
RTVersion 12:00:38-033 {dump :066} rockit building: built- 2023-02-28 15:23:19
RTVersion 12:00:38-033 {dump :067} ---------------------------------------------------------
rockit default level 4, can use export rt_log_level=x, x=0,1,2,3,4,5,6 change
(null) 12:00:38-033 {read_log_level :093} text is all=4
(null) 12:00:38-034 {read_log_level :095} module is all, log_level is 4
(null) 12:00:38-037 {monitor_log_level :144} #Start monitor_log_level thread, arg:(nil)
RTIsp3x 12:00:38-052 {ispInitDevice :208} sensor name = m00_b_ov9281 4-0070
RTIsp3x 12:00:38-054 {ispInitDevice :211} sensor_index = 0
RTIsp3x 12:00:38-059 {ispInitDevice :208} sensor name = m01_b_ov9281 3-0070
RTIsp3x 12:00:38-060 {ispInitDevice :211} sensor_index = 1
RTIsp3x 12:00:38-067 {ispInitDevice :208} sensor name = m00_b_ov9281 4-0070
RTIsp3x 12:00:38-068 {ispInitDevice :211} sensor_index = 0
RTIsp3x 12:00:38-073 {ispInitDevice :208} sensor name = m01_b_ov9281 3-0070
RTIsp3x 12:00:38-075 {ispInitDevice :211} sensor_index = 1
RKViDev 12:00:38-086 {vi_set_dev_attr :440} VI_DEV_ATTR_S all parameter reserved
=== VI ATTRS INFO: ===
devId : 0
chnId : 0
buffcnt: 0
buffSize: 0
width: 0
height: 0
Maxwidth: 0
Maxwidth: 0
streaming: 0
RKViChn 12:00:38-099 {prepareRuntime :334} ---------------------------------------------------------
RKViChn 12:00:38-099 {prepareRuntime :336} vi version: 1.98, name:vvi
RKViChn 12:00:38-099 {prepareRuntime :337} rockit-ko version: vmpi:fb2eed2be49e
RKViChn 12:00:38-099 {prepareRuntime :338} rockit-ko building: -2023-02-09-11:04:49
RKViChn 12:00:38-099 {prepareRuntime :339} ---------------------------------------------------------
RKViChn 12:00:38-104 {prepareRuntime :358} mb pool create success, MBCnt= 2
cmpi 12:00:38-106 {createRuntime :546} [non-WRAP MODE]: buff size = 240000
RTIsp3x 12:00:38-110 {ispInitDevice :208} sensor name = m00_b_ov9281 4-0070
RTIsp3x 12:00:38-112 {ispInitDevice :211} sensor_index = 0
RTIsp3x 12:00:38-117 {ispInitDevice :208} sensor name = m01_b_ov9281 3-0070
RTIsp3x 12:00:38-118 {ispInitDevice :211} sensor_index = 1
RTDeviceV4L2 12:00:38-123 {open :138} open video name(/dev/video22)
RTDeviceV4L2 12:00:38-126 {ispCameraInfo :549} current device:/dev/video22 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0
RTDeviceV4L2 12:00:38-128 {ispInitFormat :726} ioctl VIDIOC_S_FMT OK
RKViChn 12:00:38-129 {start :813} =========== vi Start startRuntime ===========
RTDeviceV4L2 12:00:38-130 {ispStreamOn :440} do ispStreamOn start
这个大致原因是什么呢 ,因为没有遇到过相似问题
默认的rkipc应用是不支持双摄的所以无法推流,在SDK中有Rockchip提供的双摄示例应用 rv1106_dual_ipc(位于$SDK/project/app/rkipc/rkipc/src),前提是确保双摄可以运行了
由于我们也没有支持双摄的产品,我也不确定您执行的sample_multi_vi 的信息有什么问题,看起来应该是开始运行了,查看一下/data/ 下有没有生成 /data/vi_0.bin 和 /data/vi_1.bin。
由于我们也没有支持双摄的产品,我也不确定您执行的sample_multi_vi 的信息有什么问题,看起来应该是开始运行了,查看一下/data/ 下有没有生成 /data/vi_0.bin 和 /data/vi_1.bin。