Skip to contentSkip to conversation

Allwinner A31/A83T MIPI CSI-2 and A31 ISP / Platform Support

PATCH In review Paul Kocialkowski 3 participants 15 messages Jun 13 – Jun 14

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

v10 cover Allwinner A31/A83T MIPI CSI-2 and A31 ISP / Platform Support

This series adds platform support for the V3s/V3/S3 MIPI CSI-2 and ISP units as well the as A83T MIPI CSI-2 unit in the respective device-trees.

The corresponding drivers and dt bindings were merged a long time ago but this series was never actually picked up. It seems more than ready to be merged!

Changes since v9:
- Split clock definitions export;
- Added dedicated v3s d-phy compatible;
- Added interrupt to v3s d-phy definition;
- Removed a83t board overlays that need more work.

Changes since v8:
- Added collected review tags;
- Added the overlays to be built as full dtbs.
- Removed trailing whitespace.

Changes since v7:
- Added collected review tags;
- Added interconnect properties to bindings;
- Added compatible for device-tree overlays;
- Moved mclk pin to sensor node in bpi-m3 overlays;
- Removed duplicated assigned-clocks in bpi-m3 overlays.

Changes since v6:
- Rebased on top of the latest media tree, renamed dts to dtso for overlays.

Changes since v5:
- Added BananaPi M3 camera sensor support as device-tree overlays;
- Cleaned-up OV8865 regulator definitions;
- Always declared the internal links between CSI and MIPI CSI-2 on A83T in device-tree.

Changes since v4:
- Removed mbus bindings patch: an equivalent change was merged;
- Added collected tags;
- Rebased on latest media tree.

Changes since v3:
- Reordered v3s mbus compatible in binding;
- Added collected tag;
- Removed rejected interconnects fix.

Changes since all-in-one v2:
- Corrected mbus index used for the interconnects;
- Used extended mbus binding and exported the DRAM clock for that;
- Reworked the description of the core openfirmware change to give more insight about the situation.

Paul Kocialkowski (6):
dt-bindings: sun8i-v3s-ccu: Export MBUS and DRAM clocks to the public
header
clk: sunxi-ng: v3s: Remove exported clock definitions
ARM: dts: sun8i: v3s: Add mbus node to represent the interconnect
dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry
ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support
ARM: dts: sun8i: v3s: Add support for the ISP

 .../phy/allwinner,sun6i-a31-mipi-dphy.yaml    |   3 +
 arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi    | 123 ++++++++++++++++++
 drivers/clk/sunxi-ng/ccu-sun8i-v3s.h          |   4 -
 include/dt-bindings/clock/sun8i-v3s-ccu.h     |   4 +-
 4 files changed, 128 insertions(+), 6 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

PATCH v10 1/6 dt-bindings: sun8i-v3s-ccu: Export MBUS and DRAM clocks to the public header

In order to declare a mbus node for the V3s, expose its associated clocks to the public header.

---
 include/dt-bindings/clock/sun8i-v3s-ccu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/dt-bindings/clock/sun8i-v3s-ccu.h +2 -2
index c4055629c9f9..d635bffd6914 100644
@@ -87,7 +87,7 @@
 #define CLK_SPI0		55
 #define CLK_USB_PHY0		56
 #define CLK_USB_OHCI0		57
-
+#define CLK_DRAM		58
 #define CLK_DRAM_VE		59
 #define CLK_DRAM_CSI		60
 #define CLK_DRAM_EHCI		61
@@ -101,7 +101,7 @@
 #define CLK_VE			69
 #define CLK_AC_DIG		70
 #define CLK_AVS			71
-
+#define CLK_MBUS		72
 #define CLK_MIPI_CSI		73
 
 /* Clocks not available on V3s */
Signature · 1 line
2.54.0
#3 lore raw

PATCH v10 2/6 clk: sunxi-ng: v3s: Remove exported clock definitions

In reply to Paul Kocialkowski

