Lines Matching full:hub

21  * HUB "Driver"
22 * Probes device for being a hub and configurate it
52 struct usb_device *dev; /* USB hub device to scan */
53 struct usb_hub_device *hub; /* USB hub struct */ member
60 __weak void usb_hub_reset_devices(struct usb_hub_device *hub, int port) in usb_hub_reset_devices() argument
71 bool usb_hub_is_root_hub(struct udevice *hub) in usb_hub_is_root_hub() argument
73 if (device_get_uclass_id(hub->parent) != UCLASS_USB_HUB) in usb_hub_is_root_hub()
136 * Translate the USB 3.0 hub port status field into the old version in usb_get_port_status()
137 * that U-Boot understands. Do this only when the hub is not root hub. in usb_get_port_status()
138 * For root hub, the port status field has already been translated in usb_get_port_status()
162 static void usb_hub_power_on(struct usb_hub_device *hub) in usb_hub_power_on() argument
166 unsigned pgood_delay = hub->desc.bPwrOn2PwrGood * 2; in usb_hub_power_on()
169 dev = hub->pusb_dev; in usb_hub_power_on()
202 hub->query_delay = get_timer(0) + max(100, (int)pgood_delay); in usb_hub_power_on()
209 hub->connect_timeout = hub->query_delay + 1000; in usb_hub_power_on()
264 * Reset a hub port and see if a device is present on that port, providing
371 debug("usb_disconnect(&hub->children[port]);\n"); in usb_hub_port_connect_change()
426 debug("hub: disabling port %d\n", port + 1); in usb_hub_port_connect_change()
439 struct usb_hub_device *hub; in usb_scan_port() local
444 hub = usb_scan->hub; in usb_scan_port()
451 if (get_timer(0) < hub->query_delay) in usb_scan_port()
457 if (get_timer(0) >= hub->connect_timeout) { in usb_scan_port()
475 * For some situation, the hub reports no connection change but a in usb_scan_port()
477 * in the PORTSC register of a root hub), ignore such case. in usb_scan_port()
481 if (get_timer(0) >= hub->connect_timeout) { in usb_scan_port()
518 * devices to be shutdown by the hub, this hack enables in usb_scan_port()
524 debug("already running port %i disabled by hub (EMI?), re-enabling...\n", in usb_scan_port()
542 hub->overcurrent_count[i]++; in usb_scan_port()
548 if (hub->overcurrent_count[i] <= in usb_scan_port()
554 hub->overcurrent_count[i]); in usb_scan_port()
608 struct usb_hub_device *hub; in usb_get_hub_device() local
611 /* "allocate" Hub device */ in usb_get_hub_device()
612 hub = usb_hub_allocate(); in usb_get_hub_device()
614 hub = dev_get_uclass_priv(dev->dev); in usb_get_hub_device()
617 return hub; in usb_get_hub_device()
627 struct usb_hub_device *hub; in usb_hub_configure() local
631 hub = usb_get_hub_device(dev); in usb_hub_configure()
632 if (hub == NULL) in usb_hub_configure()
634 hub->pusb_dev = dev; in usb_hub_configure()
636 /* Get the the hub descriptor */ in usb_hub_configure()
639 debug("usb_hub_configure: failed to get hub " \ in usb_hub_configure()
650 debug("usb_hub_configure: failed to get hub " \ in usb_hub_configure()
654 memcpy((unsigned char *)&hub->desc, buffer, length); in usb_hub_configure()
658 &hub->desc.wHubCharacteristics); in usb_hub_configure()
660 bitmap = (unsigned char *)&hub->desc.u.hs.DeviceRemovable[0]; in usb_hub_configure()
663 bitmap = (unsigned char *)&hub->desc.u.hs.PortPowerCtrlMask[0]; in usb_hub_configure()
666 for (i = 0; i < ((hub->desc.bNbrPorts + 1 + 7)/8); i++) in usb_hub_configure()
667 hub->desc.u.hs.DeviceRemovable[i] = in usb_hub_configure()
670 for (i = 0; i < ((hub->desc.bNbrPorts + 1 + 7)/8); i++) in usb_hub_configure()
671 hub->desc.u.hs.PortPowerCtrlMask[i] = in usb_hub_configure()
677 hubCharacteristics = get_unaligned(&hub->desc.wHubCharacteristics); in usb_hub_configure()
694 debug("standalone hub\n"); in usb_hub_configure()
719 hub->tt.multi = true; in usb_hub_configure()
728 debug("Unrecognized hub protocol %d\n", in usb_hub_configure()
737 hub->tt.think_time = 666; in usb_hub_configure()
739 8, hub->tt.think_time); in usb_hub_configure()
743 hub->tt.think_time = 666 * 2; in usb_hub_configure()
745 16, hub->tt.think_time); in usb_hub_configure()
748 hub->tt.think_time = 666 * 3; in usb_hub_configure()
750 24, hub->tt.think_time); in usb_hub_configure()
753 hub->tt.think_time = 666 * 4; in usb_hub_configure()
755 32, hub->tt.think_time); in usb_hub_configure()
761 debug("hub controller current requirement: %dmA\n", in usb_hub_configure()
766 hub->desc.u.hs.DeviceRemovable[(i + 1) / 8] & \ in usb_hub_configure()
796 * Update USB host controller's internal representation of this hub in usb_hub_configure()
797 * after the hub descriptor is fetched. in usb_hub_configure()
801 debug("%s: failed to update hub device for HCD (%x)\n", in usb_hub_configure()
808 * root hub occupies the first tier. The last tier ends with a normal in usb_hub_configure()
810 * to route packets to the designated downstream port. The hub uses a in usb_hub_configure()
811 * hub depth value multiplied by four as an offset into the 'route in usb_hub_configure()
816 hub->hub_depth = -1; in usb_hub_configure()
827 hub->hub_depth = depth; in usb_hub_configure()
830 debug("set hub (%p) depth to %d\n", dev, depth); in usb_hub_configure()
832 * This request sets the value that the hub uses to in usb_hub_configure()
834 * for this hub. in usb_hub_configure()
838 debug("%s: failed to set hub depth (%lX)\n", in usb_hub_configure()
846 usb_hub_power_on(hub); in usb_hub_configure()
854 usb_hub_reset_devices(hub, i + 1); in usb_hub_configure()
872 usb_scan->hub = hub; in usb_hub_configure()
891 /* Is it a hub? */ in usb_hub_check()
899 /* Multiple endpoints? What kind of mutant ninja-hub is this? */ in usb_hub_check()
909 /* We found a hub */ in usb_hub_check()
910 debug("USB hub found\n"); in usb_hub_check()
914 debug("USB hub not found: bInterfaceClass=%d, bInterfaceSubClass=%d, bNumEndpoints=%d\n", in usb_hub_check()
937 int usb_hub_scan(struct udevice *hub) in usb_hub_scan() argument
939 struct usb_device *udev = dev_get_parent_priv(hub); in usb_hub_scan()
951 { .compatible = "usb-hub" },