Skip to contentSkip to conversation

ARM: sun8i: a83t: Support Camera Sensor Interface controller

PATCH Applied [email protected] 4 participants 8 messages May 20, 2019 – May 29, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: sun8i: a83t: Support Camera Sensor Interface controller

From: Ondrej Jirman <[email protected]>

This is a re-send of Chen-Yu's A83T CSI patch series with review tags applied and removed address/size cells from csi_in port. Already applied patches from v1 were dropped.

The series is ready to be merged:

Patch 1 and 2 via sunxi tree
Patch 3 via media tree

v2:
- dropped address/size cells from csi_in port
- added review tags

Please take a look and merge.

Thank you,
Ondrej

--------------------------
Original description:

Hi everyone,

This series adds support for the camera sensor interface controller found on the Allwinner A83T SoC. The controller is similar to the one found on the H3, with the addition of a MIPI CSI-2 interface. However, this series only supports parallel and BT.656 interfaces, based on the existing driver.

Patch 1 adds an undocumented clock parent of the CSI MCLK. This was found after finding the default value to sometimes work and sometimes not, and then comparing against BSP code.

Patch 2 adds a compatible string for the A83T variant.

Patch 3 adds support for the A83T variant to the existing sun6i-csi driver.

Patch 4 adds a device node for the controller, as well as commonly used pin muxing options.

Patch 5 adds a pin muxing option for I2C1 on the PE pins, used in conjunction with the CSI pins.

Patch 6 provides an example usage of the CSI controller: the Bananapi M3 with its camera module attached.

Please have a look.

Regards
ChenYu

Chen-Yu Tsai (3):
dt-bindings: media: sun6i-csi: Add compatible string for A83T variant
media: sun6i: Support A83T variant
ARM: dts: sun8i: a83t: Add device node for CSI (Camera Sensor
Interface)

 .../devicetree/bindings/media/sun6i-csi.txt   |  1 +
 arch/arm/boot/dts/sun8i-a83t.dtsi             | 29 +++++++++++++++++++
 .../platform/sunxi/sun6i-csi/sun6i_csi.c      |  1 +
 3 files changed, 31 insertions(+)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/3 dt-bindings: media: sun6i-csi: Add compatible string for A83T variant

From: Chen-Yu Tsai <[email protected]>

The A83T SoC has a camera sensor interface (known as CSI in Allwinner lingo), which is similar to the one found on the A64 and H3. The only difference seems to be that support of MIPI CSI through a connected MIPI CSI-2 bridge.

Add a compatible string for this variant.

---
 Documentation/devicetree/bindings/media/sun6i-csi.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/media/sun6i-csi.txt +1 -0
index 0dd540bb03db..a2e3e56f0257 100644
@@ -6,6 +6,7 @@ Allwinner V3s SoC features a CSI module(CSI1) with parallel interface.
 Required properties:
   - compatible: value must be one of:
     * "allwinner,sun6i-a31-csi"
+    * "allwinner,sun8i-a83t-csi"
     * "allwinner,sun8i-h3-csi"
     * "allwinner,sun8i-v3s-csi"
     * "allwinner,sun50i-a64-csi"
Signature · 1 line
2.21.0
#2 lore raw

PATCH v2 2/3 media: sun6i: Support A83T variant

In reply to [email protected]

From: Chen-Yu Tsai <[email protected]>

The A83T SoC has a camera sensor interface (known as CSI in Allwinner lingo), which is similar to the one found on the A64 and H3. The only difference seems to be that support of MIPI CSI through a connected MIPI CSI-2 bridge.

Add support for this variant.

---
 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +1 -0
