Skip to contentSkip to conversation

ARM: sun8i: a83t: Support Camera Sensor Interface controller

PATCH Applied Chen-Yu Tsai 5 participants 25 messages Apr 8, 2019 – May 20, 2019

Subsystems (5)
lore
Share & tools
lore

Chen-Yu Tsai

author maintainer
#0 lore raw

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

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

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 (6):
clk: sunxi-ng: a83t: Add pll-video0 as parent of csi-mclk
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)
ARM: dts: sun8i: a83t: Add I2C2 pinmux setting for PE pins [DO NOT MERGE] ARM: dts: sun8i: a83t: bananapi-m3: Enable BPI OV5640
camera

 .../devicetree/bindings/media/sun6i-csi.txt   |   1 +
 arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts  | 101 ++++++++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi             |  37 +++++++
 drivers/clk/sunxi-ng/ccu-sun8i-a83t.c         |   5 +-
 .../platform/sunxi/sun6i-csi/sun6i_csi.c      |   1 +
 5 files changed, 143 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH 1/6 clk: sunxi-ng: a83t: Add pll-video0 as parent of csi-mclk

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

Allwinner's BSP for the A83T lists pll-video0 as the first parent to csi-mclk with index 0. This parent is not listed in the datasheet, but actually works, and makes more sense considering the index is the default value out of reset.

Add pll-video0 as a parent to csi-mclk with index 0.

Fixes 05359be1176b ("clk: sunxi-ng: Add driver for A83T CCU")
---
 drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clk/sunxi-ng/ccu-sun8i-a83t.c +3 -2
index 2d6555d73170..5f714b4d8ee4 100644
@@ -513,8 +513,9 @@ static SUNXI_CCU_GATE(csi_misc_clk, "csi-misc", "osc24M", 0x130, BIT(16), 0);
 
 static SUNXI_CCU_GATE(mipi_csi_clk, "mipi-csi", "osc24M", 0x130, BIT(31), 0);
 
-static const char * const csi_mclk_parents[] = { "pll-de", "osc24M" };
-static const u8 csi_mclk_table[] = { 3, 5 };
+static const char * const csi_mclk_parents[] = { "pll-video0", "pll-de",
+						 "osc24M" };
+static const u8 csi_mclk_table[] = { 0, 3, 5 };
 static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(csi_mclk_clk, "csi-mclk",
 				       csi_mclk_parents, csi_mclk_table,
 				       0x134,
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH 2/6 dt-bindings: media: sun6i-csi: Add compatible string for A83T variant

In reply to Chen-Yu Tsai

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.20.1
author maintainer
#6 lore raw

PATCH 3/6 media: sun6i: Support A83T variant

In reply to Chen-Yu Tsai

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.20.1
author maintainer
#8 lore raw

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

In reply to Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +31 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
 			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 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
 		hdmi: hdmi@1ee0000 {
 			compatible = "allwinner,sun8i-a83t-dw-hdmi";
 			reg = <0x01ee0000 0x10000>;
Signature · 1 line
2.20.1
author maintainer
#22 lore raw

PATCH 5/6 ARM: dts: sun8i: a83t: Add I2C2 pinmux setting for PE pins

In reply to Chen-Yu Tsai

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

I2C2 is available on the PE pingroup, on the same pins as the camera sensor interface (CSI) controller's camera control interface pins. This provides an option to use I2C2 instead of that control interface to configure camera sensors.

Add a pinctrl node for it. The property /omit-if-no-ref/ is added to keep the device tree blob size down if it is unused.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +6 -0
index 0c52f945fd5f..350ea40ea560 100644
@@ -723,6 +723,12 @@
 				function = "i2c1";
 			};
 
+			/omit-if-no-ref/
+			i2c2_pe_pins: i2c2-pe-pins {
+				pins = "PE14", "PE15";
+				function = "i2c2";
+			};
+
 			i2c2_ph_pins: i2c2-ph-pins {
 				pins = "PH4", "PH5";
 				function = "i2c2";
Signature · 1 line
2.20.1
author maintainer
#24 lore raw

PATCH 6/6 ARM: dts: sun8i: a83t: bananapi-m3: Enable BPI OV5640 camera

In reply to Chen-Yu Tsai

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

Bananapi produces a camera module specifically for the Bananapi M3. This module has an OV5640 sensor connected via the parallel CSI interface, and an OV8865 sensor connected via MIPI CSI. I2C2 is the shared control interface for them. The active-low reset signal is shared by the two sensors, while each sensor has a dedicated shutdown line. The module's onboard regulator provide power for the OV5640, while the Bananapi M3 provides power from the PMIC for the OV8865.

There's also a VM149C voice coil motor driver at I2C address 0x0c, and an unknown device responding on I2C address 0x20. Both are related to the OV8655 at address 0x36.

Since there is no support for the OV8865, this patch only enables the OV5640.

---
 arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts | 101 +++++++++++++++++++
 1 file changed, 101 insertions(+)
arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts +101 -0
index 838be7b3715f..11b27755207a 100644
@@ -85,6 +85,33 @@
 		};
 	};
 
