2019-12-23 15:18:07

by Yuti Amonkar

[permalink] [raw]
Subject: [PATCH v2 01/14] dt-bindings: phy: Convert Cadence MHDP PHY bindings to YAML.

- Convert the MHDP PHY devicetree bindings to yaml schemas.
- Rename DP PHY to have generic Torrent PHY nomrnclature.
- Rename compatible string from "cdns,dp-phy" to "cdns,torrent-phy".
This will not affect ABI as the driver has never been functional,
and therefore do not exist in any active use case

Signed-off-by: Yuti Amonkar <[email protected]>
---
.../devicetree/bindings/phy/phy-cadence-dp.txt | 30 ----------
.../bindings/phy/phy-cadence-torrent.yaml | 64 ++++++++++++++++++++++
2 files changed, 64 insertions(+), 30 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
create mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml

diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt b/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
deleted file mode 100644
index 7f49fd54e..0000000
--- a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Cadence MHDP DisplayPort SD0801 PHY binding
-===========================================
-
-This binding describes the Cadence SD0801 PHY hardware included with
-the Cadence MHDP DisplayPort controller.
-
--------------------------------------------------------------------------------
-Required properties (controller (parent) node):
-- compatible : Should be "cdns,dp-phy"
-- reg : Defines the following sets of registers in the parent
- mhdp device:
- - Offset of the DPTX PHY configuration registers
- - Offset of the SD0801 PHY configuration registers
-- #phy-cells : from the generic PHY bindings, must be 0.
-
-Optional properties:
-- num_lanes : Number of DisplayPort lanes to use (1, 2 or 4)
-- max_bit_rate : Maximum DisplayPort link bit rate to use, in Mbps (2160,
- 2430, 2700, 3240, 4320, 5400 or 8100)
--------------------------------------------------------------------------------
-
-Example:
- dp_phy: phy@f0fb030a00 {
- compatible = "cdns,dp-phy";
- reg = <0xf0 0xfb030a00 0x0 0x00000040>,
- <0xf0 0xfb500000 0x0 0x00100000>;
- num_lanes = <4>;
- max_bit_rate = <8100>;
- #phy-cells = <0>;
- };
diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
new file mode 100644
index 0000000..3587312
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
@@ -0,0 +1,64 @@
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/phy-cadence-torrent.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence Torrent SD0801 PHY binding for DisplayPort
+
+description:
+ This binding describes the Cadence SD0801 PHY hardware included with
+ the Cadence MHDP DisplayPort controller.
+
+maintainers:
+ - Swapnil Jakhade <[email protected]>
+ - Yuti Amonkar <[email protected]>
+
+properties:
+ compatible:
+ const: cdns,torrent-phy
+
+ reg:
+ items:
+ - description: Offset of the DPTX PHY configuration registers.
+ - description: Offset of the SD0801 PHY configuration registers.
+
+ reg-names:
+ items:
+ - const: dptx_phy
+ - const: sd0801_phy
+
+ "#phy-cells":
+ const: 0
+
+ num_lanes:
+ description:
+ Number of DisplayPort lanes.
+ allOf:
+ - $ref: /schemas/types.yaml#/definitions/uint32
+ - enum: [1, 2, 4]
+
+ max_bit_rate:
+ description:
+ Maximum DisplayPort link bit rate to use, in Mbps
+ allOf:
+ - $ref: /schemas/types.yaml#/definitions/uint32
+ - enum: [2160, 2430, 2700, 3240, 4320, 5400, 8100]
+
+required:
+ - compatible
+ - reg
+ - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ dp_phy: phy@f0fb030a00 {
+ compatible = "cdns,torrent-phy";
+ reg = <0xf0 0xfb030a00 0x0 0x00000040>,
+ <0xf0 0xfb500000 0x0 0x00100000>;
+ num_lanes = <4>;
+ max_bit_rate = <8100>;
+ #phy-cells = <0>;
+ };
+...
--
2.7.4


2019-12-31 12:26:36

by Jyri Sarha

[permalink] [raw]
Subject: Re: [PATCH v2 01/14] dt-bindings: phy: Convert Cadence MHDP PHY bindings to YAML.

