aboutsummaryrefslogtreecommitdiff
path: root/common/usb_hub.c
diff options
context:
space:
mode:
authorShantur Rathore <i@shantur.com>2023-12-09 18:10:56 +0000
committerTom Rini <trini@konsulko.com>2024-01-22 12:49:03 -0500
commit33e06dcbe57a16e4f8b5b94dd8a3f89b87db2487 (patch)
tree7463a941e8fe1a5f11a4d966119f2db3b0243526 /common/usb_hub.c
parentc09ec8e1cb3baddef44458fb945fc258587a7d1b (diff)
downloadu-boot-33e06dcbe57a16e4f8b5b94dd8a3f89b87db2487.zip
u-boot-33e06dcbe57a16e4f8b5b94dd8a3f89b87db2487.tar.gz
u-boot-33e06dcbe57a16e4f8b5b94dd8a3f89b87db2487.tar.bz2
common: usb-hub: Reset hub port before scanning
Currently when a hub is turned on, all the ports are powered on. This works well for hubs which have individual power control. For the hubs without individual power control this has no effect. Mostly in these scenarios the hub port is powered before the USB controller is enabled, this can lead to some devices in unexpected state. With this patch, we explicitly reset the port while powering up hub This resets the port for hubs without port power control and has no effect on hubs with port power control as the port is still off. Before this patch AMicro AM8180 based NVME to USB adapter won't be detected as a USB3.0 Mass Storage device but with this it works as expected. Tested working after this patch: 1. AMicro AM8180 based NVME to USB Adapter 2. Kingston DataTraveler 3.0 3. GenesysLogic USB3.0 Hub The drives were tested while connected directly and via the hub. Signed-off-by: Shantur Rathore <i@shantur.com> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'common/usb_hub.c')
-rw-r--r--common/usb_hub.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 70279f3..3fb7e14 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -174,8 +174,10 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
debug("enabling power on all ports\n");
for (i = 0; i < dev->maxchild; i++) {
+ usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_RESET);
+ debug("Reset : port %d returns %lX\n", i + 1, dev->status);
usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
- debug("port %d returns %lX\n", i + 1, dev->status);
+ debug("PowerOn : port %d returns %lX\n", i + 1, dev->status);
}
#ifdef CONFIG_SANDBOX