[U-Boot] config_distro_bootcmd: Avoid scanning usb twice (under some circumstances)

Hans de Goede hdegoede at redhat.com
Sun Nov 23 12:03:33 CET 2014


Hi,

On 11/20/2014 07:59 PM, Hans de Goede wrote:
> When using usb-keyboard support, the preboot env variable must be set to a
> command to scan usb, so that the keyboard is available to interrupt autoboot.
> 
> The logical command to add when using config_distro_bootcmd.h is
> "run usb_init", as that does a "setenv usb_need_init false" which should avoid
> a second scan when booting from usb.
> 
> However this does not work because config_distro_bootcmd sets
> bootcmd to "setenv usb_need_init; ...".
> 
> This is not necessary "if ${usb_need_init}" will evaluate to true just as well
> if usb_need_init is not set at all. So drop the BOOTENV_SET_USB_NEED_INIT
> macro and calling of it, thereby fixing the double usb-scan.
> 
> While at it do the same for scsi_need_init which was modelled after the usb
> code.

Self-NAK, this breaks things after an "env save" command, as then the env
saved will contain usb_need_init=false, and usb will no longer get scanned.

I'll look into a different fix.

Regards,

Hans


More information about the U-Boot mailing list