Commit Graph

9 Commits

Author SHA1 Message Date
Thomas Huth 9ca6ebded5 usb: Set XHCI slot speed according to port status
So far, the code was always assuming SuperSpeed for all devices,
which seemed to work OK with QEMU ... but let's better play safe
instead and use the speed from the port status instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-08-03 13:48:18 +10:00
Thomas Huth cf7963a12c usb: Initialize USB3 devices on a hub and keep track of hub topology
USB3 devices need to be initialized with usb3_dev_init(), so that
they get assigned a proper slot ID. And for USB3 devices that are
attached to a (non-root) hub, we also need to keep track of the
hub topology, so a new field called "hub" is added to the struct
usb_dev which references the hub devices where the current USB
devices is attached to. The hub topology will be used later to
build the so-called "route string" for the USB3 devices.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-08-03 13:48:18 +10:00
Thomas Huth edd582383f Stack optimization in libusb: split up setup_new_device()
When scanning hubs, the code in libusb can be called recursively, for
example usb_hub_init() calls setup_new_device(), which then calls
slof_usb_handle() to execute Forth code for the next device.
If that next device is a hub, we end up recursively in usb_hub_init()
again.
Since stack space is limited in SLOF, we can optimize here a little
bit by splitting up the setup_new_device() function into the part
that retrieves the descriptors (which takes most of the stack space
in this code path since the descriptors are placed on the stack),
and the part that populates the the device tree node of the new
device (which is responsible for the recursion).

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-12-01 17:02:04 +11:00
Nikunj A Dadhania 7bc3d6b7d7 Fix dprintf macros at various points
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-16 13:59:30 +05:30
Nikunj A Dadhania a351fc0cbc usb-ohci: update init and rationalize timings
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:01:21 +05:30
Nikunj A Dadhania 1abf624dfb usb: fix various issues found with js2x
* JS20 exposed various timing related issues that were not apparent in
  the emulated environment.
* Reset the USB Bus
* JS20 overrides the frame_interval and periodic_start on setting the
  controller to USB operational. Reprogram them.
* ohci fix the data-toggle bits.
* Robust error handling

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:50:02 +05:30
Nikunj A Dadhania 5a75cd882e usb: Use separate in-memory endian swap
Convert pending in-memory byteswaps to accessors

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:49:41 +05:30
Benjamin Herrenschmidt fa6de662a9 usb: Fix a couple of warnings
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:03:55 +10:00
Nikunj A Dadhania da1c3fa98a USB generic hub device driver
Support for usb generic hub driver.

Todo: Detect disconnects and remove device

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30