Skip to content

usb: dwc2: fixes, enhancements and new features

Grigor Tovmasyan stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest49 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/49usb: dwc2: eliminate irq parameter from dwc2_gadget_initdrivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c drivers/usb/dwc2/platform.c+6 -70 replies
2/49usb: dwc2: Force mode optimizationsdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/hcd.c +2 more+28 -640 replies
3/49usb: dwc2: Remove version check in GSNPSIDdrivers/usb/dwc2/core.h drivers/usb/dwc2/hw.h drivers/usb/dwc2/params.c+11 -60 replies
4/49usb: dwc2: Set AHB burst size to INCRdrivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c drivers/usb/dwc2/params.c+3 -30 replies
5/49usb: dwc2: Remove unnecessary debug printsdrivers/usb/dwc2/hcd.c+2 -140 replies
6/49usb: dwc2: Define PCGCCTL1 register in hw.hdrivers/usb/dwc2/hw.h+4 -00 replies
7/49usb: dwc2: Define Active Clock Gating support bit in GHWCFG4drivers/usb/dwc2/hw.h+1 -00 replies
8/49usb: dwc2: Add dwc2_enable_acg functiondrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c +2 more+35 -20 replies
9/49usb: dwc2: Backup and restore PCGCCTL1 registerdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h+3 -00 replies
10/49usb: dwc2: Update dwc2_handle_incomplete_isoc_in() functiondrivers/usb/dwc2/gadget.c+8 -10 replies
11/49usb: dwc2: Update dwc2_handle_incomplete_isoc_out() functiondrivers/usb/dwc2/gadget.c+12 -20 replies
12/49usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handlingdrivers/usb/dwc2/gadget.c+8 -10 replies
13/49usb: dwc2: Rename function namesdrivers/usb/dwc2/gadget.c+22 -220 replies
14/49usb: dwc2: Delete unused functionalitydrivers/usb/dwc2/core.h drivers/usb/dwc2/hcd.c drivers/usb/dwc2/hcd.h+0 -1440 replies
15/49usb: dwc2: Make function staticdrivers/usb/dwc2/core.c+1 -10 replies
16/49usb: dwc2: Fix GLPMCFG... definitionsdrivers/usb/dwc2/hw.h+20 -180 replies
17/49usb: dwc2: Add core parameters for LPM supportdrivers/usb/dwc2/core.h drivers/usb/dwc2/debugfs.c drivers/usb/dwc2/params.c+38 -00 replies
18/49usb: dwc2: gadget: Add functionality to exit from LPM L1 statedrivers/usb/dwc2/core_intr.c+52 -00 replies
19/49usb: dwc2: gadget: LPM interrupt handlerdrivers/usb/dwc2/core_intr.c+63 -00 replies
20/49usb: dwc2: Enable LPM Transaction Received interrupt.drivers/usb/dwc2/core_intr.c drivers/usb/dwc2/gadget.c drivers/usb/dwc2/hcd.c+8 -30 replies
21/49usb: dwc2: gadget: Configure the core to enable LPM.drivers/usb/dwc2/core.h drivers/usb/dwc2/core_intr.c drivers/usb/dwc2/gadget.c+29 -00 replies
22/49usb: dwc2: Add call_gadget() function calldrivers/usb/dwc2/core_intr.c+6 -00 replies
23/49usb: dwc2: Add core state checkingdrivers/usb/dwc2/gadget.c+2 -20 replies
24/49usb: dwc2: Enable LPMdrivers/usb/dwc2/gadget.c+4 -00 replies
25/49usb: dwc2: Rename hibernation to partial_power_downdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/core_intr.c +4 more+38 -380 replies
26/49usb: dwc2: Add hibernation field into dwc2_hw_paramsdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/hcd.c +1 more+48 -40 replies
27/49usb: dwc2: gadget: Moved dtxfsiz backup array placedrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c+6 -80 replies
28/49usb: dwc2: gadget: Fix dwc2_restore_device_registersdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c+30 -150 replies
29/49usb: dwc2: core: Add hibernated flagdrivers/usb/dwc2/core.h drivers/usb/dwc2/platform.c+3 -00 replies
30/49usb: dwc2: gadget: Add remote_wakeup_allowed flagdrivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c+8 -00 replies
31/49usb: dwc2: Changes in registers backup/restore functionsdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/hcd.c+12 -40 replies
32/49usb: dwc2: Add helper functions for restore routinedrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h+149 -00 replies
33/49usb: dwc2: Add host/device hibernation functionsdrivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c +1 more+430 -20 replies
34/49usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()drivers/usb/dwc2/core.c drivers/usb/dwc2/core.h+41 -00 replies
35/49usb: dwc2: Allow entering hibernation from USB_SUSPEND interruptdrivers/usb/dwc2/core_intr.c+32 -200 replies
36/49usb: dwc2: Add dwc2_handle_gpwrdn_intr() handlerdrivers/usb/dwc2/core.h drivers/usb/dwc2/core_intr.c drivers/usb/dwc2/hcd.c+121 -10 replies
37/49usb: dwc2: Change hub-control to allow hibernationdrivers/usb/dwc2/hcd.c+13 -30 replies
38/49usb: dwc2: Enable power downdrivers/usb/dwc2/params.c+15 -10 replies
39/49usb: dwc2: Change TxFIFO and RxFIFO flushing flowdrivers/usb/dwc2/core.c+32 -20 replies
40/49usb: dwc2: hcd: Fix host channel halt flowdrivers/usb/dwc2/hcd.c+18 -00 replies
41/49usb: dwc2: Add safety check for STSPHSERCVD intrdrivers/usb/dwc2/gadget.c+7 -30 replies
42/49usb: dwc2: host: Fix transaction errors in host modedrivers/usb/dwc2/hcd.c+13 -10 replies
43/49usb: dwc2: Add safety check in setting of descriptor chain pointersdrivers/usb/dwc2/gadget.c+3 -10 replies
44/49usb: dwc2: Bit polling functionality update.drivers/usb/dwc2/core.c drivers/usb/dwc2/core.h drivers/usb/dwc2/gadget.c +1 more+86 -1160 replies
45/49usb: dwc2: Fix dwc2_hsotg_core_init_disconnected()drivers/usb/dwc2/gadget.c+6 -60 replies
46/49usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()drivers/usb/dwc2/pci.c+1 -20 replies
47/49usb: dwc2: pci: Move usb_phy_generic_register()drivers/usb/dwc2/pci.c+7 -70 replies
48/49usb: dwc2: pci: Move devm_kzalloc() before platform_device_add()drivers/usb/dwc2/pci.c+4 -40 replies
49/49usb: dwc2: pci: Handle error cleanup in probedrivers/usb/dwc2/pci.c+3 -30 replies