+	reg_ov5640_avdd: ov5640-avdd {
+		compatible = "regulator-fixed";
+		regulator-name = "ov5640-avdd";
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+		/* dldo4 enables this regulator; real supply is PS */
+		vin-supply = <&reg_dldo4>;
+	};
+
+	reg_ov5640_dovdd: ov5640-iovdd {
+		compatible = "regulator-fixed";
+		regulator-name = "ov5640-dovdd";
+		regulator-min-microvolt = <2800000>;
+		regulator-max-microvolt = <2800000>;
+		/* dldo4 enables this regulator; real supply is PS */
+		vin-supply = <&reg_dldo4>;
+	};
+
+	reg_ov5640_dvdd: ov5640-dvdd {
+		compatible = "regulator-fixed";
+		regulator-name = "ov5640-dvdd";
+		regulator-min-microvolt = <1500000>;
+		regulator-max-microvolt = <1500000>;
+		/* dldo4 enables this regulator; real supply is PS */
+		vin-supply = <&reg_dldo4>;
+	};
+
 	reg_usb1_vbus: reg-usb1-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb1-vbus";
@@ -115,6 +142,30 @@
 	cpu-supply = <&reg_dcdc3>;
 };
 
+&ccu {
+	/* Use a stable clock source with known fixed rate for MCLK */
+	assigned-clocks = <&ccu CLK_CSI_MCLK>;
+	assigned-clock-parents = <&osc24M>;
+	assigned-clock-rates = <24000000>;
+};
+
+&csi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&csi_8bit_parallel_pins>;
+	status = "okay";
+};
+
+&csi_in {
+	csi_from_ov5640: endpoint {
+		remote-endpoint = <&ov5640_to_csi>;
+		bus-width = <8>;
+		data-shift = <2>;
+		hsync-active = <1>;     /* Active high */
+		vsync-active = <1>;     /* Active high */
+		pclk-sample = <1>;      /* Rising */
+	};
+};
+
 &de {
 	status = "okay";
 };
