2020-04-27 |
treewide: remove references to CREDITS
...
The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97
("Remove the CREDITS file"). Remove references to it from several files.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 23 Apr 2020
Sascha Hauer
committed
on 27 Apr 2020
|
2020-04-16 |
Merge branch 'for-next/usb'
Sascha Hauer
committed
on 16 Apr 2020
|
2020-03-31 |
usb: gadget: dfu: Fix DFU mode interface descriptor
...
The gadget driver set the bInterfaceProtocol value to 1 in the DFU
interface descriptor. However this value is used to indicate that the
gadget is in run-time mode and not ready for DFU. When ready for DFU
operation the bInterfaceProtocol value must be set to 2 (DFU mode).
From the DFU 1.1 specification, the value of bInterfaceProtocol select:
- 1: Runtime protocol (see Table 4.1)
- 2: DFU mode protocol (see Table 4.4)
This patch change the bInterfaceProtocol value from 1 to 2. As this
DFU gadget driver is always ready for DFU operation (DFU mode) and
doesn't require a USB reset.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jules Maselbas
authored
on 26 Mar 2020
Sascha Hauer
committed
on 31 Mar 2020
|
usb: gadget: dfu: Progressive erase if file is a mtd
...
When downloading a firmware into a big flash partition the erase
operation can take a long time to be complete from few seconds to
minutes in extreme cases. During the erase the DFU gadget does not
respond to any USB setup request, the host only see a stalled USB
endpoint and cannot get responses from DFU_GETSTATE nor DFU_GETSTATUS.
After 5 seconds without any updates the host will abort the DFU
transfer and return an error (when using dfu-util).
For instance I have a 2MB partition that takes 25 seconds to erase,
this erase cannot be done in one step as it takes too much time or it
should be done in the manifestation phase, see previous patch.
This patch modify the erase behavior when downloading a new firmware.
If the updated file is a mtd partition then the DFU gadget will do
a progressive erase by erasing the least amount of required blocks
before writing a new chunk into the mtd device.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jules Maselbas
authored
on 26 Mar 2020
Sascha Hauer
committed
on 31 Mar 2020
|
usb: gadget: dfu: Add manifestation phase
...
When downloading a firmware into a big flash partition the erase
operation can take a long time to be complete from few seconds to
minutes in extreme cases. During the erase the DFU gadget does not
respond to any USB setup request, the host only see a stalled USB
endpoint and cannot get responses from DFU_GETSTATE nor DFU_GETSTATUS.
After 5 seconds without any updates the host will abort the DFU
transfer and return an error (when using dfu-util).
When using the safe flag on the partition the file is first downloaded
in memory. The partition is only erased when the last chunk is received
if the partition takes more than 5 seconds to be erased then the
transfer fails.
This patch fix this issue by using the manifestation phase for safe
partitions. It's used to inform the host that the transfer is complete
and that the device will now be doing the actual erasing and writing.
Not all devices will be able to respond to DFU_GETSTATUS when in the
dfuMANIFEST state (from DFU-1.1 specification page 22).
This is far from perfect as the utility dfu-util will exit before the
erase/writing is done, but it will not report an error status if a
timeout happen during this phase.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jules Maselbas
authored
on 26 Mar 2020
Sascha Hauer
committed
on 31 Mar 2020
|
usb: gadget: dfu: Reset global variables on unbind
...
Global variables must be reset to their default value before a new
dfu_bind is done. Otherwise things wont work and are likely to cause
a system crash due to a use after free: the global dfu_files was still
pointing deallocated structure after unbind.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jules Maselbas
authored
on 26 Mar 2020
Sascha Hauer
committed
on 31 Mar 2020
|
2020-03-26 |
usb: Add U-Boot xhci driver
...
This adds the xhci driver from U-Boot-2020.04-rc2. The usual things
like adjusting to the barebox driver model and using dev_* instead of
printf/puts/debug messages are made.
The previously existing PCI support is not present in this driver
currently. XHCI PCI support was not enabled in any defconfig, so we
boldly assume it was unused. It shouldn't be much effort though to
add it again.
The memory handling has been changed for barebox. The various
descriptor rings and descriptors are allocated with dma_alloc_coherent()
which makes the cache flushing/invalidating unnecessary. They are left
in the driver in case we want to change that.
The XHCI has a nasty limitation in that the TRBs may not cross a 64KiB
boundary. This limitation has been handled in the U-Boot driver, but the
handling seems to be broken. We help ourselves with using a bounce
buffer which is sufficiently aligned, but this limits the maximum bulk
transfer size to 64KiB.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Mar 2020
|
usb: host: remove xhci driver
...
The current xhci driver support USB 2.0 only. The U-Boot driver is better
developed and supports USB 3.0 devices. Remove the xhci driver first as
a separate patch to make the patch adding the new U-Boot based driver
better readable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Mar 2020
|
usb: hub: When no connection came up remove from scanning list
...
When after a timeout no connection came up then we have not only bail
out, but also remove the device from the scanning list. Otherwise it
can happen that the list never becomes empty and we probe forever.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Mar 2020
|
usb: Add super speed support
...
This adds the missing bits and pieces to add super speed support to the
USB stack. It is based on the corresponding U-Boot code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Mar 2020
|
usb: hub: Translate USB 3.0 hub port status into old version
...
Adoption of U-Boot commit:
| 1commit 74ffc7c
| Author: Bin Meng <bmeng.cn@gmail.com>
| Date: Wed Jul 19 21:51:12 2017 +0800
|
| usb: hub: Translate USB 3.0 hub port status into old version
|
| USB 3.0 hub port status field has different bit positions from 2.0
| hubs. Since U-Boot only understands the old version, translate the
| new one into the old one.
|
| Since we are going to add USB 3.0 hub support, this feature is only
| available with driver model USB.
|
| Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Mar 2020
|
usb: factor out a usb_setup_descriptor() function
...
This factors out a usb_setup_descriptor() function with the goal to
make the code better comparable to the corresponding U-Boot code.
This also incorporates this U-Boot commit:
| commit 2b338ef
| Author: Hans de Goede <hdegoede@redhat.com>
| Date: Tue May 5 23:56:04 2015 +0200
|
| usb: Fix maxpacketsize for first descriptor read for low-speed usb devs
|
| This fixes descriptor reading of lowspeed devices through ohci not working.
|
| Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Mar 2020
|
2020-03-20 |
usb: remove unnecessary variable
...
"tmp" is only used to store the size of the descriptor. The name is not
very meaningful and "tmp" is not even used everywhere it could be used.
Just replace by using sizeof() directly where needed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: Assign dev_index once
...
dev->devnum is set once in usb_alloc_new_device(), set to 0 again later
in usb_new_device() and then set back to the original value. This seems
unnecessary, just set devnum once right before calling usb_set_address()
on the device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: support set hub depth request for USB 3.0 hubs
...
This is an adoption of U-Boot commit bbc6f06 :
| commit bbc6f06
| Author: Bin Meng <bmeng.cn@gmail.com>
| Date: Wed Jul 19 21:51:13 2017 +0800
|
| usb: hub: Support 'set hub depth' request for USB 3.0 hubs
|
| USB 3.0 hub uses a hub depth value multiplied by four as an offset
| into the 'route string' to locate the bits it uses to determine the
| downstream port number. We shall set the hub depth value of a USB
| 3.0 hub after it is configured.
|
| Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| Reviewed-by: Simon Glass <sjg@chromium.org>
In this patch we also support recording the depth of a hub in
struct usb_device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: host: make init hook optional
...
For controllers which do everything relevant during probe time
make the init hook optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: hub: Parse and save TT details from device descriptor
...
Adoption of U-Boot commit 5624dfd :
| commit 5624dfd
| Author: Bin Meng <bmeng.cn@gmail.com>
| Date: Wed Jul 19 21:51:16 2017 +0800
|
| usb: hub: Parse and save TT details from device descriptor
|
| A high speed hub has a special responsibility to handle full speed/
| low speed devices connected on downstream ports. In this case, the
| hub must isolate the high speed signaling environment from the full
| speed/low speed signaling environment with the help of Transaction
| Translator (TT). TT details are provided by hub descriptors and we
| parse and save it to hub uclass_priv for later use.
|
| Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: Use dev_*
...
Give the USB messages some context by using dev_* functions rather than
printf()/debug().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: Set new USB device name earlier
...
in usb_new_device() set the device name as early as possible to let
dev_* functions print a meaningful name.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: hub: Do not power-cycle usb devices on init
...
This is an adoption of U-Boot commit 0834bb2fb0 ("usb: Do not power-cycle
usb devices on init")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: Pass portstatus/portchange to usb_hub_port_connect_change()
...
portstatus/portchange have just been read in usb_scan_port(), there
shouldn't be any need to read them again in
usb_hub_port_connect_change().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: Remove hack from the early days
...
The weird hack about "bad shielded USB devices" goes back to the initial
U-Boot git commmit. Let's be bold and remove it 18 years later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: hub: let usb_scan_port() return void
...
usb_scan_port() never returns anything else but 0, so let it return
void.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: hub: do not reset devices twice
...
U-Boot has this since 3ed9eb93c2 ("usb: Don't reset the USB hub a 2nd
time"), so do the same for barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
usb: hub: Make debugging output more consistent
...
Some of the messages print the port they belong to, others don't. Print
the port consistently in all debugging messages. Also remove some stray
'\' in the messages.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Mar 2020
|
2020-03-18 |
Merge branch 'for-next/stm32'
Sascha Hauer
committed
on 18 Mar 2020
|
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 18 Mar 2020
|
Merge branch 'for-next/imx'
Sascha Hauer
committed
on 18 Mar 2020
|
Merge branch 'for-next/block'
Sascha Hauer
committed
on 18 Mar 2020
|
2020-03-11 |
usb: Add extra delay for device scan
...
Since b1d9837182, detection of various USB flash drives stopped working.
While the changes itself look correct, probably the HUB requires some
"recovery time" between the GET_STATUS commands in order to be able to
detect devices.
Our configuration: i.MX6ULL (USB-OTG) with only one port on the root
HUB. This port is connected to a Microchip USB4916 hub (permanently
attached). The USB4916 is configured with it's power on defaults which
means that bPwrOn2PwrGood is set to the maximum (0xFF = 510 ms).
Fixes: b1d9837182 ("usb: Change power-on / scanning timeout handling")
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Christian Eggers
authored
on 9 Mar 2020
Sascha Hauer
committed
on 11 Mar 2020
|