target: project: 8996: Enable reboot module

Reboot module & usage of PON registers for reboot reason is enabled and
remove the reboot_device, shutdown_device apis from target code.

Change-Id: Id80cf16a95a3e6ed9ba38e1bd9cd33f34b431e11
diff --git a/include/target.h b/include/target.h
index 84e93c0..b7f92a2 100644
--- a/include/target.h
+++ b/include/target.h
@@ -86,4 +86,5 @@
 void target_crypto_init_params(void);
 int target_cont_splash_screen(void);
 bool target_build_variant_user();
+void pmic_reset_configure(uint8_t reset_type);
 #endif
diff --git a/project/msm8996.mk b/project/msm8996.mk
index 2669b56..e885f30 100644
--- a/project/msm8996.mk
+++ b/project/msm8996.mk
@@ -82,3 +82,6 @@
 
 #SCM call before entering DLOAD mode
 DEFINES += PLATFORM_USE_SCM_DLOAD=1
+
+#Enable the external reboot functions
+ENABLE_REBOOT_MODULE := 1
diff --git a/target/msm8996/init.c b/target/msm8996/init.c
index e9e8eea..e6cfeed 100644
--- a/target/msm8996/init.c
+++ b/target/msm8996/init.c
@@ -363,42 +363,6 @@
 	}
 }
 
-unsigned check_reboot_mode(void)
-{
-	uint32_t restart_reason = 0;
-	uint32_t restart_reason_addr;
-
-	restart_reason_addr = RESTART_REASON_ADDR;
-
-	/* Read reboot reason and scrub it */
-	restart_reason = readl(restart_reason_addr);
-	writel(0x00, restart_reason_addr);
-
-	return restart_reason;
-}
-
-void reboot_device(unsigned reboot_reason)
-{
-	uint8_t reset_type = 0;
-
-	/* Write the reboot reason */
-	writel(reboot_reason, RESTART_REASON_ADDR);
-
-	if(reboot_reason)
-		reset_type = PON_PSHOLD_WARM_RESET;
-	else
-		reset_type = PON_PSHOLD_HARD_RESET;
-
-	pm8994_reset_configure(reset_type);
-
-	/* Drop PS_HOLD for MSM */
-	writel(0x00, MPM2_MPM_PS_HOLD);
-
-	mdelay(5000);
-
-	dprintf(CRITICAL, "Rebooting failed\n");
-}
-
 int emmc_recovery_init(void)
 {
 	return _emmc_recovery_init();
@@ -503,19 +467,7 @@
 	return ret;
 }
 
-void shutdown_device()
+void pmic_reset_configure(uint8_t reset_type)
 {
-	dprintf(CRITICAL, "Going down for shutdown.\n");
-
-	/* Configure PMIC for shutdown. */
-	pm8994_reset_configure(PON_PSHOLD_SHUTDOWN);
-
-	/* Drop PS_HOLD for MSM */
-	writel(0x00, MPM2_MPM_PS_HOLD);
-
-	mdelay(5000);
-
-	dprintf(CRITICAL, "Shutdown failed\n");
-
-	ASSERT(0);
+	pm8994_reset_configure(reset_type);
 }