On 23/12/2019 17:15, Yuti Amonkar wrote:
> - Convert the MHDP PHY devicetree bindings to yaml schemas.
> - Rename DP PHY to have generic Torrent PHY nomrnclature.
> - Rename compatible string from "cdns,dp-phy" to "cdns,torrent-phy".
> This will not affect ABI as the driver has never been functional,
> and therefore do not exist in any active use case
>
> Signed-off-by: Yuti Amonkar <[email protected]>
> ---
> .../devicetree/bindings/phy/phy-cadence-dp.txt | 30 ----------
> .../bindings/phy/phy-cadence-torrent.yaml | 64 ++++++++++++++++++++++
> 2 files changed, 64 insertions(+), 30 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> create mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt b/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> deleted file mode 100644
> index 7f49fd54e..0000000
> --- a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -Cadence MHDP DisplayPort SD0801 PHY binding
> -===========================================
> -
> -This binding describes the Cadence SD0801 PHY hardware included with
> -the Cadence MHDP DisplayPort controller.
> -
> --------------------------------------------------------------------------------
> -Required properties (controller (parent) node):
> -- compatible : Should be "cdns,dp-phy"
> -- reg : Defines the following sets of registers in the parent
> - mhdp device:
> - - Offset of the DPTX PHY configuration registers
> - - Offset of the SD0801 PHY configuration registers
> -- #phy-cells : from the generic PHY bindings, must be 0.
> -
> -Optional properties:
> -- num_lanes : Number of DisplayPort lanes to use (1, 2 or 4)
> -- max_bit_rate : Maximum DisplayPort link bit rate to use, in Mbps (2160,
> - 2430, 2700, 3240, 4320, 5400 or 8100)
> --------------------------------------------------------------------------------
> -
> -Example:
> - dp_phy: phy@f0fb030a00 {
> - compatible = "cdns,dp-phy";
> - reg = <0xf0 0xfb030a00 0x0 0x00000040>,
> - <0xf0 0xfb500000 0x0 0x00100000>;
> - num_lanes = <4>;
> - max_bit_rate = <8100>;
> - #phy-cells = <0>;
> - };
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> new file mode 100644
> index 0000000..3587312
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> @@ -0,0 +1,64 @@
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/phy/phy-cadence-torrent.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Cadence Torrent SD0801 PHY binding for DisplayPort
> +
> +description:
> + This binding describes the Cadence SD0801 PHY hardware included with
> + the Cadence MHDP DisplayPort controller.
> +
> +maintainers:
> + - Swapnil Jakhade <[email protected]>
> + - Yuti Amonkar <[email protected]>
> +
> +properties:
> + compatible:
> + const: cdns,torrent-phy
> +
> + reg:
> + items:
> + - description: Offset of the DPTX PHY configuration registers.

Isn't it possible to use torrent-phy in a configuration that does not
have dptx? Shouldn't the "dptx_phy" reg entry be optional?

BTW, I have no idea how to indicate in a yaml binding that some named
reg-entry is mandatory, and another is optional... anybody? Or is it
just something to explain in the description?

> + - description: Offset of the SD0801 PHY configuration registers.
> +
> + reg-names:
> + items:
> + - const: dptx_phy
> + - const: sd0801_phy
> +
> + "#phy-cells":
> + const: 0
> +
> + num_lanes:
> + description:
> + Number of DisplayPort lanes.
> + allOf:
> + - $ref: /schemas/types.yaml#/definitions/uint32
> + - enum: [1, 2, 4]
> +
> + max_bit_rate:
> + description:
> + Maximum DisplayPort link bit rate to use, in Mbps
> + allOf:
> + - $ref: /schemas/types.yaml#/definitions/uint32
> + - enum: [2160, 2430, 2700, 3240, 4320, 5400, 8100]
> +
> +required:
> + - compatible
> + - reg

Shouldn't the reg-names be mandatory too?

> + - "#phy-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + dp_phy: phy@f0fb030a00 {
> + compatible = "cdns,torrent-phy";
> + reg = <0xf0 0xfb030a00 0x0 0x00000040>,
> + <0xf0 0xfb500000 0x0 0x00100000>;

There are no reg-names here?

> + num_lanes = <4>;
> + max_bit_rate = <8100>;
> + #phy-cells = <0>;
> + };
> +...
>


--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