Reviews trailers per patch

None of the 49 patches has a Reviewed-by or Acked-by.

PatchStefan Wahren
1/49
2/49T-b
3/49
4/49
5/49
6/49
7/49
8/49
9/49
10/49
11/49
12/49
13/49
14/49
15/49
16/49
17/49
18/49
19/49
20/49
21/49
22/49
23/49
24/49
25/49
26/49
27/49
28/49
29/49
30/49
31/49
32/49
33/49
34/49
35/49
36/49
37/49
38/49
39/49
40/49
41/49
42/49
43/49
44/49
45/49
46/49
47/49
48/49
49/49

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/49] usb: dwc2: fixes, enhancements and new features

This patch series includes new features such us Active Clock Gating(ACG), LPM and Hibernation, enhancements and fixes for already existing features. All this patches were already sent to lkml separately. ACG, LPM and Hibernation were sent as patch series.

All patches were tested in our lab.

Changes from v1:

"usb: dwc2: pci: Fix error handling in dwc2_pci_probe" was divided into 4 patches:
"usb: dwc2: pci: Handle error cleanup in probe"
"usb: dwc2: pci: Move devm_kzalloc() before platform_device_add()" "usb: dwc2: pci: Move usb_phy_generic_register()"
"usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()"

"usb: dwc2: Move polling function to core.c." and "usb: dwc2: Use common polling function." patches were merged into "usb: dwc2: Bit polling functionality update.".
Also created dwc2_hsotg_wait_bit_clear() function, because in some cases,
we should wait for bit would be cleared not set. Updated all new loops which came with patches in this series.

usb: dwc2: gadget: Add LPM functionality (LPM):

- "usb: gadget: Allow a non-SuperSpeed gadget to support LPM"
and "usb: gadget: composite: Exclude SS Dev Cap Desc" patches were removed, because they were already merged to kernel.
- "usb: dwc2: Add core state checking" and "usb: dwc2: Add call_gadget() function call" patches were added.
- Fixed GLPMCFG initialization. Now hird and besl values also writes into GLPMCFG.
- Replaced shift operator with BIT() macro.

usb: dwc2: Add hibernation feature support (Hibernation):

- Added WA in dwc2_restore_device_registers() function for enabled EPx's IN in DDMA mode for not to get BNA Interrupt asserted on hibernation exit.
- Added argument is_host to determine if core is in host mode or not and changed some udelay values in dwc2_hib_restore_common() function.
- Added is_host function parameter to determine being in host mode, checking host mode to set pcgcctl properly and changed hard coded numbers to defined values also changed the logic of loading restore values for [31:14] bits in dwc2_restore_essential_regs() function.
- Fixed a minor bug: added checks for determine hibernation exiting flows in dwc2_handle_gpwrdn_intr() function. Also changed the way of clearing all interrupts.
- dwc2_gadget_enter_hibernation() fixed some minor bugs, phy clock now remains not stopped. Added unmasking of GPWRDN_STS_CHGINT_MSK device mode interrupts in GPWRDN.
- dwc2_host_enter_hibernation() added a udelay after writing in gpwrdn register.

ACG support for dwc2 driver (ACG):

