All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Shresth Prasad <shresthprasad7@gmail.com>,
	vkoul@kernel.org, kishon@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de,
	sebastian.reichel@collabora.com, andy.yan@rock-chips.com,
	s.hauer@pengutronix.de, jbx6244@yandex.com
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	javier.carrasco.cruz@gmail.com, skhan@linuxfoundation.org
Subject: Re: [PATCH v4] dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema
Date: Mon, 17 Jun 2024 17:58:56 +0200	[thread overview]
Message-ID: <f691c7f9-cd81-4bdf-a794-95118cb26686@kernel.org> (raw)
In-Reply-To: <20240617085341.34332-2-shresthprasad7@gmail.com>

On 17/06/2024 10:53, Shresth Prasad wrote:
> Convert txt bindings of Rockchip EMMC PHY to dtschema to allow
> for validation.
> 
> Signed-off-by: Shresth Prasad <shresthprasad7@gmail.com>
> ---


...


> +
> +  reg:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: emmcclk
> +
> +  clocks:
> +    maxItems: 1

Keep order from DTS coding style, so clocks then clock-names.

> +
> +  drive-impedance-ohm:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Specifies the drive impedance in Ohm.
> +    enum: [33, 40, 50, 66, 100]
> +    default: 50
> +
> +  rockchip,enable-strobe-pulldown:
> +    type: boolean
> +    description: |
> +      Enable internal pull-down for the strobe
> +      line.  If not set, pull-down is not used.
> +
> +  rockchip,output-tapdelay-select:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Specifies the phyctrl_otapdlysec register.
> +    default: 0x4
> +    maximum: 0xf
> +
> +  "#phy-cells":
> +    const: 0
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#phy-cells"
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    grf: syscon@ff770000 {

Drop label... actually entire node looks not needed.

> +      compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";

Drop

> +      reg = <0xff770000 0x10000>;

Drop


> +      #address-cells = <1>;
> +      #size-cells = <1>;
> +
> +      emmcphy: phy@f780 {

Drop label

> +        compatible = "rockchip,rk3399-emmc-phy";
> +        reg = <0xf780 0x20>;
> +        clocks = <&sdhci>;
> +        clock-names = "emmcclk";
> +        drive-impedance-ohm = <50>;
> +        #phy-cells = <0>;
> +      };
> +    };
> diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> deleted file mode 100644
> index 57d28c0d5696..000000000000
> --- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -Rockchip EMMC PHY
> ------------------------
> -
> -Required properties:
> - - compatible: rockchip,rk3399-emmc-phy
> - - #phy-cells: must be 0
> - - reg: PHY register address offset and length in "general
> -   register files"
> -
> -Optional properties:
> - - clock-names: Should contain "emmcclk".  Although this is listed as optional
> -		(because most boards can get basic functionality without having
> -		access to it), it is strongly suggested.
> -		See ../clock/clock-bindings.txt for details.
> - - clocks: Should have a phandle to the card clock exported by the SDHCI driver.
> - - drive-impedance-ohm: Specifies the drive impedance in Ohm.
> -                        Possible values are 33, 40, 50, 66 and 100.
> -                        If not set, the default value of 50 will be applied.
> - - rockchip,enable-strobe-pulldown: Enable internal pull-down for the strobe
> -                                    line.  If not set, pull-down is not used.
> - - rockchip,output-tapdelay-select: Specifies the phyctrl_otapdlysec register.
> -                                    If not set, the register defaults to 0x4.
> -                                    Maximum value 0xf.
> -
> -Example:
> -
> -
> -grf: syscon@ff770000 {
> -	compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
> -	#address-cells = <1>;
> -	#size-cells = <1>;
> -
> -...
> -
> -	emmcphy: phy@f780 {
> -		compatible = "rockchip,rk3399-emmc-phy";
> -		reg = <0xf780 0x20>;
> -		clocks = <&sdhci>;
> -		clock-names = "emmcclk";
> -		drive-impedance-ohm = <50>;
> -		#phy-cells = <0>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> index 79798c747476..6e1b1cdea680 100644
> --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> @@ -176,9 +176,12 @@ allOf:
>              Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt
>  
>        patternProperties:
> -        "phy@[0-9a-f]+$":
> -          description:
> -            Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +        "^phy@[0-9a-f]+$":
> +          type: object
> +

Drop blank line

> +          $ref: /schemas/phy/rockchip,rk3399-emmc-phy.yaml#
> +

Drop blank line

> +          unevaluatedProperties: false
>  
>    - if:
>        properties:

Nothing in example? Isn't the example for 3399?

We want only one complete example of such multi-children devices, so the
example can be moved and included in existing one here.


Best regards,
Krzysztof


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Shresth Prasad <shresthprasad7@gmail.com>,
	vkoul@kernel.org, kishon@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de,
	sebastian.reichel@collabora.com, andy.yan@rock-chips.com,
	s.hauer@pengutronix.de, jbx6244@yandex.com
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	javier.carrasco.cruz@gmail.com, skhan@linuxfoundation.org
Subject: Re: [PATCH v4] dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema
Date: Mon, 17 Jun 2024 17:58:56 +0200	[thread overview]
Message-ID: <f691c7f9-cd81-4bdf-a794-95118cb26686@kernel.org> (raw)
In-Reply-To: <20240617085341.34332-2-shresthprasad7@gmail.com>

On 17/06/2024 10:53, Shresth Prasad wrote:
> Convert txt bindings of Rockchip EMMC PHY to dtschema to allow
> for validation.
> 
> Signed-off-by: Shresth Prasad <shresthprasad7@gmail.com>
> ---


...


> +
> +  reg:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: emmcclk
> +
> +  clocks:
> +    maxItems: 1

Keep order from DTS coding style, so clocks then clock-names.

> +
> +  drive-impedance-ohm:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Specifies the drive impedance in Ohm.
> +    enum: [33, 40, 50, 66, 100]
> +    default: 50
> +
> +  rockchip,enable-strobe-pulldown:
> +    type: boolean
> +    description: |
> +      Enable internal pull-down for the strobe
> +      line.  If not set, pull-down is not used.
> +
> +  rockchip,output-tapdelay-select:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Specifies the phyctrl_otapdlysec register.
> +    default: 0x4
> +    maximum: 0xf
> +
> +  "#phy-cells":
> +    const: 0
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#phy-cells"
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    grf: syscon@ff770000 {

Drop label... actually entire node looks not needed.

> +      compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";

Drop

> +      reg = <0xff770000 0x10000>;

Drop


> +      #address-cells = <1>;
> +      #size-cells = <1>;
> +
> +      emmcphy: phy@f780 {

Drop label

> +        compatible = "rockchip,rk3399-emmc-phy";
> +        reg = <0xf780 0x20>;
> +        clocks = <&sdhci>;
> +        clock-names = "emmcclk";
> +        drive-impedance-ohm = <50>;
> +        #phy-cells = <0>;
> +      };
> +    };
> diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> deleted file mode 100644
> index 57d28c0d5696..000000000000
> --- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -Rockchip EMMC PHY
> ------------------------
> -
> -Required properties:
> - - compatible: rockchip,rk3399-emmc-phy
> - - #phy-cells: must be 0
> - - reg: PHY register address offset and length in "general
> -   register files"
> -
> -Optional properties:
> - - clock-names: Should contain "emmcclk".  Although this is listed as optional
> -		(because most boards can get basic functionality without having
> -		access to it), it is strongly suggested.
> -		See ../clock/clock-bindings.txt for details.
> - - clocks: Should have a phandle to the card clock exported by the SDHCI driver.
> - - drive-impedance-ohm: Specifies the drive impedance in Ohm.
> -                        Possible values are 33, 40, 50, 66 and 100.
> -                        If not set, the default value of 50 will be applied.
> - - rockchip,enable-strobe-pulldown: Enable internal pull-down for the strobe
> -                                    line.  If not set, pull-down is not used.
> - - rockchip,output-tapdelay-select: Specifies the phyctrl_otapdlysec register.
> -                                    If not set, the register defaults to 0x4.
> -                                    Maximum value 0xf.
> -
> -Example:
> -
> -
> -grf: syscon@ff770000 {
> -	compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
> -	#address-cells = <1>;
> -	#size-cells = <1>;
> -
> -...
> -
> -	emmcphy: phy@f780 {
> -		compatible = "rockchip,rk3399-emmc-phy";
> -		reg = <0xf780 0x20>;
> -		clocks = <&sdhci>;
> -		clock-names = "emmcclk";
> -		drive-impedance-ohm = <50>;
> -		#phy-cells = <0>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> index 79798c747476..6e1b1cdea680 100644
> --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> @@ -176,9 +176,12 @@ allOf:
>              Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt
>  
>        patternProperties:
> -        "phy@[0-9a-f]+$":
> -          description:
> -            Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +        "^phy@[0-9a-f]+$":
> +          type: object
> +

Drop blank line

> +          $ref: /schemas/phy/rockchip,rk3399-emmc-phy.yaml#
> +

Drop blank line

> +          unevaluatedProperties: false
>  
>    - if:
>        properties:

Nothing in example? Isn't the example for 3399?

We want only one complete example of such multi-children devices, so the
example can be moved and included in existing one here.


Best regards,
Krzysztof


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Shresth Prasad <shresthprasad7@gmail.com>,
	vkoul@kernel.org, kishon@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de,
	sebastian.reichel@collabora.com, andy.yan@rock-chips.com,
	s.hauer@pengutronix.de, jbx6244@yandex.com
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	javier.carrasco.cruz@gmail.com, skhan@linuxfoundation.org
Subject: Re: [PATCH v4] dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema
Date: Mon, 17 Jun 2024 17:58:56 +0200	[thread overview]
Message-ID: <f691c7f9-cd81-4bdf-a794-95118cb26686@kernel.org> (raw)
In-Reply-To: <20240617085341.34332-2-shresthprasad7@gmail.com>

On 17/06/2024 10:53, Shresth Prasad wrote:
> Convert txt bindings of Rockchip EMMC PHY to dtschema to allow
> for validation.
> 
> Signed-off-by: Shresth Prasad <shresthprasad7@gmail.com>
> ---


...


> +
> +  reg:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: emmcclk
> +
> +  clocks:
> +    maxItems: 1

Keep order from DTS coding style, so clocks then clock-names.

> +
> +  drive-impedance-ohm:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Specifies the drive impedance in Ohm.
> +    enum: [33, 40, 50, 66, 100]
> +    default: 50
> +
> +  rockchip,enable-strobe-pulldown:
> +    type: boolean
> +    description: |
> +      Enable internal pull-down for the strobe
> +      line.  If not set, pull-down is not used.
> +
> +  rockchip,output-tapdelay-select:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Specifies the phyctrl_otapdlysec register.
> +    default: 0x4
> +    maximum: 0xf
> +
> +  "#phy-cells":
> +    const: 0
> +
> +required:
> +  - compatible
> +  - reg
> +  - "#phy-cells"
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    grf: syscon@ff770000 {

Drop label... actually entire node looks not needed.

> +      compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";

Drop

> +      reg = <0xff770000 0x10000>;

Drop


> +      #address-cells = <1>;
> +      #size-cells = <1>;
> +
> +      emmcphy: phy@f780 {

Drop label

> +        compatible = "rockchip,rk3399-emmc-phy";
> +        reg = <0xf780 0x20>;
> +        clocks = <&sdhci>;
> +        clock-names = "emmcclk";
> +        drive-impedance-ohm = <50>;
> +        #phy-cells = <0>;
> +      };
> +    };
> diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> deleted file mode 100644
> index 57d28c0d5696..000000000000
> --- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -Rockchip EMMC PHY
> ------------------------
> -
> -Required properties:
> - - compatible: rockchip,rk3399-emmc-phy
> - - #phy-cells: must be 0
> - - reg: PHY register address offset and length in "general
> -   register files"
> -
> -Optional properties:
> - - clock-names: Should contain "emmcclk".  Although this is listed as optional
> -		(because most boards can get basic functionality without having
> -		access to it), it is strongly suggested.
> -		See ../clock/clock-bindings.txt for details.
> - - clocks: Should have a phandle to the card clock exported by the SDHCI driver.
> - - drive-impedance-ohm: Specifies the drive impedance in Ohm.
> -                        Possible values are 33, 40, 50, 66 and 100.
> -                        If not set, the default value of 50 will be applied.
> - - rockchip,enable-strobe-pulldown: Enable internal pull-down for the strobe
> -                                    line.  If not set, pull-down is not used.
> - - rockchip,output-tapdelay-select: Specifies the phyctrl_otapdlysec register.
> -                                    If not set, the register defaults to 0x4.
> -                                    Maximum value 0xf.
> -
> -Example:
> -
> -
> -grf: syscon@ff770000 {
> -	compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
> -	#address-cells = <1>;
> -	#size-cells = <1>;
> -
> -...
> -
> -	emmcphy: phy@f780 {
> -		compatible = "rockchip,rk3399-emmc-phy";
> -		reg = <0xf780 0x20>;
> -		clocks = <&sdhci>;
> -		clock-names = "emmcclk";
> -		drive-impedance-ohm = <50>;
> -		#phy-cells = <0>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> index 79798c747476..6e1b1cdea680 100644
> --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
> @@ -176,9 +176,12 @@ allOf:
>              Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt
>  
>        patternProperties:
> -        "phy@[0-9a-f]+$":
> -          description:
> -            Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +        "^phy@[0-9a-f]+$":
> +          type: object
> +

Drop blank line

> +          $ref: /schemas/phy/rockchip,rk3399-emmc-phy.yaml#
> +

Drop blank line

> +          unevaluatedProperties: false
>  
>    - if:
>        properties:

Nothing in example? Isn't the example for 3399?

We want only one complete example of such multi-children devices, so the
example can be moved and included in existing one here.


Best regards,
Krzysztof



  reply	other threads:[~2024-06-17 15:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17  8:53 [PATCH v4] dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema Shresth Prasad
2024-06-17  8:53 ` Shresth Prasad
2024-06-17  8:53 ` Shresth Prasad
2024-06-17 15:58 ` Krzysztof Kozlowski [this message]
2024-06-17 15:58   ` Krzysztof Kozlowski
2024-06-17 15:58   ` Krzysztof Kozlowski
2024-06-17 18:14   ` Shresth Prasad
2024-06-17 18:14     ` Shresth Prasad
2024-06-17 18:14     ` Shresth Prasad
2024-06-18  6:20     ` Krzysztof Kozlowski
2024-06-18  6:20       ` Krzysztof Kozlowski
2024-06-18  6:20       ` Krzysztof Kozlowski
2024-06-18  6:58       ` Shresth Prasad
2024-06-18  6:58         ` Shresth Prasad
2024-06-18  6:58         ` Shresth Prasad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f691c7f9-cd81-4bdf-a794-95118cb26686@kernel.org \
    --to=krzk@kernel.org \
    --cc=andy.yan@rock-chips.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jbx6244@yandex.com \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sebastian.reichel@collabora.com \
    --cc=shresthprasad7@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.