mach-snapdragon: allocate fastboot buffer dynamically

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
index 8d039b9..98d4a1d 100644
--- a/arch/arm/mach-snapdragon/board.c
+++ b/arch/arm/mach-snapdragon/board.c
@@ -219,6 +219,11 @@
 
 #define KERNEL_COMP_SIZE	SZ_64M
 #define SZ_96M			(SZ_64M + SZ_32M)
+#ifdef CONFIG_FASTBOOT_BUF_SIZE
+#define FASTBOOT_BUF_SIZE CONFIG_FASTBOOT_BUF_SIZE
+#else
+#define FASTBOOT_BUF_SIZE 0
+#endif
 
 #define addr_alloc(lmb, size) lmb_alloc(lmb, size, SZ_2M)
 
@@ -235,6 +240,8 @@
 	status |= env_set_hex("ramdisk_addr_r", addr_alloc(&lmb, SZ_96M));
 	status |= env_set_hex("kernel_comp_addr_r", addr_alloc(&lmb, KERNEL_COMP_SIZE));
 	status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE);
+	if (IS_ENABLED(CONFIG_FASTBOOT))
+		status |= env_set_hex("fastboot_addr_r", addr_alloc(&lmb, FASTBOOT_BUF_SIZE));
 	status |= env_set_hex("scriptaddr", addr_alloc(&lmb, SZ_4M));
 	status |= env_set_hex("pxefile_addr_r", addr_alloc(&lmb, SZ_4M));
 	status |= env_set_hex("fdt_addr_r", addr_alloc(&lmb, SZ_2M));
diff --git a/include/configs/qcom.h b/include/configs/qcom.h
index 64258b9..944c736 100644
--- a/include/configs/qcom.h
+++ b/include/configs/qcom.h
@@ -13,13 +13,15 @@
 
 /* Load addressed are calculated during board_late_init(). See arm/mach-snapdragon/board.c */
 #define CFG_EXTRA_ENV_SETTINGS \
+	"bootdelay=1\0" \
 	"stdin=serial,button-kbd\0"	\
 	"stdout=serial,vidconsole\0"	\
 	"stderr=serial,vidconsole\0" \
-	"preboot=true || bootflow scan -l\0" \
+	"preboot=bootflow scan -l\0" \
+	"fastboot=fastboot -l $fastboot_addr_r usb 0\0" \
 	"bootmenu_0=Boot first available device=bootflow scan -b\0" \
 	"bootmenu_1=Enable USB mass storage=ums 0 scsi 0,1,2,3,4,5\0" \
-	"bootmenu_2=Enable fastboot mode=fastboot usb 0\0" \
+	"bootmenu_2=Enable fastboot mode=run fastboot\0" \
 	"bootmenu_3=Reset device=reset\0" \
 	"menucmd=bootmenu\0" \
 	"bootcmd=bootflow scan -b\0" /* first entry is default */