X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=common%2Fusb_hub.c;h=e1de813adf82225ab4f7204088a698eeb782b0e4;hb=0ac8b1f437aa71c205f498d068d9d097cf72ce03;hp=652a104361f63ee715a99e924ccd1145a2c66224;hpb=dcc7dbc73169bb4e39f27c1d95bbf031ccfc1744;p=u-boot diff --git a/common/usb_hub.c b/common/usb_hub.c index 652a104361..e1de813adf 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -26,10 +26,14 @@ #include #include #include +#include #include #include #include #include +#ifdef CONFIG_SANDBOX +#include +#endif #include #include @@ -229,7 +233,7 @@ int legacy_hub_port_reset(struct usb_device *dev, int port, #ifdef CONFIG_DM_USB int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat) { - struct usb_device *udev = dev_get_parentdata(dev); + struct usb_device *udev = dev_get_parent_priv(dev); return legacy_hub_port_reset(udev, port, portstat); } @@ -465,7 +469,12 @@ static int usb_hub_configure(struct usb_device *dev) unsigned short portstatus, portchange; int ret; ulong start = get_timer(0); + uint delay = CONFIG_SYS_HZ; +#ifdef CONFIG_SANDBOX + if (state_get_skip_delays()) + delay = 0; +#endif #ifdef CONFIG_DM_USB debug("\n\nScanning '%s' port %d\n", dev->dev->name, i + 1); #else @@ -497,7 +506,7 @@ static int usb_hub_configure(struct usb_device *dev) if (portstatus & USB_PORT_STAT_CONNECTION) break; - } while (get_timer(start) < CONFIG_SYS_HZ * 1); + } while (get_timer(start) < delay); if (ret < 0) continue; @@ -609,7 +618,7 @@ int usb_hub_probe(struct usb_device *dev, int ifnum) #ifdef CONFIG_DM_USB int usb_hub_scan(struct udevice *hub) { - struct usb_device *udev = dev_get_parentdata(hub); + struct usb_device *udev = dev_get_parent_priv(hub); return usb_hub_configure(udev); }