Message ID | 076994fc051e9230a3fef9e3eb5ec932104ef16a.1612867682.git.michal.simek@xilinx.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | usb: misc: Add support for Microchip USB5744 | expand |
On Tue, Feb 09, 2021 at 11:48:09AM +0100, Michal Simek wrote: > From: Piyush Mehta <piyush.mehta@xilinx.com> > > Added dt binding for usb5744 driver. > > Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com> > Signed-off-by: Michal Simek <michal.simek@xilinx.com> > --- > > Changes in v2: None > > .../bindings/usb/microchip,usb5744.yaml | 56 +++++++++++++++++++ > MAINTAINERS | 1 + > 2 files changed, 57 insertions(+) > create mode 100644 Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > > diff --git a/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > new file mode 100644 > index 000000000000..fe222f6db81d > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > @@ -0,0 +1,56 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/usb/microchip,usb5744.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > + > +title: Bindings for the Microchip USB5744 4-port Hub Controller > + > +description: > + Microchip’s USB5744 SmartHub™ IC is a 4 port, SuperSpeed (SS)/Hi-Speed (HS), > + low power, low pin count configurable and fully compliant with the USB 3.1 > + Gen 1 specification. The USB5744 also supports Full Speed (FS) and Low Speed > + (LS) USB signaling, offering complete coverage of all defined USB operating > + speeds. The new SuperSpeed hubs operate in parallel with the USB 2.0 > + controller, so 5 Gbps SuperSpeed data transfers are not affected by slower > + USB 2.0 traffic. > + > +maintainers: > + - Piyush Mehta <piyush.mehta@xilinx.com> > + - Michal Simek <michal.simek@xilinx.com> > + > +properties: > + compatible: > + const: microchip,usb5744 > + > + reg: > + maxItems: 1 > + description: | > + Specifies the i2c slave address, it is required and should be 0x2d > + if I2C is used. If I2C is not used, then this should be underneath the USB host as a USB device. That also implies a different compatible string. I'd suggest you just say I2C is required if that's your use. 'const: 0x2d' instead of maxItems is the schema to express the address if fixed. > + > + reset-gpios: > + maxItems: 1 > + description: > + The phandle and specifier for the GPIO that controls the RESET line of > + USB hub. > + > +required: > + - compatible > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/gpio/gpio.h> > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + usb5744@2d { > + compatible = "microchip,usb5744"; > + reg = <0x2d>; > + reset-gpios = <&gpio 44 GPIO_ACTIVE_HIGH>; > + }; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index 41e8d3d7faec..7439471b5d37 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -2697,6 +2697,7 @@ W: http://wiki.xilinx.com > T: git https://github.com/Xilinx/linux-xlnx.git > F: Documentation/devicetree/bindings/i2c/cdns,i2c-r1p10.yaml > F: Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml > +F: Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > F: arch/arm/mach-zynq/ > F: drivers/block/xsysace.c > F: drivers/clocksource/timer-cadence-ttc.c > -- > 2.30.0 >
Hi Rob, On 2/10/21 11:22 PM, Rob Herring wrote: > On Tue, Feb 09, 2021 at 11:48:09AM +0100, Michal Simek wrote: >> From: Piyush Mehta <piyush.mehta@xilinx.com> >> >> Added dt binding for usb5744 driver. >> >> Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com> >> Signed-off-by: Michal Simek <michal.simek@xilinx.com> >> --- >> >> Changes in v2: None >> >> .../bindings/usb/microchip,usb5744.yaml | 56 +++++++++++++++++++ >> MAINTAINERS | 1 + >> 2 files changed, 57 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/usb/microchip,usb5744.yaml >> >> diff --git a/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml >> new file mode 100644 >> index 000000000000..fe222f6db81d >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml >> @@ -0,0 +1,56 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: "http://devicetree.org/schemas/usb/microchip,usb5744.yaml#" >> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" >> + >> +title: Bindings for the Microchip USB5744 4-port Hub Controller >> + >> +description: >> + Microchip’s USB5744 SmartHub™ IC is a 4 port, SuperSpeed (SS)/Hi-Speed (HS), >> + low power, low pin count configurable and fully compliant with the USB 3.1 >> + Gen 1 specification. The USB5744 also supports Full Speed (FS) and Low Speed >> + (LS) USB signaling, offering complete coverage of all defined USB operating >> + speeds. The new SuperSpeed hubs operate in parallel with the USB 2.0 >> + controller, so 5 Gbps SuperSpeed data transfers are not affected by slower >> + USB 2.0 traffic. >> + >> +maintainers: >> + - Piyush Mehta <piyush.mehta@xilinx.com> >> + - Michal Simek <michal.simek@xilinx.com> >> + >> +properties: >> + compatible: >> + const: microchip,usb5744 >> + >> + reg: >> + maxItems: 1 >> + description: | >> + Specifies the i2c slave address, it is required and should be 0x2d >> + if I2C is used. > > If I2C is not used, then this should be underneath the USB host as a USB > device. That also implies a different compatible string. I'd suggest you > just say I2C is required if that's your use. We can't say that i2c is required because we have both cases. One is really usb hub connected over i2c which at least requires to send one smbus command to start operate. But it can be extended to add more features - limit speeds, disable ports, etc. And the second is really the same usb hub without i2c connected which runs in default mode. But reset is required to ensure proper reset sequence. Hub also have external clock chip which is not handled now because it is just crystal on the board but if you want I can also model it via fixed clock and call clock enable for it. It is the same use case as is with Documentation/devicetree/bindings/usb/usb3503.txt Can you please elaborate why different compatible string should be used? It is still the same device and not quite sure why different compatible string should be used. Do you also want to example where this node is the part of usb node? > > 'const: 0x2d' instead of maxItems is the schema to express the address > if fixed. Will fix. Thanks, Michal
On Thu, Feb 11, 2021 at 3:35 AM Michal Simek <michal.simek@xilinx.com> wrote: > > Hi Rob, > > On 2/10/21 11:22 PM, Rob Herring wrote: > > On Tue, Feb 09, 2021 at 11:48:09AM +0100, Michal Simek wrote: > >> From: Piyush Mehta <piyush.mehta@xilinx.com> > >> > >> Added dt binding for usb5744 driver. > >> > >> Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com> > >> Signed-off-by: Michal Simek <michal.simek@xilinx.com> > >> --- > >> > >> Changes in v2: None > >> > >> .../bindings/usb/microchip,usb5744.yaml | 56 +++++++++++++++++++ > >> MAINTAINERS | 1 + > >> 2 files changed, 57 insertions(+) > >> create mode 100644 Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > >> > >> diff --git a/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > >> new file mode 100644 > >> index 000000000000..fe222f6db81d > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > >> @@ -0,0 +1,56 @@ > >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >> +%YAML 1.2 > >> +--- > >> +$id: "http://devicetree.org/schemas/usb/microchip,usb5744.yaml#" > >> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > >> + > >> +title: Bindings for the Microchip USB5744 4-port Hub Controller > >> + > >> +description: > >> + Microchip’s USB5744 SmartHub™ IC is a 4 port, SuperSpeed (SS)/Hi-Speed (HS), > >> + low power, low pin count configurable and fully compliant with the USB 3.1 > >> + Gen 1 specification. The USB5744 also supports Full Speed (FS) and Low Speed > >> + (LS) USB signaling, offering complete coverage of all defined USB operating > >> + speeds. The new SuperSpeed hubs operate in parallel with the USB 2.0 > >> + controller, so 5 Gbps SuperSpeed data transfers are not affected by slower > >> + USB 2.0 traffic. > >> + > >> +maintainers: > >> + - Piyush Mehta <piyush.mehta@xilinx.com> > >> + - Michal Simek <michal.simek@xilinx.com> > >> + > >> +properties: > >> + compatible: > >> + const: microchip,usb5744 > >> + > >> + reg: > >> + maxItems: 1 > >> + description: | > >> + Specifies the i2c slave address, it is required and should be 0x2d > >> + if I2C is used. > > > > If I2C is not used, then this should be underneath the USB host as a USB > > device. That also implies a different compatible string. I'd suggest you > > just say I2C is required if that's your use. > > We can't say that i2c is required because we have both cases. One is > really usb hub connected over i2c which at least requires to send one > smbus command to start operate. But it can be extended to add more > features - limit speeds, disable ports, etc. > > And the second is really the same usb hub without i2c connected which > runs in default mode. But reset is required to ensure proper reset > sequence. > Hub also have external clock chip which is not handled now because it is > just crystal on the board but if you want I can also model it via fixed > clock and call clock enable for it. > > It is the same use case as is with > Documentation/devicetree/bindings/usb/usb3503.txt Yes, there are examples of how we don't want to do it. > Can you please elaborate why different compatible string should be used? > It is still the same device and not quite sure why different compatible > string should be used. > > Do you also want to example where this node is the part of usb node? See usb/usb-device.txt. And there is this[1] under review. For these cases with I2C, I'd really rather see the hub always under the USB bus with a link to the I2C bus when connected. Rob [1] https://lore.kernel.org/linux-devicetree/20210210091015.v5.1.I248292623d3d0f6a4f0c5bc58478ca3c0062b49a@changeid/
Hi Rob, On 2/11/21 3:42 PM, Rob Herring wrote: > On Thu, Feb 11, 2021 at 3:35 AM Michal Simek <michal.simek@xilinx.com> wrote: >> >> Hi Rob, >> >> On 2/10/21 11:22 PM, Rob Herring wrote: >>> On Tue, Feb 09, 2021 at 11:48:09AM +0100, Michal Simek wrote: >>>> From: Piyush Mehta <piyush.mehta@xilinx.com> >>>> >>>> Added dt binding for usb5744 driver. >>>> >>>> Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com> >>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com> >>>> --- >>>> >>>> Changes in v2: None >>>> >>>> .../bindings/usb/microchip,usb5744.yaml | 56 +++++++++++++++++++ >>>> MAINTAINERS | 1 + >>>> 2 files changed, 57 insertions(+) >>>> create mode 100644 Documentation/devicetree/bindings/usb/microchip,usb5744.yaml >>>> >>>> diff --git a/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml >>>> new file mode 100644 >>>> index 000000000000..fe222f6db81d >>>> --- /dev/null >>>> +++ b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml >>>> @@ -0,0 +1,56 @@ >>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>>> +%YAML 1.2 >>>> +--- >>>> +$id: "http://devicetree.org/schemas/usb/microchip,usb5744.yaml#" >>>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" >>>> + >>>> +title: Bindings for the Microchip USB5744 4-port Hub Controller >>>> + >>>> +description: >>>> + Microchip’s USB5744 SmartHub™ IC is a 4 port, SuperSpeed (SS)/Hi-Speed (HS), >>>> + low power, low pin count configurable and fully compliant with the USB 3.1 >>>> + Gen 1 specification. The USB5744 also supports Full Speed (FS) and Low Speed >>>> + (LS) USB signaling, offering complete coverage of all defined USB operating >>>> + speeds. The new SuperSpeed hubs operate in parallel with the USB 2.0 >>>> + controller, so 5 Gbps SuperSpeed data transfers are not affected by slower >>>> + USB 2.0 traffic. >>>> + >>>> +maintainers: >>>> + - Piyush Mehta <piyush.mehta@xilinx.com> >>>> + - Michal Simek <michal.simek@xilinx.com> >>>> + >>>> +properties: >>>> + compatible: >>>> + const: microchip,usb5744 >>>> + >>>> + reg: >>>> + maxItems: 1 >>>> + description: | >>>> + Specifies the i2c slave address, it is required and should be 0x2d >>>> + if I2C is used. >>> >>> If I2C is not used, then this should be underneath the USB host as a USB >>> device. That also implies a different compatible string. I'd suggest you >>> just say I2C is required if that's your use. >> >> We can't say that i2c is required because we have both cases. One is >> really usb hub connected over i2c which at least requires to send one >> smbus command to start operate. But it can be extended to add more >> features - limit speeds, disable ports, etc. >> >> And the second is really the same usb hub without i2c connected which >> runs in default mode. But reset is required to ensure proper reset >> sequence. >> Hub also have external clock chip which is not handled now because it is >> just crystal on the board but if you want I can also model it via fixed >> clock and call clock enable for it. >> >> It is the same use case as is with >> Documentation/devicetree/bindings/usb/usb3503.txt > > Yes, there are examples of how we don't want to do it. ok. > >> Can you please elaborate why different compatible string should be used? >> It is still the same device and not quite sure why different compatible >> string should be used. >> >> Do you also want to example where this node is the part of usb node? > > See usb/usb-device.txt. And there is this[1] under review. > > For these cases with I2C, I'd really rather see the hub always under > the USB bus with a link to the I2C bus when connected. I read that thread and also looked at his device and it is very similar to this one. Binding should also have information about i2c or spi. It is the same case here that you can use this hub without any bus connected which works in default mode. Or when i2c/smbus is connected and the hub is waiting for initialization sequence. And I expect spi behaves very similarly but don't have this setup here. Do we have any binding doc which is using suggested bus link? Thanks, Michal
On Wed, Feb 24, 2021 at 7:38 AM Michal Simek <michal.simek@xilinx.com> wrote: > > Hi Rob, > > On 2/11/21 3:42 PM, Rob Herring wrote: > > On Thu, Feb 11, 2021 at 3:35 AM Michal Simek <michal.simek@xilinx.com> wrote: > >> > >> Hi Rob, > >> > >> On 2/10/21 11:22 PM, Rob Herring wrote: > >>> On Tue, Feb 09, 2021 at 11:48:09AM +0100, Michal Simek wrote: > >>>> From: Piyush Mehta <piyush.mehta@xilinx.com> > >>>> > >>>> Added dt binding for usb5744 driver. > >>>> > >>>> Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com> > >>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com> > >>>> --- > >>>> > >>>> Changes in v2: None > >>>> > >>>> .../bindings/usb/microchip,usb5744.yaml | 56 +++++++++++++++++++ > >>>> MAINTAINERS | 1 + > >>>> 2 files changed, 57 insertions(+) > >>>> create mode 100644 Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > >>>> > >>>> diff --git a/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > >>>> new file mode 100644 > >>>> index 000000000000..fe222f6db81d > >>>> --- /dev/null > >>>> +++ b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml > >>>> @@ -0,0 +1,56 @@ > >>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >>>> +%YAML 1.2 > >>>> +--- > >>>> +$id: "http://devicetree.org/schemas/usb/microchip,usb5744.yaml#" > >>>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > >>>> + > >>>> +title: Bindings for the Microchip USB5744 4-port Hub Controller > >>>> + > >>>> +description: > >>>> + Microchip’s USB5744 SmartHub™ IC is a 4 port, SuperSpeed (SS)/Hi-Speed (HS), > >>>> + low power, low pin count configurable and fully compliant with the USB 3.1 > >>>> + Gen 1 specification. The USB5744 also supports Full Speed (FS) and Low Speed > >>>> + (LS) USB signaling, offering complete coverage of all defined USB operating > >>>> + speeds. The new SuperSpeed hubs operate in parallel with the USB 2.0 > >>>> + controller, so 5 Gbps SuperSpeed data transfers are not affected by slower > >>>> + USB 2.0 traffic. > >>>> + > >>>> +maintainers: > >>>> + - Piyush Mehta <piyush.mehta@xilinx.com> > >>>> + - Michal Simek <michal.simek@xilinx.com> > >>>> + > >>>> +properties: > >>>> + compatible: > >>>> + const: microchip,usb5744 > >>>> + > >>>> + reg: > >>>> + maxItems: 1 > >>>> + description: | > >>>> + Specifies the i2c slave address, it is required and should be 0x2d > >>>> + if I2C is used. > >>> > >>> If I2C is not used, then this should be underneath the USB host as a USB > >>> device. That also implies a different compatible string. I'd suggest you > >>> just say I2C is required if that's your use. > >> > >> We can't say that i2c is required because we have both cases. One is > >> really usb hub connected over i2c which at least requires to send one > >> smbus command to start operate. But it can be extended to add more > >> features - limit speeds, disable ports, etc. > >> > >> And the second is really the same usb hub without i2c connected which > >> runs in default mode. But reset is required to ensure proper reset > >> sequence. > >> Hub also have external clock chip which is not handled now because it is > >> just crystal on the board but if you want I can also model it via fixed > >> clock and call clock enable for it. > >> > >> It is the same use case as is with > >> Documentation/devicetree/bindings/usb/usb3503.txt > > > > Yes, there are examples of how we don't want to do it. > > ok. > > > > >> Can you please elaborate why different compatible string should be used? > >> It is still the same device and not quite sure why different compatible > >> string should be used. > >> > >> Do you also want to example where this node is the part of usb node? > > > > See usb/usb-device.txt. And there is this[1] under review. > > > > For these cases with I2C, I'd really rather see the hub always under > > the USB bus with a link to the I2C bus when connected. > > I read that thread and also looked at his device and it is very similar > to this one. Binding should also have information about i2c or spi. It > is the same case here that you can use this hub without any bus > connected which works in default mode. Or when i2c/smbus is connected > and the hub is waiting for initialization sequence. And I expect spi > behaves very similarly but don't have this setup here. > > Do we have any binding doc which is using suggested bus link? 'i2c-bus' or 'ddc-i2c-bus' properties for I2C. Don't think we have anything for SPI, but I'd expect it would be similar though we'd need a cell for the chip-select. Rob
diff --git a/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml new file mode 100644 index 000000000000..fe222f6db81d --- /dev/null +++ b/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/microchip,usb5744.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Bindings for the Microchip USB5744 4-port Hub Controller + +description: + Microchip’s USB5744 SmartHub™ IC is a 4 port, SuperSpeed (SS)/Hi-Speed (HS), + low power, low pin count configurable and fully compliant with the USB 3.1 + Gen 1 specification. The USB5744 also supports Full Speed (FS) and Low Speed + (LS) USB signaling, offering complete coverage of all defined USB operating + speeds. The new SuperSpeed hubs operate in parallel with the USB 2.0 + controller, so 5 Gbps SuperSpeed data transfers are not affected by slower + USB 2.0 traffic. + +maintainers: + - Piyush Mehta <piyush.mehta@xilinx.com> + - Michal Simek <michal.simek@xilinx.com> + +properties: + compatible: + const: microchip,usb5744 + + reg: + maxItems: 1 + description: | + Specifies the i2c slave address, it is required and should be 0x2d + if I2C is used. + + reset-gpios: + maxItems: 1 + description: + The phandle and specifier for the GPIO that controls the RESET line of + USB hub. + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + usb5744@2d { + compatible = "microchip,usb5744"; + reg = <0x2d>; + reset-gpios = <&gpio 44 GPIO_ACTIVE_HIGH>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 41e8d3d7faec..7439471b5d37 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2697,6 +2697,7 @@ W: http://wiki.xilinx.com T: git https://github.com/Xilinx/linux-xlnx.git F: Documentation/devicetree/bindings/i2c/cdns,i2c-r1p10.yaml F: Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml +F: Documentation/devicetree/bindings/usb/microchip,usb5744.yaml F: arch/arm/mach-zynq/ F: drivers/block/xsysace.c F: drivers/clocksource/timer-cadence-ttc.c