Skip to contentSkip to conversation

arm64: dts: imx8mp: Align both CSI2 pixel clock

PATCH Superseded Marek Vasut 5 participants 10 messages Apr 16, 2024 – May 6, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: dts: imx8mp: Align both CSI2 pixel clock

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines

Subject: [PATCH v2] arm64: dts: imx8mp: Align both CSI2 pixel clock

Configure both CSI2 assigned-clock-rates the same way.
There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Quoted 13 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Quoted 27 lines

---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk
 IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk
 IMX8MP_SYS_PLL2_1000M>,
 							 <&clk
 IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;

power-domains = <&media_blk_ctrl
IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
status = "disabled";

--
2.43.0

Reviewed-by on v2 1/1
#2 lore raw
In reply to Marek Vasut

Am Dienstag, 16. April 2024, 16:19:10 CEST schrieb Marek Vasut:

Quoted 9 lines

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Apparently there is no difference when using imx415 (3840x2160) sensor.

Quoted 33 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
#3 lore raw

Hi,

Am Mittwoch, 17. April 2024, 11:12:04 CEST schrieb Alexander Stein:

Quoted 5 lines

Am Dienstag, 16. April 2024, 16:19:10 CEST schrieb Marek Vasut:

Quoted 4 lines

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

Quoted 7 lines
Quoted 5 lines

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Apparently there is no difference when using imx415 (3840x2160) sensor.

Just for the records: While this change does not affect imx415 (3840x2160) processing, reducing clock-frequency as well (v3) imx415 does not work. So I assume that for this image size a higher than default frequency is required.

Best regards,
Alexander

Quoted 38 lines
Quoted 33 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
#4 lore raw
Quoted 10 lines · Alexander Stein

Am Mittwoch, 17. April 2024, 11:12:04 CEST schrieb Alexander Stein:

Quoted 9 lines

Am Dienstag, 16. April 2024, 16:19:10 CEST schrieb Marek Vasut:

Quoted 8 lines

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Apparently there is no difference when using imx415 (3840x2160) sensor.

Just for the records: While this change does not affect imx415 (3840x2160) processing, reducing clock-frequency as well (v3) imx415 does not work. So I assume that for this image size a higher than default frequency is required.

For the time being I expect sensor overlays to override the default clock setup. Ideally the clock frequencies should be configured automatically at runtime by the CSI-2 RX driver.

Quoted 35 lines
Quoted 35 lines
Quoted 33 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 3 lines
Regards,

Laurent Pinchart
#5 lore raw

Am Freitag, 3. Mai 2024, 15:45:57 CEST schrieb Laurent Pinchart:

Quoted 15 lines · Alexander Stein
Quoted 14 lines

Am Mittwoch, 17. April 2024, 11:12:04 CEST schrieb Alexander Stein:

Quoted 12 lines

Am Dienstag, 16. April 2024, 16:19:10 CEST schrieb Marek Vasut:

Quoted 9 lines

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Apparently there is no difference when using imx415 (3840x2160) sensor.

Quoted 7 lines
Quoted 4 lines

Just for the records: While this change does not affect imx415 (3840x2160) processing, reducing clock-frequency as well (v3) imx415 does not work. So I assume that for this image size a higher than default frequency is required.

For the time being I expect sensor overlays to override the default clock setup.

Yep, that's what I did in the end.

Quoted 2 lines

Ideally the clock frequencies should be configured automatically at runtime by the CSI-2 RX driver.

Ideally, yes. In this case it depends on whether it is MIPI-CSI 1 in normal or overdrive mode, if it is MIPI-CSI 2 or if both cameras a run simultaneously. I wonder if it really worth to add that much infrastructure for a use case which is essentially fixed setup.

Best regards,
Alexander

Quoted 37 lines
Quoted 35 lines
Quoted 35 lines
Quoted 33 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
#6 lore raw
Quoted 26 lines · Alexander Stein

Am Freitag, 3. Mai 2024, 15:45:57 CEST schrieb Laurent Pinchart:

Quoted 15 lines · Alexander Stein
Quoted 14 lines

Am Mittwoch, 17. April 2024, 11:12:04 CEST schrieb Alexander Stein:

Quoted 12 lines

Am Dienstag, 16. April 2024, 16:19:10 CEST schrieb Marek Vasut:

Quoted 9 lines

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Apparently there is no difference when using imx415 (3840x2160) sensor.

Quoted 7 lines
Quoted 4 lines

Just for the records: While this change does not affect imx415 (3840x2160) processing, reducing clock-frequency as well (v3) imx415 does not work. So I assume that for this image size a higher than default frequency is required.

For the time being I expect sensor overlays to override the default clock setup.

Yep, that's what I did in the end.

Quoted 7 lines
Quoted 2 lines

Ideally the clock frequencies should be configured automatically at runtime by the CSI-2 RX driver.

Ideally, yes. In this case it depends on whether it is MIPI-CSI 1 in normal or overdrive mode, if it is MIPI-CSI 2 or if both cameras a run simultaneously. I wonder if it really worth to add that much infrastructure for a use case which is essentially fixed setup.

There could be platforms where two cameras are connected, and the user would want to operate them either concurrently at lower resolutions (and speed), or separately at higher resolutions.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
Quoted 32 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 3 lines
Regards,

Laurent Pinchart
Reviewed-by on v2 1/1
#7 lore raw
In reply to Marek Vasut
Quoted 9 lines · Marek Vasut

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Quoted 32 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw
Quoted 5 lines · Ahmad Fatoum
Quoted 4 lines · Marek Vasut

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

Quoted 7 lines
Quoted 5 lines

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

I see now that the node has a clock-frequency = <500000000>; still. This should be lowered too, shouldn't it?

Cheers,
Ahmad

Quoted 34 lines
Quoted 33 lines

---
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: Align both clock to 266 MHz and update commit message

---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
index 1bb96e96639f2..7883f5c056f4e 100644
@@ -1667,7 +1667,7 @@ mipi_csi_0: csi@32e40000 {
 						  <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF>;
 				assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>,
 							 <&clk IMX8MP_CLK_24M>;
-				assigned-clock-rates = <500000000>;
+				assigned-clock-rates = <266000000>;
 				power-domains = <&media_blk_ctrl IMX8MP_MEDIABLK_PD_MIPI_CSI2_1>;
 				status = "disabled";
 
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#9 lore raw
Quoted 10 lines · Ahmad Fatoum
Quoted 9 lines · Ahmad Fatoum
Quoted 8 lines · Marek Vasut

Configure both CSI2 assigned-clock-rates the same way. There does not seem to be any reason for keeping the two CSI2 pixel clock set to different frequencies.

This also reduces first CSI2 clock from overdrive mode frequency which is 500 MHz down below the regular mode frequency of 400 MHz.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I see now that the node has a clock-frequency = <500000000>; still. This should be lowered too, shouldn't it?

Oh, right, good catch.