@@ -147,6 +198,36 @@
 	};
 };
 
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_pe_pins>;
+	status = "okay";
+
+	ov5640: camera@3c {
+		compatible = "ovti,ov5640";
+		reg = <0x3c>;
+		clocks = <&ccu CLK_CSI_MCLK>;
+		clock-names = "xclk";
+		AVDD-supply = <&reg_ov5640_avdd>;
+		DOVDD-supply = <&reg_ov5640_dovdd>;
+		DVDD-supply = <&reg_ov5640_dvdd>;
+		powerdown-gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; /* PD15 */
+		reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
+		rotation = <180>;
+
+		port {
+			ov5640_to_csi: endpoint {
+				remote-endpoint = <&csi_from_ov5640>;
+				bus-width = <8>;
+				data-shift = <2>;
+				hsync-active = <1>;     /* Active high */
+				vsync-active = <1>;     /* Active high */
+				pclk-sample = <1>;      /* Rising */
+			};
+		};
+	};
+};
+
 &mdio {
 	rgmii_phy: ethernet-phy@1 {
 		compatible = "ethernet-phy-ieee802.3-c22";
@@ -191,6 +272,12 @@
 	status = "okay";
 };
 
+&pio {
+	/* pinctrl hog: MCLK is shared by both camera sensors */
+	pinctrl-names = "default";
+	pinctrl-0 = <&csi_mclk_pin>;
+};
+
 &r_cir {
 	clock-frequency = <3000000>;
 	status = "okay";
@@ -327,11 +414,25 @@
 	regulator-name = "vcc-pd";
 };
 
+&reg_dldo4 {
+	/* This also powers the pull-ups on the CSI connector */
+	regulator-always-on;
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+	regulator-name = "avdd-csi";
+};
+
 &reg_drivevbus {
 	regulator-name = "usb0-vbus";
 	status = "okay";
 };
 
+&reg_eldo1 {
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "dvdd-csi-r";
+};
+
 &reg_fldo1 {
 	regulator-min-microvolt = <1080000>;
 	regulator-max-microvolt = <1320000>;
Signature · 1 line
2.20.1
Acked-by on v1 3/6
#7 lore raw

Re: [PATCH 3/6] media: sun6i: Support A83T variant

In reply to Chen-Yu Tsai
Quoted 10 lines · Chen-Yu Tsai

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.

Maxime

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

#2 lore raw

Re: [PATCH 1/6] clk: sunxi-ng: a83t: Add pll-video0 as parent of csi-mclk

In reply to Chen-Yu Tsai
Quoted 11 lines · Chen-Yu Tsai

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

Allwinner's BSP for the A83T lists pll-video0 as the first parent to csi-mclk with index 0. This parent is not listed in the datasheet, but actually works, and makes more sense considering the index is the default value out of reset.

Add pll-video0 as a parent to csi-mclk with index 0.

Fixes 05359be1176b ("clk: sunxi-ng: Add driver for A83T CCU")

Applied, thanks!
Maxime

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

Acked-by on v1 2/6
#4 lore raw

Re: [PATCH 2/6] dt-bindings: media: sun6i-csi: Add compatible string for A83T variant

In reply to Chen-Yu Tsai
Quoted 10 lines · Chen-Yu Tsai

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.

Maxime

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

#9 lore raw

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

In reply to Chen-Yu Tsai

Hi,

Quoted 50 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +18 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
 			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>;

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 10 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +10 -0
+			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 {
+				#address-cells = <1>;
+				#size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Maxime

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

#23 lore raw

Re: [PATCH 5/6] ARM: dts: sun8i: a83t: Add I2C2 pinmux setting for PE pins

In reply to Chen-Yu Tsai
Quoted 11 lines · Chen-Yu Tsai

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

I2C2 is available on the PE pingroup, on the same pins as the camera sensor interface (CSI) controller's camera control interface pins. This provides an option to use I2C2 instead of that control interface to configure camera sensors.

Add a pinctrl node for it. The property /omit-if-no-ref/ is added to keep the device tree blob size down if it is unused.

Applied, thanks!
Maxime

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

author maintainer
#10 lore raw

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

In reply to Maxime Ripard
Quoted 59 lines · Maxime Ripard

Hi,

Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

ChenYu

#11 lore raw

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

Quoted 66 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Quoted 8 lines

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Maxime

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

author maintainer
#12 lore raw

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

Quoted 74 lines · Maxime Ripard
Quoted 72 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

Quoted 8 lines
Quoted 2 lines

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Makes sense. Do you want me to re-spin?

#13 lore raw

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

Quoted 78 lines · Chen-Yu Tsai
Quoted 77 lines · Maxime Ripard
Quoted 74 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Quoted 7 lines
Quoted 5 lines

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Makes sense. Do you want me to re-spin?

If there's no other comment, we'll fix it when applying.

Maxime

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

#19 lore raw

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

In reply to Maxime Ripard
Quoted 73 lines · Maxime Ripard
Quoted 72 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

Quoted 8 lines
Quoted 2 lines

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

I'm planning on having two sensors there, in a less arcane setup, though - no shared resets, and different I2C addresses.

Anyway, I can confirm that CSI driver works fine on A83T with just a DTSI patch, even without the clock patch in this series. I've been running it for quite a while that way without any issues (different camera chip than the ones being used by wens).

regards,

	o.
Quoted 13 lines

Maxime

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

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

#20 lore raw

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

Hi,

Quoted 83 lines · Ondřej Jirman
Quoted 73 lines · Maxime Ripard
Quoted 72 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

Quoted 8 lines
Quoted 2 lines

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Quoted 7 lines

I'm planning on having two sensors there, in a less arcane setup, though - no shared resets, and different I2C addresses.

Anyway, I can confirm that CSI driver works fine on A83T with just a DTSI patch, even without the clock patch in this series. I've been running it for quite a while that way without any issues (different camera chip than the ones being used by wens).

That's quite nice to hear! I would be interested in getting some insight on which sensors are known to work and which are broken or have limitations.

Would you happen to have a list of the sensors that you tested and whether you encountered such issues with them?

Cheers,

Paul

Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#21 lore raw

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

Quoted 26 lines · Paul Kocialkowski
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

Quoted 8 lines
Quoted 2 lines

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Quoted 7 lines

I'm planning on having two sensors there, in a less arcane setup, though - no shared resets, and different I2C addresses.

Anyway, I can confirm that CSI driver works fine on A83T with just a DTSI patch, even without the clock patch in this series. I've been running it for quite a while that way without any issues (different camera chip than the ones being used by wens).

Quoted 6 lines

That's quite nice to hear! I would be interested in getting some insight on which sensors are known to work and which are broken or have limitations.

Would you happen to have a list of the sensors that you tested and whether you encountered such issues with them?

I wrote the driver for the sensor I'm using, so the issues were mostly during the development. It's Himax HM5065 sensor (not yet upstream).

If you try using other mainline sensors, the issues you'll face will mostly be configuring the buses (CSI, I2C) correctly in DTS, or lack of support for some VSYNC/HSYNC combinations on the sensor driver side. Luckily, CSI controller is quite flexible, and will accomodate lack of configurability on the sensor side.

regards,
o.

Quoted 9 lines

Cheers,

Paul

Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
maintainer Reviewed-by on v1 2/6
#5 lore raw

Re: [PATCH 2/6] dt-bindings: media: sun6i-csi: Add compatible string for A83T variant

In reply to Chen-Yu Tsai
Quoted 7 lines · Chen-Yu Tsai

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 compatible string for this variant.

---
 Documentation/devicetree/bindings/media/sun6i-csi.txt | 1 +
 1 file changed, 1 insertion(+)
#14 lore raw

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

In reply to Maxime Ripard

Hi Maxime,

Quoted 82 lines · Maxime Ripard
Quoted 81 lines · Chen-Yu Tsai
Quoted 80 lines · Maxime Ripard
Quoted 66 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Quoted 8 lines

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Makes sense. Do you want me to re-spin?

If there's no other comment, we'll fix it when applying.

This patch series seems to have been forgotten. It doesn't seem there are any blockers. Can you please apply it now? I have some further series (camera module support for TBS-A711) that depend on this.

thank you and regards,
Ondrej

Quoted 13 lines

Maxime

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

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

#15 lore raw

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

Hi Ondřej,

Quoted 86 lines · Ondřej Jirman
Quoted 85 lines · Maxime Ripard
Quoted 84 lines · Chen-Yu Tsai
Quoted 82 lines · Maxime Ripard
Quoted 66 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Quoted 8 lines

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Makes sense. Do you want me to re-spin?

If there's no other comment, we'll fix it when applying.

This patch series seems to have been forgotten. It doesn't seem there are any blockers.

Sorry about that :/

Quoted 2 lines

Can you please apply it now? I have some further series (camera module support for TBS-A711) that depend on this.

Some parts of it will have to be merged through v4l2, and I can't apply those patches.

Can you resend that series, and ping on a regular basis (like once a week) if you don't get any feedback?

Thanks!
Maxime

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

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

#16 lore raw

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

Hi Maxime,

Quoted 98 lines · Maxime Ripard

Hi Ondřej,

Quoted 86 lines · Ondřej Jirman
Quoted 85 lines · Maxime Ripard
Quoted 84 lines · Chen-Yu Tsai
Quoted 82 lines · Maxime Ripard
Quoted 66 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Quoted 8 lines

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Makes sense. Do you want me to re-spin?

If there's no other comment, we'll fix it when applying.

This patch series seems to have been forgotten. It doesn't seem there are any blockers.

Sorry about that :/

Quoted 8 lines
Quoted 2 lines

Can you please apply it now? I have some further series (camera module support for TBS-A711) that depend on this.

Some parts of it will have to be merged through v4l2, and I can't apply those patches.

Can you resend that series, and ping on a regular basis (like once a week) if you don't get any feedback?

You mean this series for A83t CSI?

regards,

	o.
Quoted 14 lines

Thanks!
Maxime

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

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

#17 lore raw

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

Quoted 104 lines · Ondřej Jirman

Hi Maxime,

Quoted 101 lines · Maxime Ripard

Hi Ondřej,

Quoted 86 lines · Ondřej Jirman
Quoted 85 lines · Maxime Ripard
Quoted 84 lines · Chen-Yu Tsai
Quoted 82 lines · Maxime Ripard
Quoted 66 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Quoted 8 lines

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Makes sense. Do you want me to re-spin?

If there's no other comment, we'll fix it when applying.

This patch series seems to have been forgotten. It doesn't seem there are any blockers.

Sorry about that :/

Quoted 2 lines

Can you please apply it now? I have some further series (camera module support for TBS-A711) that depend on this.

Quoted 7 lines
Quoted 5 lines

Some parts of it will have to be merged through v4l2, and I can't apply those patches.

Can you resend that series, and ping on a regular basis (like once a week) if you don't get any feedback?

You mean this series for A83t CSI?

Yes

Maxime

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

#18 lore raw

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

Quoted 108 lines · Maxime Ripard
Quoted 107 lines · Ondřej Jirman

Hi Maxime,

Quoted 104 lines · Maxime Ripard

Hi Ondřej,

Quoted 86 lines · Ondřej Jirman
Quoted 85 lines · Maxime Ripard
Quoted 84 lines · Chen-Yu Tsai
Quoted 82 lines · Maxime Ripard
Quoted 66 lines · Chen-Yu Tsai
Quoted 56 lines · Maxime Ripard
Quoted 55 lines · Chen-Yu Tsai

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 | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +23 -0
index f739b88efb53..0c52f945fd5f 100644
@@ -682,6 +682,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",
@@ -994,6 +1008,23 @@
                      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>;
Quoted 8 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 1024

Quoted 5 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +5 -0
+                     status = "disabled";
+
+                     csi_in: port {
+                             #address-cells = <1>;
+                             #size-cells = <0>;

If we expect a single enpoint, then we don't need the address-cells and size-cells properties.

Quoted 8 lines

I wouldn't bet on anything. The way the Q8 tablets did front/back cameras is kind of genius if not very hacky. They have two "identical" sensors on the same I2C bus and CSI bus, with shared reset line but separate shutdown lines. Since they are identical, they also have the same I2C address. I haven't figured out how to model this in the device tree.

The point is, it's perfectly possible to have two or more sensors use the same controller, provided only one be active at a time.

Right, but I guess the common case would be to have a single sensor, where that wouldn't be needed.

In odd cases, we can always specify it in the DTS, and if it becomes common enough, we can move it to the DTSI.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Makes sense. Do you want me to re-spin?

If there's no other comment, we'll fix it when applying.

This patch series seems to have been forgotten. It doesn't seem there are any blockers.

Sorry about that :/

Quoted 2 lines

Can you please apply it now? I have some further series (camera module support for TBS-A711) that depend on this.

Some parts of it will have to be merged through v4l2, and I can't apply those patches.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Can you resend that series, and ping on a regular basis (like once a week) if you don't get any feedback?

You mean this series for A83t CSI?

Yes

Ok, done. :)

regards,
Ondrej

Quoted 13 lines

Maxime

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

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