| d17dd8c5 | 18-Sep-2017 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: usb: xhci: Don't assume LS/FS devices are always behind a HS hub
At present xHCI driver assumes LS/FS devices are attached directly to a HS hub. If they are connected to a LS/FS hub, the d
UPSTREAM: usb: xhci: Don't assume LS/FS devices are always behind a HS hub
At present xHCI driver assumes LS/FS devices are attached directly to a HS hub. If they are connected to a LS/FS hub, the driver will fail to perform the USB enumeration process on such devices.
This is fixed by looking from the device itself all the way up to the HS hub where the TT that serves the device is located.
Change-Id: I3465e64fdb09cf2fd15e181a5606938cf5819681 Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 8a0e6d83070a977442aaba2c5a74cbe34e157012)
show more ...
|
| 57058838 | 01-Oct-2017 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: usb: Remove no longer needed blk_unbind_all()
With the root hub unbinding in usb_stop(), there is no need to do a blk uclass specific unbind operation.
Change-Id: I1f8fef976ba14efc836
UPSTREAM: dm: usb: Remove no longer needed blk_unbind_all()
With the root hub unbinding in usb_stop(), there is no need to do a blk uclass specific unbind operation.
Change-Id: I1f8fef976ba14efc836041e79b23c0cd916a39ee Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit ad0a9378bf5cc9280e117b7db94b6bfa1b6e8e76)
show more ...
|
| 4f46a20e | 01-Oct-2017 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: usb: Fix broken usb_stop()
At present we only do device_remove() during usb stop. The DM API device_remove() only marks the device state as inactivated, but still keeps its USB topolog
UPSTREAM: dm: usb: Fix broken usb_stop()
At present we only do device_remove() during usb stop. The DM API device_remove() only marks the device state as inactivated, but still keeps its USB topology (eg: parent, children, etc) in the DM device structure. There is no issue if we only start USB subsystem once and never stop it. But a big issue occurs when we do 'usb stop' and 'usb start' multiple times.
Strange things may be observed with current implementation, like: - the enumeration may report only 1 mass storage device is detected, but the total number of USB devices is correct. - USB keyboard does not work anymore after a bunch of 'usb reset' even if 'usb tree' shows it is correctly identified. - read/write flash drive via 'fatload usb' may complain "Bad device"
In fact, every time when USB host controller starts the enumeration process, it takes random time for each USB port to show up online, hence each USB device may appear in a different order from previous enumeration, and gets assigned to a totally different USB address. As a result, we end up using a stale USB topology in the DM device structure which still reflects the previous enumeration result, and it may create an exact same DM device name like generic_bus_0_dev_7 that is already in the DM device structure. And since the DM device structure is there, there is no device_bind() call to bind driver to the device during current enumeration process, eventually creating an inconsistent software representation of the hardware topology, a non-working USB subsystem.
The fix is to clear the unused USB topology in the usb_stop(), by calling device_unbind() on each controller's root hub device, and the unbinding will unbind all of its children automatically.
For Sandbox, we need scan the device tree each time when we start the USB stack, in order to re-create the emulated USB devices and bind drivers for them before we actually do the driver probe.
Change-Id: I690fd9e4bd18421ea5f11772aab39806a2208b4e Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit d4efefe32ea8a45b7b30f4769b3928c28e181c73)
show more ...
|
| 97ff91fa | 12-Sep-2017 |
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> |
UPSTREAM: usb: host: ehci-generic: convert to livetree
Update the generic EHCI driver to support a live tree.
Change-Id: I07159bf921cda3d42247d2134a4f5a6bd7d65bb5 Signed-off-by: Philipp Tomsich <ph
UPSTREAM: usb: host: ehci-generic: convert to livetree
Update the generic EHCI driver to support a live tree.
Change-Id: I07159bf921cda3d42247d2134a4f5a6bd7d65bb5 Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 6e652e3a7d15b896fd82b717c6eca74b70a33b7a)
show more ...
|
| c32504a8 | 12-Sep-2017 |
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> |
UPSTREAM: usb: dwc2: convert to livetree
Update the DWC2 USB driver to support a live tree.
Change-Id: I1b2ccc05a637856cf1af0583985f0f336530121a Signed-off-by: Philipp Tomsich <philipp.tomsich@theo
UPSTREAM: usb: dwc2: convert to livetree
Update the DWC2 USB driver to support a live tree.
Change-Id: I1b2ccc05a637856cf1af0583985f0f336530121a Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit a9d3037a8e4f045434184623eadbe86fa3844b28)
show more ...
|
| d5c8d3f5 | 12-Sep-2017 |
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> |
UPSTREAM: rockchip: xhci: Convert to livetree
Update the Rockchip xhci wrapper driver to support a live device tree.
Change-Id: Ie5dad13ae0327b7893c1530d7383994a1375d12e Signed-off-by: Philipp Toms
UPSTREAM: rockchip: xhci: Convert to livetree
Update the Rockchip xhci wrapper driver to support a live device tree.
Change-Id: Ie5dad13ae0327b7893c1530d7383994a1375d12e Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 32c8eee37fcb88d372410952d3ab88bcf5fdf7e7)
show more ...
|
| 50293ea8 | 07-Sep-2017 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: usb: ehci: Implement get_max_xfer_size() operation
EHCD can handle any transfer length as long as there is enough free heap space left, hence set the theoretical max number SIZE_MAX.
UPSTREAM: dm: usb: ehci: Implement get_max_xfer_size() operation
EHCD can handle any transfer length as long as there is enough free heap space left, hence set the theoretical max number SIZE_MAX.
Change-Id: I58711c5a6348b525caf950748d7c3338997e146a Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit a23aa66baa3725e8707da46b18c645ad1a7243a0)
show more ...
|
| dbdd0140 | 07-Sep-2017 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: usb: xhci: Implement get_max_xfer_size() operation
xHCD allocates one segment which includes 64 TRBs for each endpoint and the last TRB in this segment is configured as a link TRB to f
UPSTREAM: dm: usb: xhci: Implement get_max_xfer_size() operation
xHCD allocates one segment which includes 64 TRBs for each endpoint and the last TRB in this segment is configured as a link TRB to form a TRB ring. Each TRB can transfer up to 64K bytes, however data buffers referenced by transfer TRBs shall not span 64KB boundaries. Hence the maximum number of TRBs we can use in one transfer is 62.
Change-Id: I7ea20b7805fe4da11343d38001a414b95751c7d5 Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 022ceacaf8a6a67f86f0a5ed8f6ce6b2f6ab73a4)
show more ...
|
| 51da7f21 | 07-Sep-2017 |
Bin Meng <bmeng.cn@gmail.com> |
UPSTREAM: dm: usb: Add a new USB controller operation 'get_max_xfer_size'
The HCD may have limitation on the maximum bytes to be transferred in a USB transfer. USB class driver needs to be aware of
UPSTREAM: dm: usb: Add a new USB controller operation 'get_max_xfer_size'
The HCD may have limitation on the maximum bytes to be transferred in a USB transfer. USB class driver needs to be aware of this.
Change-Id: I6084946910810d5dbbe66a9191e6da768b084fe6 Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 3e59f59015e39ceb870fa8a7a12e0464e775512b)
show more ...
|
| d38a8ea1 | 25-Jul-2017 |
Patrice Chotard <patrice.chotard@st.com> |
usb: host: xhci-dxc3: fix compilation warnings
Fix following warnings encountered with platforms dra7xx_evm and dra7xx_hs_evm :
arm: + dra7xx_evm + hccr = (struct xhci_hccr *)devfdt_get_
usb: host: xhci-dxc3: fix compilation warnings
Fix following warnings encountered with platforms dra7xx_evm and dra7xx_hs_evm :
arm: + dra7xx_evm + hccr = (struct xhci_hccr *)devfdt_get_addr(dev); + ^ + hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + ^ w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] arm: + dra7xx_hs_evm + hccr = (struct xhci_hccr *)devfdt_get_addr(dev); + ^ + hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + ^ w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Introduced by 7e65e84 usb: host: xhci-dwc3: Convert driver to DM
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
show more ...
|
| 2080d023 | 24-Jul-2017 |
Patrice Chotard <patrice.chotard@st.com> |
usb: host: ohci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chota
usb: host: ohci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
show more ...
|
| 4b3928a0 | 24-Jul-2017 |
Patrice Chotard <patrice.chotard@st.com> |
usb: host: ehci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chota
usb: host: ehci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
show more ...
|
| 78e30987 | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
usb: xhci: Enable TT to support LS/FS devices behind a HS hub
So far LS/FS devices directly attached to xHC root port can be successfully enumerated by xHCI driver, but if they are connected behind
usb: xhci: Enable TT to support LS/FS devices behind a HS hub
So far LS/FS devices directly attached to xHC root port can be successfully enumerated by xHCI driver, but if they are connected behind a hub, the enumeration process fails to address the device.
It turns out xHCI driver still misses a part that in the device's input slot context, all Transaction Translator (TT) related fields are not programmed. The xHCI spec defines how to enable TT.
Now LS/FS devices like USB keyboard/mouse can be enumerated behind a high speed hub.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| d228ca36 | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
usb: xhci: Implement update_hub_device() operation
There is no way to know whether the attached device is a hub or not in advance before the device's descriptor is fetched. But once we know it's a h
usb: xhci: Implement update_hub_device() operation
There is no way to know whether the attached device is a hub or not in advance before the device's descriptor is fetched. But once we know it's a high speed hub, per the xHCI spec, we need to tell xHC it's a hub device by initializing hub-related fields in the input slot context.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 9ca1b4ba | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
dm: usb: Add a new USB controller operation 'update_hub_device'
For USB host controllers like xHC, its internal representation of hub needs to be updated after the hub descriptor is fetched. This ad
dm: usb: Add a new USB controller operation 'update_hub_device'
For USB host controllers like xHC, its internal representation of hub needs to be updated after the hub descriptor is fetched. This adds a new op that does this.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 493b8dd0 | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
usb: xhci: Program 'route string' in the input slot context
xHCI spec says: the values of the 'route string' field shall be initialized by the first 'Address Device' command issued to a device slot,
usb: xhci: Program 'route string' in the input slot context
xHCI spec says: the values of the 'route string' field shall be initialized by the first 'Address Device' command issued to a device slot, and shall not be modified by any other command.
So far U-Boot does not program this field, and it does not prevent SS device directly attached to root port, or HS device behind an HS hub, from working, due to the fact that 'route string' is used by the xHC to target SS packets. But in order to enumerate devices behind an SS hub, this field must be programmed.
With this commit and along with previous commits, now SS & HS devices attached to a USB 3.0 hub can be enumerated by U-Boot.
As usual, this new feature is only available when DM is on.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| daec4691 | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
usb: xhci: Change xhci_setup_addressable_virt_dev() signature
For future extension, change xhci_setup_addressable_virt_dev() signature to accept a pointer to 'struct usb_device', instead of its memb
usb: xhci: Change xhci_setup_addressable_virt_dev() signature
For future extension, change xhci_setup_addressable_virt_dev() signature to accept a pointer to 'struct usb_device', instead of its members slot_id & speed, as the struct already contains these two plus some other useful information of the device.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 46c1d493 | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
usb: hub: Add a new API to test if a hub device is root hub
Sometimes we need know if a given hub device is root hub or not. Add a new API to test this. This removes the xHCI driver's own version is
usb: hub: Add a new API to test if a hub device is root hub
Sometimes we need know if a given hub device is root hub or not. Add a new API to test this. This removes the xHCI driver's own version is_root_hub() and change to use the new API.
While we are here, remove the unused/commented out get_usb_device() in the xHCI driver too.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
| dfa96e06 | 19-Jul-2017 |
Bin Meng <bmeng.cn@gmail.com> |
usb: hub: Use 'struct usb_hub_device' as hub device's uclass_priv
Use USB hub device's dev->uclass_priv to point to 'usb_hub_device' so that with driver model usb_hub_reset() and usb_hub_allocate()
usb: hub: Use 'struct usb_hub_device' as hub device's uclass_priv
Use USB hub device's dev->uclass_priv to point to 'usb_hub_device' so that with driver model usb_hub_reset() and usb_hub_allocate() are no longer needed.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|