Age | Commit message (Collapse) | Author | Files | Lines |
|
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-testing
Felipe writes:
usb: changes for v4.17 merge window
Quite a lot happened in this cycle, with a total of 95 non-merge
commits. The most interesting parts are listed below:
Synopsys has been adding better support for USB 3.1 to dwc3. The same
series also sets g_mass_storage's max speed to SSP.
Roger Quadros (TI) added support for dual-role using the OTG block
available in some dwc3 implementations, this makes sure that AM437x
can swap roles in runtime.
We have a new SoC supported in dwc3 now - Amlogic Meson GX - thanks to
the work of Martin Blumenstingl.
We also have a ton of changes in dwc2 (51% of all changes, in
fact). The most interesting part there is the support for
Hibernation (a Synopsys PM feature).
Apart from these, we have our regular set of non-critical fixes all
over the place.
|
|
We want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Trivial fix to spelling mistake in dev_warn warning message text.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Declared dwc2_force_mode() function as static, because it was used
only in core.c file, for fixing sparse error.
Acked-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
This patch adds a way to enable an external vbus supply in host mode,
when dwc2 drvvbus signal is not used.
This patch is very similar to the one done in U-Boot dwc2 driver [1]. It
also adds dynamic vbus supply management depending on the role and state
of the core.
[1] https://lists.denx.de/pipermail/u-boot/2017-March/283434.html
Signed-off-by: Amelie Delaunay <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
If the dr_mode is USB_DR_MODE_OTG, forcing the mode is needed during
driver probe to get the host and device specific HW parameters. Then we
clear the force mode bits so that the core operates in OTG mode.
The force mode bits should not be touched at any other time during the
driver lifetime and they should be preserved whenever the GUSBCFG
register is written to. The force mode bit values will persist across
soft resets of the core.
If the dr_mode is either USB_DR_MODE_HOST or USB_DR_MODE_PERIPHERAL, the
force mode is set just once at probe to configure the core as either a
host or peripheral.
Given the above, we no longer need any other reset delays, force delays,
or any forced modes anywhere else in the driver. So replace all calls to
dwc2_core_reset_and_force_dr_mode() with dwc2_core_reset() and remove
all other unnecessary delays.
Also remove the dwc2_force_mode_if_needed() function since the "if
needed" part is already taken care of by the polling in
dwc2_force_mode().
Finally, remove all other calls to dwc2_clear_force_mode().
Tested-by: Stefan Wahren <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Enable the power down option based on the core capability.
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: Artur Petrosyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Affected cases:
ClearPortFeature's
USB_PORT_FEAT_SUSPEND
SetPortFeature's
USB_PORT_FEAT_SUSPEND
USB_PORT_FEAT_RESET
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
The GPWRDN interrupts are those that occur in both Host and
Device mode while core is in hibernated state.
Export dwc2_core_init to be able to use it in GPWRDN_IDSTS
interrupt handler.
Here we have duplicated init functions in host and gadget sides
so I have left things as it was(used corresponing functions for
host and gadget), maybe in the future we'll resolve this problem
and will use dwc2_core_init for both sides.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Artur Petrosyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Do changes to allow entering hibernated state from USB_SUSPEND
interrupt. All code is added under if conditions and mustn't impact
existing functionality.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
These are wrapper functions which are calling device or host
enter/exit hibernation functions.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Add host/device hibernation functions which must be wrapped
by core's dwc2_enter_hibernation()/dwc2_exit_hibernation()
functions.
Make dwc2_backup_global_registers dwc2_restore_global_register
non-static to use them in both host/gadget sides.
Added function names:
dwc2_gadget_enter_hibernation()
dwc2_gadget_exit_hibernation()
dwc2_host_enter_hibernation()
dwc2_host_exit_hibernation()
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Artur Petrosyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Add common (host/device) helper functions, which will be called while
exiting from hibernation, from both sides.
dwc2_restore_essential_regs()
dwc2_hib_restore_common()
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Artur Petrosyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Move hptxfsiz to host register's backup/restore functions, not
needed to have it in global register's backup/restore functions.
Add backup for glpmcfg, and read/write for gi2cctl and pcgcctl.
As requires programming guide.
Affected functions:
dwc2_backup_host_registers()
dwc2_restore_host_registers()
dwc2_backup_global_registers()
dwc2_restore_global_registers()
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
It will be set once corresponding set_feature command comes.
True if device is allowed to wake-up host by remote-wakeup
signalling.
This is preparation for remote wake-up support implementation,
it will not be implemented until gadget stack provide interface
for bringing remote wake-up signalling.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Added a flag to indicate that core is in hibernation,
it is used to determine the hibernation state of the core.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Add parameter remote_wakeup to dwc2_restore_device_registers()
to be able to restore device registers according to programming
guide for dwc-otg. It says that in case of rem_wakeup DCTL must not
be restored here.
Remove setting of DCTL_PWRONPRGDONE from this function, because it
will be done in function responsible for exiting from hibernation.
WA for enabled EPx's IN and OUT in DDMA mode. On entering to
hibernation wrong value read and saved from DIEPDMAx,
as result BNA interrupt asserted on hibernation exit
by restoring from saved area.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Artur Petrosyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Moved dtxfsiz from dwc2_gregs_backup to dwc2_dregs_backup,
because it is device register.
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Add parameter and it's initialization, needed for hibernation.
Reimplement dwc2_set_param_power_down() to support hibernation too.
Now 'power_down' parameter can be initialized with 0, 1 or 2.
0 - No
1 - Partial power down
2 - Hibernation
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
No-op change, only rename.
This code was misnamed originally. It was only responsible for partial
power down and not for hibernation.
Rename core_params->hibernation to core_params->power_down,
dwc2_set_param_hibernation() to dwc2_set_param_power_down().
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Set 'lpm_capable' flag in the gadget structure so
indicating that LPM is supported.
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Assign true or false to boolean variables instead of an integer value.
This issue was detected with the help of Coccinelle.
Acked-by: John Youn <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Added core state checking in dwc2_hsotg_ep_queue() function
to make sure that application will submit requests only in L0 state.
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Added call_gadget() function call when entering to L1 state
to inform gadget that core is in L1 state.
Did the same thing when exiting from L1 state
to inform gadget that core is in L0 state.
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Configure core in device mode to support LPM according to
programming guide.
Device will start giving valid responses for LPM tokens.
After this patch device side LPM will start working.
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Enable "LPM Transaction Received" interrupt for receive an
interrupt when host will send LPM token.
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
This interrupt indicates that an LPM transaction
was received on the USB bus. After getting this
interrupt we are going from L0 state to L1 state.
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Add a function which will be called if device is in L1 sleep state
and Resume/Remote Wakeup Detected interrupt is asserted.
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Add lpm, lpm_clock_gating, besl, hird_threshold_en and hird_threshold
core parameters. These will indicate LPM and LPM Errata support
as well as chosen L1 sleeping mode for the core and PHY.
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Make field names of GLPMCFG register in definitions to be
the same with the databook.
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Backup PCGCCTL1 register when entering hibernation mode and
restore it after exiting from hibernation, to keep active ACG
feature.
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Added function for supporting Active Clock Gating functionality
in the driver.
PCGCCTL1 (Power and Clock Control) register will be used
for controlling the core`s active clock gating feature, and
the previously reserved 12th bit in GHWCFG4 now indicates that the
controller supports the Dynamic Power Reduction (Active Clock Gating)
during no traffic scenarios such as L0, idle, resume and suspend
states.
dwc2_enable_acg() function sets GATEEN bit in PCGCCTL1 register
and enables ACG, if it supported.
According to ACG functional specification, enabling of ACG feature
in host mode done in host initialization, before turning Vbus on,
specifically in dwc2_core_host_init function.
Enabling of ACG feature in device mode done in device initialization,
before clearing the SftDiscon bit in DCTL.
This bit was cleared in dwc2_hsotg_core_connect() function.So
dwc2_enable_acg() called before dwc2_core_connect() calls.
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
We better print an error in case probing of dwc2 fails on
setting the DMA coherent mask.
Signed-off-by: Stefan Wahren <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
The maximum value that unsigned char can hold is 255, meanwhile
the maximum value of interval is 2^(bIntervalMax-1)=2^15.
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
The probe function doesn't properly handle errors. Fix it so that it
properly handles cleanup.
Acked-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
After platform_device_add(), if we error out, we must do
platform_device_unregister(), which also does the put. So lets move
devm_kzalloc() to simplify error handling and avoid calling of
platform_device_unregister().
Acked-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Move usb_phy_generic_register() function call to the top, to simplify
error handling. If this fails we can simply return instead of cleaning
up.
Acked-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Use devm_kzalloc() and remove the unnecessary kfree().
Acked-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Before flushing fifos required to check AHB master state and
lush when AHB master is in IDLE state.
Acked-by: John Youn <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Added missing GUSBCFG programming in host mode, which fixes
transaction errors issue on HiKey and Altera Cyclone V boards.
These field even if was programmed in device mode (in function
dwc2_hsotg_core_init_disconnected()) will be resetting to POR values
after core soft reset applied.
So, each time when switching to host mode required to set this field
to correct value.
Acked-by: John Youn <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
According databook in Buffer and External DMA mode
non-split periodic channels can't be halted.
Acked-by: John Youn <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Removed unnecessary debug prints about DMA mode for host side
from dwc2_gahbcfg_init() function.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Deleted dwc2_hcd_dump_frrem() function, because it used undefined
parameters from dwc2_hsotg structure. The function body was in #ifdef
statement and was never compiled.
Also removed that parameters from dwc2_hsotg structure, which were
used only in dwc2_hcd_dump_frrem() function.
And also delete dwc2_sample_frrem macro, because without
dwc2_hcd_dump_frrem() function it's lose its purpose.
Acked-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Renamed __orr32 and __bic32 function names to more descriptive
dwc2_set_bit and dwc2_clear_bit respectively.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Disabled only unmasked endpoints based on DAINTMSK register.
This will allow to minimize GINTSTS_GOUTNAKEFF interrupt handling.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
In 'for' loop skipped masked and non-ISOC EPs. Also breaked 'for' loop
after setting SGOUTNAK in DCTL,when one enabled EP was detected.
This will allow to minimize incomplete ISOC OUT interrupt handling.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Disabled only that ISOC endpoints,for which interrupt bit was set
in the DAINTMSK register. This will allow to minimize incomplete
ISOC IN interrupt handling.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Changed AHB burst size from INCR4 to INCR by default.
With this value driver shows excellent DMA performance.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
In dwc2_hsotg_core_init_disconnected() function used AHB burst size
parameter, instead of calculating already calculated value.
Acked-by: John Youn <[email protected]>
Signed-off-by: Razmik Karapetyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|
|
Move dwc2_hsotg_wait_bit_set function to core.c so it can be used
anywhere in the code.
Added dwc2_hsotg_wait_bit_clear function in core.c.
Replace all the parts of register bit polling code with
dwc2_hsotg_wait_bit_set or dwc2_hsotg_wait_bit_clear functions
calls depends on code logic.
Acked-by: John Youn <[email protected]>
Signed-off-by: Sevak Arakelyan <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
|