Skip to contentSkip to conversation

dt-bindings: media: sun4i-csi: Drop the module clock

PATCH In review Maxime Ripard 2 participants 8 messages Oct 3, 2019 – Oct 7, 2019

Subsystems (4)
lore
Share & tools
lore

Maxime Ripard

author maintainer
#0 lore raw

PATCH 1/2 dt-bindings: media: sun4i-csi: Drop the module clock

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -5
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";
         resets = <&ccu RST_CSI0>;
 
         port {
Signature · 1 line
2.23.0
author maintainer
#1 lore raw

PATCH 2/2 ARM: dts: sun7i: Drop the module clock from the device tree

What we thought would be the module clock is actually the clock meant to be used by the sensors, and play no role in the CSI controller. Now that the binding has been updated to reflect that, let's update the device tree too.

Fixes d2b9c6444301 ("ARM: dts: sun7i: Add CSI0 controller")
---
 arch/arm/boot/dts/sun7i-a20.dtsi | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm/boot/dts/sun7i-a20.dtsi +2 -3
index 874231be04e4..8aebefd6accf 100644
@@ -380,9 +380,8 @@
 			compatible = "allwinner,sun7i-a20-csi0";
 			reg = <0x01c09000 0x1000>;
 			interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-				 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-			clock-names = "bus", "mod", "isp", "ram";
+			clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+			clock-names = "bus", "isp", "ram";
 			resets = <&ccu RST_CSI0>;
 			status = "disabled";
 		};
Signature · 1 line
2.23.0
#2 lore raw
In reply to Maxime Ripard

Hi,

Quoted 32 lines · Maxime Ripard

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -2
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 

Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml examples: · line 91

Quoted 8 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -3
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";

I believe what we thought was the ISP clock is actually the module clock for the whole CSI subsystem. So we should still use the module clock entry, and remove the ISP entry.

ChenYu

Quoted 6 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -1
         resets = <&ccu RST_CSI0>;
 
         port {
--

2.23.0

author maintainer
#3 lore raw

Hi,

Quoted 32 lines · Chen-Yu Tsai
Quoted 31 lines · Maxime Ripard

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -2
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 
Quoted 13 lines

Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml examples: · line 91

Quoted 9 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -3
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";

I believe what we thought was the ISP clock is actually the module clock for the whole CSI subsystem. So we should still use the module clock entry, and remove the ISP entry.

I'm really not sure it is. CSI1 on the A20 (possibly the A10 as well, I haven't checked), and the one on the A13 don't have any ISP embedded in the CSI controller.

It makes some difference, because according to the BSP, you can see that the ISP clock is taken for CSI0:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi0/sun4i_drv_csi.c#L389

While for CSI1, that block is commented out, and the ISP clock never used:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi1/sun4i_drv_csi.c#L396

So I really believe that the ISP clock is here to feed the ISP block within the CSI controller if there's any. But it's far from always the case, as opposed to a module clock for the whole CSI controller that would be here in both cases.

Maxime

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw
Quoted 58 lines · Maxime Ripard

Hi,

Quoted 32 lines · Chen-Yu Tsai
Quoted 31 lines · Maxime Ripard

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -2
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 
Quoted 13 lines

Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml examples: · line 91

Quoted 9 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -3
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";

I believe what we thought was the ISP clock is actually the module clock for the whole CSI subsystem. So we should still use the module clock entry, and remove the ISP entry.

I'm really not sure it is. CSI1 on the A20 (possibly the A10 as well, I haven't checked), and the one on the A13 don't have any ISP embedded in the CSI controller.

It makes some difference, because according to the BSP, you can see that the ISP clock is taken for CSI0:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi0/sun4i_drv_csi.c#L389

Quoted 8 lines

While for CSI1, that block is commented out, and the ISP clock never used:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi1/sun4i_drv_csi.c#L396

So I really believe that the ISP clock is here to feed the ISP block within the CSI controller if there's any. But it's far from always the case, as opposed to a module clock for the whole CSI controller that would be here in both cases.

I guess we should try to test this with CSI1 one, either on a Cubieboard or OlinuXino with a simple camera like the OV7670?

Do you have any hardware on hand for this? I have the Cubieboard but I need to get some proper 2.0mm connector blocks.

ChenYu

author maintainer
#5 lore raw

Hi,

Quoted 65 lines · Chen-Yu Tsai
Quoted 55 lines · Maxime Ripard
Quoted 32 lines · Chen-Yu Tsai
Quoted 31 lines · Maxime Ripard

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -2
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 
Quoted 13 lines

Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml examples: · line 91

Quoted 9 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -3
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";

I believe what we thought was the ISP clock is actually the module clock for the whole CSI subsystem. So we should still use the module clock entry, and remove the ISP entry.

I'm really not sure it is. CSI1 on the A20 (possibly the A10 as well, I haven't checked), and the one on the A13 don't have any ISP embedded in the CSI controller.

