app: aboot: Do normal boot when the power off reason is reset

When KPDPWR_AND_RESIN is in poff reason1 and resin by S3,it means
it is a force resin triggered by user. It is required to do normal
boot in this case.

CRs-Fixed: 689864
Change-Id: I7e86a54297a51159ecd2cc1dad9e56592e4b42c1
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 3b5092d..84241d4 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -2497,6 +2497,13 @@
 
 	memset(display_panel_buf, '\0', MAX_PANEL_BUF_SIZE);
 
+	/*
+	 * Check power off reason if user force reset,
+	 * if yes phone will do normal boot.
+	 */
+	if (is_user_force_reset())
+		goto normal_boot;
+
 	/* Check if we should do something other than booting up */
 	if (keys_get_state(KEY_VOLUMEUP) && keys_get_state(KEY_VOLUMEDOWN))
 	{
@@ -2532,6 +2539,7 @@
 		boot_into_fastboot = true;
 	}
 
+normal_boot:
 	if (!boot_into_fastboot)
 	{
 		if (target_is_emmc_boot())
diff --git a/include/target.h b/include/target.h
index c7c05db..ba95cbb 100644
--- a/include/target.h
+++ b/include/target.h
@@ -59,6 +59,7 @@
 void target_load_ssd_keystore(void);
 bool target_is_ssd_enabled(void);
 void *target_mmc_device();
+uint32_t is_user_force_reset(void);
 
 bool target_display_panel_node(char *panel_name, char *pbuf,
 	uint16_t buf_size);
diff --git a/target/init.c b/target/init.c
index 0d99880..4a896e8 100644
--- a/target/init.c
+++ b/target/init.c
@@ -69,6 +69,11 @@
 {
 }
 
+__WEAK uint32_t is_user_force_reset(void)
+{
+	return 0;
+}
+
 __WEAK int set_download_mode(enum dload_mode mode)
 {
 	return -1;