target: msm8996: Move the charging after storage init

Display driver has changed to first read the splash image from storage
and then fallback to display image stored in lk header file, if the image
is not present on the storage partition. Charger driver calls into
display API to show the charging image and if storage is not initialized
then LK would crash trying to access uninitialized storage data
structures.

Change-Id: I6f7ea6399f92d8a10983b02925e3aa9a46d523cf
diff --git a/target/msm8996/init.c b/target/msm8996/init.c
index a627874..e9e8eea 100644
--- a/target/msm8996/init.c
+++ b/target/msm8996/init.c
@@ -248,16 +248,6 @@
 	/* Initialize Glink */
 	rpm_glink_init();
 
-#if ENABLE_WBC
-	/* Look for battery voltage and make sure we have enough to bootup
-	 * Otherwise initiate battery charging
-	 * Charging should happen as early as possible, any other driver
-	 * initialization before this should consider the power impact
-	 */
-	if (board_hardware_id() == HW_PLATFORM_MTP)
-		pm_appsbl_chg_check_weak_battery_status(1);
-#endif
-
 	target_keystatus();
 
 	if (target_use_signed_kernel())
@@ -282,6 +272,16 @@
 	/* Storage initialization is complete, read the partition table info */
 	mmc_read_partition_table(0);
 
+#if ENABLE_WBC
+	/* Look for battery voltage and make sure we have enough to bootup
+	 * Otherwise initiate battery charging
+	 * Charging should happen as early as possible, any other driver
+	 * initialization before this should consider the power impact
+	 */
+	if (board_hardware_id() == HW_PLATFORM_MTP)
+		pm_appsbl_chg_check_weak_battery_status(1);
+#endif
+
 	if (rpmb_init() < 0)
 	{
 		dprintf(CRITICAL, "RPMB init failed\n");