It makes some difference, because according to the BSP, you can see that the ISP clock is taken for CSI0:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi0/sun4i_drv_csi.c#L389

Quoted 8 lines

While for CSI1, that block is commented out, and the ISP clock never used:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi1/sun4i_drv_csi.c#L396

So I really believe that the ISP clock is here to feed the ISP block within the CSI controller if there's any. But it's far from always the case, as opposed to a module clock for the whole CSI controller that would be here in both cases.

Quoted 5 lines

I guess we should try to test this with CSI1 one, either on a Cubieboard or OlinuXino with a simple camera like the OV7670?

Do you have any hardware on hand for this? I have the Cubieboard but I need to get some proper 2.0mm connector blocks.

I've tested it with the A13 before, and it doesn't need the ISP clock

Maxime

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw
Quoted 69 lines · Maxime Ripard

Hi,

Quoted 65 lines · Chen-Yu Tsai
Quoted 63 lines · Maxime Ripard
Quoted 32 lines · Chen-Yu Tsai
Quoted 31 lines · Maxime Ripard

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -2
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 
Quoted 13 lines

Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml examples: · line 91

Quoted 9 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -3
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";

I believe what we thought was the ISP clock is actually the module clock for the whole CSI subsystem. So we should still use the module clock entry, and remove the ISP entry.

I'm really not sure it is. CSI1 on the A20 (possibly the A10 as well, I haven't checked), and the one on the A13 don't have any ISP embedded in the CSI controller.

It makes some difference, because according to the BSP, you can see that the ISP clock is taken for CSI0:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi0/sun4i_drv_csi.c#L389

While for CSI1, that block is commented out, and the ISP clock never used:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi1/sun4i_drv_csi.c#L396

So I really believe that the ISP clock is here to feed the ISP block within the CSI controller if there's any. But it's far from always the case, as opposed to a module clock for the whole CSI controller that would be here in both cases.

Quoted 7 lines
Quoted 5 lines

I guess we should try to test this with CSI1 one, either on a Cubieboard or OlinuXino with a simple camera like the OV7670?

Do you have any hardware on hand for this? I have the Cubieboard but I need to get some proper 2.0mm connector blocks.

I've tested it with the A13 before, and it doesn't need the ISP clock

OK! That clears things up!

ChenYu

author maintainer
#7 lore raw
Quoted 73 lines · Chen-Yu Tsai
Quoted 72 lines · Maxime Ripard

Hi,

Quoted 68 lines · Chen-Yu Tsai
Quoted 55 lines · Maxime Ripard
Quoted 32 lines · Chen-Yu Tsai
Quoted 31 lines · Maxime Ripard

It turns out that what was thought to be the module clock was actually the clock meant to be used by the sensor, and isn't playing any role with the CSI controller itself. Let's drop that clock from our binding.

Fixes c5e8f4ccd775 ("media: dt-bindings: media: Add Allwinner A10 CSI binding")
---
 .../devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +0 -2
index 5dd1cf490cd9..d3e423fcb6c2 100644
@@ -27,14 +27,12 @@ properties:
   clocks:
     items:
       - description: The CSI interface clock
-      - description: The CSI module clock
       - description: The CSI ISP clock
       - description: The CSI DRAM clock
 
   clock-names:
     items:
       - const: bus
-      - const: mod
       - const: isp
       - const: ram
 
Quoted 13 lines

Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml examples: · line 91

Quoted 9 lines
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml +2 -3
@@ -89,9 +87,8 @@ examples:
         compatible = "allwinner,sun7i-a20-csi0";
         reg = <0x01c09000 0x1000>;
         interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
-                 <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
-        clock-names = "bus", "mod", "isp", "ram";
+        clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
+        clock-names = "bus", "isp", "ram";

I believe what we thought was the ISP clock is actually the module clock for the whole CSI subsystem. So we should still use the module clock entry, and remove the ISP entry.

I'm really not sure it is. CSI1 on the A20 (possibly the A10 as well, I haven't checked), and the one on the A13 don't have any ISP embedded in the CSI controller.

It makes some difference, because according to the BSP, you can see that the ISP clock is taken for CSI0:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi0/sun4i_drv_csi.c#L389

Quoted 8 lines

While for CSI1, that block is commented out, and the ISP clock never used:
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/media/video/sun4i_csi/csi1/sun4i_drv_csi.c#L396

So I really believe that the ISP clock is here to feed the ISP block within the CSI controller if there's any. But it's far from always the case, as opposed to a module clock for the whole CSI controller that would be here in both cases.

I guess we should try to test this with CSI1 one, either on a Cubieboard or OlinuXino with a simple camera like the OV7670?

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Do you have any hardware on hand for this? I have the Cubieboard but I need to get some proper 2.0mm connector blocks.

I've tested it with the A13 before, and it doesn't need the ISP clock

OK! That clears things up!

I've added both patches as fixes then. Thanks!
Maxime

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel