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

Wolfgang Denk wd at denx.de
Wed Nov 17 00:40:43 CET 2010


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.

> 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.]

Eventually you might be looking at arch_preboot_os(), but actually is
is NOT an architecture specific thing.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the pitiful, multipage, connection-boxed form to which  the  flow-
chart  has  today  been  elaborated, it has proved to be useless as a
design tool -- programmers draw flowcharts after, not before, writing
the programs they describe.                        - Fred Brooks, Jr.


More information about the U-Boot mailing list