* [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support
@ 2020-01-06 8:42 Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 1/7] ARM: dts: sun4i: Add CSI1 controller and pinmux options Chen-Yu Tsai
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
Hi everyone,
This is v2 of my A10/A20 CSI1 and R40 CSI0 series. v2 is simply the
remaining patches rebased on top of linux-next 20200106, with the
MBUS device tree binding changes converted to YAML format.
This series adds basic support for CSI1 on Allwinner A10/A20 and CSI0 on
Allwinner R40. The CSI1 block has the same structure and layout as the
CSI0 block. Differences include:
- Only one channel in BT.656 instead of four in CSI0
- 10-bit raw data input vs 8-bit in CSI0
- 24-bit RGB888/YUV444 input vs 16-bit RGB565/YUV422 in CSI0
- No ISP hardware (CSI SCLK not needed)
The CSI0 block in the Allwinner R40 SoC looks to be the same as the one
in the A20. The register maps line up, and they support the same
features. The R40 appears to support BT.1120 based on the feature
overview, but it is not mentioned anywhere else. Also like the A20, the
ISP is not mentioned, but the CSI special clock needs to be enabled for
the hardware to function. The manual does state that the CSI special
clock is the TOP clock for all CSI hardware, but currently no hardware
exists for us to test if CSI1 also depends on it or not.
Included are a couple of fixes for signal polarity and DRAM offset
handling.
Patches 1 and 2 add CSI1 to A10 (sun4i) and A20 (sun7i) dtsi files.
Patch 3 adds a compatible string for the R40's MBUS (memory bus).
This patch needs to go through Rob's tree as it now depends on
the patch "dt-bindings: interconnect: Convert Allwinner MBUS
controller to a schema" that was already merged.
Patch 4 adds CSI0 to the R40 dtsi file
Patches 5 through 7 are examples of cameras hooked up to boards.
Regards
ChenYu
Chen-Yu Tsai (7):
ARM: dts: sun4i: Add CSI1 controller and pinmux options
ARM: dts: sun7i: Add CSI1 controller and pinmux options
dt-bindings: bus: sunxi: Add R40 MBUS compatible
ARM: dts: sun8i: r40: Add device node for CSI0
[DO NOT MERGE] ARM: dts: sun4i: cubieboard: Enable OV7670 camera on
CSI1
[DO NOT MERGE] ARM: dts: sun7i: cubieboard2: Enable OV7670 camera on
CSI1
[DO NOT MERGE] ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable OV5640
camera
.../arm/sunxi/allwinner,sun4i-a10-mbus.yaml | 1 +
arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 42 ++++++++++++
arch/arm/boot/dts/sun4i-a10.dtsi | 35 ++++++++++
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 42 ++++++++++++
arch/arm/boot/dts/sun7i-a20.dtsi | 36 ++++++++++
.../boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 67 +++++++++++++++++++
arch/arm/boot/dts/sun8i-r40.dtsi | 36 ++++++++++
7 files changed, 259 insertions(+)
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/7] ARM: dts: sun4i: Add CSI1 controller and pinmux options
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 2/7] ARM: dts: sun7i: " Chen-Yu Tsai
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
The CSI controller driver now supports the second CSI controller, CSI1.
Add a device node for it. Pinmuxing options for the MCLK output, the
standard 8-bit interface, and a secondary 24-bit interface are included.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 35 ++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 4c268b70b735..bf531efc0610 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -624,6 +624,16 @@ ohci1: usb@1c1c400 {
status = "disabled";
};
+ csi1: csi@1c1d000 {
+ compatible = "allwinner,sun4i-a10-csi1";
+ reg = <0x01c1d000 0x1000>;
+ interrupts = <43>;
+ clocks = <&ccu CLK_AHB_CSI1>, <&ccu CLK_DRAM_CSI1>;
+ clock-names = "bus", "ram";
+ resets = <&ccu RST_CSI1>;
+ status = "disabled";
+ };
+
spi3: spi@1c1f000 {
compatible = "allwinner,sun4i-a10-spi";
reg = <0x01c1f000 0x1000>;
@@ -670,6 +680,31 @@ can0_ph_pins: can0-ph-pins {
function = "can";
};
+ /omit-if-no-ref/
+ csi1_8bits_pg_pins: csi1-8bits-pg-pins {
+ pins = "PG0", "PG2", "PG3", "PG4", "PG5",
+ "PG6", "PG7", "PG8", "PG9", "PG10",
+ "PG11";
+ function = "csi1";
+ };
+
+ /omit-if-no-ref/
+ csi1_24bits_ph_pins: csi1-24bits-ph-pins {
+ pins = "PH0", "PH1", "PH2", "PH3", "PH4",
+ "PH5", "PH6", "PH7", "PH8", "PH9",
+ "PH10", "PH11", "PH12", "PH13", "PH14",
+ "PH15", "PH16", "PH17", "PH18", "PH19",
+ "PH20", "PH21", "PH22", "PH23", "PH24",
+ "PH25", "PH26", "PH27";
+ function = "csi1";
+ };
+
+ /omit-if-no-ref/
+ csi1_clk_pg_pin: csi1-clk-pg-pin {
+ pins = "PG1";
+ function = "csi1";
+ };
+
emac_pins: emac0-pins {
pins = "PA0", "PA1", "PA2",
"PA3", "PA4", "PA5", "PA6",
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/7] ARM: dts: sun7i: Add CSI1 controller and pinmux options
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 1/7] ARM: dts: sun4i: Add CSI1 controller and pinmux options Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible Chen-Yu Tsai
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
The CSI controller driver now supports the second CSI controller, CSI1.
Add a device node for it. Pinmuxing options for the MCLK output, the
standard 8-bit interface, and a secondary 24-bit interface are included.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun7i-a20.dtsi | 36 ++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index 8aebefd6accf..92b5be97085d 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -729,6 +729,17 @@ ohci1: usb@1c1c400 {
status = "disabled";
};
+ csi1: csi@1c1d000 {
+ compatible = "allwinner,sun7i-a20-csi1",
+ "allwinner,sun4i-a10-csi1";
+ reg = <0x01c1d000 0x1000>;
+ interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_AHB_CSI1>, <&ccu CLK_DRAM_CSI1>;
+ clock-names = "bus", "ram";
+ resets = <&ccu RST_CSI1>;
+ status = "disabled";
+ };
+
spi3: spi@1c1f000 {
compatible = "allwinner,sun4i-a10-spi";
reg = <0x01c1f000 0x1000>;
@@ -802,6 +813,31 @@ csi0_clk_pin: csi-clk-pin {
function = "csi0";
};
+ /omit-if-no-ref/
+ csi1_8bits_pg_pins: csi1-8bits-pg-pins {
+ pins = "PG0", "PG2", "PG3", "PG4", "PG5",
+ "PG6", "PG7", "PG8", "PG9", "PG10",
+ "PG11";
+ function = "csi1";
+ };
+
+ /omit-if-no-ref/
+ csi1_24bits_ph_pins: csi1-24bits-ph-pins {
+ pins = "PH0", "PH1", "PH2", "PH3", "PH4",
+ "PH5", "PH6", "PH7", "PH8", "PH9",
+ "PH10", "PH11", "PH12", "PH13", "PH14",
+ "PH15", "PH16", "PH17", "PH18", "PH19",
+ "PH20", "PH21", "PH22", "PH23", "PH24",
+ "PH25", "PH26", "PH27";
+ function = "csi1";
+ };
+
+ /omit-if-no-ref/
+ csi1_clk_pg_pin: csi1-clk-pg-pin {
+ pins = "PG1";
+ function = "csi1";
+ };
+
/omit-if-no-ref/
emac_pa_pins: emac-pa-pins {
pins = "PA0", "PA1", "PA2",
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 1/7] ARM: dts: sun4i: Add CSI1 controller and pinmux options Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 2/7] ARM: dts: sun7i: " Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:51 ` Maxime Ripard
2020-01-06 8:42 ` [PATCH v2 4/7] ARM: dts: sun8i: r40: Add device node for CSI0 Chen-Yu Tsai
` (4 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
Allwinner R40 SoC also contains MBUS controller.
Add compatible for it.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Changes since v1:
- Reworked on top of "dt-bindings: interconnect: Convert Allwinner
MBUS controller to a schema"
This particular patch should go through Rob's tree, instead of the
sunxi tree.
---
.../devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml b/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
index 9370e64992dd..23cda7437dcb 100644
--- a/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
@@ -30,6 +30,7 @@ properties:
enum:
- allwinner,sun5i-a13-mbus
- allwinner,sun8i-h3-mbus
+ - allwinner,sun8i-r40-mbus
reg:
maxItems: 1
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/7] ARM: dts: sun8i: r40: Add device node for CSI0
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
` (2 preceding siblings ...)
2020-01-06 8:42 ` [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 5/7] [DO NOT MERGE] ARM: dts: sun4i: cubieboard: Enable OV7670 camera on CSI1 Chen-Yu Tsai
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
The CSI0 and CSI1 blocks are the same as found on the A20. However only
CSI0 is supported upstream right now.
Add a device node for CSI0 using the A20 compatible as a fallback, and
the standard pinctrl options. Also add the MBUS interconnect.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun8i-r40.dtsi | 36 ++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 7c940b20b81c..84d240c39f0f 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -181,6 +181,20 @@ nmi_intc: interrupt-controller@1c00030 {
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
};
+ csi0: csi@1c09000 {
+ compatible = "allwinner,sun8i-r40-csi0",
+ "allwinner,sun7i-a20-csi0";
+ reg = <0x01c09000 0x1000>;
+ interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_CSI0>, <&ccu CLK_CSI_SCLK>,
+ <&ccu CLK_DRAM_CSI0>;
+ clock-names = "bus", "isp", "ram";
+ resets = <&ccu RST_BUS_CSI0>;
+ interconnects = <&mbus 5>;
+ interconnect-names = "dma-mem";
+ status = "disabled";
+ };
+
mmc0: mmc@1c0f000 {
compatible = "allwinner,sun8i-r40-mmc",
"allwinner,sun50i-a64-mmc";
@@ -356,6 +370,20 @@ clk_out_a_pin: clk-out-a-pin {
function = "clk_out_a";
};
+ /omit-if-no-ref/
+ csi0_8bits_pins: csi0-8bits-pins {
+ pins = "PE0", "PE2", "PE3", "PE4", "PE5",
+ "PE6", "PE7", "PE8", "PE9", "PE10",
+ "PE11";
+ function = "csi0";
+ };
+
+ /omit-if-no-ref/
+ csi0_mclk_pin: csi0-mclk-pin {
+ pins = "PE1";
+ function = "csi0";
+ };
+
gmac_rgmii_pins: gmac-rgmii-pins {
pins = "PA0", "PA1", "PA2", "PA3",
"PA4", "PA5", "PA6", "PA7",
@@ -625,6 +653,14 @@ gmac_mdio: mdio {
};
};
+ mbus: dram-controller@1c62000 {
+ compatible = "allwinner,sun8i-r40-mbus";
+ reg = <0x01c62000 0x1000>;
+ clocks = <&ccu 155>;
+ dma-ranges = <0x00000000 0x40000000 0x80000000>;
+ #interconnect-cells = <1>;
+ };
+
tcon_top: tcon-top@1c70000 {
compatible = "allwinner,sun8i-r40-tcon-top";
reg = <0x01c70000 0x1000>;
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/7] [DO NOT MERGE] ARM: dts: sun4i: cubieboard: Enable OV7670 camera on CSI1
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
` (3 preceding siblings ...)
2020-01-06 8:42 ` [PATCH v2 4/7] ARM: dts: sun8i: r40: Add device node for CSI0 Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 6/7] [DO NOT MERGE] ARM: dts: sun7i: cubieboard2: " Chen-Yu Tsai
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
The Cubieboard has CSI1 pins exposed on one of its GPIO headers.
Combined with I2C1 on the same header, a connected OV7670 based
camera module can be used. Power is provided via the 5V rail on
the same header. The module has onboard LDOs for the sensor's
various power rails.
Add a device node for the sensor, enable CSI1 and I2C1, and hook
everything up.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 42 ++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
index 6ca02e824acc..29bfec8fad5b 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
@@ -101,6 +101,25 @@ &cpu0 {
cpu-supply = <®_dcdc2>;
};
+&csi1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi1_8bits_pg_pins>;
+ status = "okay";
+
+ port {
+ /* Parallel bus endpoint */
+ csi_from_ov7670: endpoint {
+ remote-endpoint = <&ov7670_to_csi>;
+ bus-width = <8>;
+ /* driver is broken */
+ hsync-active = <0>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+};
+
&de {
status = "okay";
};
@@ -143,6 +162,29 @@ axp209: pmic@34 {
&i2c1 {
status = "okay";
+
+ ov7670: camera@21 {
+ compatible = "ovti,ov7670";
+ reg = <0x21>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi1_clk_pg_pin>;
+ clocks = <&ccu CLK_CSI1>;
+ clock-names = "xclk";
+
+ reset-gpios = <&pio 7 14 GPIO_ACTIVE_LOW>; /* PH14 */
+ powerdown-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
+
+ port {
+ ov7670_to_csi: endpoint {
+ remote-endpoint = <&csi_from_ov7670>;
+ bus-width = <8>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+ };
};
&ir0 {
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 6/7] [DO NOT MERGE] ARM: dts: sun7i: cubieboard2: Enable OV7670 camera on CSI1
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
` (4 preceding siblings ...)
2020-01-06 8:42 ` [PATCH v2 5/7] [DO NOT MERGE] ARM: dts: sun4i: cubieboard: Enable OV7670 camera on CSI1 Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 7/7] [DO NOT MERGE] ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable OV5640 camera Chen-Yu Tsai
2020-01-06 8:52 ` [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Maxime Ripard
7 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
The Cubieboard2 has CSI1 pins exposed on one of its GPIO headers.
Combined with I2C1 on the same header, a connected OV7670 based
camera module can be used. Power is provided via the 5V rail on
the same header. The module has onboard LDOs for the sensor's
various power rails.
Add a device node for the sensor, enable CSI1 and I2C1, and hook
everything up.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 42 +++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
index b8203e4ef21c..0ff1593041eb 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
@@ -100,6 +100,25 @@ &cpu0 {
cpu-supply = <®_dcdc2>;
};
+&csi1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi1_8bits_pg_pins>;
+ status = "okay";
+
+ port {
+ /* Parallel bus endpoint */
+ csi_from_ov7670: endpoint {
+ remote-endpoint = <&ov7670_to_csi>;
+ bus-width = <8>;
+ /* driver is broken */
+ hsync-active = <0>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+};
+
&de {
status = "okay";
};
@@ -142,6 +161,29 @@ axp209: pmic@34 {
&i2c1 {
status = "okay";
+
+ ov7670: camera@21 {
+ compatible = "ovti,ov7670";
+ reg = <0x21>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi1_clk_pg_pin>;
+ clocks = <&ccu CLK_CSI1>;
+ clock-names = "xclk";
+
+ reset-gpios = <&pio 7 14 GPIO_ACTIVE_LOW>; /* PH14 */
+ powerdown-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
+
+ port {
+ ov7670_to_csi: endpoint {
+ remote-endpoint = <&csi_from_ov7670>;
+ bus-width = <8>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+ };
};
&ir0 {
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 7/7] [DO NOT MERGE] ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable OV5640 camera
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
` (5 preceding siblings ...)
2020-01-06 8:42 ` [PATCH v2 6/7] [DO NOT MERGE] ARM: dts: sun7i: cubieboard2: " Chen-Yu Tsai
@ 2020-01-06 8:42 ` Chen-Yu Tsai
2020-01-06 8:52 ` [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Maxime Ripard
7 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-01-06 8:42 UTC (permalink / raw)
To: Maxime Ripard, Rob Herring, Mark Rutland
Cc: devicetree, Chen-Yu Tsai, linux-kernel, linux-arm-kernel
From: Chen-Yu Tsai <wens@csie.org>
Bananapi offers a small OV5640 based camera module, attached via an FPC
connector.
Add the related regulator constraints, and hook everything up.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
.../boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 67 +++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index 42d62d1ba1dc..86183d40c7af 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -113,6 +113,24 @@ &ahci {
status = "okay";
};
+&csi0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi0_8bits_pins>;
+ status = "okay";
+
+ port {
+ /* Parallel bus endpoint */
+ csi0_from_ov5640: endpoint {
+ remote-endpoint = <&ov5640_to_csi0>;
+ bus-width = <8>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+};
+
&de {
status = "okay";
};
@@ -164,6 +182,37 @@ axp22x: pmic@34 {
#include "axp22x.dtsi"
+&i2c4 {
+ status = "okay";
+
+ ov5640: camera@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&csi0_mclk_pin>;
+ clocks = <&ccu CLK_CSI0_MCLK>;
+ clock-names = "xclk";
+
+ reset-gpios = <&pio 8 7 GPIO_ACTIVE_LOW>; /* PI7 */
+ powerdown-gpios = <&pio 8 6 GPIO_ACTIVE_HIGH>; /* PI6 */
+ AVDD-supply = <®_aldo1>;
+ DOVDD-supply = <®_eldo1>;
+ DVDD-supply = <®_eldo2>;
+
+ port {
+ ov5640_to_csi0: endpoint {
+ remote-endpoint = <&csi0_from_ov5640>;
+ bus-width = <8>;
+ data-shift = <2>;
+ hsync-active = <1>; /* Active high */
+ vsync-active = <1>; /* Active high */
+ data-active = <1>; /* Active high */
+ pclk-sample = <1>; /* Rising */
+ };
+ };
+ };
+};
+
&mmc0 {
vmmc-supply = <®_dcdc1>;
bus-width = <4>;
@@ -209,6 +258,12 @@ &pio {
vcc-pg-supply = <®_dldo1>;
};
+®_aldo1 {
+ regulator-name = "csi-avdd";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+};
+
®_aldo2 {
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
@@ -289,6 +344,18 @@ ®_dldo4 {
regulator-name = "vdd2v5-sata";
};
+®_eldo1 {
+ regulator-name = "csi-iovcc";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+};
+
+®_eldo2 {
+ regulator-name = "csi-dvdd";
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+};
+
®_eldo3 {
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
--
2.24.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible
2020-01-06 8:42 ` [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible Chen-Yu Tsai
@ 2020-01-06 8:51 ` Maxime Ripard
2020-03-12 5:36 ` Chen-Yu Tsai
0 siblings, 1 reply; 11+ messages in thread
From: Maxime Ripard @ 2020-01-06 8:51 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Mark Rutland, devicetree, linux-kernel, Chen-Yu Tsai, Rob Herring,
linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 289 bytes --]
On Mon, Jan 06, 2020 at 04:42:36PM +0800, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <wens@csie.org>
>
> Allwinner R40 SoC also contains MBUS controller.
>
> Add compatible for it.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
` (6 preceding siblings ...)
2020-01-06 8:42 ` [PATCH v2 7/7] [DO NOT MERGE] ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable OV5640 camera Chen-Yu Tsai
@ 2020-01-06 8:52 ` Maxime Ripard
7 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2020-01-06 8:52 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Mark Rutland, devicetree, linux-kernel, Chen-Yu Tsai, Rob Herring,
linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1828 bytes --]
On Mon, Jan 06, 2020 at 04:42:33PM +0800, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <wens@csie.org>
>
> Hi everyone,
>
> This is v2 of my A10/A20 CSI1 and R40 CSI0 series. v2 is simply the
> remaining patches rebased on top of linux-next 20200106, with the
> MBUS device tree binding changes converted to YAML format.
>
> This series adds basic support for CSI1 on Allwinner A10/A20 and CSI0 on
> Allwinner R40. The CSI1 block has the same structure and layout as the
> CSI0 block. Differences include:
>
> - Only one channel in BT.656 instead of four in CSI0
> - 10-bit raw data input vs 8-bit in CSI0
> - 24-bit RGB888/YUV444 input vs 16-bit RGB565/YUV422 in CSI0
> - No ISP hardware (CSI SCLK not needed)
>
> The CSI0 block in the Allwinner R40 SoC looks to be the same as the one
> in the A20. The register maps line up, and they support the same
> features. The R40 appears to support BT.1120 based on the feature
> overview, but it is not mentioned anywhere else. Also like the A20, the
> ISP is not mentioned, but the CSI special clock needs to be enabled for
> the hardware to function. The manual does state that the CSI special
> clock is the TOP clock for all CSI hardware, but currently no hardware
> exists for us to test if CSI1 also depends on it or not.
>
> Included are a couple of fixes for signal polarity and DRAM offset
> handling.
>
> Patches 1 and 2 add CSI1 to A10 (sun4i) and A20 (sun7i) dtsi files.
>
> Patch 3 adds a compatible string for the R40's MBUS (memory bus).
> This patch needs to go through Rob's tree as it now depends on
> the patch "dt-bindings: interconnect: Convert Allwinner MBUS
> controller to a schema" that was already merged.
>
> Patch 4 adds CSI0 to the R40 dtsi file
>
> Patches 5 through 7 are examples of cameras hooked up to boards.
Applied 1,2 and 4, thanks!
Maxime
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible
2020-01-06 8:51 ` Maxime Ripard
@ 2020-03-12 5:36 ` Chen-Yu Tsai
0 siblings, 0 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2020-03-12 5:36 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland, devicetree, linux-kernel, Maxime Ripard,
Chen-Yu Tsai, linux-arm-kernel
Hi Rob,
On Mon, Jan 6, 2020 at 4:52 PM Maxime Ripard <mripard@kernel.org> wrote:
>
> On Mon, Jan 06, 2020 at 04:42:36PM +0800, Chen-Yu Tsai wrote:
> > From: Chen-Yu Tsai <wens@csie.org>
> >
> > Allwinner R40 SoC also contains MBUS controller.
> >
> > Add compatible for it.
> >
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>
> Acked-by: Maxime Ripard <mripard@kernel.org>
Looks like this didn't get picked up. But the device tree change using
the new compatible did make it into v5.6-rc1.
Could you pick this up as a fix for v5.6 so they make the same release?
Or I could pick it through our tree.
Regards
ChenYu
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-03-12 5:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-06 8:42 [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 1/7] ARM: dts: sun4i: Add CSI1 controller and pinmux options Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 2/7] ARM: dts: sun7i: " Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 3/7] dt-bindings: bus: sunxi: Add R40 MBUS compatible Chen-Yu Tsai
2020-01-06 8:51 ` Maxime Ripard
2020-03-12 5:36 ` Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 4/7] ARM: dts: sun8i: r40: Add device node for CSI0 Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 5/7] [DO NOT MERGE] ARM: dts: sun4i: cubieboard: Enable OV7670 camera on CSI1 Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 6/7] [DO NOT MERGE] ARM: dts: sun7i: cubieboard2: " Chen-Yu Tsai
2020-01-06 8:42 ` [PATCH v2 7/7] [DO NOT MERGE] ARM: dts: sun8i-r40: bananapi-m2-ultra: Enable OV5640 camera Chen-Yu Tsai
2020-01-06 8:52 ` [PATCH v2 0/7] media: sun4i-csi: A10/A20 CSI1 and R40 CSI0 support Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).