V3s MBUS and DRAM clock definitions are now exported in the dt-bindings header. We can remove the duplicated definitons in the clock driver.

---
 drivers/clk/sunxi-ng/ccu-sun8i-v3s.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/clk/sunxi-ng/ccu-sun8i-v3s.h +0 -4
index 345cdbbab362..c933ef016570 100644
@@ -39,14 +39,10 @@
 
 /* The first bunch of module clocks are exported */
 
-#define CLK_DRAM		58
-
 /* All the DRAM gates are exported */
 
 /* Some more module clocks are exported */
 
-#define CLK_MBUS		72
-
 /* And the GPU module clock is exported */
 
 #define CLK_PLL_DDR1		74
Signature · 1 line
2.54.0
#4 lore raw

PATCH v10 3/6 ARM: dts: sun8i: v3s: Add mbus node to represent the interconnect

In reply to Paul Kocialkowski

From: Paul Kocialkowski <[email protected]>

The V3s uses the mbus interconnect to provide DRAM access for a number of blocks. The SoC can only map 2 GiB of DRAM, which is reflected in the dma-ranges property.

---
 arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +15 -0
index fa54510319ac..02d6c62b3874 100644
@@ -629,6 +629,21 @@ int_mii_phy: ethernet-phy@1 {
 			};
 		};
 