index 4c79eb64a7a7..6e0e894154f4 100644
@@ -924,6 +924,7 @@ static int sun6i_csi_remove(struct platform_device *pdev)
 
 static const struct of_device_id sun6i_csi_of_match[] = {
 	{ .compatible = "allwinner,sun6i-a31-csi", },
+	{ .compatible = "allwinner,sun8i-a83t-csi", },
 	{ .compatible = "allwinner,sun8i-h3-csi", },
 	{ .compatible = "allwinner,sun8i-v3s-csi", },
 	{ .compatible = "allwinner,sun50i-a64-csi", },
Signature · 1 line
2.21.0
#3 lore raw

PATCH v2 3/3 ARM: dts: sun8i: a83t: Add device node for CSI (Camera Sensor Interface)

In reply to [email protected]

From: Chen-Yu Tsai <[email protected]>

The A83T SoC has a camera sensor interface (known as CSI in Allwinner lingo), which is similar to the one found on the A64 and H3. The only difference seems to be that support of MIPI CSI through a connected MIPI CSI-2 bridge.

Add a device node for it, and pinctrl nodes for the commonly used MCLK and 8-bit parallel interface. The property /omit-if-no-ref/ is added to the pinctrl nodes to keep the device tree blob size down if they are unused.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +29 -0
index 392b0cabbf0d..ada6d08bc540 100644
@@ -679,6 +679,20 @@
 			#interrupt-cells = <3>;
 			#gpio-cells = <3>;
 
+			/omit-if-no-ref/
+			csi_8bit_parallel_pins: csi-8bit-parallel-pins {
+				pins = "PE0", "PE2", "PE3", "PE6", "PE7",
+				       "PE8", "PE9", "PE10", "PE11",
+				       "PE12", "PE13";
+				function = "csi";
+			};
+
+			/omit-if-no-ref/
+			csi_mclk_pin: csi-mclk-pin {
+				pins = "PE1";
+				function = "csi";
+			};
+
 			emac_rgmii_pins: emac-rgmii-pins {
 				pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7",
 				       "PD11", "PD12", "PD13", "PD14", "PD18",
@@ -997,6 +1011,21 @@
 			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
+		csi: camera@1cb0000 {
+			compatible = "allwinner,sun8i-a83t-csi";
+			reg = <0x01cb0000 0x1000>;
+			interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CSI>,
+				 <&ccu CLK_CSI_SCLK>,
+				 <&ccu CLK_DRAM_CSI>;
+			clock-names = "bus", "mod", "ram";
+			resets = <&ccu RST_BUS_CSI>;
+			status = "disabled";
+
+			csi_in: port {
+			};
+		};
+
 		hdmi: hdmi@1ee0000 {
 			compatible = "allwinner,sun8i-a83t-dw-hdmi";
 			reg = <0x01ee0000 0x10000>;
Signature · 1 line
2.21.0
#4 lore raw

Re: [PATCH v2 3/3] ARM: dts: sun8i: a83t: Add device node for CSI (Camera Sensor Interface)

Quoted 7 lines · On Mon, May 20, 2019 at 05:06:37PM +0200, [email protected] wrote:

From: Chen-Yu Tsai <[email protected]>

The A83T SoC has a camera sensor interface (known as CSI in Allwinner lingo), which is similar to the one found on the A64 and H3. The only difference seems to be that support of MIPI CSI through a connected MIPI CSI-2 bridge.

Quoted 7 lines

Add a device node for it, and pinctrl nodes for the commonly used MCLK and 8-bit parallel interface. The property /omit-if-no-ref/ is added to the pinctrl nodes to keep the device tree blob size down if they are unused.

Applied, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#5 lore raw
In reply to [email protected]
Quoted 10 lines · verejna

From: Ondrej Jirman <[email protected]>

This is a re-send of Chen-Yu's A83T CSI patch series with review tags applied and removed address/size cells from csi_in port. Already applied patches from v1 were dropped.

The series is ready to be merged:

Patch 1 and 2 via sunxi tree
Patch 3 via media tree

Sorry, wrong numbers. 2 is for media tree, 3 is for sunxi, 1 is a dt-bindings patch, where I'm not sure.

thanks,
Ondrej

Quoted 62 lines

v2:
- dropped address/size cells from csi_in port
- added review tags

Please take a look and merge.

Thank you,
Ondrej

--------------------------
Original description:

Hi everyone,

This series adds support for the camera sensor interface controller found on the Allwinner A83T SoC. The controller is similar to the one found on the H3, with the addition of a MIPI CSI-2 interface. However, this series only supports parallel and BT.656 interfaces, based on the existing driver.

Patch 1 adds an undocumented clock parent of the CSI MCLK. This was found after finding the default value to sometimes work and sometimes not, and then comparing against BSP code.

Patch 2 adds a compatible string for the A83T variant.

Patch 3 adds support for the A83T variant to the existing sun6i-csi driver.

Patch 4 adds a device node for the controller, as well as commonly used pin muxing options.

Patch 5 adds a pin muxing option for I2C1 on the PE pins, used in conjunction with the CSI pins.

Patch 6 provides an example usage of the CSI controller: the Bananapi M3 with its camera module attached.

Please have a look.

Regards
ChenYu

Chen-Yu Tsai (3):
dt-bindings: media: sun6i-csi: Add compatible string for A83T variant
media: sun6i: Support A83T variant
ARM: dts: sun8i: a83t: Add device node for CSI (Camera Sensor
Interface)

 .../devicetree/bindings/media/sun6i-csi.txt   |  1 +
 arch/arm/boot/dts/sun8i-a83t.dtsi             | 29 +++++++++++++++++++
 .../platform/sunxi/sun6i-csi/sun6i_csi.c      |  1 +
 3 files changed, 31 insertions(+)
Signature · 7 lines
2.21.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#6 lore raw
Quoted 8 lines · Ondřej Jirman
Quoted 6 lines · verejna

From: Ondrej Jirman <[email protected]>

This is a re-send of Chen-Yu's A83T CSI patch series with review tags applied and removed address/size cells from csi_in port. Already applied patches from v1 were dropped.

Quoted 7 lines
Quoted 4 lines

The series is ready to be merged:

Patch 1 and 2 via sunxi tree
Patch 3 via media tree

Sorry, wrong numbers. 2 is for media tree, 3 is for sunxi, 1 is a dt-bindings patch, where I'm not sure.

Bindings typically go with the driver.

Sakari, this series is and has been ready for some time since before the merge window. Could you please merge patches 1 and 2.

Thanks
ChenYu

Quoted 66 lines

thanks,
Ondrej

Quoted 62 lines

v2:
- dropped address/size cells from csi_in port
- added review tags

Please take a look and merge.

Thank you,
Ondrej

--------------------------
Original description:

Hi everyone,

This series adds support for the camera sensor interface controller found on the Allwinner A83T SoC. The controller is similar to the one found on the H3, with the addition of a MIPI CSI-2 interface. However, this series only supports parallel and BT.656 interfaces, based on the existing driver.

Patch 1 adds an undocumented clock parent of the CSI MCLK. This was found after finding the default value to sometimes work and sometimes not, and then comparing against BSP code.

Patch 2 adds a compatible string for the A83T variant.

Patch 3 adds support for the A83T variant to the existing sun6i-csi driver.

Patch 4 adds a device node for the controller, as well as commonly used pin muxing options.

Patch 5 adds a pin muxing option for I2C1 on the PE pins, used in conjunction with the CSI pins.

Patch 6 provides an example usage of the CSI controller: the Bananapi M3 with its camera module attached.

Please have a look.

Regards
ChenYu

Chen-Yu Tsai (3):
dt-bindings: media: sun6i-csi: Add compatible string for A83T variant
media: sun6i: Support A83T variant
ARM: dts: sun8i: a83t: Add device node for CSI (Camera Sensor
Interface)

 .../devicetree/bindings/media/sun6i-csi.txt   |  1 +
 arch/arm/boot/dts/sun8i-a83t.dtsi             | 29 +++++++++++++++++++
 .../platform/sunxi/sun6i-csi/sun6i_csi.c      |  1 +
 3 files changed, 31 insertions(+)

--
2.21.0

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

#7 lore raw

Hi Chen-Yu,

Quoted 14 lines · Chen-Yu Tsai
Quoted 13 lines · Ondřej Jirman
Quoted 10 lines · verejna

From: Ondrej Jirman <[email protected]>

This is a re-send of Chen-Yu's A83T CSI patch series with review tags applied and removed address/size cells from csi_in port. Already applied patches from v1 were dropped.

The series is ready to be merged:

Patch 1 and 2 via sunxi tree
Patch 3 via media tree

Quoted 7 lines
Quoted 2 lines

Sorry, wrong numbers. 2 is for media tree, 3 is for sunxi, 1 is a dt-bindings patch, where I'm not sure.

Bindings typically go with the driver.

Sakari, this series is and has been ready for some time since before the merge window. Could you please merge patches 1 and 2.

Don't wait, instead cc or ping me; that helps. :-)

The two patches are fine; I'll merge them.

Signature · 4 lines
Kind regards,

Sakari Ailus
[email protected]