Merge change I02a42409

* changes:
  [msm7627]: Replace thread_sleep calls and disable keypad initialization for nandwrite
diff --git a/platform/qsd8k/platform.c b/platform/qsd8k/platform.c
index 93fcb6f..9fb28ef 100644
--- a/platform/qsd8k/platform.c
+++ b/platform/qsd8k/platform.c
@@ -55,7 +55,9 @@
 void platform_init(void)
 {
         dprintf(INFO, "platform_init()\n");
+#if (!ENABLE_NANDWRITE)
         acpu_clock_init();
+#endif
 }
 
 void display_init(void)
diff --git a/project/qsd8250_ffa_nandwrite.mk b/project/qsd8250_ffa_nandwrite.mk
index ef1bf0e..cf8b2dc 100644
--- a/project/qsd8250_ffa_nandwrite.mk
+++ b/project/qsd8250_ffa_nandwrite.mk
@@ -7,6 +7,7 @@
 MODULES += app/nandwrite
 
 DEFINES += WITH_DEBUG_JTAG=1
+DEFINES += ENABLE_NANDWRITE=1
 #DEFINES += WITH_DEBUG_DCC=1
 #DEFINES += WITH_DEBUG_UART=1
 #DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/qsd8250_surf_nandwrite.mk b/project/qsd8250_surf_nandwrite.mk
index 6b362bb..2867174 100644
--- a/project/qsd8250_surf_nandwrite.mk
+++ b/project/qsd8250_surf_nandwrite.mk
@@ -7,6 +7,7 @@
 MODULES += app/nandwrite
 
 DEFINES += WITH_DEBUG_JTAG=1
+DEFINES += ENABLE_NANDWRITE=1
 #DEFINES += WITH_DEBUG_DCC=1
 #DEFINES += WITH_DEBUG_UART=1
 #DEFINES += WITH_DEBUG_FBCON=1
diff --git a/target/qsd8250_ffa/init.c b/target/qsd8250_ffa/init.c
index d6b1319..a86ddc7 100644
--- a/target/qsd8250_ffa/init.c
+++ b/target/qsd8250_ffa/init.c
@@ -61,12 +61,17 @@
 	},
 	{
 		.start = 664,
-		.length = 608 /* 76MB */,
+		.length = 40  /* 5MB */,
 		.name = "cache",
 	},
 	{
-		.start = 1272,
-		.length = 304 /* 38MB */,
+		.start = 704,
+		.length = 40 /* 5MB */,
+		.name = "recovery",
+	},
+	{
+		.start = 744,
+		.length = 720 /* 90MB */,
 		.name = "userdata",
 	},
 };
@@ -85,8 +90,10 @@
 
 	dprintf(INFO, "target_init()\n");
 
+#if (!ENABLE_NANDWRITE)
 	keys_init();
 	keypad_init();
+#endif
 
 	ptable_init(&flash_ptable);
 	smem_ptable_init();
diff --git a/target/qsd8250_ffa/tools/makefile b/target/qsd8250_ffa/tools/makefile
index de55adf..c85db18 100644
--- a/target/qsd8250_ffa/tools/makefile
+++ b/target/qsd8250_ffa/tools/makefile
@@ -9,6 +9,12 @@
 SRC_DIR  := target/$(TARGET)/tools
 COMPILER := gcc
 
+ifeq ($(BUILD_NANDWRITE), 1)
+  APPSBOOTHDR_FILES :=
+else
+  APPSBOOTHDR_FILES := appsboot.mbn
+endif
+
 APPSBOOTHEADER: appsboot.mbn
 
 
diff --git a/target/qsd8250_surf/init.c b/target/qsd8250_surf/init.c
index 9769a4c..cbfeeaf 100644
--- a/target/qsd8250_surf/init.c
+++ b/target/qsd8250_surf/init.c
@@ -61,12 +61,17 @@
 	},
 	{
 		.start = 664,
-		.length = 608 /* 76MB */,
+		.length = 40 /* 5MB */,
 		.name = "cache",
 	},
 	{
-		.start = 1272,
-		.length = 608 /* 76MB */,
+		.start = 704,
+		.length = 40 /* 5MB */,
+		.name = "recovery",
+	},
+	{
+		.start = 744,
+		.length = 720 /* 90MB */,
 		.name = "userdata",
 	},
 };
@@ -85,9 +90,10 @@
 
 	dprintf(INFO, "target_init()\n");
 
+#if (!ENABLE_NANDWRITE)
 	keys_init();
 	keypad_init();
-
+#endif
 	ptable_init(&flash_ptable);
 	smem_ptable_init();
 
diff --git a/target/qsd8250_surf/tools/makefile b/target/qsd8250_surf/tools/makefile
index de55adf..9d3897d 100644
--- a/target/qsd8250_surf/tools/makefile
+++ b/target/qsd8250_surf/tools/makefile
@@ -9,7 +9,13 @@
 SRC_DIR  := target/$(TARGET)/tools
 COMPILER := gcc
 
-APPSBOOTHEADER: appsboot.mbn
+ifeq ($(BUILD_NANDWRITE), 1)
+  APPSBOOTHDR_FILES :=
+else
+  APPSBOOTHDR_FILES := appsboot.mbn
+endif
+
+APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
 
 
 appsboot.mbn: appsboothd.mbn $(OUTBIN)