- Added new acg_enable filed in dwc2_hw_params checks ACG support from hardware side.
- Similar acg_enable field in dwc2_core_params used for dynamically disabling/enabling ACG functionality from driver.

usb: dwc2: Add safety check in setting of descriptor chain pointer

Updated description of patch.

usb: dwc2: host: Fix transaction errors in host mode

- Rename patch name from "usb: dwc2: host: Setting TOUTCAL and USBTRDTIM fields in host mode".
- Remove programming of USBTRDTIM bitfiled, because this field available
only in Device mode.
- Added comment with description of TOUTCAL bitfiled in comment.
- In description added platforms for which this patch fixes transactions error.

usb: dwc2: hcd: Fix host channel halt flow

Rebased to latest Kernel.

usb: dwc2: Change TxFIFO and RxFIFO flushing flow

Rewritten loop for waiting AHB master IDLE state.

Gevorg Sahakyan (1):
usb: dwc2: Remove version check in GSNPSID

Grigor Tovmasyan (4):
usb: dwc2: Delete unused functionality
usb: dwc2: Make function static
usb: dwc2: Add call_gadget() function call
usb: dwc2: Add core state checking

John Youn (2):
usb: dwc2: Enable LPM
usb: dwc2: Enable power down

Minas Harutyunyan (5):
usb: dwc2: Change TxFIFO and RxFIFO flushing flow
usb: dwc2: hcd: Fix host channel halt flow
usb: dwc2: Add safety check for STSPHSERCVD intr
usb: dwc2: host: Fix transaction errors in host mode
usb: dwc2: Add safety check in setting of descriptor chain pointers

Razmik Karapetyan (10):
usb: dwc2: Set AHB burst size to INCR
usb: dwc2: Remove unnecessary debug prints
usb: dwc2: Define PCGCCTL1 register in hw.h
usb: dwc2: Define Active Clock Gating support bit in GHWCFG4
usb: dwc2: Add dwc2_enable_acg function
usb: dwc2: Backup and restore PCGCCTL1 register
usb: dwc2: Update dwc2_handle_incomplete_isoc_in() function
usb: dwc2: Update dwc2_handle_incomplete_isoc_out() function
usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling
usb: dwc2: Rename function names

Sevak Arakelyan (7):
usb: dwc2: Fix GLPMCFG... definitions
usb: dwc2: Add core parameters for LPM support
usb: dwc2: gadget: Add functionality to exit from LPM L1 state
usb: dwc2: gadget: LPM interrupt handler
usb: dwc2: Enable LPM Transaction Received interrupt.
usb: dwc2: gadget: Configure the core to enable LPM.
usb: dwc2: Bit polling functionality update.

Vardan Mikayelyan (20):
usb: dwc2: eliminate irq parameter from dwc2_gadget_init
usb: dwc2: Force mode optimizations
usb: dwc2: Rename hibernation to partial_power_down
usb: dwc2: Add hibernation field into dwc2_hw_params
usb: dwc2: gadget: Moved dtxfsiz backup array place
usb: dwc2: gadget: Fix dwc2_restore_device_registers
usb: dwc2: core: Add hibernated flag
usb: dwc2: gadget: Add remote_wakeup_allowed flag
usb: dwc2: Changes in registers backup/restore functions
usb: dwc2: Add helper functions for restore routine
usb: dwc2: Add host/device hibernation functions
usb: dwc2: Add dwc2_enter_hibernation(), dwc2_exit_hibernation()
usb: dwc2: Allow entering hibernation from USB_SUSPEND interrupt
usb: dwc2: Add dwc2_handle_gpwrdn_intr() handler
usb: dwc2: Change hub-control to allow hibernation
usb: dwc2: Fix dwc2_hsotg_core_init_disconnected()
usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()
usb: dwc2: pci: Move usb_phy_generic_register()
usb: dwc2: pci: Move devm_kzalloc() before platform_device_add()
usb: dwc2: pci: Handle error cleanup in probe

 drivers/usb/dwc2/core.c      | 410 ++++++++++++++++++++++++++++++-----------
 drivers/usb/dwc2/core.h      | 134 ++++++++++----
 drivers/usb/dwc2/core_intr.c | 304 +++++++++++++++++++++++++++---
 drivers/usb/dwc2/debugfs.c   |   7 +-
 drivers/usb/dwc2/gadget.c    | 425 ++++++++++++++++++++++++++++++++----------
 drivers/usb/dwc2/hcd.c       | 430 +++++++++++++++++++++++++++++++------------
 drivers/usb/dwc2/hcd.h       |  56 ------
 drivers/usb/dwc2/hw.h        |  44 +++--
 drivers/usb/dwc2/params.c    |  90 +++++++--
 drivers/usb/dwc2/pci.c       |  27 ++-
 drivers/usb/dwc2/platform.c  |  12 +-
 11 files changed, 1450 insertions(+), 489 deletions(-)
Signature · 1 line
2.11.0