From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Sun, 23 Nov 2014 12:03:33 +0100 Subject: [U-Boot] config_distro_bootcmd: Avoid scanning usb twice (under some circumstances) In-Reply-To: <1416509997-6536-1-git-send-email-hdegoede@redhat.com> References: <1416509997-6536-1-git-send-email-hdegoede@redhat.com> Message-ID: <5471BF05.3030203@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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