Merge "platform: msm_shared: Pass virtual address to invalidate cache."
diff --git a/platform/msm_shared/rules.mk b/platform/msm_shared/rules.mk
index e18a014..957f78d 100755
--- a/platform/msm_shared/rules.mk
+++ b/platform/msm_shared/rules.mk
@@ -527,6 +527,7 @@
 			$(LOCAL_DIR)/display.o \
 			$(LOCAL_DIR)/mipi_dsi.o \
 			$(LOCAL_DIR)/mipi_dsi_phy.o \
+			$(LOCAL_DIR)/flash-ubi.o \
 			$(LOCAL_DIR)/mipi_dsi_autopll.o
 endif
 
diff --git a/platform/msm_shared/smem.h b/platform/msm_shared/smem.h
index 9a46d1d..bad142c 100644
--- a/platform/msm_shared/smem.h
+++ b/platform/msm_shared/smem.h
@@ -498,8 +498,8 @@
 	HW_PLATFORM_SUBTYPE_CSFB = 1,
 	HW_PLATFORM_SUBTYPE_SVLTE1 = 2,
 	HW_PLATFORM_SUBTYPE_IOT = 2,
-	HW_PLATFORM_SUBTYPE_SNAP = 2,
-	HW_PLATFORM_SUBTYPE_SNAP_NOPMI = 3,
+	HW_PLATFORM_SUBTYPE_SAP = 2,
+	HW_PLATFORM_SUBTYPE_SAP_NOPMI = 3,
 	HW_PLATFORM_SUBTYPE_SVLTE2A = 3,
 	HW_PLATFORM_SUBTYPE_SGLTE = 6,
 	HW_PLATFORM_SUBTYPE_DSDA = 7,
diff --git a/target/msm8909/init.c b/target/msm8909/init.c
index 56aecd9..f3e9361 100644
--- a/target/msm8909/init.c
+++ b/target/msm8909/init.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -102,6 +102,7 @@
 #define QPIC_NAND_MAX_DESC_LEN                        0x7FFF
 
 #define LAST_NAND_PTN_LEN_PATTERN                     0xFFFFFFFF
+#define UBI_CMDLINE " rootfstype=ubifs rootflags=bulk_read"
 
 struct qpic_nand_init_config config;
 
@@ -416,6 +417,7 @@
 	case MSM8209:
 	case MSM8208:
 	case MSM8609:
+	case MSM8909W:
 		board->baseband = BASEBAND_MSM;
 		break;
 
@@ -426,6 +428,7 @@
 		break;
 
 	case APQ8009:
+	case APQ8009W:
 		if ((board->platform_hw == HW_PLATFORM_MTP) &&
 			((board->platform_subtype == HW_SUBTYPE_APQ_NOWGR) ||
 			 (board->platform_subtype == HW_PLATFORM_SUBTYPE_SWOC_NOWGR_CIRC)))
@@ -532,8 +535,7 @@
 		{
 			if (!target_is_emmc_boot())
 			{
-				/* Extra character is for Null termination */
-				buflen = strlen(" root=/dev/mtdblock") + sizeof(int) +1;
+				buflen = strlen(UBI_CMDLINE) + strlen(" root=ubi0:rootfs ubi.mtd=") + sizeof(int) + 1; /* 1 byte for null character*/
 
 				/* In success case, this memory is freed in calling function */
 				*buf = (char *)malloc(buflen);
@@ -542,7 +544,9 @@
 					return -1;
 				}
 
-				snprintf(*buf, buflen, " root=/dev/mtdblock%d",system_ptn_index);
+				/* Adding command line parameters according to target boot type */
+				snprintf(*buf, buflen, UBI_CMDLINE);
+				snprintf(*buf+strlen(*buf), buflen, " root=ubi0:rootfs ubi.mtd=%d", system_ptn_index);
 			}
 			else
 			{
diff --git a/target/msm8909/target_display.c b/target/msm8909/target_display.c
index c7664dd..63f546f 100755
--- a/target/msm8909/target_display.c
+++ b/target/msm8909/target_display.c
@@ -344,8 +344,8 @@
 		(((HW_PLATFORM_MTP == hw_id) &&
 		  (HW_PLATFORM_SUBTYPE_DSDA2 == platform_subtype)) ||
 		 ((HW_PLATFORM_RCM == hw_id) &&
-		 ((HW_PLATFORM_SUBTYPE_SNAP == platform_subtype)||
-		  (HW_PLATFORM_SUBTYPE_SNAP_NOPMI == platform_subtype))))) {
+		 ((HW_PLATFORM_SUBTYPE_SAP == platform_subtype)||
+		  (HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype))))) {
 		dprintf(INFO, "Splash disabled\n");
 		return true;
 	} else {
diff --git a/target/msm8952/init.c b/target/msm8952/init.c
index 6dd3a75..88d6854 100644
--- a/target/msm8952/init.c
+++ b/target/msm8952/init.c
@@ -761,7 +761,7 @@
 bool target_is_pmi_enabled(void)
 {
 	if(platform_is_msm8917() &&
-	   (board_hardware_subtype() ==	HW_PLATFORM_SUBTYPE_SNAP_NOPMI))
+	   (board_hardware_subtype() ==	HW_PLATFORM_SUBTYPE_SAP_NOPMI))
 		return 0;
 	else
 		return 1;
diff --git a/target/msm8952/target_display.c b/target/msm8952/target_display.c
index ee001bc..15326bf 100644
--- a/target/msm8952/target_display.c
+++ b/target/msm8952/target_display.c
@@ -582,8 +582,8 @@
 	uint32_t platform_subtype = board_hardware_subtype();
 
 	/* default to hdmi for apq iot */
-	if ((HW_PLATFORM_SUBTYPE_SNAP == platform_subtype) ||
-		(HW_PLATFORM_SUBTYPE_SNAP_NOPMI == platform_subtype)) {
+	if ((HW_PLATFORM_SUBTYPE_SAP == platform_subtype) ||
+		(HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype)) {
 		if (!strcmp(oem.panel, "")) {
 			if (buf_size < (prefix_string_len +
 				strlen(HDMI_ADV_PANEL_STRING))) {
@@ -646,8 +646,8 @@
 		return;
 	}
 
-	if ((HW_PLATFORM_SUBTYPE_SNAP == platform_subtype) ||
-		(HW_PLATFORM_SUBTYPE_SNAP_NOPMI == platform_subtype)) {
+	if ((HW_PLATFORM_SUBTYPE_SAP == platform_subtype) ||
+		(HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype)) {
 		dprintf(INFO, "%s: Platform subtype %d\n",
 			__func__, platform_subtype);
 		return;