mbox series

[V3,0/7] dt-bindings: usb: covert ci-hdrc-usb2/usbmisc-imx to yaml

Message ID 20230226130539.277336-1-peng.fan@oss.nxp.com
Headers show
Series dt-bindings: usb: covert ci-hdrc-usb2/usbmisc-imx to yaml | expand

Message

Peng Fan (OSS) Feb. 26, 2023, 1:05 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

V3:
 Sorry for this long time delay for V3. I thought this should be V5, but actually
 I only posted two versions before.
 Add myself ad maintainer
 The major changes are in patch 4:
   Added some properties to address dtbs_check error, for qcom, fsl. But I still leave
   some properties not introduced, such as phy-select for qcom,
   nvidia,needs-double-reset operating-points-v2 for nvidia, which I would expect
   sub-soc maintainers continue on it.

 Add A-b from Rob
 Add a new patch 7

v2:
 patch order changed, usbmisc-imx moved to first
 Add Xu Yang as maintainer
 Typo fix
 Not define properties within if/then/else
 Set additionalProperties to false
 Drop duplicated compatibles
 Fix checkpatch issue
 For pinctrl-names: I think there is restrictin in allOf, so not list items
 Add fsl,usbmisc: ref
 Define items for mux-control-names
 Rename usbmisc-imx.yaml to fsl,usbmisc.yaml

 Hope I not miss any comments

 Note: there will still be dtbs_check failure if run with only a single patch,
 with this patchset applied, there is no related dtbs_check failure.


This patchset is to convert ci-hdrc-usb2 and usbmisc-imx to yaml format.
There are compatible strings not landed in binding doc, but in device tree,
so run dtbs_check on the single yaml convertion patch will report
dtbs_check failure. If apply the whole patchset, there will be no failure.


Peng Fan (7):
  dt-bindings: usb: usbmisc-imx: convert to DT schema
  dt-bindings: usb: usbmisc-imx: add clocks property
  dt-bindings: usb: usbmisc-imx: add more i.MX compatible
  dt-bindings: usb: ci-hdrc-usb2: convert to DT schema format
  dt-bindings: usb: ci-hdrc-usb2: add i.MX53/6SLL/UL compatible
  dt-bindings: usb: ci-hdrc-usb2: add i.MX8DXL/MN support
  dt-bindings: usb: usb-nop-xceiv: add power-domains property

 .../devicetree/bindings/usb/ci-hdrc-usb2.txt  | 159 -------
 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml | 421 ++++++++++++++++++
 .../devicetree/bindings/usb/fsl,usbmisc.yaml  |  68 +++
 .../bindings/usb/usb-nop-xceiv.yaml           |   3 +
 .../devicetree/bindings/usb/usbmisc-imx.txt   |  19 -
 5 files changed, 492 insertions(+), 178 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
 create mode 100644 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/usbmisc-imx.txt

Comments

Rob Herring Feb. 27, 2023, 8:52 p.m. UTC | #1
On Sun, Feb 26, 2023 at 09:05:33PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Convert usbmisc-imx to DT schema format.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/usb/fsl,usbmisc.yaml  | 54 +++++++++++++++++++
>  .../devicetree/bindings/usb/usbmisc-imx.txt   | 19 -------
>  2 files changed, 54 insertions(+), 19 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
>  delete mode 100644 Documentation/devicetree/bindings/usb/usbmisc-imx.txt
> 
> diff --git a/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml b/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
> new file mode 100644
> index 000000000000..517390b9d2c6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/fsl,usbmisc.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/fsl,usbmisc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale i.MX wrapper module for Chipidea USB2 controller
> +
> +maintainers:
> +  - Xu Yang <xu.yang_2@nxp.com>
> +  - Peng Fan <peng.fan@nxp.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - fsl,imx6q-usbmisc
> +          - fsl,imx7ulp-usbmisc
> +          - fsl,vf610-usbmisc
> +      - items:
> +          - enum:
> +              - fsl,imx6ul-usbmisc
> +              - fsl,imx6sx-usbmisc
> +              - fsl,imx7d-usbmisc
> +          - const: fsl,imx6q-usbmisc
> +      - items:
> +          - enum:
> +              - fsl,imx7ulp-usbmisc
> +              - fsl,imx8mm-usbmisc
> +          - const: fsl,imx7d-usbmisc

So imx8mm is compatible with imx7d, and imx7d is compatible with imx6q, 
but imx8mm is not compatible with imx6q? That doesn't really make sense. 
Maybe all 3 compatibles makes sense, but only if s/w understanding only 
one of the fallback compatibles would function without knowledge of the 
newer h/w.

> +
> +  reg:
> +    maxItems: 1
> +
> +  '#index-cells':
> +    const: 1
> +    description: Cells used to describe usb controller index.

Please mark this as deprecated. If it is always 1 cell, then there's no 
point. 

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

