[U-Boot] "Un-initialization" of hardware block prior to launching linux

Steve Sakoman sakoman at gmail.com
Wed Nov 17 01:02:31 CET 2010


On Tue, Nov 16, 2010 at 3:40 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Steve Sakoman,
>
> In message <AANLkTi==8qfve-r+NXVvCs4sJZmkv3-V1Q2FxY4zAG4=@mail.gmail.com> you wrote:
>> Beagle currently enables musb gadget support in u-boot in order to
>> support console communication over USB.
>>
>> The musb hardware remains in an active state as linux is launched.
>
> Leaving USB enabled when starting an OS is calling for really serious
> trouble.

Indeed.  I sort of assumed that the gadget code would shut things down
properly prior to launching linux, but it seems that isn't true.

>> I've had complaints from those working on Linux power management -- it
>> seems that leaving things active prevents the kernel from entering
>> full chip retention.
>
> Power management is the least of your problems. I don't know for USB
> gadgets, but at least for Host Controllers you will suffer from
> (usually silent) memory corruption.
>
>> Is there an approved mechanism for shutting down hardware gracefully
>> prior to launching linux?
>
>> The console gadget seems somewhat of a special case since you really
>> want it to remain active till the very last moment so error messages
>> can be displayed.
>
>
> I think you should shut down USB with usb_stop(); (see
> common/cmd_bootm.c:643). Yes, even when this precents some error
> messages from being displayed on the USB console. [I never understood
> the hw designers that omitted a real serial port.]

OK, it seems I might need to make this happen when CONFIG_USB_DEVICE
is enabled as well as CONFIG_CMD_USB.

I'll investigate to see if it really is this simple.

BTW -- there are "real" serial ports on OMAP silicon.  It seems that
lots of customers have PC's without serial ports and they want to use
USB consoles, hence the inclusion of the gadget support in several of
the OMAP board configs.

Go figure -- personally I feel better using a serial dongle and
connecting to the hw serial ports.

Thanks for the pointer Wolfgang!

Steve


More information about the U-Boot mailing list