arm64: dts: imx8mm: Add CSI nodes
Subsystems (2)
PATCH 1/1 arm64: dts: imx8mm: Add CSI nodes
There is a csi bridge and csis interface that tie together to allow csi2 capture.
arch/arm64/boot/dts/freescale/imx8mm.dtsi +51 -0
@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>; + csi: csi@32e20000 { + compatible = "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 = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;
@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; }; + mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + 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"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + }; + }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;
Signature · 1 line
2.25.1
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>
Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 31 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +16
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>; + csi: csi@32e20000 { + compatible = "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 = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };
arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;
When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk IMX8MM_CLK_CSI1_PHY_REF>,
<&clk IMX8MM_CLK_CSI1_CORE>,
<&clk IMX8MM_CLK_CSI1_ROOT>,
<&clk IMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>,
<&clk IMX8MM_SYS_PLL2_1000M>,
<&clk IMX8MM_CLK_CSI1_CORE>,
<&clk IMX8MM_SYS_PLL1_800M>;
However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Any ideas if what/if any other clock entries might be missing?
Quoted 32 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +26
-1+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + }; + }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>; --2.25.1
Laurent Pinchart
Reviewed-byHi Adam,
Quoted 20 lines · Adam Ford
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi aips4: bus@32c00000 { · line 1072
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2
-0+ csi: csi@32e20000 { + compatible = "fsl,imx7-csi";
This should be
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";;
Quoted 44 lines
Quoted 20 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +14
-0+ reg = <0x32e20000 0x1000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk
IMX8MM_CLK_CSI1_PHY_REF>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_CLK_CSI1_ROOT>,
<&clkIMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_SYS_PLL1_800M>;
Quoted 6 lines
However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Any ideas if what/if any other clock entries might be missing?
Have you tried looking at the error interrupt counters to see if the CSI-2 bus side operates as expected ? I'd start there before blaming the clocks. Note that the issue could also be in the CSI bridge.
I've had issues capturing from one particular sensor on an i.MX8MM board, where I would get images, but with heavy corruption. The problem was solved by chance when trying a different SPL binary. I need to investigate the differences there, and possibly update the driver accordingly. It may or may not be related to your issue.
Apart from the compatible string issue mentioned above, the bindings match what I am using, so, with the compatible string fixed,
Quoted 29 lines
Quoted 29 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +26
-0+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + }; + }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 80 lines · Laurent Pinchart
Hi Adam,
Quoted 20 lines · Adam Ford
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi aips4: bus@32c00000 { · line 1072
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2
-0+ csi: csi@32e20000 { + compatible = "fsl,imx7-csi";This should be
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";;Quoted 49 lines
Quoted 20 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +14
-0+ reg = <0x32e20000 0x1000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk
IMX8MM_CLK_CSI1_PHY_REF>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_CLK_CSI1_ROOT>,
<&clkIMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_SYS_PLL1_800M>;However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Quoted 5 lines
Quoted 1 line
Any ideas if what/if any other clock entries might be missing?
Have you tried looking at the error interrupt counters to see if the CSI-2 bus side operates as expected ? I'd start there before blaming the clocks. Note that the issue could also be in the CSI bridge.
I am not seeing interrupts on either the CSI, mipi-csi, or err:
54: 0 0 0 0 GICv3 48 Level csi 55: 0 0 0 0 GICv3 49 Level
32e30000.mipi-csi
Err: 0
Quoted 4 lines
I've had issues capturing from one particular sensor on an i.MX8MM board, where I would get images, but with heavy corruption. The problem was solved by chance when trying a different SPL binary. I need to
I wonder if the issue was related to different versions of ATF, and depending on the power domain controls used, it could have been using ATF to set the power domains.
I've had issues in the past too, but I have tried a couple different binaries, and I am not seeing a change in behavior.
Quoted 6 lines
investigate the differences there, and possibly update the driver accordingly. It may or may not be related to your issue.
Apart from the compatible string issue mentioned above, the bindings match what I am using, so, with the compatible string fixed,
Out of curiosity, I noticed the default csi clock parents point to a 24MHz clock, but the csi-2 interface wants to set the clock to 333MHz. Any chance you could share your clk_summary?
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>
Thanks for the review
Quoted 35 lines
Quoted 22 lines
Quoted 22 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +21
-0+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + };Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1151
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +5
-0+ }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;--
Regards,Laurent Pinchart
Hi Adam,
Quoted 95 lines · Adam Ford
Quoted 77 lines · Laurent Pinchart
Quoted 20 lines · Adam Ford
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi aips4: bus@32c00000 { · line 1072
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2
-0+ csi: csi@32e20000 { + compatible = "fsl,imx7-csi";This should be
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";;Quoted 49 lines
Quoted 20 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +14
-0+ reg = <0x32e20000 0x1000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk
IMX8MM_CLK_CSI1_PHY_REF>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_CLK_CSI1_ROOT>,
<&clkIMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_SYS_PLL1_800M>;However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Quoted 5 lines
Quoted 1 line
Any ideas if what/if any other clock entries might be missing?
Have you tried looking at the error interrupt counters to see if the CSI-2 bus side operates as expected ? I'd start there before blaming the clocks. Note that the issue could also be in the CSI bridge.
I am not seeing interrupts on either the CSI, mipi-csi, or err:
54: 0 0 0 0 GICv3 48 Level csi 55: 0 0 0 0 GICv3 49 Level32e30000.mipi-csi
Err: 0Quoted 3 lines
I've had issues capturing from one particular sensor on an i.MX8MM board, where I would get images, but with heavy corruption. The problem was solved by chance when trying a different SPL binary. I need to
Quoted 5 lines
I wonder if the issue was related to different versions of ATF, and depending on the power domain controls used, it could have been using ATF to set the power domains.
I've had issues in the past too, but I have tried a couple different binaries, and I am not seeing a change in behavior.
We've just finished the investigation, and it turned out to be related to the clock frequencies. Here's the DT changes we had to make to get it working:
assigned-clocks = <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, <&clk IMX8MM_CLK_DISP_APB>, <&clk IMX8MM_CLK_DISP_APB_ROOT>; assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>, <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_SYS_PLL1_800M>, <&clk IMX8MM_CLK_DISP_APB>;
assigned-clock-rates = <500000000>, <500000000>, <200000000>, <200000000>;
This results in the following clock configuration:
sys_pll2_1000m 1000000000
disp_axi 500000000
disp_axi_root_clk 500000000
sys_pll1_800m 800000000
disp_apb 200000000
disp_apb_root_clk 200000000
I'll check which clock is the culprit, and see if we could program the clocks in the driver directly.
Quoted 9 lines
Quoted 5 lines
investigate the differences there, and possibly update the driver accordingly. It may or may not be related to your issue.
Apart from the compatible string issue mentioned above, the bindings match what I am using, so, with the compatible string fixed,
Out of curiosity, I noticed the default csi clock parents point to a 24MHz clock, but the csi-2 interface wants to set the clock to 333MHz. Any chance you could share your
clk_summary?
Is the above information what you need ?
Quoted 33 lines
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>Thanks for the review
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +26
-0+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + }; + }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 125 lines · Laurent Pinchart
Hi Adam,
Quoted 95 lines · Adam Ford
Quoted 77 lines · Laurent Pinchart
Quoted 20 lines · Adam Ford
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi aips4: bus@32c00000 { · line 1072
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2
-0+ csi: csi@32e20000 { + compatible = "fsl,imx7-csi";This should be
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";;Quoted 49 lines
Quoted 20 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +14
-0+ reg = <0x32e20000 0x1000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk
IMX8MM_CLK_CSI1_PHY_REF>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_CLK_CSI1_ROOT>,
<&clkIMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_SYS_PLL1_800M>;However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Quoted 5 lines
Quoted 1 line
Any ideas if what/if any other clock entries might be missing?
Have you tried looking at the error interrupt counters to see if the CSI-2 bus side operates as expected ? I'd start there before blaming the clocks. Note that the issue could also be in the CSI bridge.
I am not seeing interrupts on either the CSI, mipi-csi, or err:
54: 0 0 0 0 GICv3 48 Level csi 55: 0 0 0 0 GICv3 49 Level32e30000.mipi-csi
Err: 0Quoted 3 lines
I've had issues capturing from one particular sensor on an i.MX8MM board, where I would get images, but with heavy corruption. The problem was solved by chance when trying a different SPL binary. I need to
Quoted 5 lines
I wonder if the issue was related to different versions of ATF, and depending on the power domain controls used, it could have been using ATF to set the power domains.
I've had issues in the past too, but I have tried a couple different binaries, and I am not seeing a change in behavior.We've just finished the investigation, and it turned out to be related to the clock frequencies. Here's the DT changes we had to make to get it working:
assigned-clocks = <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, <&clk IMX8MM_CLK_DISP_APB>, <&clk IMX8MM_CLK_DISP_APB_ROOT>; assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>, <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_SYS_PLL1_800M>, <&clk IMX8MM_CLK_DISP_APB>; assigned-clock-rates = <500000000>, <500000000>, <200000000>, <200000000>;This results in the following clock configuration:
sys_pll2_1000m1000000000
disp_axi500000000
disp_axi_root_clk500000000
Quoted 6 lines
sys_pll1_800m800000000
disp_apb200000000
disp_apb_root_clk200000000I'll check which clock is the culprit, and see if we could program the clocks in the driver directly.
I am using Shawn Guo's "for-next" branch, and by default the disp_axi and disp_apb clocks appear to already have these parents and clock rates. They appear to be defined in the pgc_dispmix node.
disp_axi 1 1 0 500000000
0 0 50000 Y
disp_axi_root_clk 2 2 0 500000000
0 0 50000 Y
disp_apb 1 1 0 200000000
0 0 50000 Y
disp_apb_root_clk 2 2 0 200000000
0 0 50000 YCan you tell me which branch you're using? I wonder if I should switch branches.
adam
Quoted 51 lines
Quoted 10 lines
Quoted 6 lines
investigate the differences there, and possibly update the driver accordingly. It may or may not be related to your issue.
Apart from the compatible string issue mentioned above, the bindings match what I am using, so, with the compatible string fixed,
Out of curiosity, I noticed the default csi clock parents point to a 24MHz clock, but the csi-2 interface wants to set the clock to 333MHz. Any chance you could share your
clk_summary?Is the above information what you need ?
Quoted 25 lines
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>Thanks for the review
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +21
-0+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + };Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1151
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +5
-0+ }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;--
Regards,Laurent Pinchart
Quoted 148 lines · Adam Ford
Quoted 125 lines · Laurent Pinchart
Hi Adam,
Quoted 95 lines · Adam Ford
Quoted 77 lines · Laurent Pinchart
Quoted 20 lines · Adam Ford
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi aips4: bus@32c00000 { · line 1072
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2
-0+ csi: csi@32e20000 { + compatible = "fsl,imx7-csi";This should be
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";;Quoted 49 lines
Quoted 20 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +14
-0+ reg = <0x32e20000 0x1000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk
IMX8MM_CLK_CSI1_PHY_REF>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_CLK_CSI1_ROOT>,
<&clkIMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_SYS_PLL1_800M>;However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Quoted 5 lines
Quoted 1 line
Any ideas if what/if any other clock entries might be missing?
Have you tried looking at the error interrupt counters to see if the CSI-2 bus side operates as expected ? I'd start there before blaming the clocks. Note that the issue could also be in the CSI bridge.
I am not seeing interrupts on either the CSI, mipi-csi, or err:
54: 0 0 0 0 GICv3 48 Level csi 55: 0 0 0 0 GICv3 49 Level32e30000.mipi-csi
Err: 0Quoted 3 lines
I've had issues capturing from one particular sensor on an i.MX8MM board, where I would get images, but with heavy corruption. The problem was solved by chance when trying a different SPL binary. I need to
Quoted 5 lines
I wonder if the issue was related to different versions of ATF, and depending on the power domain controls used, it could have been using ATF to set the power domains.
I've had issues in the past too, but I have tried a couple different binaries, and I am not seeing a change in behavior.We've just finished the investigation, and it turned out to be related to the clock frequencies. Here's the DT changes we had to make to get it working:
assigned-clocks = <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, <&clk IMX8MM_CLK_DISP_APB>, <&clk IMX8MM_CLK_DISP_APB_ROOT>; assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>, <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_SYS_PLL1_800M>, <&clk IMX8MM_CLK_DISP_APB>; assigned-clock-rates = <500000000>, <500000000>, <200000000>, <200000000>;This results in the following clock configuration:
sys_pll2_1000m1000000000
disp_axi500000000
disp_axi_root_clk500000000Quoted 6 lines
sys_pll1_800m800000000
disp_apb200000000
disp_apb_root_clk200000000I'll check which clock is the culprit, and see if we could program the clocks in the driver directly.
I am using Shawn Guo's "for-next" branch, and by default the
disp_axianddisp_apbclocks appear to already have these parents and clock rates. They appear to be defined in thepgc_dispmixnode.disp_axi 1 1 0 500000000 0 0 50000 Y disp_axi_root_clk 2 2 0 500000000 0 0 50000 Y disp_apb 1 1 0 200000000 0 0 50000 Y disp_apb_root_clk 2 2 0 200000000 0 0 50000 Y
Quoted 3 lines
Can you tell me which branch you're using? I wonder if I should switch branches.
I started investigating the power domain, and I did a dump of the disp-blk-ctl dump, and it appears the csi power domain is remaining off:
cat /sys/kernel/debug/regmap/32e28000.blk-ctrl/registers 00: 00000047
04: 0000103f
I compared it with pm_genpd_summary, and found the dispblk-mipi-csi appears to be off:
dispblk-csi-bridge on
/devices/platform/soc@0/32c00000.bus/32e20000.csi
dispblk-mipi-csi off-0
0
/devices/platform/soc@0/32c00000.bus/32e30000.mipi-csisuspended 0
Do you have any idea why the dispblk-mipi-csi power domain might turn off while the dispblk-csi-bridge is on?
I added some debug code, and it looks like we're intentionally turning it off, but it's not clear as to why.
Quoted 52 lines
adam
Quoted 51 lines
Quoted 10 lines
Quoted 6 lines
investigate the differences there, and possibly update the driver accordingly. It may or may not be related to your issue.
Apart from the compatible string issue mentioned above, the bindings match what I am using, so, with the compatible string fixed,
Out of curiosity, I noticed the default csi clock parents point to a 24MHz clock, but the csi-2 interface wants to set the clock to 333MHz. Any chance you could share your
clk_summary?Is the above information what you need ?
Quoted 25 lines
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>Thanks for the review
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +21
-0+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + };Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1151
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +5
-0+ }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;--
Regards,Laurent Pinchart
Quoted 170 lines · Adam Ford
Quoted 148 lines · Adam Ford
Quoted 125 lines · Laurent Pinchart
Hi Adam,
Quoted 95 lines · Adam Ford
Quoted 77 lines · Laurent Pinchart
Quoted 20 lines · Adam Ford
Quoted 5 lines · Adam Ford
There is a csi bridge and csis interface that tie together to allow csi2 capture.
Signed-off-by Adam Ford <[email protected]>Laurent,
Since you did some work to make the csis functional on the imx8mm, I was hoping you might have some insights. Please see below:
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0
-0@@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi aips4: bus@32c00000 { · line 1072
Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2
-0+ csi: csi@32e20000 { + compatible = "fsl,imx7-csi";This should be
compatible = "fsl,imx8mm-csi", "fsl,imx7-csi";;Quoted 49 lines
Quoted 20 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +14
-0+ reg = <0x32e20000 0x1000>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>;@@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; };arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1122
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +9
-0+ mipi_csi2: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>;When comparing clock parents and the clock rates to one of NXP's kernels, it appears we need assigned-clocks and assigned-clock-parents to allow the CSI1 clocks to run fast enough.
assigned-clocks = <&clk
IMX8MM_CLK_CSI1_PHY_REF>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_CLK_CSI1_ROOT>,
<&clkIMX8MM_CLK_CSI1_ESC>;
assigned-clock-parents = <&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_SYS_PLL2_1000M>,
<&clkIMX8MM_CLK_CSI1_CORE>,
<&clkIMX8MM_SYS_PLL1_800M>;However, even with this, I am attempting to capture. While I can get the pipeline enabled, when I try to capture a file, I get no data. i can use control-c to exit gstreamer, so I know the kernel didn't hang. I don't get errors, but I don't get data either.
Quoted 5 lines
Quoted 1 line
Any ideas if what/if any other clock entries might be missing?
Have you tried looking at the error interrupt counters to see if the CSI-2 bus side operates as expected ? I'd start there before blaming the clocks. Note that the issue could also be in the CSI bridge.
I am not seeing interrupts on either the CSI, mipi-csi, or err:
54: 0 0 0 0 GICv3 48 Level csi 55: 0 0 0 0 GICv3 49 Level32e30000.mipi-csi
Err: 0Quoted 3 lines
I've had issues capturing from one particular sensor on an i.MX8MM board, where I would get images, but with heavy corruption. The problem was solved by chance when trying a different SPL binary. I need to
Quoted 5 lines
I wonder if the issue was related to different versions of ATF, and depending on the power domain controls used, it could have been using ATF to set the power domains.
I've had issues in the past too, but I have tried a couple different binaries, and I am not seeing a change in behavior.We've just finished the investigation, and it turned out to be related to the clock frequencies. Here's the DT changes we had to make to get it working:
assigned-clocks = <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, <&clk IMX8MM_CLK_DISP_APB>, <&clk IMX8MM_CLK_DISP_APB_ROOT>; assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>, <&clk IMX8MM_CLK_DISP_AXI>, <&clk IMX8MM_SYS_PLL1_800M>, <&clk IMX8MM_CLK_DISP_APB>; assigned-clock-rates = <500000000>, <500000000>, <200000000>, <200000000>;This results in the following clock configuration:
sys_pll2_1000m1000000000
disp_axi500000000
disp_axi_root_clk500000000Quoted 6 lines
sys_pll1_800m800000000
disp_apb200000000
disp_apb_root_clk200000000I'll check which clock is the culprit, and see if we could program the clocks in the driver directly.
I am using Shawn Guo's "for-next" branch, and by default the
disp_axianddisp_apbclocks appear to already have these parents and clock rates. They appear to be defined in thepgc_dispmixnode.disp_axi 1 1 0 500000000 0 0 50000 Y disp_axi_root_clk 2 2 0 500000000 0 0 50000 Y disp_apb 1 1 0 200000000 0 0 50000 Y disp_apb_root_clk 2 2 0 200000000 0 0 50000 YQuoted 3 lines
Can you tell me which branch you're using? I wonder if I should switch branches.
I started investigating the power domain, and I did a dump of the disp-blk-ctl dump, and it appears the csi power domain is remaining off:
cat
/sys/kernel/debug/regmap/32e28000.blk-ctrl/registers00: 00000047
04:0000103fI compared it with
pm_genpd_summary, and found the dispblk-mipi-csi appears to be off:dispblk-csi-bridge on /devices/platform/soc@0/32c00000.bus/32e20000.csi dispblk-mipi-csi off-0 0 /devices/platform/soc@0/32c00000.bus/32e30000.mipi-csi
Quoted 7 lines
suspended 0
Do you have any idea why the dispblk-mipi-csi power domain might turn off while the dispblk-csi-bridge is on?
I added some debug code, and it looks like we're intentionally turning it off, but it's not clear as to why.
Upon further investigation, it looks like the streaming start/stop enabled/disables the power-domain, and I can see the disp-blk bits are correct when we're attempting to stream.
I think we need the assign-clock-parents in CSI node because they're set by default in the NXP kernel, and we're setting the clock rate of the wrap clock (IMX8MM_CLK_CSI1_ROOT) to 333MHz and when I set the clock parents, the clock rate of IMX8MM_CLK_CSI1_ROOT shows 333333334.
I have an OV5640 camera connected, and the xclk on the OV5640 is being driven by IMX8MM_CLK_CLKO1 which has its parent set to IMX8MM_CLK_24M.
When streaming, the CSI clocks look like:
csi1_phy_ref 2 2 0 1000000000
0 0 50000 Y
csi1_core 1 1 0 333333334
0 0 50000 Y
csi1_root_clk 3 3 0 333333334
0 0 50000 Y
csi1_esc 0 0 0 800000000
0 0 50000 NAnd the IMX8MM_CLK_CLKO1 looks like:
clko1 1 1 0 24000000
0 0 50000 Y
From what I can tell, all the clocks, except csi1_esc are enabled and running at the frequencies that I would expect when compared to the NXP custom kernel which works just fine for me. The NXP kernel assigns the csi1_esc, but it never seems to get enabled. Looking at the TRM, I don't see a patch for csi1_esc, so I am not sure we need to enable that one.
I'm going to re-submit the patch with the CSI enabled with the compatible entry fixed, and with the assigned-parents added, then I'll add a second patch to enable the CSI and CSIS drivers as modules. The third patch will be an RFC with the beacon-imx8mm board adding the stuff for the OV5640 since I still cannot get data to stream. No interrupts on CSI and no error interrupts appear in the /proc/interrupts.
I don't have a scope at home, so I can't tell if the 24MHz is clocking the OV5640, but I'll check that when time permits.
adam
Quoted 53 lines
Quoted 53 lines
adam
Quoted 51 lines
Quoted 10 lines
Quoted 6 lines
investigate the differences there, and possibly update the driver accordingly. It may or may not be related to your issue.
Apart from the compatible string issue mentioned above, the bindings match what I am using, so, with the compatible string fixed,
Out of curiosity, I noticed the default csi clock parents point to a 24MHz clock, but the csi-2 interface wants to set the clock to 333MHz. Any chance you could share your
clk_summary?Is the above information what you need ?
Quoted 25 lines
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>Thanks for the review
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +21
-0+ clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + imx8mm_mipi_csi_in: endpoint { + }; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + };Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi disp_blk_ctrl: blk-ctrl@32e28000 { · line 1151
Quoted 8 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +5
-0+ }; + }; + }; + + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>;--
Regards,Laurent Pinchart