[PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX

Karthik Poduval posted 2 patches 5 months ago
[PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Karthik Poduval 5 months ago
Add DT Bindings for Synopsys D-PHY RX, presently tested on version 1.2

Signed-off-by: Karthik Poduval <kpoduval@lab126.com>
---
 .../bindings/phy/snps,dw-dphy-rx.yaml         | 44 +++++++++++++++++++
 MAINTAINERS                                   |  7 +++
 2 files changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml

diff --git a/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml b/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
new file mode 100644
index 000000000000..c3c657b1e77d
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/snps,dw-dphy-rx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synopsys Designware MIPI D-PHY RX
+
+maintainers:
+  - Karthik Poduval <kpoduval@lab126.com>
+  - Jason Xiong <jyxiong@amazon.com>
+  - Miguel Lopes <miguel.lopes@synopsys.com
+
+description: |
+  These are the bindings for Synopsys Designware MIPI DPHY RX phy driver.
+  Currently only supported phy version is v1.2.
+
+properties:
+  compatible:
+    const: snps,dw-dphy-1p2
+
+  '#phy-cells':
+    const: 0
+
+  reg:
+    minItems: 2
+    maxItems: 2
+
+required:
+  - compatible
+  - '#phy-cells'
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    dw_dphy_rx: dw-dphy@900000040 {
+        compatible = "snps,dw-dphy-1p2";
+        #phy-cells = <0>;
+        reg = <0x0 0x90000040 0x0 0x20>, <0x0 0x90001000 0x0 0x8>;
+        status = "disabled";
+    };
+
diff --git a/MAINTAINERS b/MAINTAINERS
index b5a472a544cf..5fd5a92431bd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24217,6 +24217,13 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml
 F:	drivers/dma/dw-axi-dmac/
 
+SYNOPSYS DESIGNWARE MIPI D-PHY RX DRIVER
+M:	Karthik Poduval <kpoduval@lab126.com>
+M:	Jason Xiong <jyxiong@amazon.com>
+M:	Miguel Lopes <miguel.lopes@synopsys.com>
+S:	Supported
+F:	Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
+
 SYNOPSYS DESIGNWARE DMAC DRIVER
 M:	Viresh Kumar <vireshk@kernel.org>
 R:	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-- 
2.43.0
Re: [PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Krzysztof Kozlowski 5 months ago
On 10/07/2025 04:42, Karthik Poduval wrote:
> Add DT Bindings for Synopsys D-PHY RX, presently tested on version 1.2
> 
> Signed-off-by: Karthik Poduval <kpoduval@lab126.com>
> ---
>  .../bindings/phy/snps,dw-dphy-rx.yaml         | 44 +++++++++++++++++++
>  MAINTAINERS                                   |  7 +++
>  2 files changed, 51 insertions(+)
Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

Best regards,
Krzysztof
Re: [PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Krzysztof Kozlowski 5 months ago
On Wed, Jul 09, 2025 at 07:42:21PM -0700, Karthik Poduval wrote:
> +---
> +$id: http://devicetree.org/schemas/phy/snps,dw-dphy-rx.yaml#

Filename and id should match compatible.

> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Synopsys Designware MIPI D-PHY RX
> +
> +maintainers:
> +  - Karthik Poduval <kpoduval@lab126.com>
> +  - Jason Xiong <jyxiong@amazon.com>
> +  - Miguel Lopes <miguel.lopes@synopsys.com
> +
> +description: |
> +  These are the bindings for Synopsys Designware MIPI DPHY RX phy driver.
> +  Currently only supported phy version is v1.2.
> +
> +properties:
> +  compatible:
> +    const: snps,dw-dphy-1p2

You should rather use SoC compatibles.

> +
> +  '#phy-cells':
> +    const: 0
> +
> +  reg:
> +    minItems: 2
> +    maxItems: 2

List the items instead

And fix the order, reg goes second.

> +
> +required:
> +  - compatible
> +  - '#phy-cells'
> +  - reg

Here as well

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    dw_dphy_rx: dw-dphy@900000040 {

phy@

> +        compatible = "snps,dw-dphy-1p2";
> +        #phy-cells = <0>;
> +        reg = <0x0 0x90000040 0x0 0x20>, <0x0 0x90001000 0x0 0x8>;
> +        status = "disabled";

No, drop. And fix the order of properties, see DTS coding style.

> +    };

Best regards,
Krzysztof
Re: [PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Poduval, Karthik 5 months ago
Hi Krzysztof,

Thanks for your comments.

On Thu, 2025-07-10 at 09:24 +0200, Krzysztof Kozlowski wrote:
> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you can confirm the sender
> and know the content is safe.
> 
> 
> 
> On Wed, Jul 09, 2025 at 07:42:21PM -0700, Karthik Poduval wrote:
> > +---
> > +$id: http://devicetree.org/schemas/phy/snps,dw-dphy-rx.yaml#
> 
> Filename and id should match compatible.
> 
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Synopsys Designware MIPI D-PHY RX
> > +
> > +maintainers:
> > +  - Karthik Poduval <kpoduval@lab126.com>
> > +  - Jason Xiong <jyxiong@amazon.com>
> > +  - Miguel Lopes <miguel.lopes@synopsys.com
> > +
> > +description: |
> > +  These are the bindings for Synopsys Designware MIPI DPHY RX phy
> > driver.
> > +  Currently only supported phy version is v1.2.
> > +
> > +properties:
> > +  compatible:
> > +    const: snps,dw-dphy-1p2
> 
> You should rather use SoC compatibles.
If similar Synopsys D-PHY is used in multiple SoCs with slight
variations, should each SoC have its own D-PHY driver or is it better
to have a common one that works for all SoCs like arm,smmu-v3 or like
the EEPROM driver below ? 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/misc/eeprom/eeprom_93xx46.c?h=v6.16-rc5#n391
where driver specific driver_data could support multiple versions or
SoC variations. 
Our team thought of the common driver approach however looking for
general guidance from PHY subsystem maintainers and contributors.
> 
> > +
> > +  '#phy-cells':
> > +    const: 0
> > +
> > +  reg:
> > +    minItems: 2
> > +    maxItems: 2
> 
> List the items instead
> 
> And fix the order, reg goes second.
ack
> 
> > +
> > +required:
> > +  - compatible
> > +  - '#phy-cells'
> > +  - reg
> 
> Here as well
ack
> 
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    dw_dphy_rx: dw-dphy@900000040 {
> 
> phy@
> 
> > +        compatible = "snps,dw-dphy-1p2";
> > +        #phy-cells = <0>;
> > +        reg = <0x0 0x90000040 0x0 0x20>, <0x0 0x90001000 0x0 0x8>;
> > +        status = "disabled";
> 
> No, drop. And fix the order of properties, see DTS coding style.
> 
> > +    };
> 
> Best regards,
> Krzysztof
> 

Re: [PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Krzysztof Kozlowski 5 months ago
On 10/07/2025 23:24, Poduval, Karthik wrote:
>>> +maintainers:
>>> +  - Karthik Poduval <kpoduval@lab126.com>
>>> +  - Jason Xiong <jyxiong@amazon.com>
>>> +  - Miguel Lopes <miguel.lopes@synopsys.com
>>> +
>>> +description: |
>>> +  These are the bindings for Synopsys Designware MIPI DPHY RX phy
>>> driver.
>>> +  Currently only supported phy version is v1.2.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: snps,dw-dphy-1p2
>>
>> You should rather use SoC compatibles.
> If similar Synopsys D-PHY is used in multiple SoCs with slight
> variations, should each SoC have its own D-PHY driver or is it better

Your incorrect subject probably mislead you, but this is not a driver
patch. These are DT bindings.

SoC specific compatibles are almost always preferred.

> to have a common one that works for all SoCs like arm,smmu-v3 or like
> the EEPROM driver below ? 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/misc/eeprom/eeprom_93xx46.c?h=v6.16-rc5#n391
> where driver specific driver_data could support multiple versions or
> SoC variations. 
> Our team thought of the common driver approach however looking for
> general guidance from PHY subsystem maintainers and contributors.

We don't discuss here driver.

Best regards,
Krzysztof
Re: [PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Frank Li 5 months ago
On Wed, Jul 09, 2025 at 07:42:21PM -0700, Karthik Poduval wrote:
> Add DT Bindings for Synopsys D-PHY RX, presently tested on version 1.2
>
> Signed-off-by: Karthik Poduval <kpoduval@lab126.com>
> ---
>  .../bindings/phy/snps,dw-dphy-rx.yaml         | 44 +++++++++++++++++++
>  MAINTAINERS                                   |  7 +++
>  2 files changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
>
> diff --git a/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml b/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
> new file mode 100644
> index 000000000000..c3c657b1e77d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
> @@ -0,0 +1,44 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/phy/snps,dw-dphy-rx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Synopsys Designware MIPI D-PHY RX
> +
> +maintainers:
> +  - Karthik Poduval <kpoduval@lab126.com>
> +  - Jason Xiong <jyxiong@amazon.com>
> +  - Miguel Lopes <miguel.lopes@synopsys.com
> +
> +description: |

Needn't |

> +  These are the bindings for Synopsys Designware MIPI DPHY RX phy driver.
> +  Currently only supported phy version is v1.2.
> +
> +properties:
> +  compatible:
> +    const: snps,dw-dphy-1p2
> +
> +  '#phy-cells':
> +    const: 0
> +
> +  reg:
> +    minItems: 2
> +    maxItems: 2

items:
  - description: ....
  - description: ....

Not all dphy have second register.

> +
> +required:
> +  - compatible
> +  - '#phy-cells'
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    dw_dphy_rx: dw-dphy@900000040 {
> +        compatible = "snps,dw-dphy-1p2";
> +        #phy-cells = <0>;
> +        reg = <0x0 0x90000040 0x0 0x20>, <0x0 0x90001000 0x0 0x8>;

Some DW MIPI CSI2 test1/test2 register is not tail part of whole MMIO space

such as imx93.

Frank
> +        status = "disabled";
> +    };
> +
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b5a472a544cf..5fd5a92431bd 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -24217,6 +24217,13 @@ S:	Maintained
>  F:	Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml
>  F:	drivers/dma/dw-axi-dmac/
>
> +SYNOPSYS DESIGNWARE MIPI D-PHY RX DRIVER
> +M:	Karthik Poduval <kpoduval@lab126.com>
> +M:	Jason Xiong <jyxiong@amazon.com>
> +M:	Miguel Lopes <miguel.lopes@synopsys.com>
> +S:	Supported
> +F:	Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
> +
>  SYNOPSYS DESIGNWARE DMAC DRIVER
>  M:	Viresh Kumar <vireshk@kernel.org>
>  R:	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> --
> 2.43.0
>
Re: [PATCH v2 2/2] phy: dw-dphy-rx: Add dt bindings for Synopsys MIPI D-PHY RX
Posted by Rob Herring (Arm) 5 months ago
On Wed, 09 Jul 2025 19:42:21 -0700, Karthik Poduval wrote:
> Add DT Bindings for Synopsys D-PHY RX, presently tested on version 1.2
> 
> Signed-off-by: Karthik Poduval <kpoduval@lab126.com>
> ---
>  .../bindings/phy/snps,dw-dphy-rx.yaml         | 44 +++++++++++++++++++
>  MAINTAINERS                                   |  7 +++
>  2 files changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/phy/snps,dw-dphy-rx.example.dtb: dw-dphy@900000040 (snps,dw-dphy-1p2): reg: [[0, 2415919168], [0, 32], [0, 2415923200], [0, 8]] is too long
	from schema $id: http://devicetree.org/schemas/phy/snps,dw-dphy-rx.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/7f4b676678b27ea91314c834a297c1e057959b09.1752106239.git.kpoduval@lab126.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.