+		mbus: dram-controller@1c62000 {
+			compatible = "allwinner,sun8i-v3s-mbus";
+			reg = <0x01c62000 0x1000>,
+			      <0x01c63000 0x1000>;
+			reg-names = "mbus", "dram";
+			clocks = <&ccu CLK_MBUS>,
+				 <&ccu CLK_DRAM>,
+				 <&ccu CLK_BUS_DRAM>;
+			clock-names = "mbus", "dram", "bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			dma-ranges = <0x00000000 0x40000000 0x80000000>;
+			#interconnect-cells = <1>;
+		};
+
 		spi0: spi@1c68000 {
 			compatible = "allwinner,sun8i-h3-spi";
 			reg = <0x01c68000 0x1000>;
Signature · 1 line
2.54.0
#5 lore raw

PATCH v10 4/6 dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

In reply to Paul Kocialkowski

The V3s/V3/S3 comes with a rx-only D-PHY paired with the MIPI CSI-2 controller. It is compatible with the D-PHY found on the A31.

Add an entry with a new compatible and the A31 compatible as fallback.

---
 .../devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +3 -0
index 6a4fd4929959..3ca1a1c47032 100644
@@ -21,6 +21,9 @@ properties:
       - items:
           - const: allwinner,sun50i-a64-mipi-dphy
           - const: allwinner,sun6i-a31-mipi-dphy
+      - items:
+          - const: allwinner,sun8i-v3s-mipi-dphy
+          - const: allwinner,sun6i-a31-mipi-dphy
       - items:
           - const: allwinner,sun20i-d1-mipi-dphy
           - const: allwinner,sun50i-a100-mipi-dphy
Signature · 1 line
2.54.0
#10 lore raw

PATCH v10 5/6 ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support

In reply to Paul Kocialkowski

From: Paul Kocialkowski <[email protected]>

MIPI CSI-2 is supported on the V3s with an A31-based MIPI CSI-2 bridge controller. The controller uses a separate D-PHY, which is the same that is otherwise used for MIPI DSI, but used in Rx mode.

On the V3s, the CSI0 controller is dedicated to MIPI CSI-2 as it does not have access to any parallel interface pins.

Add all the necessary nodes (CSI0, MIPI CSI-2 bridge and D-PHY) to support the MIPI CSI-2 interface.

Note that a fwnode graph link is created between CSI0 and MIPI CSI-2 even when no sensor is connected. This will result in a probe failure for the controller as long as no sensor is connected but this is fine since no other interface is available.

The interconnects property is used to inherit the proper DMA offset.

---
 arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +73 -0
index 02d6c62b3874..03a1739683b1 100644
@@ -671,6 +671,79 @@ gic: interrupt-controller@1c81000 {
 			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
+		csi0: camera@1cb0000 {
+			compatible = "allwinner,sun8i-v3s-csi";
+			reg = <0x01cb0000 0x1000>;
+			interrupts = <GIC_SPI 83 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>;
+			interconnects = <&mbus 5>;
+			interconnect-names = "dma-mem";
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@1 {
+					reg = <1>;
+
+					csi0_in_mipi_csi2: endpoint {
+						remote-endpoint = <&mipi_csi2_out_csi0>;
+					};
+				};
+			};
+		};
+
+		mipi_csi2: csi@1cb1000 {
+			compatible = "allwinner,sun8i-v3s-mipi-csi2",
+				     "allwinner,sun6i-a31-mipi-csi2";
+			reg = <0x01cb1000 0x1000>;
+			interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CSI>,
+				 <&ccu CLK_CSI_SCLK>;
+			clock-names = "bus", "mod";
+			resets = <&ccu RST_BUS_CSI>;
+			status = "disabled";
+
+			phys = <&dphy>;
+			phy-names = "dphy";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				mipi_csi2_in: port@0 {
+					reg = <0>;
+				};
+
+				mipi_csi2_out: port@1 {
+					reg = <1>;
+
+					mipi_csi2_out_csi0: endpoint {
+						remote-endpoint = <&csi0_in_mipi_csi2>;
+					};
+				};
+			};
+		};
+
+		dphy: d-phy@1cb2000 {
+			compatible = "allwinner,sun8i-v3s-mipi-dphy",
+				     "allwinner,sun6i-a31-mipi-dphy";
+			reg = <0x01cb2000 0x1000>;
+			interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CSI>,
+				 <&ccu CLK_MIPI_CSI>;
+			clock-names = "bus", "mod";
+			resets = <&ccu RST_BUS_CSI>;
+			allwinner,direction = "rx";
+			status = "disabled";
+			#phy-cells = <0>;
+		};
+
 		csi1: camera@1cb4000 {
 			compatible = "allwinner,sun8i-v3s-csi";
 			reg = <0x01cb4000 0x3000>;
Signature · 1 line
2.54.0
#13 lore raw

PATCH v10 6/6 ARM: dts: sun8i: v3s: Add support for the ISP

In reply to Paul Kocialkowski

From: Paul Kocialkowski <[email protected]>

The V3s (and related platforms) come with an instance of the A31 ISP. Even though it is very close to the A31 ISP, it is not exactly register-compatible and a dedicated compatible only is used as a result.

Just like most other blocks of the camera pipeline, the ISP uses the common CSI bus, module and ram clock as well as reset.

A port connection to the ISP is added to CSI0 for convenience since CSI0 serves for MIPI CSI-2 interface support, which is likely to receive raw data that will need to be processed by the ISP to produce a final image.

The interconnects property is used to inherit the proper DMA offset.

---
 arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +35 -0
index 03a1739683b1..628d5504c3ae 100644
@@ -695,6 +695,14 @@ csi0_in_mipi_csi2: endpoint {
 						remote-endpoint = <&mipi_csi2_out_csi0>;
 					};
 				};
+
+				port@2 {
+					reg = <2>;
+
+					csi0_out_isp: endpoint {
+						remote-endpoint = <&isp_in_csi0>;
+					};
+				};
 			};
 		};
 
@@ -755,5 +763,32 @@ csi1: camera@1cb4000 {
 			resets = <&ccu RST_BUS_CSI>;
 			status = "disabled";
 		};
+
+		isp: isp@1cb8000 {
+			compatible = "allwinner,sun8i-v3s-isp";
+			reg = <0x01cb8000 0x1000>;
+			interrupts = <GIC_SPI 83 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>;
+			interconnects = <&mbus 5>;
+			interconnect-names = "dma-mem";
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					isp_in_csi0: endpoint {
+						remote-endpoint = <&csi0_out_isp>;
+					};
+				};
+			};
+		};
 	};
 };
