[U-Boot] [PATCH] USB: add CONFIG_USB_INIT to autoinitialize USB before main_loop
Allen Martin
AMartin at nvidia.com
Thu Dec 22 23:40:03 CET 2011
> > > > The point is to be able to use USB keyboard to stop autoboot on
> > > > systems where USB keyboard is the primary (or only) input device.
> > > > This needs to happen before BOOTCOMMAND gets parsed.
> > >
> > > I think the "preboot" environment variable already *is* run before
> > > starting the autoboot timer?
> >
> > Yep.
> >
>
> I also had to stick it before console init because console makes
> decisions about the input device based on what's been registered when it
> initializes (at least with iomux turned on, I didn't try it without).
>
> Maybe a better fix is to have console reevaluate things when the usb
> keyboard driver registers itself? I'm open to suggestions.
I don't fully grok how console/stdin gets assigned, but is this possibly
the problem? (from drv_usb_kbd_init()):
/* Check if this is the standard input device. */
if (strcmp(stdinname, DEVNAME))
return 1;
/* Reassign the console */
if (overwrite_console())
return 1;
error = console_assign(stdin, DEVNAME);
This seems incompatible with iomux, shouldn't these decisions be made in the
console driver? In my case, stdin is set to "serial,tegra-kbc,usbkbd" so this
strcmp won't match.
-Allen
nvpublic
More information about the U-Boot
mailing list