c - 配置 DTS 以连接多台摄像机
问题描述
我有来自 texas insturments 的以下补丁,它执行我想做的类似行为。CSI 多路复用器是:TS5MP646 是简单的两位 CSI 多路复用器
现在补丁是这样做的:
Two RPi camera headers present on EAIK are connected to each port of
two CSI2RX instances 0 and 1. Sensors are configured through I2C
interface via an I2C switch.
CSI2RX-0 ====> \\
==>RPi header==>RPi-Cam0(IMX219)
//
MAIN_I2C ==> I2C_switch(TCA954) ===>
\\
==>RPi header==>RPi-Cam1(IMX219)
CSI2RX-1 ====> //
Both MIPI and RPi connectors are connected to the CSI2 interface. A mux
select should be set to high to select the RPi connector. So add a node
to set the mux select pin to high.
Add node for the I2C switch through which the camera sensors shall be
configured.
Add IMX219 camera nodes as a child node to the I2C switch.
在 RPi 相机和 CSI2RX 之间添加端点节点。
我真正需要的是以下内容:我想这样配置我的设置
I2C Multiplexer ----------> \ Camera RP0
/ Camera RP1
CSIRX ---> CSI-MULTIPLEXER / camera RPI 0
\ Camera RPI 1
这是应用第一个配置的当前补丁代码,我想像前面提到的那样配置。当前补丁代码:
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/k3.h>
+
+/ {
+ fragment@101 {
+ target-path = "/";
+
+ __overlay__ {
+ clk_imx219_fixed: imx219-xclk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <24000000>;
+ };
+ };
+ };
+};
+
+&main_pmx0 {
+ main_rpi_cam0_reset_pins_default: main-rpi-cam0-reset-pins-default {
+ pinctrl-single,pins = <
+ J721E_IOPAD(0x1D4, PIN_OUTPUT, 7) /* (Y3) SPI1_CS0 */
+ >;
+ };
+
+ main_rpi_cam1_reset_pins_default: main-rpi-cam1-reset-pins-default {
+ pinctrl-single,pins = <
+ J721E_IOPAD(0x1E0, PIN_OUTPUT, 7) /* (Y5) SPI1_D0 */
+ >;
+ };
+
+ main_csi_mux_sel2_pins_default: main-csi-mux-sel2-pins-default {
+ pinctrl-single,pins = <
+ J721E_IOPAD(0x164, PIN_OUTPUT, 7) /* (V29) RGMII5_TD2 */
+ >;
+ };
+};
+
+&main_gpio0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&main_csi_mux_sel2_pins_default>;
+
+ csi-mux-hog {
+ /* CSI_MUX_SEL_2 */
+ gpio-hog;
+ gpios = <88 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "CSI_MUX_SEL_2";
+ };
+};
+
+&main_i2c3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c-switch@70 {
+ compatible = "nxp,pca9543";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x70>;
+
+ i2c-alias-pool = /bits/ 16 <0x10 0x11>;
+
+ /* CAM0 I2C */
+ cam0_i2c: i2c@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ imx219_0: imx219_0@10 {
+ compatible = "sony,imx219";
+ reg = <0x10>;
+
+ clocks = <&clk_imx219_fixed>;
+ clock-names = "xclk";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&main_rpi_cam0_reset_pins_default>;
+ reset-gpios = <&main_gpio0 116 GPIO_ACTIVE_HIGH>;
+
+ port {
+ csi2_cam0: endpoint {
+ remote-endpoint = <&csi2rx0_in_sensor>;
+ link-frequencies = /bits/ 64 <456000000>;
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+ };
+
+ /* CAM1 I2C */
+ cam1_i2c: i2c@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+
+ imx219_1: imx219_1@10 {
+ compatible = "sony,imx219";
+ reg = <0x10>;
+
+ clocks = <&clk_imx219_fixed>;
+ clock-names = "xclk";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&main_rpi_cam1_reset_pins_default>;
+ reset-gpios = <&main_gpio0 119 GPIO_ACTIVE_HIGH>;
+
+ port {
+ csi2_cam1: endpoint {
+ remote-endpoint = <&csi2rx1_in_sensor>;
+ link-frequencies = /bits/ 64 <456000000>;
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+ };
+ };
+};
+
+&csi0_port0 {
+ csi2rx0_in_sensor: endpoint {
+ remote-endpoint = <&csi2_cam0>;
+ bus-type = <4>; /* CSI2 DPHY. */
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+};
+
+&csi1_port0 {
+ csi2rx1_in_sensor: endpoint {
+ remote-endpoint = <&csi2_cam1>;
+ bus-type = <4>; /* CSI2 DPHY. */
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+};
解决方案
推荐阅读
- java - Java httpcleint 使用 X.509 证书发送 SSL 请求
- elasticsearch - Elasticsearch _count 查询请求缓存
- android - 为什么ejabberd在收到消息后不向客户端发送消息?
- coq - 两个术语之间的相等关系
- python - 在 *.docx 文件的标题中创建一个表
- flask - 将 Flask 应用程序中的值存储到 Heroku 上的 Json 文件以供以后调用
- python-3.x - 选择从哪个目录运行 pytest
- wso2 - 无法使用 WSO2 Enterprise Integrator(ESB) API/Endpoint 从 WSO2 API Manager 获取访问令牌
- php - eclipse PDT,如何在 CLI 模式下运行 PHP 脚本
- python - 在 python 中迭代 .wav 部分时获取准确的时间戳