devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/12] usb: Handle different sublink speeds
@ 2020-09-25  2:41 Thinh Nguyen
  2020-09-25  2:42 ` [PATCH v5 06/12] usb: devicetree: Include USB SSP Gen X x Y Thinh Nguyen
  2020-09-29 18:13 ` [PATCH v5 00/12] usb: Handle different sublink speeds Thinh Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Thinh Nguyen @ 2020-09-25  2:41 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Thinh.Nguyen, linux-usb,
	devicetree, Rob Herring, Peter Chen, Lee Jones, Alan Stern,
	Dejin Zheng, Jun Li, Marek Szyprowski
  Cc: John Youn

A USB super-speed-plus device may operate at different sublink speed and lane
count (e.g. gen2x2, gen1x2, or gen2x1). The usb gadget stack needs to be able
to handle a couple things:

1) Report the sublink speed attributes the device support
2) Select the sublink speed attribute

This series introduces sublink speed attribute structure to ch9.h to capture
the device capability of the gadget. It also introduces a new gadget ops
udc_set_num_lanes_and_speed to select a specific sublink speed.

DWC3 needs this support for DWC_usb32 IP. Implement the new changes for DWC3.

Changes in v5:
 - Rebase on Felipe's testing/next branch
 - Changed Signed-off-by email to match From: email header
 - Add Rob's Reviewed-by

Changes in v4:
 - Instead of using a single function to parse "maximum-speed" property for
   speed, gen X, and number of lanes, split those tasks to separate common
   functions
 - Revise DWC3 driver to use those new common functions
 - Fix checkpatch warnings for using "unsigned" rather than "unsigned int" and
   missing identifier name in udc_set_num_lanes_and_speed gadget ops

Changes in v3:
 - Remove "num-lanes" and "lane-speed-mantissa-gbps" common properties
 - Remove "num-lanes" and "lane-speed-mantissa-gbps" properties validation in dwc3
 - Update "maximum-speed" to support variations of SSP Gen X x Y
 - Update common function to parse new strings for "maximum-speed"
 - Update commit messages for the new changes

Changes in v2:
 - Move usb_sublink_speed attribute struct and enum to include/linux/usb/ch9.h
 - Use "num-lanes" and "lane-speed-mantissa-gbps" as common properties instead
 - Add common functions to get num-lanes and lsm properties
 - Fix missing gen1x2 sublink speed attribute check report in dwc3


Thinh Nguyen (12):
  usb: ch9: Add sublink speed struct
  usb: gadget: composite: Avoid using magic numbers
  usb: gadget: Expose sublink speed attributes
  usb: gadget: Set max speed for SSP devices
  usb: composite: Properly report sublink speed
  usb: devicetree: Include USB SSP Gen X x Y
  usb: common: Add and update common functions for SSP speeds
  usb: dwc3: Initialize lane count and sublink speed
  usb: dwc3: gadget: Report sublink speed capability
  usb: dwc3: gadget: Implement setting of sublink speed
  usb: dwc3: gadget: Track connected lane and sublink speed
  usb: dwc3: gadget: Set speed only up to the max supported

 .../devicetree/bindings/usb/generic.txt       |  11 +-
 drivers/usb/common/common.c                   |  46 +++++-
 drivers/usb/dwc3/core.c                       |  29 ++++
 drivers/usb/dwc3/core.h                       |  14 ++
 drivers/usb/dwc3/gadget.c                     | 143 +++++++++++++++++-
 drivers/usb/gadget/composite.c                |  81 ++++++----
 drivers/usb/gadget/udc/core.c                 |  24 ++-
 include/linux/usb/ch9.h                       |  73 +++++++++
 include/linux/usb/gadget.h                    |  23 +++
 9 files changed, 403 insertions(+), 41 deletions(-)


base-commit: 1b28687a9c679499ddaa46dac6ca3660e46801c5
-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v5 06/12] usb: devicetree: Include USB SSP Gen X x Y
  2020-09-25  2:41 [PATCH v5 00/12] usb: Handle different sublink speeds Thinh Nguyen
@ 2020-09-25  2:42 ` Thinh Nguyen
  2020-09-29 18:13 ` [PATCH v5 00/12] usb: Handle different sublink speeds Thinh Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2020-09-25  2:42 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Thinh.Nguyen, linux-usb,
	devicetree, Rob Herring
  Cc: John Youn

According to the USB 3.2 spec, a super-speed-plus device can operate at
gen2x2, gen2x1, or gen1x2. If the USB controller device supports
multiple lanes at different transfer rates, the user can specify the HW
capability via these new speed strings:

"super-speed-plus-gen2x2"
"super-speed-plus-gen2x1"
"super-speed-plus-gen1x2"

If the argument is simply "super-speed-plus", USB controllers should
default to their maximum transfer rate and number of lanes.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
Changes in v5:
- Add Reviewed-by: Rob Herring <robh@kernel.org>
- Rebase on Felipe's testing/next branch
- Changed Signed-off-by email to match From: email header
Changes in v4:
- None
Changes in v3:
- Use "maximum-speed" to include both the num-lane and transfer rate for SSP
- Remove "num-lanes" and "lane-speed-mantissa-gbps" properties
Changes in v2:
- Make "num-lanes" and "lane-speed-mantissa-gbps" common USB properties

 Documentation/devicetree/bindings/usb/generic.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt
