]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
distro bootcmd: make net boot only optionally start USB
authorStephen Warren <swarren@nvidia.com>
Tue, 26 Jan 2016 18:10:12 +0000 (11:10 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 29 Jan 2016 04:01:23 +0000 (21:01 -0700)
Currently, the distro boot commands always enumerate USB devices before
performing network operations. However, depending on the board and end-
user configuration, network devices may not be attached to USB, and so
enumerating USB may not be necessary. Enhance the scripts to make this
step optional, so that the user can decrease boot time if they don't
need USB.

This change is performed by moving the "usb start" invocation into a
standalone variable. If the user desires, they can replace that
variable's value with some no-op command such as "true" instead.

Booting from a USB storage device always needs to enumerate USB devices,
so this action is still hard-coded.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
doc/README.distro
include/config_distro_bootcmd.h

index 9e4722a86ee562fdc80b675f5be9d30e30e61597..019903ea7d91fb0a58c9d8c5474782760c81c420 100644 (file)
@@ -341,6 +341,13 @@ scan_dev_for_scripts:
   If you want to disable boot.scr on all disks, set the value to something
   innocuous, e.g. setenv scan_dev_for_scripts true.
 
+boot_net_usb_start:
+
+  If you want to prevent USB enumeration by distro boot commands which execute
+  network operations, set the value to something innocuous, e.g. setenv
+  boot_net_usb_start true. This would be useful if you know your Ethernet
+  device is not attached to USB, and you wish to increase boot speed by
+  avoiding unnecessary actions.
 
 Interactively booting from a specific device at the u-boot prompt
 =================================================================
index 66264ce3b4711a610bca600a72419a6d6d672749..c027d8643967c1e393a9831fbaa3250f038e82ab 100644 (file)
 #endif
 
 #ifdef CONFIG_CMD_USB
-#define BOOTENV_RUN_USB_INIT "usb start; "
+#define BOOTENV_RUN_NET_USB_START "run boot_net_usb_start; "
 #define BOOTENV_SHARED_USB \
+       "boot_net_usb_start=usb start\0" \
        "usb_boot=" \
-               BOOTENV_RUN_USB_INIT \
+               "usb start; " \
                BOOTENV_SHARED_BLKDEV_BODY(usb)
 #define BOOTENV_DEV_USB                BOOTENV_DEV_BLKDEV
 #define BOOTENV_DEV_NAME_USB   BOOTENV_DEV_NAME_BLKDEV
 #else
-#define BOOTENV_RUN_USB_INIT
+#define BOOTENV_RUN_NET_USB_START
 #define BOOTENV_SHARED_USB
 #define BOOTENV_DEV_USB \
        BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
 #if defined(CONFIG_CMD_DHCP)
 #define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \
        "bootcmd_dhcp=" \
-               BOOTENV_RUN_USB_INIT \
+               BOOTENV_RUN_NET_USB_START \
                "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \
                        "source ${scriptaddr}; " \
                "fi\0"
 #if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
 #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \
        "bootcmd_pxe=" \
-               BOOTENV_RUN_USB_INIT \
+               BOOTENV_RUN_NET_USB_START \
                "dhcp; " \
                "if pxe get; then " \
                        "pxe boot; " \