| 58b4048f | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Add dm support
Add driver-model support to the ohci code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de> |
| 8f761f02 | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Skip unnecessary mdelay(1) calls in various places
For some reason the ohci code is full with:
#ifdef DEBUG pkt_print(...) #else mdelay(1); #endif
AFAICT there is no reason for t
usb: ohci: Skip unnecessary mdelay(1) calls in various places
For some reason the ohci code is full with:
#ifdef DEBUG pkt_print(...) #else mdelay(1); #endif
AFAICT there is no reason for the mdelay(1) calls. This commit disables them when building the ohci code for new driver-model using boards. It leaves the mdelay(1) calls in place when building for older boards, so as to avoid causing any regressions there.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
| 969bb5ba | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Remove unnecessary delays from hc_start and power power-on paths
The usb spec says that we must wait a minimum amount of time after port power on (exact time is in the hub descriptor), th
usb: ohci: Remove unnecessary delays from hc_start and power power-on paths
The usb spec says that we must wait a minimum amount of time after port power on (exact time is in the hub descriptor), this is something which we must not only do for root ports but also for external hub ports, which is why the common usb_hub code already waits a full second after powering up ports. Having a separate wait for just the root hub in the ohci-hcd code only leads to doing the waiting twice for the root ports, so drop the wait from the ohci-hcd code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
| 47976d2c | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Do not resubmit and leak urbs for interrupt packets
The u-boot usb code uses polling for all endpoints, including interrupt endpoints, so urbs should never be automatically resubmitted.
usb: ohci: Do not resubmit and leak urbs for interrupt packets
The u-boot usb code uses polling for all endpoints, including interrupt endpoints, so urbs should never be automatically resubmitted.
This also fixes a leak of the urb, as submit_int_msg() did not check if an already re-submitted urb exists before creating a new one.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| e253637b | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Do not scan companion buses if no devices where handed over
USB scanning is slow, and there is no need to scan the companion buses if no usb devices where handed over to the companinon cont
dm: usb: Do not scan companion buses if no devices where handed over
USB scanning is slow, and there is no need to scan the companion buses if no usb devices where handed over to the companinon controllers by any of the main controllers.
This saves e.g. 2 seconds when booting a A10 OLinuxIno Lime with no USB-1 devices plugged into the root usb ports.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| b6de4d10 | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Add support for companion controllers
USB companion controllers must be scanned after the main controller has been scanned, so that any devices which the main controller which to hand over
dm: usb: Add support for companion controllers
USB companion controllers must be scanned after the main controller has been scanned, so that any devices which the main controller which to hand over to the companion have actually been handed over before we scan the companion.
As there are no guarantees that this will magically happen in the right order, split the scanning of the buses in 2 phases, first main controllers, and then companion controllers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| a24a0e91 | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Move printing of usb scan status to usb_scan_bus()
Move printing of usb scan status to usb_scan_bus().
This is a preparation patch for adding companion controller support to the usb uclass
dm: usb: Move printing of usb scan status to usb_scan_bus()
Move printing of usb scan status to usb_scan_bus().
This is a preparation patch for adding companion controller support to the usb uclass.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 8a5f0665 | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Add support for interrupt queues to the dm usb code
Interrupt endpoints typically are polled for a long time by the usb controller before they return anything, so calls to submit_int_msg()
dm: usb: Add support for interrupt queues to the dm usb code
Interrupt endpoints typically are polled for a long time by the usb controller before they return anything, so calls to submit_int_msg() can take a long time to complete this.
To avoid this the u-boot code has the an interrupt queue mechanism / API, add support for this to the driver-model usb code and implement it for the dm ehci code.
See the added doc comments for more details.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 029fd8ea | 11-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Prefix ehci interrupt-queue functions with _ehci_
This is a preparation patch for adding interrupt-queue support to the ehci dm code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Ack
dm: usb: Prefix ehci interrupt-queue functions with _ehci_
This is a preparation patch for adding interrupt-queue support to the ehci dm code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 45b9ea1d | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: Stop reset procedure when a dev is handed over to a companion hcd
Short circuit the retry loop in legacy_hub_port_reset() by returning an error from usb_control_msg() when a device was handed o
usb: Stop reset procedure when a dev is handed over to a companion hcd
Short circuit the retry loop in legacy_hub_port_reset() by returning an error from usb_control_msg() when a device was handed over to a companion by the ehci code. This avoids trying to reset low / fullspeed devices 5 times needlessly. Also do not print an error when a device has been handed over.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
| 71b94526 | 10-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: Fix handover of full-speed devices from ehci to companion
When after a reset the port status connection bit is still set and the enable bit is not then we're dealing with a full-speed device an
usb: Fix handover of full-speed devices from ehci to companion
When after a reset the port status connection bit is still set and the enable bit is not then we're dealing with a full-speed device and should hand it over to the companion controller.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
| f56da290 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: usb: exynos: Drop legacy USB code
Drop the code that doesn't use driver model for USB.
Signed-off-by: Simon Glass <sjg@chromium.org> |
| fa5b9baa | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Don't log an error on interrupt packet timeout
Interrupts transfers timing out is normal, so do not log an error for this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ma
usb: ohci: Don't log an error on interrupt packet timeout
Interrupts transfers timing out is normal, so do not log an error for this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| 8d005ef8 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Add proper cache flushing / invalidating for non cache coherent cpus
Add proper cache flushing / invalidating for non cache coherent cpus, for now only enable this for new (driver-model)
usb: ohci: Add proper cache flushing / invalidating for non cache coherent cpus
Add proper cache flushing / invalidating for non cache coherent cpus, for now only enable this for new (driver-model) usb code to avoid regressions.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| cae01cb2 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Fix ctrl in messages with a data-len of 0
Fix taken from the Linux kernel ohci driver.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de> |
| 6651c140 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Move static func and var declarations from ohci.h to ohci-hcd.c
Non static function and variable declarations do not belong in a .h file.
Signed-off-by: Hans de Goede <hdegoede@redhat.co
usb: ohci: Move static func and var declarations from ohci.h to ohci-hcd.c
Non static function and variable declarations do not belong in a .h file.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| 26548bb2 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Remove unnecessary phcca variable
This is a preparation patch for adding driver-model support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de> |
| 3c5497d8 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Move the td array struct to inside the ohci_dev struct
This is a preparation patch for adding driver-model support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vas
usb: ohci: Move the td array struct to inside the ohci_dev struct
This is a preparation patch for adding driver-model support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| 19d95d57 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Move the ohci_dev struct to inside the main ohci struct
This is a preparation patch for adding driver-model support.
Note we do keep ohci_dev as a separate struct so that we can later ad
usb: ohci: Move the ohci_dev struct to inside the main ohci struct
This is a preparation patch for adding driver-model support.
Note we do keep ohci_dev as a separate struct so that we can later add support for interrupt-queues which requires allocating a separate ohci_dev per interrupt-queue.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| c5613df5 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Pass around a pointer to ohci_t rather then accessing global vars
This is a preparation patch for adding driver-model support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by
usb: ohci: Pass around a pointer to ohci_t rather then accessing global vars
This is a preparation patch for adding driver-model support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| 69710ce3 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
usb: ohci: Remove unused devgone global variable
devgone is never assigned a value, so the one comparisson reading it will never be true, and devgone can be completely removed.
Signed-off-by: Hans
usb: ohci: Remove unused devgone global variable
devgone is never assigned a value, so the one comparisson reading it will never be true, and devgone can be completely removed.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| cb8a2c14 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Set desc_before_addr from ehci dm code
Without this usb-1 device descriptors do not get read properly.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromiu
dm: usb: Set desc_before_addr from ehci dm code
Without this usb-1 device descriptors do not get read properly.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| fcdd8aaa | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Fix finding of first upstream usb-2 hub in the ehci dm code
The ehci driver model code for finding the first upstream usb-2 hub before this commit has a number of issues:
1) "if (!ttdev->s
dm: usb: Fix finding of first upstream usb-2 hub in the ehci dm code
The ehci driver model code for finding the first upstream usb-2 hub before this commit has a number of issues:
1) "if (!ttdev->speed != USB_SPEED_HIGH)" does not work because the '!' takes presedence over the '!=' this should simply be "if (ttdev->speed == USB_SPEED_HIGH)" 2) It makes ttdev point to the first upstream usb-2 hub, but ttdev should point to the last usb-1 device before the first usb-2 hub (when going upstream from the device), as ttdev is used to find the port of the first usb-2 hub to which the the last usb-1 device is connected. 3) parent_devnum however should be set to the devnum of the first usb-2 hub, so we need to keep pointers around to both usb_device structs.
To complicate things further during enumeration usb_device.dev will point to the parent udevice, where as during normal use it will point to the actual udevice, we must handle both cases correctly.
This commit fixes all this making usb-1 devices attached to usb-2 hubs, including usb-1 devices attached to usb-1 hubs attached to usb-2 hubs, work.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 25c8ebdf | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Use usb_get_bus in dm ehci code
Use usb_get_bus in dm ehci code rather then re-implementing it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org> |
| 7f1a0753 | 05-May-2015 |
Hans de Goede <hdegoede@redhat.com> |
dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Currently we copy over a number of usb_device values stored in the on stack struct usb_device probed in usb_scan_devic
dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Currently we copy over a number of usb_device values stored in the on stack struct usb_device probed in usb_scan_device() to the final driver-model managed struct usb_device in usb_child_pre_probe() through usb_device_platdata, and then call usb_select_config() to fill in the rest.
There are 3 problems with this approach:
1) It does not fill in enough fields before calling usb_select_config(), specifically it does not fill in ep0's maxpacketsize causing a div by zero exception in the ehci driver.
2) It unnecessarily redoes a number of usb requests making usb probing slower
3) Calling usb_select_config() a second time fails on some usb-1 devices plugged into usb-2 hubs, causing u-boot to not recognize these devices.
This commit fixes these issues by removing (*) the usb_select_config() call from usb_child_pre_probe(), and instead of copying over things field by field through usb_device_platdata, store a pointer to the in stack usb_device (which is still valid when usb_child_pre_probe() gets called) and copy over the entire struct.
*) Except for devices which are explictly instantiated through device-tree rather then discovered through usb_scan_device() such as emulated usb devices in the sandbox.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|