Merge "platform: mdm9607: Define qseecom_get_version"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 9aca572..11d64c4 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -136,7 +136,7 @@
 #endif
 
 #define MAX_TAGS_SIZE   1024
-
+#define PLL_CODES_OFFSET 4096
 /* make 4096 as default size to ensure EFS,EXT4's erasing */
 #define DEFAULT_ERASE_SIZE  4096
 #define MAX_PANEL_BUF_SIZE 196
@@ -3193,7 +3193,7 @@
 	}
 
 	/* By default copy raw to response */
-	strncpy(response, RAW_STR, strlen(RAW_STR));
+	strlcpy(response, RAW_STR, MAX_RSP_SIZE);
 
 	/* Mark partiton type for known paritions only */
 	for (n=0; n < ARRAY_SIZE(part_type_known); n++)
@@ -3205,13 +3205,13 @@
 			switch (fs_signature)
 			{
 				case EXT_FS_SIGNATURE:
-					strncpy(response, EXT_STR, strlen(EXT_STR));
+					strlcpy(response, EXT_STR, MAX_RSP_SIZE);
 					break;
 				case EXT_F2FS_SIGNATURE:
-					strncpy(response, F2FS_STR, strlen(F2FS_STR));
+					strlcpy(response, F2FS_STR, MAX_RSP_SIZE);
 					break;
 				case NO_FS:
-					strncpy(response, part_type_known[n].type_response, MAX_RSP_SIZE);
+					strlcpy(response, part_type_known[n].type_response, MAX_RSP_SIZE);
 			}
 		}
 	}
@@ -4372,7 +4372,7 @@
 
 	base = (uint8_t *) fb_display->base;
 
-	if (mmc_read(ptn, (uint32_t *)(base + LOGO_IMG_OFFSET), blocksize)) {
+	if (mmc_read(ptn + PLL_CODES_OFFSET, (uint32_t *)(base + LOGO_IMG_OFFSET), blocksize)) {
 		dprintf(CRITICAL, "ERROR: Cannot read splash image header\n");
 		return -1;
 	}
@@ -4404,7 +4404,7 @@
 				return -1;
 			}
 
-			if (mmc_read(ptn + blocksize, (uint32_t *)(base + blocksize), readsize)) {
+			if (mmc_read(ptn + PLL_CODES_OFFSET + blocksize, (uint32_t *)(base + blocksize), readsize)) {
 				dprintf(CRITICAL, "ERROR: Cannot read splash image from partition\n");
 				return -1;
 			}
@@ -4421,13 +4421,13 @@
 			readsize =  ROUNDUP((realsize + LOGO_IMG_HEADER_SIZE), blocksize) - blocksize;
 
 			if (blocksize == LOGO_IMG_HEADER_SIZE) { /* read the content directly */
-				if (mmc_read((ptn + LOGO_IMG_HEADER_SIZE), (uint32_t *)base, readsize)) {
+				if (mmc_read((ptn + PLL_CODES_OFFSET + LOGO_IMG_HEADER_SIZE), (uint32_t *)base, readsize)) {
 					fbcon_clear();
 					dprintf(CRITICAL, "ERROR: Cannot read splash image from partition\n");
 					return -1;
 				}
 			} else {
-				if (mmc_read(ptn + blocksize ,
+				if (mmc_read(ptn + PLL_CODES_OFFSET + blocksize ,
 						(uint32_t *)(base + LOGO_IMG_OFFSET + blocksize), readsize)) {
 					dprintf(CRITICAL, "ERROR: Cannot read splash image from partition\n");
 					return -1;
diff --git a/target/msm8952/target_display.c b/target/msm8952/target_display.c
index 2f27fda..65d8222 100644
--- a/target/msm8952/target_display.c
+++ b/target/msm8952/target_display.c
@@ -593,10 +593,11 @@
 	bool ret = true;
 	struct oem_panel_data oem = mdss_dsi_get_oem_data();
 	uint32_t platform_subtype = board_hardware_subtype();
+	uint32_t platform = board_platform_id();
 
 	/* default to hdmi for apq iot */
-	if ((HW_PLATFORM_SUBTYPE_SAP == platform_subtype) ||
-		(HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype)) {
+	if ((APQ8017 == platform) && ((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,6 +647,7 @@
 	int32_t ret = 0;
 	uint32_t panel_loop = 0;
 	uint32_t platform_subtype = board_hardware_subtype();
+	uint32_t platform = board_platform_id();
 
 	set_panel_cmd_string(panel_name);
 	oem = mdss_dsi_get_oem_data();
@@ -659,8 +661,8 @@
 		oem.cont_splash = false;
 	}
 
-	if ((HW_PLATFORM_SUBTYPE_SAP == platform_subtype) ||
-		(HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype)) {
+	if ((APQ8017 == platform) && ((HW_PLATFORM_SUBTYPE_SAP == platform_subtype) ||
+		(HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype))) {
 		dprintf(INFO, "%s: Platform subtype %d\n",
 			__func__, platform_subtype);
 		return;