Hi,
I am afraid, I maybe will not help You too much but I try it:
I shortly looked into ML to Your posts. As I saw short part of debug
output in one of Your e-mail, GRUB freezes when it wants to get device
descriptor - more precisely, when it requests first 8 bytes of device
descriptor. It is the first thing which is done after address is
assigned to the device.
So, it looks like device does not set address properly (even if control
message Set Address returns success) or happened something else what
prevent device to respond (but I don't know what...).
For the first try You can increase related delays in usbhub.c:
...
/* Wait "recovery interval", spec. says 2ms */
grub_millisleep (2);<<<<---- HERE (try 4ms or more)
grub_usb_device_attach (dev);
...
...
/* Enable the port. */
err = hub->controller->dev->portstatus (hub->controller, portno, 1);
if (err)
return;
hub->controller->dev->pending_reset = grub_get_time_ms () + 5000;
grub_millisleep (10);<<<<---- maybe here also
/* Enable the port and create a device. */
dev = grub_usb_hub_add_dev (hub->controller, speed, portno, 0);
hub->controller->dev->pending_reset = 0;
if (! dev)
return;
...
If this will not help You, I currently have no other idea what could be
the reason of timeout.
I think You don't need EHCI because it looks like Set Address control
message works (at least it does not return error), i.e. You probably
have OHCI or UHCI USB (companion) controller on computer and Your device
is working at full or low speed with Your USB controller.
By the way, for the first look into ML I did not find which USB
controller You have - OHCI/UHCI ? (which driver/module are You using -
ohci/uhci?) - and which machine/architecture is the computer You are
trying to boot with GRUB2 - ?
I sometimes had some unidentified problems on my UHCI/EHCI controller,
mostly with port powering - UHCI does not have power management but EHCI
does and if EHCI is not properly initialized by BIOS (it could be Your
case with coreboot, maybe ?) then USB ports are not properly powered.
Another BIOS (coreboot?) issue could be improper handling of USB
controller ownership.
Do You have USB device connected directly into root port or via some USB
hub ? Try to do it in opposite way (i.e. if You are not using the USB
hub, try use it and connect USB device via hub - maybe it helps...)
Hmmm, I remember now one issue which could be related to Your problem.
On my very old machine with OHCI USB controller some devices are not
working "for the first time". I am still not able to debug why it
happened (it does not happened when full debug is active - so it looks
like it is related to some timing). But I am afraid it will be not Your
case because device stops working after it is recognized, configured,
usbms module loaded and GRUB USB device usb0 created.
But - try load ohci/uhci module when USB disk is connected and then
disconnect and connect it again after few seconds. In my case device
becomes working as new usb device (i.e. usb1).
Additionally, lot of manufacturers does not follow USB or USBMS
specifications, as You can read in Linux source code of USB controllers
and USB mass storage devices and related documentation.
Did You tried more different USB mass storage devices ?
What is manufacturer& type of Your USB mass storage device ?
Of course, You can also try EHCI driver, it maybe can solve Your problem
because of little bit different ports/devices handling. But EHCI driver
is currently highly experimental, it still exists only as uncorrected
and not accepted "patch". I have to do some improvement but I don't have
sufficient time still, unfortunately...
If You want try to use it, You can get my patch from ML (sent at
25.6.2011) and use it with related source code trunk branch revision
(maybe also any later or current revision, because USB parts of GRUB are
not frequently changed). Please also read about know issue and another
limitations of the "zero version" of EHCI driver - e.g. it may not work
if Your PC is not x86 machine or USB registers are mapped above 4GB etc.
Sorry if You will wait longer time for my response in future - I don't
check the post so often and additionally currently I am (and probably
will be) longer time too busy - I am not regular GRUB2 contributor, I do
something for GRUB2 USB part only time to time...
BRs,
Ales
Cui Lei píše v Út 09. 08. 2011 v 11:05 +0800:
Hi Aleš,
I am trying to boot OS from USB disk, I use coreboot-v4 with grub2 as
payload, but my usb disk can not been
detect. I try to use usb-keyboard, it is not working. I know you are
working on the EHCI driver from Vladimir ,
could you give me some advices? Vladimir said it may need EHCI driver,
but I think the usb device should run
with low-speed or full-speed if no EHCI driver.C
Looking forward to your reply.
BRs,
Rock Cui.