All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Serge Semin <fancer.lancer@gmail.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Felipe Balbi <balbi@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Manu Gautam <mgautam@codeaurora.org>,
	Roger Quadros <rogerq@ti.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	arcml <linux-snps-arc@lists.infradead.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Linux USB List <linux-usb@vger.kernel.org>,
	devicetree@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
Date: Mon, 30 Nov 2020 08:38:13 -0700	[thread overview]
Message-ID: <CAL_JsqKscjEgArQDbdEgbdNfC7PGVku7Wmk1myjADpsBWqJt+g@mail.gmail.com> (raw)
In-Reply-To: <20201125083202.ytoyd62bg3s7kvvg@mobilestation>

On Wed, Nov 25, 2020 at 1:32 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> On Sat, Nov 21, 2020 at 06:42:28AM -0600, Rob Herring wrote:
> > On Thu, Nov 12, 2020 at 01:29:46PM +0300, Serge Semin wrote:
> > > On Wed, Nov 11, 2020 at 02:14:23PM -0600, Rob Herring wrote:
> > > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote:
> > > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI
> > > > > Controller schema, but with additional vendor-specific properties, the
> > > > > controller-specific reference clocks and PHYs. So let's convert the
> > > > > currently available legacy text-based DWC USB3 bindings to the DT schema
> > > > > and make sure the DWC USB3 nodes are also validated against the
> > > > > usb-xhci.yaml schema.
> > > > >
> > > > > Note we have to discard the nodename restriction of being prefixed with
> > > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
> > > > > are supposed to be named as "^usb(@.*)".
> > > > >
> > > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > >
> > > > > ---
> > > > >
> > > > > Changelog v2:
> > > > > - Discard '|' from the descriptions, since we don't need to preserve
> > > > >   the text formatting in any of them.
> > > > > - Drop quotes from around the string constants.
> > > > > - Fix the "clock-names" prop description to be referring the enumerated
> > > > >   clock-names instead of the ones from the Databook.
> > > > >
> > > > > Changelog v3:
> > > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work
> > > > >   as either host or otg.
> > > > >
> > > > > Changelog v4:
> > > > > - Apply usb-drd.yaml schema first. If the controller is configured
> > > > >   to work in a gadget mode only, then apply the usb.yaml schema too,
> > > > >   otherwise apply the usb-xhci.yaml schema.
> > > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more
> > > > >   time.
> > > > > ---
> > > > >  .../devicetree/bindings/usb/dwc3.txt          | 125 --------
> > > > >  .../devicetree/bindings/usb/snps,dwc3.yaml    | 303 ++++++++++++++++++
> > > > >  2 files changed, 303 insertions(+), 125 deletions(-)
> > > > >  delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
> > > > >  create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> >
> >
> > > > > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..079617891da6
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > @@ -0,0 +1,303 @@
> > > > > +# SPDX-License-Identifier: GPL-2.0
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: Synopsys DesignWare USB3 Controller
> > > > > +
> > > > > +maintainers:
> > > > > +  - Felipe Balbi <balbi@kernel.org>
> > > > > +
> > > > > +description:
> > > > > +  This is usually a subnode to DWC3 glue to which it is connected, but can also
> > > > > +  be presented as a standalone DT node with an optional vendor-specific
> > > > > +  compatible string.
> > > > > +
> > >
> > > > > +allOf:
> > > > > +  - $ref: usb-drd.yaml#
> > > > > +  - if:
> > > > > +      properties:
> > > > > +        dr_mode:
> > > > > +          const: peripheral
> >
>
> > Another thing, this evaluates to true if dr_mode is not present. You
> > need to add 'required'?
>
> Right. Will something like this do that?

Yes.

