Hello,
I want to enable media devices for camera sensors on imx8mm.
Then I found the topic related to that:
https://community.nxp.com/t5/i-MX-Processors/imx8mm-mipi-csi-capture-with-tc358743-hdmi-gt-mipi-not-...
Environment: Yocto Kirkstone 5.15.71
I modified imx8mm.dtsi:
csi1_bridge: csi1_bridge@32e20000 {
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";
reg = <0x32e20000 0x1000>;
interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_CSI1_ROOT>;
clock-names = "mclk";
power-domains = <&dispmix_pd>;
status = "disabled";
port {
csi_in: endpoint {
remote-endpoint = <&imx8mm_mipi_csi_out>;
};
};
};
mipi_csi: mipi-csi@32e30000 {
compatible = "fsl,imx8mm-mipi-csi2", "fsl,imx8mm-mipi-csi";
reg = <0x32e30000 0x1000>;
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
assigned-clocks = <&clk IMX8MM_CLK_CSI1_CORE>,
<&clk IMX8MM_CLK_CSI1_PHY_REF>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>,
<&clk IMX8MM_SYS_PLL2_1000M>;
clock-frequency = <500000000>;
clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>,
<&clk IMX8MM_CLK_CSI1_ROOT>,
<&clk IMX8MM_CLK_CSI1_PHY_REF>,
<&clk IMX8MM_CLK_DISP_AXI_ROOT>;
clock-names = "pclk", "wrap", "phy", "axi";
bus-width = <4>;
power-domains = <&mipi_pd>;
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
};
port@1 {
reg = <1>;
imx8mm_mipi_csi_out: endpoint {
remote-endpoint = <&csi_in>;
};
};
};
};
and modified sensor dtsi below that:
...
fragment@1 {
target = <&mipi_csi>;
__overlay__ {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx8mm_mipi_csi_in: endpoint {
remote-endpoint = <&ov5640_mipi1_ep>;
data-lanes = <1 2>;
};
};
};
};
};
...
fragment@2 {
target = <&i2c2>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
...
ov5640_mipi: ov5640_mipi@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_csi_pwn>, <&pinctrl_csi_rst>;
clocks = <&clk IMX8MM_CLK_CLKO1>;
clock-names = "xclk";
assigned-clocks = <&clk IMX8MM_CLK_CLKO1>;
assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
assigned-clock-rates = <24000000>;
csi_id = <0>;
powerdown-gpios = <&pca9555_a21 2 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
nvmem = <&ov5640_otp_0>;
nvmem-names = "calib-data";
port {
ov5640_mipi1_ep: endpoint {
remote-endpoint = <&imx8mm_mipi_csi_in>;
};
};
};
};
However, I cannot ENABLE the sensor source pad to the csi sink pad:
# media-ctl -p
Media controller API version 5.15.71
Media device information
------------------------
driver imx7-csi
model imx-media
serial
bus info platform:32e20000.csi1_bridge
hw revision 0x0
driver version 5.15.71
Device topology
- entity 1: csi (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:UYVY8_2X8/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
<- "csis-32e30000.mipi-csi":1 [ENABLED,IMMUTABLE]
pad1: Source
[fmt:UYVY8_2X8/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
-> "csi capture":0 [ENABLED,IMMUTABLE]
- entity 4: csi capture (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "csi":1 [ENABLED,IMMUTABLE]
- entity 10: csis-32e30000.mipi-csi (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
[fmt:UYVY8_1X16/640x480 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
<- "ov5640 1-003c":0 []
pad1: Source
[fmt:UYVY8_1X16/640x480 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
-> "csi":0 [ENABLED,IMMUTABLE]
- entity 15: ov5640 1-003c (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
pad0: Source
-> "csis-32e30000.mipi-csi":0 []
Why it cannot link between sensor entity and csi entity and how to resolve it?