Signature · 1 line
2.54.0
#6 lore raw

Re: [PATCH v10 4/6] dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

In reply to Paul Kocialkowski
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The newly added V3s compatible string is for an rx-only hardware variant, but the binding schema…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The newly added V3s compatible string is for an rx-only hardware variant, but the binding schema allows it to incorrectly default to tx. --

commit 2fd664ce10fb7edbf45c93a3bcbbd8adb0bad2ea
Author: Paul Kocialkowski <[email protected]>

dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

The V3s/V3/S3 comes with a rx-only D-PHY paired with the MIPI CSI-2 controller. It is compatible with the D-PHY found on the A31. Add an entry with a new compatible and the A31 compatible as fallback.

Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml properties: · line 26

Quoted 11 lines
Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +3 -0
index 6a4fd49299590..3ca1a1c47032f 100644
@@ -21,6 +21,9 @@ properties:
       - items:
           - const: allwinner,sun50i-a64-mipi-dphy
           - const: allwinner,sun6i-a31-mipi-dphy
+      - items:
+          - const: allwinner,sun8i-v3s-mipi-dphy
+          - const: allwinner,sun6i-a31-mipi-dphy

[Severity: Medium]
Since the commit message indicates the V3s D-PHY is rx-only, should this schema include an if-then block to enforce the rx direction?

The base binding defines allwinner,direction with a default of tx:

allwinner,direction:
...
enum:
- tx
- rx
default: tx

Without an allOf if-then block constraining this property for the allwinner,sun8i-v3s-mipi-dphy compatible string, a V3s device tree node that omits the property will implicitly default to tx.

Would this allow an incomplete device tree node to pass schema validation while misconfiguring the rx-only hardware?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#11 lore raw

Re: [PATCH v10 5/6] ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support

In reply to Paul Kocialkowski
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The `csi0` node introduces the `interconnects` and `interconnect-names` properties, but these are…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The csi0 node introduces the interconnects and interconnect-names properties, but these are not defined in the corresponding dt-binding schema allwinner,sun6i-a31-csi.yaml. --

commit 6348731e0b0149fecdb9ccb7d05f8577710a1724
Author: Paul Kocialkowski <[email protected]>

ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support

This commit adds MIPI CSI-2 support for the V3s SoC by introducing nodes for CSI0, the MIPI CSI-2 bridge, and the D-PHY. The CSI0 node includes interconnect properties to inherit the proper DMA offsets.

Quoted 4 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +0 -0
index 02d6c62b3874e..03a1739683b16 100644

[ ... ]