>
> + allOf:
> +  - $ref: usb-drd.yaml#
> +  - if:
> +      properties:
> +        dr_mode:
> +          const: peripheral
> +
> +      required:
> +        - dr_mode
> +    then:
> +      $ref: usb.yaml#
> +    else
> +      $ref: usb-xhci.yaml#
>
> > If dr_mode is otg, then don't you need to apply
> > both usb.yaml and usb-xhci.yaml?
>
> No I don't. Since there is no peripheral-specific DT schema, then the
> only schema any USB-gadget node needs to pass is usb.yaml, which
> is already included into the usb-xhci.yaml schema. So for pure OTG devices
> with xHCI host and gadget capabilities it's enough to evaluate: allOf:
> [$ref: usb-drd.yaml#, $ref: usb-xhci.yaml#].  Please see the
> sketch/ASCII-figure below and the following text for details.

Okay.

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Kevin Hilman <khilman@baylibre.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	arcml <linux-snps-arc@lists.infradead.org>,
	devicetree@vger.kernel.org,
	Mathias Nyman <mathias.nyman@intel.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Roger Quadros <rogerq@ti.com>, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	Serge Semin <fancer.lancer@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Manu Gautam <mgautam@codeaurora.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
Date: Mon, 30 Nov 2020 08:38:13 -0700	[thread overview]
Message-ID: <CAL_JsqKscjEgArQDbdEgbdNfC7PGVku7Wmk1myjADpsBWqJt+g@mail.gmail.com> (raw)
In-Reply-To: <20201125083202.ytoyd62bg3s7kvvg@mobilestation>

On Wed, Nov 25, 2020 at 1:32 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> On Sat, Nov 21, 2020 at 06:42:28AM -0600, Rob Herring wrote:
> > On Thu, Nov 12, 2020 at 01:29:46PM +0300, Serge Semin wrote:
> > > On Wed, Nov 11, 2020 at 02:14:23PM -0600, Rob Herring wrote:
> > > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote:
> > > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI
> > > > > Controller schema, but with additional vendor-specific properties, the
> > > > > controller-specific reference clocks and PHYs. So let's convert the
> > > > > currently available legacy text-based DWC USB3 bindings to the DT schema
> > > > > and make sure the DWC USB3 nodes are also validated against the
> > > > > usb-xhci.yaml schema.
> > > > >
> > > > > Note we have to discard the nodename restriction of being prefixed with
> > > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
> > > > > are supposed to be named as "^usb(@.*)".
> > > > >
> > > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > >
> > > > > ---
> > > > >
> > > > > Changelog v2:
> > > > > - Discard '|' from the descriptions, since we don't need to preserve
> > > > >   the text formatting in any of them.
> > > > > - Drop quotes from around the string constants.
> > > > > - Fix the "clock-names" prop description to be referring the enumerated
> > > > >   clock-names instead of the ones from the Databook.
> > > > >
> > > > > Changelog v3:
> > > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work
> > > > >   as either host or otg.
> > > > >
> > > > > Changelog v4:
> > > > > - Apply usb-drd.yaml schema first. If the controller is configured
> > > > >   to work in a gadget mode only, then apply the usb.yaml schema too,
> > > > >   otherwise apply the usb-xhci.yaml schema.
> > > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more
> > > > >   time.
> > > > > ---
> > > > >  .../devicetree/bindings/usb/dwc3.txt          | 125 --------
> > > > >  .../devicetree/bindings/usb/snps,dwc3.yaml    | 303 ++++++++++++++++++
> > > > >  2 files changed, 303 insertions(+), 125 deletions(-)
> > > > >  delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
> > > > >  create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> >
> >
> > > > > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..079617891da6
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > @@ -0,0 +1,303 @@
> > > > > +# SPDX-License-Identifier: GPL-2.0
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: Synopsys DesignWare USB3 Controller
> > > > > +
> > > > > +maintainers:
> > > > > +  - Felipe Balbi <balbi@kernel.org>
> > > > > +
> > > > > +description:
> > > > > +  This is usually a subnode to DWC3 glue to which it is connected, but can also
> > > > > +  be presented as a standalone DT node with an optional vendor-specific
> > > > > +  compatible string.
> > > > > +
> > >
> > > > > +allOf:
> > > > > +  - $ref: usb-drd.yaml#
> > > > > +  - if:
> > > > > +      properties:
> > > > > +        dr_mode:
> > > > > +          const: peripheral
> >
>
> > Another thing, this evaluates to true if dr_mode is not present. You
> > need to add 'required'?
>
> Right. Will something like this do that?

Yes.

>
> + allOf:
> +  - $ref: usb-drd.yaml#
> +  - if:
> +      properties:
> +        dr_mode:
> +          const: peripheral
> +
> +      required:
> +        - dr_mode
> +    then:
> +      $ref: usb.yaml#
> +    else
> +      $ref: usb-xhci.yaml#
>
> > If dr_mode is otg, then don't you need to apply
> > both usb.yaml and usb-xhci.yaml?
>
> No I don't. Since there is no peripheral-specific DT schema, then the
> only schema any USB-gadget node needs to pass is usb.yaml, which
> is already included into the usb-xhci.yaml schema. So for pure OTG devices
> with xHCI host and gadget capabilities it's enough to evaluate: allOf:
> [$ref: usb-drd.yaml#, $ref: usb-xhci.yaml#].  Please see the
> sketch/ASCII-figure below and the following text for details.

Okay.

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Kevin Hilman <khilman@baylibre.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	arcml <linux-snps-arc@lists.infradead.org>,
	devicetree@vger.kernel.org,
	Mathias Nyman <mathias.nyman@intel.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Roger Quadros <rogerq@ti.com>, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	Serge Semin <fancer.lancer@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Manu Gautam <mgautam@codeaurora.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
Date: Mon, 30 Nov 2020 08:38:13 -0700	[thread overview]
Message-ID: <CAL_JsqKscjEgArQDbdEgbdNfC7PGVku7Wmk1myjADpsBWqJt+g@mail.gmail.com> (raw)
In-Reply-To: <20201125083202.ytoyd62bg3s7kvvg@mobilestation>

On Wed, Nov 25, 2020 at 1:32 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> On Sat, Nov 21, 2020 at 06:42:28AM -0600, Rob Herring wrote:
> > On Thu, Nov 12, 2020 at 01:29:46PM +0300, Serge Semin wrote:
> > > On Wed, Nov 11, 2020 at 02:14:23PM -0600, Rob Herring wrote:
> > > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote:
> > > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI
> > > > > Controller schema, but with additional vendor-specific properties, the
> > > > > controller-specific reference clocks and PHYs. So let's convert the
> > > > > currently available legacy text-based DWC USB3 bindings to the DT schema
> > > > > and make sure the DWC USB3 nodes are also validated against the
> > > > > usb-xhci.yaml schema.
> > > > >
> > > > > Note we have to discard the nodename restriction of being prefixed with
> > > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
> > > > > are supposed to be named as "^usb(@.*)".
> > > > >
> > > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > >
> > > > > ---
> > > > >
> > > > > Changelog v2:
> > > > > - Discard '|' from the descriptions, since we don't need to preserve
> > > > >   the text formatting in any of them.
> > > > > - Drop quotes from around the string constants.
> > > > > - Fix the "clock-names" prop description to be referring the enumerated
> > > > >   clock-names instead of the ones from the Databook.
> > > > >
> > > > > Changelog v3:
> > > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work
> > > > >   as either host or otg.
> > > > >
> > > > > Changelog v4:
> > > > > - Apply usb-drd.yaml schema first. If the controller is configured
> > > > >   to work in a gadget mode only, then apply the usb.yaml schema too,
> > > > >   otherwise apply the usb-xhci.yaml schema.
> > > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more
> > > > >   time.
> > > > > ---
> > > > >  .../devicetree/bindings/usb/dwc3.txt          | 125 --------
> > > > >  .../devicetree/bindings/usb/snps,dwc3.yaml    | 303 ++++++++++++++++++
> > > > >  2 files changed, 303 insertions(+), 125 deletions(-)
> > > > >  delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
> > > > >  create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> >
> >
> > > > > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..079617891da6
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > @@ -0,0 +1,303 @@
> > > > > +# SPDX-License-Identifier: GPL-2.0
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: Synopsys DesignWare USB3 Controller
> > > > > +
> > > > > +maintainers:
> > > > > +  - Felipe Balbi <balbi@kernel.org>
> > > > > +
> > > > > +description:
> > > > > +  This is usually a subnode to DWC3 glue to which it is connected, but can also
> > > > > +  be presented as a standalone DT node with an optional vendor-specific
> > > > > +  compatible string.
> > > > > +
> > >
> > > > > +allOf:
> > > > > +  - $ref: usb-drd.yaml#
> > > > > +  - if:
> > > > > +      properties:
> > > > > +        dr_mode:
> > > > > +          const: peripheral
> >
>
> > Another thing, this evaluates to true if dr_mode is not present. You
> > need to add 'required'?
>
> Right. Will something like this do that?

Yes.

>
> + allOf:
> +  - $ref: usb-drd.yaml#
> +  - if:
> +      properties:
> +        dr_mode:
> +          const: peripheral
> +
> +      required:
> +        - dr_mode
> +    then:
> +      $ref: usb.yaml#
> +    else
> +      $ref: usb-xhci.yaml#
>
> > If dr_mode is otg, then don't you need to apply
> > both usb.yaml and usb-xhci.yaml?
>
> No I don't. Since there is no peripheral-specific DT schema, then the
> only schema any USB-gadget node needs to pass is usb.yaml, which
> is already included into the usb-xhci.yaml schema. So for pure OTG devices
> with xHCI host and gadget capabilities it's enough to evaluate: allOf:
> [$ref: usb-drd.yaml#, $ref: usb-xhci.yaml#].  Please see the
> sketch/ASCII-figure below and the following text for details.

Okay.

Rob

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Kevin Hilman <khilman@baylibre.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	arcml <linux-snps-arc@lists.infradead.org>,
	devicetree@vger.kernel.org,
	Mathias Nyman <mathias.nyman@intel.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Roger Quadros <rogerq@ti.com>, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	Serge Semin <fancer.lancer@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Manu Gautam <mgautam@codeaurora.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
Date: Mon, 30 Nov 2020 08:38:13 -0700	[thread overview]
Message-ID: <CAL_JsqKscjEgArQDbdEgbdNfC7PGVku7Wmk1myjADpsBWqJt+g@mail.gmail.com> (raw)
In-Reply-To: <20201125083202.ytoyd62bg3s7kvvg@mobilestation>

On Wed, Nov 25, 2020 at 1:32 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> On Sat, Nov 21, 2020 at 06:42:28AM -0600, Rob Herring wrote:
> > On Thu, Nov 12, 2020 at 01:29:46PM +0300, Serge Semin wrote:
> > > On Wed, Nov 11, 2020 at 02:14:23PM -0600, Rob Herring wrote:
> > > > On Wed, Nov 11, 2020 at 12:08:45PM +0300, Serge Semin wrote:
> > > > > DWC USB3 DT node is supposed to be compliant with the Generic xHCI
> > > > > Controller schema, but with additional vendor-specific properties, the
> > > > > controller-specific reference clocks and PHYs. So let's convert the
> > > > > currently available legacy text-based DWC USB3 bindings to the DT schema
> > > > > and make sure the DWC USB3 nodes are also validated against the
> > > > > usb-xhci.yaml schema.
> > > > >
> > > > > Note we have to discard the nodename restriction of being prefixed with
> > > > > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
> > > > > are supposed to be named as "^usb(@.*)".
> > > > >
> > > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > >
> > > > > ---
> > > > >
> > > > > Changelog v2:
> > > > > - Discard '|' from the descriptions, since we don't need to preserve
> > > > >   the text formatting in any of them.
> > > > > - Drop quotes from around the string constants.
> > > > > - Fix the "clock-names" prop description to be referring the enumerated
> > > > >   clock-names instead of the ones from the Databook.
> > > > >
> > > > > Changelog v3:
> > > > > - Apply usb-xhci.yaml# schema only if the controller is supposed to work
> > > > >   as either host or otg.
> > > > >
> > > > > Changelog v4:
> > > > > - Apply usb-drd.yaml schema first. If the controller is configured
> > > > >   to work in a gadget mode only, then apply the usb.yaml schema too,
> > > > >   otherwise apply the usb-xhci.yaml schema.
> > > > > - Discard the Rob'es Reviewed-by tag. Please review the patch one more
> > > > >   time.
> > > > > ---
> > > > >  .../devicetree/bindings/usb/dwc3.txt          | 125 --------
> > > > >  .../devicetree/bindings/usb/snps,dwc3.yaml    | 303 ++++++++++++++++++
> > > > >  2 files changed, 303 insertions(+), 125 deletions(-)
> > > > >  delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
> > > > >  create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> >
> >
> > > > > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..079617891da6
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > > > > @@ -0,0 +1,303 @@
> > > > > +# SPDX-License-Identifier: GPL-2.0
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: Synopsys DesignWare USB3 Controller
> > > > > +
> > > > > +maintainers:
> > > > > +  - Felipe Balbi <balbi@kernel.org>
> > > > > +
> > > > > +description:
> > > > > +  This is usually a subnode to DWC3 glue to which it is connected, but can also
> > > > > +  be presented as a standalone DT node with an optional vendor-specific
> > > > > +  compatible string.
> > > > > +
> > >
> > > > > +allOf:
> > > > > +  - $ref: usb-drd.yaml#
> > > > > +  - if:
> > > > > +      properties:
> > > > > +        dr_mode:
> > > > > +          const: peripheral
> >
>
> > Another thing, this evaluates to true if dr_mode is not present. You
> > need to add 'required'?
>
> Right. Will something like this do that?

Yes.

>
> + allOf:
> +  - $ref: usb-drd.yaml#
> +  - if:
> +      properties:
> +        dr_mode:
> +          const: peripheral
> +
> +      required:
> +        - dr_mode
> +    then:
> +      $ref: usb.yaml#
> +    else
> +      $ref: usb-xhci.yaml#
>
> > If dr_mode is otg, then don't you need to apply
> > both usb.yaml and usb-xhci.yaml?
>
> No I don't. Since there is no peripheral-specific DT schema, then the
> only schema any USB-gadget node needs to pass is usb.yaml, which
> is already included into the usb-xhci.yaml schema. So for pure OTG devices
> with xHCI host and gadget capabilities it's enough to evaluate: allOf:
> [$ref: usb-drd.yaml#, $ref: usb-xhci.yaml#].  Please see the
> sketch/ASCII-figure below and the following text for details.

Okay.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-30 15:39 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  9:08 [PATCH v4 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
2020-11-11  9:08 ` Serge Semin
2020-11-11  9:08 ` Serge Semin
2020-11-11  9:08 ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 01/18] dt-bindings: usb: usb-hcd: Detach generic USB controller properties Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11 19:16   ` Rob Herring
2020-11-11 19:16     ` Rob Herring
2020-11-11 19:16     ` Rob Herring
2020-11-11 19:16     ` Rob Herring
2020-11-11 19:30     ` Serge Semin
2020-11-11 19:30       ` Serge Semin
2020-11-11 19:30       ` Serge Semin
2020-11-11 19:30       ` Serge Semin
2020-11-13  6:04   ` Chunfeng Yun
2020-11-13  6:04     ` Chunfeng Yun
2020-11-13  6:04     ` Chunfeng Yun
2020-11-13  6:04     ` Chunfeng Yun
2020-11-11  9:08 ` [PATCH v4 02/18] dt-bindings: usb: Convert generic USB properties to DT schemas Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-21 12:44   ` Rob Herring
2020-11-21 12:44     ` Rob Herring
2020-11-21 12:44     ` Rob Herring
2020-11-21 12:44     ` Rob Herring
2020-11-11  9:08 ` [PATCH v4 03/18] dt-bindings: usb: usb-drd: Add "otg-rev" property constraints Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 04/18] dt-bindings: usb: Add "ulpi/serial/hsic" PHY types Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 06/18] dt-bindings: usb: Add generic "usb-phy" property Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 08/18] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 09/18] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:16   ` Krzysztof Kozlowski
2020-11-11  9:16     ` Krzysztof Kozlowski
2020-11-11  9:16     ` Krzysztof Kozlowski
2020-11-11  9:16     ` Krzysztof Kozlowski
2020-11-11  9:32     ` Serge Semin
2020-11-11  9:32       ` Serge Semin
2020-11-11  9:32       ` Serge Semin
2020-11-11  9:32       ` Serge Semin
2020-11-11  9:34       ` Krzysztof Kozlowski
2020-11-11  9:34         ` Krzysztof Kozlowski
2020-11-11  9:34         ` Krzysztof Kozlowski
2020-11-11  9:34         ` Krzysztof Kozlowski
2020-11-11  9:40         ` Serge Semin
2020-11-11  9:40           ` Serge Semin
2020-11-11  9:40           ` Serge Semin
2020-11-11  9:40           ` Serge Semin
2020-11-11 20:14   ` Rob Herring
2020-11-11 20:14     ` Rob Herring
2020-11-11 20:14     ` Rob Herring
2020-11-11 20:14     ` Rob Herring
2020-11-12 10:29     ` Serge Semin
2020-11-12 10:29       ` Serge Semin
2020-11-12 10:29       ` Serge Semin
2020-11-12 10:29       ` Serge Semin
2020-11-21 12:42       ` Rob Herring
2020-11-21 12:42         ` Rob Herring
2020-11-21 12:42         ` Rob Herring
2020-11-21 12:42         ` Rob Herring
2020-11-25  8:32         ` Serge Semin
2020-11-25  8:32           ` Serge Semin
2020-11-25  8:32           ` Serge Semin
2020-11-25  8:32           ` Serge Semin
2020-11-30 15:38           ` Rob Herring [this message]
2020-11-30 15:38             ` Rob Herring
2020-11-30 15:38             ` Rob Herring
2020-11-30 15:38             ` Rob Herring
2020-11-11  9:08 ` [PATCH v4 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 12/18] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string Serge Semin
2020-11-11  9:08   ` [PATCH v4 12/18] dt-bindings: usb: dwc3: Add synopsys, dwc3 " Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis constraints Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj constraints Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 15/18] dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08 ` [PATCH v4 18/18] dt-bindings: usb: qcom,dwc3: " Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin
2020-11-11  9:08   ` Serge Semin

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=CAL_JsqKscjEgArQDbdEgbdNfC7PGVku7Wmk1myjADpsBWqJt+g@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=chunfeng.yun@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@baylibre.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mathias.nyman@intel.com \
    --cc=mgautam@codeaurora.org \
    --cc=narmstrong@baylibre.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=rogerq@ti.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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.