U-boot 2016 breaks USB for old Linux

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

ryanmeulenkamp
Posts: 3
Joined: Thu Dec 06, 2018 4:37 pm

U-boot 2016 breaks USB for old Linux

Tue Nov 03, 2020 2:20 pm

Hi,

I'm running into a problem in which we install a "new" 2016 u-boot during an update of our systems. When these systems get downgraded again the new u-boot stays in there. With the "new" 2016 version u-boot we can boot that old OS just fine, only the root USB hub can't detect anything on the USB port anymore. The old OS was based around Linux kernel 2.6.25.14.

In u-boot we start USB up to see if a flash drive is connected containing an image we might want to flash. If I skip this USB step, it works just fine in Linux. So in short, u-boot 2016 's USB implementation leaves it in such a state that Linux cannot use it anymore. Breaking open older releases to fix this problem isn't feasible for us, but we need to get the new bootloader in as many systems as possible, so I'm left with finding a solution on the bootloader side. I tried simply running `usb stop` right before boot, without success.

Does there happen to be some known bug in the bootloader that has since been patched? I guess this has been fixed on the Linux side because the combination of a newer Linux kernel with that same bootloader works just fine.

I couldn't find a way to get it up and running in Linux after boot. I tried unbinding and reprobing the drivers without success.

Thanks in advance!

Ryan
blue_z
Location: USA
Posts: 2131
Joined: Thu Apr 19, 2007 10:15 pm

Re: U-boot 2016 breaks USB for old Linux

Wed Nov 04, 2020 2:00 am

There has previously been at least one (unwanted) dependency between U-Boot and the Linux kernel that affected device initialization (that I'm aware of). The Linux kernel driver for the Atmel EMAC (i.e. the cadence macb driver) used to depend on some hardware initialization to be performed by U-Boot.

Seems like you may be encountering a dependency of the opposite sort, i.e. the Linux kernel driver for the Microchip/Atmel USB host controller is expecting the hardware to be in a quiescent state. When U-Boot configures the USB host controller for its purposes, and if the Linux kernel driver then preforms an incomplete initialization because it assumes the default settings, then what you describe can be possible.

The universal fixes are (a) U-Boot must leave peripheral devices in a quiescent state (except specific devices such as the debug console), and (b) kernel drivers should perform a full initialization of hardware.
I suspect that (b) is not an actual Linux kernel requirement.

Regards
ryanmeulenkamp
Posts: 3
Joined: Thu Dec 06, 2018 4:37 pm

Re: U-boot 2016 breaks USB for old Linux

Wed Nov 04, 2020 1:00 pm

Hi blue_z,

Thanks, yes I expect I will have to go into the u-boot code and make sure that the USB hardware is reset to it's default state, or to the state the old Linux kernel expects. I was just hoping someone could point me into the right direction here.

Regards,

Ryan
ryanmeulenkamp
Posts: 3
Joined: Thu Dec 06, 2018 4:37 pm

Re: U-boot 2016 breaks USB for old Linux

Thu Nov 05, 2020 10:30 am

By the way, I since discovered that the previous combination of U-boot and Linux configured USB for OHCI and the new U-boot and Linux both configure it as EHCI. But from what I understand in code, it should be brought down again correctly when you run `usb stop`.

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 12 guests