Merge "msm8974: Add download mode entrance on power-on"
diff --git a/platform/msm8974/include/platform/iomap.h b/platform/msm8974/include/platform/iomap.h
index f18064e..12f0015 100644
--- a/platform/msm8974/include/platform/iomap.h
+++ b/platform/msm8974/include/platform/iomap.h
@@ -44,6 +44,8 @@
#define RESTART_REASON_ADDR (RPM_MSG_RAM_BASE + 0x65C)
#define RESTART_REASON_ADDR_V2 (MSM_SHARED_IMEM_BASE + 0x65C)
+#define FORCE_DLOAD_MODE_ADDR_V2 (MSM_SHARED_IMEM_BASE + 0xFE0)
+
#define KPSS_BASE 0xF9000000
#define MSM_GIC_DIST_BASE KPSS_BASE
diff --git a/platform/msm_shared/rules.mk b/platform/msm_shared/rules.mk
index 107960d..99827d7 100644
--- a/platform/msm_shared/rules.mk
+++ b/platform/msm_shared/rules.mk
@@ -94,7 +94,8 @@
$(LOCAL_DIR)/crypto5_eng.o \
$(LOCAL_DIR)/crypto5_wrapper.o \
$(LOCAL_DIR)/i2c_qup.o \
- $(LOCAL_DIR)/gpio.o
+ $(LOCAL_DIR)/gpio.o \
+ $(LOCAL_DIR)/dload_util.o
endif
ifeq ($(PLATFORM),msm8226)
diff --git a/target/msm8974/init.c b/target/msm8974/init.c
index 704867e..fb9da87 100644
--- a/target/msm8974/init.c
+++ b/target/msm8974/init.c
@@ -32,6 +32,7 @@
#include <reg.h>
#include <target.h>
#include <platform.h>
+#include <dload_util.h>
#include <uart_dm.h>
#include <mmc.h>
#include <spmi.h>
@@ -481,6 +482,13 @@
dprintf(CRITICAL, "Rebooting failed\n");
}
+int set_download_mode(void)
+{
+ dload_util_write_cookie(FORCE_DLOAD_MODE_ADDR_V2);
+
+ return 0;
+}
+
/* Do target specific usb initialization */
void target_usb_init(void)
{