ipq807x: Disable dump collection during warm reset.

This is to provide software framework to retain IMEM’s state
across warm reset. For warm reset crashdump collection should be
disabled.

In uboot we will check for the environment variable dload_warm_reset.The
crashdump magic is reset to 0x10 in SDI path, hence disable the SDI bit
in Uboot  if environment variable is set which will disable crashdump 
collection. 

Change-Id: Ic60b63ead03436689ee04d2e3e7ecdbb275ccfee
Signed-off-by: Nikhil Prakash V <nprakash@codeaurora.org>
diff --git a/board/qca/arm/common/board_init.c b/board/qca/arm/common/board_init.c
index 0606656..4d08783 100644
--- a/board/qca/arm/common/board_init.c
+++ b/board/qca/arm/common/board_init.c
@@ -17,6 +17,7 @@
 #include <asm/arch-qca-common/smem.h>
 #include <asm/arch-qca-common/uart.h>
 #include <asm/arch-qca-common/gpio.h>
+#include <asm/arch-qca-common/scm.h>
 #include <memalign.h>
 #include <fdtdec.h>
 #include <mmc.h>
@@ -82,6 +83,11 @@
 	return;
 }
 
+__weak void sdi_disable(void)
+{
+	return;
+}
+
 int board_init(void)
 {
 	int ret;
@@ -334,6 +340,7 @@
 	uint32_t flash_type;
 	uint32_t soc_ver_major, soc_ver_minor;
 	int ret;
+	char *s = NULL;
 
 	qca_smem_flash_info_t *sfi = &qca_smem_flash_info;
 
@@ -369,6 +376,13 @@
 	 * load dtb above CONFIG_IPQ_FDT_HIGH region.
 	 */
 	run_command("setenv fdt_high " MK_STR(CONFIG_IPQ_FDT_HIGH) "\n", 0);
+
+	s = getenv("dload_warm_reset");
+	if (s) {
+		printf("Dload magic cookie will not be set for warm reset\n");
+		sdi_disable();
+	}
+
 	return 0;
 }
 
diff --git a/board/qca/arm/ipq807x/ipq807x.c b/board/qca/arm/ipq807x/ipq807x.c
index c861ae3..8e844f9 100644
--- a/board/qca/arm/ipq807x/ipq807x.c
+++ b/board/qca/arm/ipq807x/ipq807x.c
@@ -1513,3 +1513,7 @@
 	}
 }
 
+void sdi_disable(void)
+{
+	qca_scm_sdi();
+}