summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-06-04 10:59:23 (GMT)
committerAlbert ARIBAUD (U-Boot) <uboot@lilith.(none)>2012-07-09 20:44:33 (GMT)
commitf78d348cb8a4f5f69a80f914e84eabd8663783a3 (patch)
treed7c0779df1a5e5dad957816f7be9be96a5eebb9c
parent03cddf28ebbaf402cdac495b71d7fb1bc5fa252f (diff)
downloadu-boot-fsl-qoriq-f78d348cb8a4f5f69a80f914e84eabd8663783a3.tar.xz
tegra: bootcmd: start USB only when needed
Instead of initializing USB as soon as bootcmd is executed, defer it until the first boot device that (potentially in the case of network) uses USB is scanned. This avoids initializing USB when booting from MMC, so speeds that up. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
-rw-r--r--include/configs/tegra2-common-post.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/configs/tegra2-common-post.h b/include/configs/tegra2-common-post.h
index 85b037c..80d9c35 100644
--- a/include/configs/tegra2-common-post.h
+++ b/include/configs/tegra2-common-post.h
@@ -58,24 +58,33 @@
#endif
#ifdef CONFIG_CMD_USB
+#define BOOTCMD_INIT_USB "run usb_init; "
#define BOOTCMDS_USB \
+ "usb_init=" \
+ "if ${usb_need_init}; then " \
+ "set usb_need_init false; " \
+ "usb start 0; " \
+ "fi\0" \
+ \
"usb_boot=" \
"setenv devtype usb; " \
+ BOOTCMD_INIT_USB \
"if usb dev ${devnum}; then " \
"run scan_boot; " \
"fi\0" \
+ \
"bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
#define BOOT_TARGETS_USB "usb0"
-#define BOOTCMD_INIT_USB "usb start 0; "
#else
+#define BOOTCMD_INIT_USB ""
#define BOOTCMDS_USB ""
#define BOOT_TARGETS_USB ""
-#define BOOTCMD_INIT_USB ""
#endif
#ifdef CONFIG_CMD_DHCP
#define BOOTCMDS_DHCP \
"bootcmd_dhcp=" \
+ BOOTCMD_INIT_USB \
"if dhcp ${scriptaddr} boot.scr.uimg; then "\
"source ${scriptaddr}; " \
"fi\0"
@@ -127,7 +136,6 @@
BOOTCMDS_DHCP
#define CONFIG_BOOTCOMMAND \
- BOOTCMD_INIT_USB \
"for target in ${boot_targets}; do run bootcmd_${target}; done"
#endif