]> xenbits.xensource.com Git - seabios.git/commitdiff
usb: Allow configuration of sigatt time (in etc/usb-time-sigatt)
authorKevin O'Connor <kevin@koconnor.net>
Mon, 9 Nov 2015 17:00:52 +0000 (12:00 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 17 Nov 2015 14:19:18 +0000 (09:19 -0500)
Several users have reported devices that take more than 100ms to
announce their presence on a USB port.  Allow the sigatt timeout to be
specified at runtime as a way to extend the default timeout.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
docs/Runtime_config.md
src/hw/usb.c

index d6fea2827667aeee9f6ea14864a3604fe7227cc7..483c37537df471b659bffe42a609fc850f5337bb 100644 (file)
@@ -189,3 +189,4 @@ There are several additional configuration options available in the
 | floppy1             | The type of the second floppy drive in the system. See the description of **floppy0** for more info.
 | threads             | By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.
 | sdcard*             | One may create one or more files with an "sdcard" prefix (eg, "etc/sdcard0") with the physical memory address of an SDHCI controller (one memory address per file).  This may be useful for SDHCI controllers that do not appear as PCI devices, but are mapped to a consistent memory address.
+| usb-time-sigatt     | The USB2 specification requires devices to signal that they are attached within 100ms of the USB port being powered on. Some USB devices are known to require more time. Prior to receiving an attachment signal there is no way to know if a USB port is empty or if it has a device attached. One may specify an amount of time here (in milliseconds, default 100) to wait for a USB device attachment signal. Increasing this value will also increase the overall machine bootup time.
index e46092c635c111ad9b2d408abcfaf48d7b4e3d89..2bffd2501169fad291d57bd94bd6a25ada1c9545 100644 (file)
@@ -8,6 +8,7 @@
 #include "config.h" // CONFIG_*
 #include "malloc.h" // free
 #include "output.h" // dprintf
+#include "romfile.h" // romfile_loadint
 #include "string.h" // memset
 #include "usb.h" // struct usb_s
 #include "usb-ehci.h" // ehci_setup
@@ -455,12 +456,14 @@ resetfail:
     goto done;
 }
 
+u32 usb_time_sigatt;
+
 void
 usb_enumerate(struct usbhub_s *hub)
 {
     u32 portcount = hub->portcount;
     hub->threads = portcount;
-    hub->detectend = timer_calc(USB_TIME_SIGATT);
+    hub->detectend = timer_calc(usb_time_sigatt);
 
     // Launch a thread for every port.
     int i;
@@ -497,5 +500,6 @@ usb_setup(void)
     ASSERT32FLAT();
     if (! CONFIG_USB)
         return;
+    usb_time_sigatt = romfile_loadint("etc/usb-time-sigatt", USB_TIME_SIGATT);
     run_thread(__usb_setup, NULL);
 }