2020-01-04 21:25:26

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 01/14] dt-bindings: phy: Convert Cadence MHDP PHY bindings to YAML.

On Tue, Dec 31, 2019 at 02:24:07PM +0200, Jyri Sarha wrote:
> On 23/12/2019 17:15, Yuti Amonkar wrote:
> > - Convert the MHDP PHY devicetree bindings to yaml schemas.
> > - Rename DP PHY to have generic Torrent PHY nomrnclature.
> > - Rename compatible string from "cdns,dp-phy" to "cdns,torrent-phy".
> > This will not affect ABI as the driver has never been functional,
> > and therefore do not exist in any active use case
> >
> > Signed-off-by: Yuti Amonkar <[email protected]>
> > ---
> > .../devicetree/bindings/phy/phy-cadence-dp.txt | 30 ----------
> > .../bindings/phy/phy-cadence-torrent.yaml | 64 ++++++++++++++++++++++
> > 2 files changed, 64 insertions(+), 30 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> > create mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt b/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> > deleted file mode 100644
> > index 7f49fd54e..0000000
> > --- a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> > +++ /dev/null
> > @@ -1,30 +0,0 @@
> > -Cadence MHDP DisplayPort SD0801 PHY binding
> > -===========================================
> > -
> > -This binding describes the Cadence SD0801 PHY hardware included with
> > -the Cadence MHDP DisplayPort controller.
> > -
> > --------------------------------------------------------------------------------
> > -Required properties (controller (parent) node):
> > -- compatible : Should be "cdns,dp-phy"
> > -- reg : Defines the following sets of registers in the parent
> > - mhdp device:
> > - - Offset of the DPTX PHY configuration registers
> > - - Offset of the SD0801 PHY configuration registers
> > -- #phy-cells : from the generic PHY bindings, must be 0.
> > -
> > -Optional properties:
> > -- num_lanes : Number of DisplayPort lanes to use (1, 2 or 4)
> > -- max_bit_rate : Maximum DisplayPort link bit rate to use, in Mbps (2160,
> > - 2430, 2700, 3240, 4320, 5400 or 8100)
> > --------------------------------------------------------------------------------
> > -
> > -Example:
> > - dp_phy: phy@f0fb030a00 {
> > - compatible = "cdns,dp-phy";
> > - reg = <0xf0 0xfb030a00 0x0 0x00000040>,
> > - <0xf0 0xfb500000 0x0 0x00100000>;
> > - num_lanes = <4>;
> > - max_bit_rate = <8100>;
> > - #phy-cells = <0>;
> > - };
> > diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> > new file mode 100644
> > index 0000000..3587312
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> > @@ -0,0 +1,64 @@
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/phy/phy-cadence-torrent.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Cadence Torrent SD0801 PHY binding for DisplayPort
> > +
> > +description:
> > + This binding describes the Cadence SD0801 PHY hardware included with
> > + the Cadence MHDP DisplayPort controller.
> > +
> > +maintainers:
> > + - Swapnil Jakhade <[email protected]>
> > + - Yuti Amonkar <[email protected]>
> > +
> > +properties:
> > + compatible:
> > + const: cdns,torrent-phy
> > +
> > + reg:
> > + items:
> > + - description: Offset of the DPTX PHY configuration registers.
>
> Isn't it possible to use torrent-phy in a configuration that does not
> have dptx? Shouldn't the "dptx_phy" reg entry be optional?
>
> BTW, I have no idea how to indicate in a yaml binding that some named
> reg-entry is mandatory, and another is optional... anybody? Or is it
> just something to explain in the description?

If it is the last entry (which is preferred), then you just need a
'minItems: 1' in here.

If it is the first entry which is the case here, then you need 2 entries
under a oneOf:

oneOf:
- items:
- description: Offset of the SD0801 PHY configuration registers.
- items:
- description: Offset of the DPTX PHY configuration registers.
- description: Offset of the SD0801 PHY configuration registers.

Otherwise, the schema looks fine to me.

Rob

2020-01-06 05:33:05

by Kishon Vijay Abraham I

[permalink] [raw]
Subject: Re: [PATCH v2 01/14] dt-bindings: phy: Convert Cadence MHDP PHY bindings to YAML.

Hi,