And drop as required. That all can be a follow-up patch if you prefer or 
in this patch is fine. Primarily, I don't want this pattern copied.

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    usbmisc@2184800 {
> +        #index-cells = <1>;
> +        compatible = "fsl,imx6q-usbmisc";
> +        reg = <0x02184800 0x200>;
> +    };
> +
> +...
> diff --git a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt b/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
> deleted file mode 100644
> index 29b8f65ff849..000000000000
> --- a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -* Freescale i.MX non-core registers
> -
> -Required properties:
> -- #index-cells: Cells used to describe usb controller index. Should be <1>
> -- compatible: Should be one of below:
> -	"fsl,imx6q-usbmisc" for imx6q
> -	"fsl,vf610-usbmisc" for Vybrid vf610
> -	"fsl,imx6sx-usbmisc" for imx6sx
> -	"fsl,imx7d-usbmisc" for imx7d
> -	"fsl,imx7ulp-usbmisc" for imx7ulp
> -	"fsl,imx8mm-usbmisc" for imx8mm
> -- reg: Should contain registers location and length
> -
> -Examples:
> -usbmisc@2184800 {
> -	#index-cells = <1>;
> -	compatible = "fsl,imx6q-usbmisc";
> -	reg = <0x02184800 0x200>;
> -};
> -- 
> 2.37.1
>
Rob Herring Feb. 27, 2023, 9:17 p.m. UTC | #2
On Sun, 26 Feb 2023 21:05:39 +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add power-domains optional property
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/usb/usb-nop-xceiv.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>
Peng Fan (OSS) March 4, 2023, 7:37 a.m. UTC | #3
Hi Rob, Krzysztof,

On 2/28/2023 1:55 PM, Peng Fan wrote:
>> Subject: Re: [PATCH V3 1/7] dt-bindings: usb: usbmisc-imx: convert to DT
>> schema
...
>>> +
>>> +title: Freescale i.MX wrapper module for Chipidea USB2 controller
>>> +
>>> +maintainers:
>>> +  - Xu Yang <xu.yang_2@nxp.com>
>>> +  - Peng Fan <peng.fan@nxp.com>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - enum:
>>> +          - fsl,imx6q-usbmisc
>>> +          - fsl,imx7ulp-usbmisc
>>> +          - fsl,vf610-usbmisc
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx6ul-usbmisc
>>> +              - fsl,imx6sx-usbmisc
>>> +              - fsl,imx7d-usbmisc
>>> +          - const: fsl,imx6q-usbmisc
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx7ulp-usbmisc
>>> +              - fsl,imx8mm-usbmisc
>>> +          - const: fsl,imx7d-usbmisc
>>
>> So imx8mm is compatible with imx7d, and imx7d is compatible with imx6q,
>> but imx8mm is not compatible with imx6q? That doesn't really make sense.
>> Maybe all 3 compatibles makes sense, but only if s/w understanding only
>> one of the fallback compatibles would function without knowledge of the
>> newer h/w.
> 
> I added the list according the current device tree in use. If using
> three compatibles,  that would involve device tree upate, and firmware
> update for SR-IR.
> 
> My understanding is imx8mm is compatible with imx7d, imx7d is compatible
> with imx6q, then imx8mm is compatible with imx6q. it is just not put
> them under one item. Please correct if my understanding is wrong.
>>

Do you have any guidance here? I am not sure how to proceed on V4.

Thanks,
Peng

>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  '#index-cells':
>>> +    const: 1
>>> +    description: Cells used to describe usb controller index.
>>
>> Please mark this as deprecated. If it is always 1 cell, then there's no point.
> 
> Fix in v4.
>>
>>> +
>>> +required:
>>> +  - compatible
>>> +  - reg
>>> +  - '#index-cells'
>>
>> And drop as required. That all can be a follow-up patch if you prefer or in
>> this patch is fine. Primarily, I don't want this pattern copied.
>>
> 
> Fix in v4.
> 
> Thanks,
> Peng.
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> +  - |
>>> +    usbmisc@2184800 {
>>> +        #index-cells = <1>;
>>> +        compatible = "fsl,imx6q-usbmisc";
>>> +        reg = <0x02184800 0x200>;
>>> +    };
>>> +
>>> +...
>>> diff --git a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
>>> b/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
>>> deleted file mode 100644
>>> index 29b8f65ff849..000000000000
>>> --- a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt
>>> +++ /dev/null
>>> @@ -1,19 +0,0 @@
>>> -* Freescale i.MX non-core registers
>>> -
>>> -Required properties:
>>> -- #index-cells: Cells used to describe usb controller index. Should
>>> be <1>
>>> -- compatible: Should be one of below:
>>> -	"fsl,imx6q-usbmisc" for imx6q
>>> -	"fsl,vf610-usbmisc" for Vybrid vf610
>>> -	"fsl,imx6sx-usbmisc" for imx6sx
>>> -	"fsl,imx7d-usbmisc" for imx7d
>>> -	"fsl,imx7ulp-usbmisc" for imx7ulp
>>> -	"fsl,imx8mm-usbmisc" for imx8mm
>>> -- reg: Should contain registers location and length
>>> -
>>> -Examples:
>>> -usbmisc@2184800 {
>>> -	#index-cells = <1>;
>>> -	compatible = "fsl,imx6q-usbmisc";
>>> -	reg = <0x02184800 0x200>;
>>> -};
>>> --
>>> 2.37.1
>>>