index ba472e7aefc9..8541b9571f2f 100644
--- a/Documentation/devicetree/bindings/usb/generic.txt
+++ b/Documentation/devicetree/bindings/usb/generic.txt
@@ -3,10 +3,13 @@ Generic USB Properties
 Optional properties:
  - maximum-speed: tells USB controllers we want to work up to a certain
 			speed. Valid arguments are "super-speed-plus",
-			"super-speed", "high-speed", "full-speed" and
-			"low-speed". In case this isn't passed via DT, USB
-			controllers should default to their maximum HW
-			capability.
+			"super-speed-plus-gen2x2", "super-speed-plus-gen2x1",
+			"super-speed-plus-gen1x2", "super-speed", "high-speed",
+			"full-speed" and "low-speed". In case this isn't passed
+			via DT, USB controllers should default to their maximum
+			HW capability. Similarly, if the argument is
+			"super-speed-plus", USB controllers should default to
+			their maximum transfer rate and number of lanes.
  - dr_mode: tells Dual-Role USB controllers that we want to work on a
 			particular mode. Valid arguments are "host",
 			"peripheral" and "otg". In case this attribute isn't
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v5 00/12] usb: Handle different sublink speeds
  2020-09-25  2:41 [PATCH v5 00/12] usb: Handle different sublink speeds Thinh Nguyen
  2020-09-25  2:42 ` [PATCH v5 06/12] usb: devicetree: Include USB SSP Gen X x Y Thinh Nguyen
@ 2020-09-29 18:13 ` Thinh Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2020-09-29 18:13 UTC (permalink / raw)
  To: Thinh Nguyen, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	devicetree, Rob Herring, Peter Chen, Lee Jones, Alan Stern,
	Dejin Zheng, Jun Li, Marek Szyprowski
  Cc: John Youn

Hi Greg/Felipe,

Thinh Nguyen wrote:
> A USB super-speed-plus device may operate at different sublink speed and lane
> count (e.g. gen2x2, gen1x2, or gen2x1). The usb gadget stack needs to be able
> to handle a couple things:
>
> 1) Report the sublink speed attributes the device support
> 2) Select the sublink speed attribute
>
> This series introduces sublink speed attribute structure to ch9.h to capture
> the device capability of the gadget. It also introduces a new gadget ops
> udc_set_num_lanes_and_speed to select a specific sublink speed.
>
> DWC3 needs this support for DWC_usb32 IP. Implement the new changes for DWC3.
>
> Changes in v5:
>  - Rebase on Felipe's testing/next branch
>  - Changed Signed-off-by email to match From: email header
>  - Add Rob's Reviewed-by
>
> Changes in v4:
>  - Instead of using a single function to parse "maximum-speed" property for
>    speed, gen X, and number of lanes, split those tasks to separate common
>    functions
>  - Revise DWC3 driver to use those new common functions
>  - Fix checkpatch warnings for using "unsigned" rather than "unsigned int" and
>    missing identifier name in udc_set_num_lanes_and_speed gadget ops
>
> Changes in v3:
>  - Remove "num-lanes" and "lane-speed-mantissa-gbps" common properties
>  - Remove "num-lanes" and "lane-speed-mantissa-gbps" properties validation in dwc3
>  - Update "maximum-speed" to support variations of SSP Gen X x Y
>  - Update common function to parse new strings for "maximum-speed"
>  - Update commit messages for the new changes
>
> Changes in v2:
>  - Move usb_sublink_speed attribute struct and enum to include/linux/usb/ch9.h
>  - Use "num-lanes" and "lane-speed-mantissa-gbps" as common properties instead
>  - Add common functions to get num-lanes and lsm properties
>  - Fix missing gen1x2 sublink speed attribute check report in dwc3
>
>
> Thinh Nguyen (12):
>   usb: ch9: Add sublink speed struct
>   usb: gadget: composite: Avoid using magic numbers
>   usb: gadget: Expose sublink speed attributes
>   usb: gadget: Set max speed for SSP devices
>   usb: composite: Properly report sublink speed
>   usb: devicetree: Include USB SSP Gen X x Y
>   usb: common: Add and update common functions for SSP speeds
>   usb: dwc3: Initialize lane count and sublink speed
>   usb: dwc3: gadget: Report sublink speed capability
>   usb: dwc3: gadget: Implement setting of sublink speed
>   usb: dwc3: gadget: Track connected lane and sublink speed
>   usb: dwc3: gadget: Set speed only up to the max supported
>
>  .../devicetree/bindings/usb/generic.txt       |  11 +-
>  drivers/usb/common/common.c                   |  46 +++++-
>  drivers/usb/dwc3/core.c                       |  29 ++++
>  drivers/usb/dwc3/core.h                       |  14 ++
>  drivers/usb/dwc3/gadget.c                     | 143 +++++++++++++++++-
>  drivers/usb/gadget/composite.c                |  81 ++++++----
>  drivers/usb/gadget/udc/core.c                 |  24 ++-
>  include/linux/usb/ch9.h                       |  73 +++++++++
>  include/linux/usb/gadget.h                    |  23 +++
>  9 files changed, 403 insertions(+), 41 deletions(-)
>
>
> base-commit: 1b28687a9c679499ddaa46dac6ca3660e46801c5

Please let me know if you have any question/concern related to these
patches.

Thanks,
Thinh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-29 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25  2:41 [PATCH v5 00/12] usb: Handle different sublink speeds Thinh Nguyen
2020-09-25  2:42 ` [PATCH v5 06/12] usb: devicetree: Include USB SSP Gen X x Y Thinh Nguyen
2020-09-29 18:13 ` [PATCH v5 00/12] usb: Handle different sublink speeds Thinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).