Merge remote-tracking branch 'goog/android-master' into android-omap-tungsten
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index 0cef2ec..b7d8830 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -2122,6 +2122,19 @@
 		return -1;
 	}
 
+	/* currently we don't allow restarting fastboot if you've run
+	 * it before and exited to u-boot prompt.  it's possible to
+	 * support, but there's are edge cases that we're not
+	 * sure the answer to (e.g. do we reload the partition table
+	 * or not) and it's just not a common situation so we're
+	 * just saying no for now.
+	 */
+	if (priv.flag & FASTBOOT_FLAG_HAS_RUN) {
+		printf("fastboot can't be restarted\n");
+		return -1;
+	}
+	priv.flag |= FASTBOOT_FLAG_HAS_RUN;
+
 	printf("Starting fastboot protocol\n");
 
 	board_fbt_start();
diff --git a/include/fastboot.h b/include/fastboot.h
index 044b4a2..ae13131 100644
--- a/include/fastboot.h
+++ b/include/fastboot.h
@@ -101,8 +101,8 @@
 #define FASTBOOT_RESPONSE_SIZE 64
 
 /* Flags */
-#define	FASTBOOT_FLAG_RESPONSE	1
-#define	FASTBOOT_FLAG_DOWNLOAD	1
+#define FASTBOOT_FLAG_RESPONSE  0x1
+#define FASTBOOT_FLAG_HAS_RUN   0x2
 
 #define FASTBOOT_MAX_INFO_NAMELEN    32
 #define FASTBOOT_MAX_NUM_DEVICE_INFO 32