[U-Boot] mpc5121 - EHCI problems with some (but not all) USB hubs

Damien Dusha d.dusha at gmail.com
Fri Sep 25 01:19:54 CEST 2009


On Fri, Sep 25, 2009 at 2:04 AM, Michael Trimarchi
<trimarchi at gandalf.sssup.it> wrote:
> Damien Dusha wrote:
>>
>> Dear All,
>>
>> I am attempting to integrate the USB on the Freescale mpc5121
>> processor on the mpc5121ads board from Silicon Turnkey for upgrades of
>> kernel, u-boot etc.
>>
>> I have succeeded in integrating Francesco Rendine 's EHCI patch for
>> the MPC5121 (see
>> http://lists.denx.de/pipermail/u-boot/2009-June/055021.html ) and I
>> have the general functionality of upgrading from a USB stick working
>> straight from the USB, or through some (but not all) USB hubs.
>>
>> However, I am having problem using the driver with some (but not all)
>> USB hubs.   I have some USB hubs that work "out of the box", but I
>> have other hubs that cause booting u-boot to hang after attempting to
>> initialise the USB.  The ones that do work, and the ones that fail all
>> fail in the same place the great majority of the time (they succeed
>> very occasionally).
>>
>> I have traced the hang to the following lines in
>> drivers/usb/host/ehci-hcd.c:
>>
>>        /* Wait for TDs to be processed. */
>>        ts = get_timer(0);
>>        vtd = td;
>>        do {
>>                /* Invalidate dcache */
>>                ehci_invalidate_dcache(&qh_list);
>>                token = hc32_to_cpu(vtd->qt_token);
>>                if (!(token & 0x80))
>>                        break;
>>
>>               /* This was my own line I added to check.  The
>> get_timer(ts) always returns 0 and never exits the loop */
>>               debug("get_timer: %d, CONFIG_SYS_HZ: %d\n",
>> get_timer(ts), CONFIG_SYS_HZ);
>>        } while (get_timer(ts) < CONFIG_SYS_HZ);
>>
>
> I think that the git_timer is not proprer implemented here and so
> what happen if you go out the busy loop and return an error to the
> message?
> Can you try on another hardware with u-boot?


Yesterday, we tried the following:

    /* Add long delay before entering the loop */
    udelay(10000);

	/* Wait for TDs to be processed. */
    /* Remove the loop and exit immediately. Do not wait for timer */
	// ts = get_timer(0);
	//vtd = td;
    //do {
		/* Invalidate dcache */
		ehci_invalidate_dcache(&qh_list);
		token = hc32_to_cpu(vtd->qt_token);
	//	if (!(token & 0x80))
	//		break;

        // debug("get_timer: %d, CONFIG_SYS_HZ: %d\n", get_timer(ts),
CONFIG_SYS_HZ);
	//} while (get_timer(ts) < CONFIG_SYS_HZ);

With the following result:
 * If only "working" hubs and a USB stick is attached, it will do our
auto upgrade sequence as normal.
 * If a "broken" hub is present, U-Boot will report that the devices
are found, but will not actually read a USB stick attached to the hub.
  It will not read a stick, even if the stick is attached to a
"working" hub, and the "broken" hub is cascaded off the working hub.

Unfortunately, I have no other EHCI hardware available - only a
5200LITE and a AVR32 dev board in the back of the cupboard somewhere.

 -- Damien.


More information about the U-Boot mailing list