On 23/12/19 8:45 PM, Yuti Amonkar wrote:
> - Convert the MHDP PHY devicetree bindings to yaml schemas.
> - Rename DP PHY to have generic Torrent PHY nomrnclature.
> - Rename compatible string from "cdns,dp-phy" to "cdns,torrent-phy".
> This will not affect ABI as the driver has never been functional,
> and therefore do not exist in any active use case

Since the Torrent SERDES is similar in design to Sierra SERDES, can we
make the binding look similar too.

For example, with the current binding here, it might not be possible to
specify multi-link. Sierra has a subnode for every link.

Thanks
Kishon

>
> Signed-off-by: Yuti Amonkar <[email protected]>
> ---
> .../devicetree/bindings/phy/phy-cadence-dp.txt | 30 ----------
> .../bindings/phy/phy-cadence-torrent.yaml | 64 ++++++++++++++++++++++
> 2 files changed, 64 insertions(+), 30 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> create mode 100644 Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt b/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> deleted file mode 100644
> index 7f49fd54e..0000000
> --- a/Documentation/devicetree/bindings/phy/phy-cadence-dp.txt
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -Cadence MHDP DisplayPort SD0801 PHY binding
> -===========================================
> -
> -This binding describes the Cadence SD0801 PHY hardware included with
> -the Cadence MHDP DisplayPort controller.
> -
> --------------------------------------------------------------------------------
> -Required properties (controller (parent) node):
> -- compatible : Should be "cdns,dp-phy"
> -- reg : Defines the following sets of registers in the parent
> - mhdp device:
> - - Offset of the DPTX PHY configuration registers
> - - Offset of the SD0801 PHY configuration registers
> -- #phy-cells : from the generic PHY bindings, must be 0.
> -
> -Optional properties:
> -- num_lanes : Number of DisplayPort lanes to use (1, 2 or 4)
> -- max_bit_rate : Maximum DisplayPort link bit rate to use, in Mbps (2160,
> - 2430, 2700, 3240, 4320, 5400 or 8100)
> --------------------------------------------------------------------------------
> -
> -Example:
> - dp_phy: phy@f0fb030a00 {
> - compatible = "cdns,dp-phy";
> - reg = <0xf0 0xfb030a00 0x0 0x00000040>,
> - <0xf0 0xfb500000 0x0 0x00100000>;
> - num_lanes = <4>;
> - max_bit_rate = <8100>;
> - #phy-cells = <0>;
> - };
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> new file mode 100644
> index 0000000..3587312
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> @@ -0,0 +1,64 @@
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/phy/phy-cadence-torrent.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Cadence Torrent SD0801 PHY binding for DisplayPort
> +
> +description:
> + This binding describes the Cadence SD0801 PHY hardware included with
> + the Cadence MHDP DisplayPort controller.
> +
> +maintainers:
> + - Swapnil Jakhade <[email protected]>
> + - Yuti Amonkar <[email protected]>
> +
> +properties:
> + compatible:
> + const: cdns,torrent-phy
> +
> + reg:
> + items:
> + - description: Offset of the DPTX PHY configuration registers.
> + - description: Offset of the SD0801 PHY configuration registers.
> +
> + reg-names:
> + items:
> + - const: dptx_phy
> + - const: sd0801_phy
> +
> + "#phy-cells":
> + const: 0
> +
> + num_lanes:
> + description:
> + Number of DisplayPort lanes.
> + allOf:
> + - $ref: /schemas/types.yaml#/definitions/uint32
> + - enum: [1, 2, 4]
> +
> + max_bit_rate:
> + description:
> + Maximum DisplayPort link bit rate to use, in Mbps
> + allOf:
> + - $ref: /schemas/types.yaml#/definitions/uint32
> + - enum: [2160, 2430, 2700, 3240, 4320, 5400, 8100]
> +
> +required:
> + - compatible
> + - reg
> + - "#phy-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + dp_phy: phy@f0fb030a00 {
> + compatible = "cdns,torrent-phy";
> + reg = <0xf0 0xfb030a00 0x0 0x00000040>,
> + <0xf0 0xfb500000 0x0 0x00100000>;
> + num_lanes = <4>;
> + max_bit_rate = <8100>;
> + #phy-cells = <0>;
> + };
> +...
>