| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This should make writing and reading more reliable.
Also:
- change loop condition to make "retries" semantically correct
- add a debug message in case of fatal failure
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Change USB port scanning procedure and timeout handling in the
following ways:
1)
The power-on delay in usb_hub_power_on() is now reduced to a value of
max(100ms, "hub->desc.bPwrOn2PwrGood * 2"). The code does not wait
using mdelay, instead usb_hub_power_on() will wait before querying
the device in the scanning loop later. The total connection timeout for
this hub, which is (1 second + hub->desc.bPwrOn2PwrGood * 2) is
calculated and will be used in the following per-port scanning loop as
the timeout to detect active USB devices on this hub.
2)
Don't delay the minimum delay (for power to stabilize) in
usb_hub_power_on(). Instead skip querying these devices in the scanning
loop usb_scan_port() until the delay time is reached.
3)
The ports are now scanned in a quasi parallel way. The current code did
wait for each (unconnected) port to reach its timeout and only then
continue with the next port. This patch now changes this to scan all
ports of all USB hubs quasi simultaneously. For this, all ports are added
to a scanning list in usb_hub_configure_ports(). The list is later scanned
in usb_device_list_scan() until all ports are ready by either a) reaching
the connection timeout (calculated earlier), or by b) detecting a USB
device. This results in a faster USB scan time as the recursive scanning
of USB hubs connected to the hub that's currently being scanned will
start earlier.
4)
Ports with overcurrent detection will get scanned multiple times if OC
condition is detected (PORT_OVERCURRENT_MAX_SCAN_COUNT).
Without patch:
$ time usb
usb: USB: scanning bus for devices...
usb: 17 USB Device(s) found
time: 10344ms
With patch:
$ time usb
usb: USB: scanning bus for devices...
usb: 17 USB Device(s) found
time: 4529ms
Delta: ~6 seconds
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove two mdelay(200) calls from usb_hub_port_connect_change() before
and after calling hub_port_reset().
These delays don't seem to be necessary since hub_port_reset() already
incorporates delays on its own.
Without patch:
$ time usb
usb: USB: scanning bus for devices...
usb: 17 USB Device(s) found
time: 16355ms
With patch:
$ time usb
usb: USB: scanning bus for devices...
usb: 17 USB Device(s) found
time: 10344ms
Delta: ~6 seconds
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Start with a short USB hub reset delay of 20ms. This can be enough for
some configurations. Switch to longer reset delay only if the short
delay hasn't been long enough.
This USB hub reset handling strategy is also used in the Linux kernel
USB hub driver, function hub_port_reset().
Without patch:
$ time usb
usb: USB: scanning bus for devices...
usb: 17 USB Device(s) found
time: 21750ms
With patch:
$ time usb
usb: USB: scanning bus for devices...
usb: 17 USB Device(s) found
time: 16355ms
Delta: ~5.5 seconds
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
barebox currently announces support for ITU V.25ter AT commands, but
doesn't handle them specially when they arrive. Instead they are passed
as is to the sole barebox input console, where it may interfere with
valid user input.
This is especially annoying as ModemManager probes ttyACM devices that
announce their AT command support. So even when not using the ttyACM
device at all, the other UART ports are affected.
Fix this by ceasing to announce USB_CDC_ACM_PROTO_AT_V25TER as function
protocol. After applying this patch, I can't see any spurious AT or ~x~
symbols on the console anymore.
Cc: <bst@pengutronix.de>
Cc: <jlu@pengutronix.de>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is an adoption of Kernel commit a7c12eaf2 ("usb: gadget: composite:
conditionally dequeue os_desc and setup requests"). Basically we only
want to dequeue ep0 requests when they are actually queued. Drivers like
dwc3 warn when unqueued requests are being tried to unqueued.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Expand the DWC3 usb core with gadget support.
Patches imported and adopted from Linux v5.2.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| | |
Add a function to notify the udc core, that a bus reset occured.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
The blackfin architecture has been removed from barebox. Remove the
blackfin specifics in the USB drivers as well.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The negative depends rules out using UDC for some targets of a
multi-image barebox while still supporting SAMA5D4.
We don't (yet) have such a configuration, but seeing as there is little
to gain by restricting the selection, drop it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
c16bcbc644 ("ARM: at91: remove unused defines") removed conflicting
definitions from the headers, so we can include the headers
and code that uses them unconditionally now.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
struct fsl_ep's name member can never be NULL because it is a character
array. Remove these superfluous null pointer checks.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Remove only the bootm.image variable which will be set by fastboot.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Linux requests the reset gpio optional by using devm_gpiod_get_optional().
We need to do this here too because the reset can be a global shared
reset line e.g. board por. We haven't such a helper so just drop the
final else path.
Fixes: 937fa50d9c ("usb: Port Microchip USB251x USB hub driver from Linux")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
barebox doesn't define a CONFIG_OF kconfig option, but CONFIG_OFTREE
for the device tree handling and CONFIG_OFDEVICE for probing devices
out of the device tree.
Replace comment mentions of CONFIG_OF with mentions of either as
appropriate.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
Since b904eca92f we depend on syscon once the "fsl,anatop" property is
found. select MFD_SYSCON to make sure it is available.
Fixes: b904eca92f ("usb: imx-usb-phy: Disable charger detect during initialization")
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I can't find any erratas this is in refernce to, but apparently
external changer detector needs to be disabled to prevent poor USB
data signal quality. The problem manifest itself as a intermittent USB
transfer corruption that happens to some device under and only under
specific circumstances.
In my case the failure was observed with Transcent SD/micro-SD card
reader (05e3:0745 Genesys Logic, Inc. Logilink CR0012) when connected
directly to front panel USB of ZII RDU2 board (the problem would go
away if device was conntecte via a hub/USB-analyzer/male-female
type A extender cable).
Note that this fix is present in Linux kernel as well as some
abandoned Barebox code removed in the next patch.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream kernel driver uses stmp_reset_block() to reset the PHY, so
convert the code to do so as well to save some code and sync both
drivers.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Those two line are the only thing that checkpatch is complaining
about. Wrap them to slince it. No functional change intended.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Import register definitions from Linux driver to simplify
comparing/sharing code a bit. No functional change intended.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Use NUM_QH, not NUM_TD to specify allocation size.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We use a fixed circular list for asynchronous schedule that never
changes, so if we drop an explicit memset() that zeros out an entire
struct and replace it with code initializine all of the fields
explicitly, we can set QH list once in ehci_init() and never touch it
again.
While at it move qt_altnext initialization to ehci_init() as well
since we never change that field either.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since ehci->qh_list is an array, convert the code to use
ehci->qh_list[0] to access its first element to make things a bit more
clear. No functional change intended.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Memory allocated by dma_alloc_coherent() is already zeroed out,
ehci->qh_list[0] never changes during the operation of the driver and
ehci->qh_list[1] will be explicitly initialized by ehci_submit_async()
so this additional memset() shouldn't be necessary.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add a comment explaining the rationale behinde QT_TOKEN_IOC(req ==
NULL).
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Change the type of 'c' to bool and drop the trigrah.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Neither of those is necessary, since both will be overwritten further
down in the code.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Re-organize the epilogue of ehci_submit_async() to bail out early if
token is still marked as "active" and drop no longer necessary check
for "dev->status != USB_ST_NOT_PROC". While at it return -EIO instead
of -1 in the case of error.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Convert the code to initialize only used qTDs as well as initializing
all of the fields explicitly without doing a wholesale memset() first.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Rework the code of ehci_td_buffer() with following trivial changes:
* Switch to using dma_addr_t for 'delta' and 'next'
* Convert while to for loop
* Replace explicit magic number with dedicated contants derived
via ARRAY_SIZE
* Use ALIGN_DOWN to calculate 'next'
* Return -ENOMEM instead of -1 when we ran out of buffers
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Only two buffers ever need to be sychronized and DMA direction of it
is always known based on the type of request we are
processing. Simplify the code by moving synchronization to be a part
of ehci_prepare_qtd(). While at it convert the code to use
dma_map_single() API.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Move shared struct qTD initialization code into a subroutine and
convert the rest of the code to use it. No functional change intended.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This looks like a leftover from U-Boot. Analogous code there would
walk all qTDs and call ehci_free() on each one of them, but since we
don't have anything of the sort it seems the whole loop can be
dropped. Note that U-Boot dropped that code in
de98e8b22a10676fd226318c92a9be7f519208ca
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Import a number of missing macros from U-Boot and convert ehci-hcd to
use them instead of explicitly specifying magic shifts. No functional
change intended.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since we already set up our last qTD to have IOC flag set we may as
well take advange of that and poll USBSTS to wait for transfer
completion. Doesn't change much, but allows us to drop a custom
polling loop and re-use handshake() instead.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Memory returned by dma_alloc_coherent() should already be zeroed
out, so there's no need to do this explicitly.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
TEST_UNIT_READY is 6 bytes long instead of 12. Fix it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For loop below is:
for (lun=0; lun<=us->max_lun; lun++)
...
so we need to set max_lun to 0 in order to default to having only one
LUN. Otherwise, we end up assuming the device has 2 valid LUNs.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since cbw.Length can be less that sizeof(cbw.CDB), add code to zero
the whole struct out to avoid sending random stack data as a part of
payload. There's no known case where this causes a problem, but it's a
reasonable thing to do anyway.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|