Quoted 5 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +1 -0
@@ -671,6 +671,79 @@ gic: interrupt-controller@1c81000 {
 			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
+		csi0: camera@1cb0000 {

arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi gic: interrupt-controller@1c81000 { · line 684

Quoted 10 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +10 -0
+			compatible = "allwinner,sun8i-v3s-csi";
+			reg = <0x01cb0000 0x1000>;
+			interrupts = <GIC_SPI 83 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>;
+			interconnects = <&mbus 5>;
+			interconnect-names = "dma-mem";

[Severity: Low]
Will adding these properties cause a dtbs_check validation warning?

The interconnects and interconnect-names properties do not appear to be defined in the corresponding dt-binding schema at Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi.yaml.

Because that schema enforces additionalProperties: false, introducing undocumented properties here might result in a validation failure. Should the schema be updated alongside this patch to allow these interconnect properties?

Quoted 2 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +2 -0
+			status = "disabled";
+

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#12 lore raw

Re: [PATCH v10 5/6] ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support

Hi,

Quoted 37 lines · Le Sat 13 Jun 26, 15:41, [email protected] a écrit :

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The csi0 node introduces the interconnects and interconnect-names properties, but these are not defined in the corresponding dt-binding schema allwinner,sun6i-a31-csi.yaml. --

commit 6348731e0b0149fecdb9ccb7d05f8577710a1724
Author: Paul Kocialkowski <[email protected]>

ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support

This commit adds MIPI CSI-2 support for the V3s SoC by introducing nodes for CSI0, the MIPI CSI-2 bridge, and the D-PHY. The CSI0 node includes interconnect properties to inherit the proper DMA offsets.

Quoted 4 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +0 -0
index 02d6c62b3874e..03a1739683b16 100644

[ ... ]

Quoted 5 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +1 -0
@@ -671,6 +671,79 @@ gic: interrupt-controller@1c81000 {
 			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
+		csi0: camera@1cb0000 {

arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi gic: interrupt-controller@1c81000 { · line 684

Quoted 10 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +10 -0
+			compatible = "allwinner,sun8i-v3s-csi";
+			reg = <0x01cb0000 0x1000>;
+			interrupts = <GIC_SPI 83 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>;
+			interconnects = <&mbus 5>;
+			interconnect-names = "dma-mem";

[Severity: Low]
Will adding these properties cause a dtbs_check validation warning?

Quoted 3 lines

The interconnects and interconnect-names properties do not appear to be defined in the corresponding dt-binding schema at Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi.yaml.

Patches to enable said properties in the binding were accepted already.

All the best,

Paul

Quoted 11 lines

Because that schema enforces additionalProperties: false, introducing undocumented properties here might result in a validation failure. Should the schema be updated alongside this patch to allow these interconnect properties?

Quoted 2 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +2 -0
+			status = "disabled";
+

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
Signature · 6 lines
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.
#7 lore raw

Re: [PATCH v10 4/6] dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

In reply to [email protected]

Hi,

Quoted 38 lines · Le Sat 13 Jun 26, 15:35, [email protected] a écrit :

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The newly added V3s compatible string is for an rx-only hardware variant, but the binding schema allows it to incorrectly default to tx. --

commit 2fd664ce10fb7edbf45c93a3bcbbd8adb0bad2ea
Author: Paul Kocialkowski <[email protected]>

dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

The V3s/V3/S3 comes with a rx-only D-PHY paired with the MIPI CSI-2 controller. It is compatible with the D-PHY found on the A31. Add an entry with a new compatible and the A31 compatible as fallback.

Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml properties: · line 26

Quoted 11 lines
Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +3 -0
index 6a4fd49299590..3ca1a1c47032f 100644
@@ -21,6 +21,9 @@ properties:
       - items:
           - const: allwinner,sun50i-a64-mipi-dphy
           - const: allwinner,sun6i-a31-mipi-dphy
+      - items:
+          - const: allwinner,sun8i-v3s-mipi-dphy
+          - const: allwinner,sun6i-a31-mipi-dphy

[Severity: Medium]
Since the commit message indicates the V3s D-PHY is rx-only, should this schema include an if-then block to enforce the rx direction?

The base binding defines allwinner,direction with a default of tx:

allwinner,direction:
...
enum:
- tx
- rx
default: tx

Quoted 6 lines

Without an allOf if-then block constraining this property for the allwinner,sun8i-v3s-mipi-dphy compatible string, a V3s device tree node that omits the property will implicitly default to tx.

Would this allow an incomplete device tree node to pass schema validation while misconfiguring the rx-only hardware?

That is correct, but maybe a bit over the top. If someone thinks this should be done, feel free to let me know and I can respin.

All the best,

Paul

Signature · 6 lines
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.
#14 lore raw

Re: [PATCH v10 6/6] ARM: dts: sun8i: v3s: Add support for the ISP

In reply to Paul Kocialkowski
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The device tree nodes `isp` and `csi0` include `interconnects` and `interconnect-names` properties…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The device tree nodes isp and csi0 include interconnects and interconnect-names properties that are not documented in their respective YAML binding schemas (Documentation/devicetree/bindings/media/allwinner,sun6i-a31-isp.yaml and Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi.yaml). Because these schemas specify additionalProperties: false, this causes schema validation failures during make dtbs_check. --

commit 299a0d91b22100c87010de21ec5908b8fed75e39
Author: Paul Kocialkowski <[email protected]>

ARM: dts: sun8i: v3s: Add support for the ISP

This commit adds support for the ISP on V3s and related platforms by introducing a dedicated compatible string and device tree node. It links the ISP to the CSI bus, module and ram clocks, resets, and adds a port connection to CSI0. The interconnects property is also used to inherit the proper DMA offset.

Quoted 3 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +0 -0

[ ... ]

Quoted 8 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +4 -0
@@ -755,5 +763,32 @@ csi1: camera@1cb4000 {
 			resets = <&ccu RST_BUS_CSI>;
 			status = "disabled";
 		};
+
+		isp: isp@1cb8000 {
+			compatible = "allwinner,sun8i-v3s-isp";
+			reg = <0x01cb8000 0x1000>;

[ ... ]

arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi csi1: camera@1cb4000 { · line 777

Quoted 3 lines
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +3 -0
+			resets = <&ccu RST_BUS_CSI>;
+			interconnects = <&mbus 5>;
+			interconnect-names = "dma-mem";

[Severity: Low]
Are these interconnect properties documented in the corresponding YAML binding schemas (like Documentation/devicetree/bindings/media/allwinner,sun6i-a31-isp.yaml and similarly for csi0)?

Since device tree schemas typically specify additionalProperties: false, leaving interconnects and interconnect-names undocumented will cause make dtbs_check to report schema validation failures for these nodes.

Quoted 1 line
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +1 -0
+			status = "disabled";

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
Acked-by on v10 1/6
#2 lore raw

Re: [PATCH v10 1/6] dt-bindings: sun8i-v3s-ccu: Export MBUS and DRAM clocks to the public header

In reply to Paul Kocialkowski
Quoted 7 lines · Paul Kocialkowski

In order to declare a mbus node for the V3s, expose its associated clocks to the public header.

---
 include/dt-bindings/clock/sun8i-v3s-ccu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH v10 4/6] dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

In reply to Paul Kocialkowski
Quoted 15 lines · Paul Kocialkowski

The V3s/V3/S3 comes with a rx-only D-PHY paired with the MIPI CSI-2 controller. It is compatible with the D-PHY found on the A31.

Add an entry with a new compatible and the A31 compatible as fallback.

---
 .../devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +0 -0
index 6a4fd4929959..3ca1a1c47032 100644

Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml properties: · line 25

Quoted 5 lines
Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +2 -0
@@ -21,6 +21,9 @@ properties:
       - items:
           - const: allwinner,sun50i-a64-mipi-dphy
           - const: allwinner,sun6i-a31-mipi-dphy
+      - items:
+          - const: allwinner,sun8i-v3s-mipi-dphy

So that's enum with previous first entry (50i-a64) - same fallback.

Best regards,
Krzysztof

#9 lore raw

Re: [PATCH v10 4/6] dt-bindings: sun6i-a31-mipi-dphy: Add V3s SoC compatible entry

Hi,

Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Paul Kocialkowski

The V3s/V3/S3 comes with a rx-only D-PHY paired with the MIPI CSI-2 controller. It is compatible with the D-PHY found on the A31.

Add an entry with a new compatible and the A31 compatible as fallback.

---
 .../devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml | 3 +++
 1 file changed, 3 insertions(+)
Quoted 12 lines

Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml properties: · line 25

Quoted 10 lines
Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +2 -0
index 6a4fd4929959..3ca1a1c47032 100644
@@ -21,6 +21,9 @@ properties:
       - items:
           - const: allwinner,sun50i-a64-mipi-dphy
           - const: allwinner,sun6i-a31-mipi-dphy
+      - items:
+          - const: allwinner,sun8i-v3s-mipi-dphy

So that's enum with previous first entry (50i-a64) - same fallback.

Ah sorry about that. Thanks for the review!

All the best,

Paul

Signature · 6 lines
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.