Merge "target: msm8953: Remap MIPI FB address"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 6987a56..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
@@ -1813,6 +1813,7 @@
unsigned dt_table_offset;
uint32_t dt_actual;
uint32_t dt_hdr_size = 0;
+ uint32_t dtb_offset = 0;
unsigned int dtb_size = 0;
unsigned char *best_match_dt_addr = NULL;
#endif
@@ -2038,7 +2039,27 @@
best_match_dt_addr = (unsigned char *)table + dt_entry.offset;
dtb_size = dt_entry.size;
memmove((void *)hdr->tags_addr, (char *)best_match_dt_addr, dtb_size);
- }
+
+ } else {
+ /* Validate the tags_addr */
+ if (check_aboot_addr_range_overlap(hdr->tags_addr, kernel_actual) ||
+ check_ddr_addr_range_bound(hdr->tags_addr, kernel_actual))
+ {
+ dprintf(CRITICAL, "Device tree addresses are not valid.\n");
+ return -1;
+ }
+ /*
+ * If appended dev tree is found, update the atags with
+ * memory address to the DTB appended location on RAM.
+ * Else update with the atags address in the kernel header
+ */
+ void *dtb = NULL;
+ dtb = dev_tree_appended((void*)(image_addr + page_size ),hdr->kernel_size, dtb_offset, (void *)hdr->tags_addr);
+ if (!dtb) {
+ dprintf(CRITICAL, "ERROR: Appended Device Tree Blob not found\n");
+ return -1;
+ }
+ }
#endif
if(target_use_signed_kernel() && (!device.is_unlocked))
{
@@ -3172,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++)
@@ -3184,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);
}
}
}
@@ -4351,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;
}
@@ -4383,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;
}
@@ -4400,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/init.c b/target/init.c
index 386f5c6..517793d 100644
--- a/target/init.c
+++ b/target/init.c
@@ -290,6 +290,8 @@
case SDA450:
case SDM632:
case SDA632:
+ case SDM429:
+ case SDM439:
/* SDCC HC DDR CONFIG has shifted by 4 bytes for these platform */
ret += 4;
break;
@@ -368,6 +370,8 @@
case SDA450:
case SDM632:
case SDA632:
+ case SDM429:
+ case SDM439:
config->vib_type = VIB_LRA_TYPE;
config->hap_rate_cfg1 = QPNP_HAP_RATE_CFG1_41;
config->hap_rate_cfg2 = QPNP_HAP_RATE_CFG2_03;
diff --git a/target/mdm9607/init.c b/target/mdm9607/init.c
index 40776f7..51172fd 100644
--- a/target/mdm9607/init.c
+++ b/target/mdm9607/init.c
@@ -97,6 +97,11 @@
#define CE_ARRAY_SIZE 20
#define SUB_TYPE_SKUT 0x0A
+__WEAK unsigned int qseecom_get_version()
+{
+ return 0;
+}
+
struct qpic_nand_init_config config;
void update_ptable_names(void)
diff --git a/target/msm8909/oem_panel.c b/target/msm8909/oem_panel.c
index 064539c..deb6024 100644
--- a/target/msm8909/oem_panel.c
+++ b/target/msm8909/oem_panel.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2015, 2017-2018, 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
@@ -472,6 +472,7 @@
struct mdss_dsi_phy_ctrl *phy_db)
{
uint32_t hw_id = board_hardware_id();
+ uint32_t platform_type = board_platform_id();
uint32_t platform_subtype = board_hardware_subtype();
int32_t panel_override_id;
@@ -499,7 +500,20 @@
case HW_PLATFORM_SUBTYPE_8909_PM660_V1:
case HW_PLATFORM_SUBTYPE_8909_PM660:
case HW_PLATFORM_SUBTYPE_8909_COMPAL_ALPHA:
- panel_id = AUO_390P_CMD_PANEL;
+ if ((platform_type == MSM8909W) ||
+ (platform_type == APQ8009W))
+ panel_id = AUO_390P_CMD_PANEL;
+ break;
+ case HW_PLATFORM_SUBTYPE_SWOC_TP_CIRC:
+ case HW_PLATFORM_SUBTYPE_SWOC_NOWGR_CIRC:
+ if ((platform_type == MSM8909W) ||
+ (platform_type == APQ8009W))
+ panel_id = AUO_400P_CMD_PANEL;
+ break;
+ case HW_PLATFORM_SUBTYPE_SWOC_WEAR:
+ if ((platform_type == MSM8909W) ||
+ (platform_type == APQ8009W))
+ panel_id = AUO_CX_QVGA_CMD_PANEL;
break;
default:
panel_id = HX8394D_720P_VIDEO_PANEL;
diff --git a/target/msm8952/init.c b/target/msm8952/init.c
index add808a..a7c3469 100644
--- a/target/msm8952/init.c
+++ b/target/msm8952/init.c
@@ -192,7 +192,8 @@
if(platform_is_msm8956())
vol_up_gpio = TLMM_VOL_UP_BTN_GPIO_8956;
- else if(platform_is_msm8937() || platform_is_msm8917())
+ else if(platform_is_msm8937() || platform_is_msm8917() ||
+ platform_is_sdm429() || platform_is_sdm439())
vol_up_gpio = TLMM_VOL_UP_BTN_GPIO_8937;
else
vol_up_gpio = TLMM_VOL_UP_BTN_GPIO;
@@ -287,7 +288,8 @@
if(target_is_pmi_enabled())
{
- if(platform_is_msm8937() || platform_is_msm8917())
+ if(platform_is_msm8937() || platform_is_msm8917() ||
+ platform_is_sdm429() || platform_is_sdm439())
{
uint8_t pmi_rev = 0;
uint32_t pmi_type = 0;
@@ -405,6 +407,8 @@
case MSM8920:
case MSM8217:
case MSM8617:
+ case SDM429:
+ case SDM439:
board->baseband = BASEBAND_MSM;
break;
case APQ8052:
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;