Merge "target: msm8909: init display config to suupport msm8909"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 77b4282..e286518 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -1915,9 +1915,9 @@
unsigned long long ptn = 0;
unsigned long long size;
int index = INVALID_PTN;
- uint32_t blocksize;
uint8_t lun = 0;
uint32_t ret = 0;
+ uint32_t device_info_sz = 0;
if (devinfo_present)
index = partition_get_index("devinfo");
@@ -1935,12 +1935,18 @@
size = partition_get_size(index);
- blocksize = mmc_get_device_blocksize();
+ device_info_sz = ROUND_TO_PAGE(sizeof(struct device_info),
+ mmc_blocksize_mask);
+ if (device_info_sz == UINT_MAX)
+ {
+ dprintf(CRITICAL, "ERROR: Incorrect blocksize of card\n");
+ return;
+ }
if (devinfo_present)
- ret = mmc_write(ptn, blocksize, (void *)info_buf);
+ ret = mmc_write(ptn, device_info_sz, (void *)info_buf);
else
- ret = mmc_write((ptn + size - blocksize), blocksize, (void *)info_buf);
+ ret = mmc_write((ptn + size - device_info_sz), device_info_sz, (void *)info_buf);
if (ret)
{
dprintf(CRITICAL, "ERROR: Cannot write device info\n");
@@ -1953,8 +1959,8 @@
unsigned long long ptn = 0;
unsigned long long size;
int index = INVALID_PTN;
- uint32_t blocksize;
uint32_t ret = 0;
+ uint32_t device_info_sz = 0;
if ((index = partition_get_index("devinfo")) < 0)
{
@@ -1972,12 +1978,18 @@
size = partition_get_size(index);
- blocksize = mmc_get_device_blocksize();
+ device_info_sz = ROUND_TO_PAGE(sizeof(struct device_info),
+ mmc_blocksize_mask);
+ if (device_info_sz == UINT_MAX)
+ {
+ dprintf(CRITICAL, "ERROR: Incorrect blocksize of card\n");
+ return;
+ }
if (devinfo_present)
- ret = mmc_read(ptn, (void *)info_buf, blocksize);
+ ret = mmc_read(ptn, (void *)info_buf, device_info_sz);
else
- ret = mmc_read((ptn + size - blocksize), (void *)info_buf, blocksize);
+ ret = mmc_read((ptn + size - device_info_sz), (void *)info_buf, device_info_sz);
if (ret)
{
dprintf(CRITICAL, "ERROR: Cannot read device info\n");
diff --git a/dev/pmic/pm8x41/include/pm8x41.h b/dev/pmic/pm8x41/include/pm8x41.h
index 5b1c20e..0fc517b 100644
--- a/dev/pmic/pm8x41/include/pm8x41.h
+++ b/dev/pmic/pm8x41/include/pm8x41.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-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 are
@@ -223,6 +223,7 @@
uint32_t pm8x41_resin_status();
void pm8x41_reset_configure(uint8_t);
void pm8994_reset_configure(uint8_t);
+void pmi632_reset_configure(uint8_t);
void pm8x41_v2_reset_configure(uint8_t);
uint8_t pmi8950_get_pmi_subtype();
int pm8x41_ldo_set_voltage(struct pm8x41_ldo *ldo, uint32_t voltage);
diff --git a/dev/pmic/pm8x41/pm8x41.c b/dev/pmic/pm8x41/pm8x41.c
index 0c389eb..442bc35 100644
--- a/dev/pmic/pm8x41/pm8x41.c
+++ b/dev/pmic/pm8x41/pm8x41.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-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 are
@@ -389,6 +389,40 @@
return 0;
}
+void pmi632_reset_configure(uint8_t reset_type)
+{
+ /* Slave ID of pm8953 and pmi632 */
+ uint8_t slave_id[] = {0, 2};
+ uint8_t i;
+
+ /* Reset sequence
+ 1. Disable the ps hold for pm8953 and pmi632
+ 2. set reset type for both pm8953 & pmi632
+ 3. Enable ps hold for pm8953 to trigger the reset
+ */
+ /* disable PS_HOLD_RESET */
+ pm8xxx_reg_write(slave_id[0], PON_PS_HOLD_RESET_CTL2, 0x0);
+ pm8xxx_reg_write(slave_id[1], PON_PS_HOLD_RESET_CTL2, 0x0);
+
+ /* Delay needed for disable to kick in. */
+ udelay(300);
+
+ /* configure reset type */
+ for (i = 0; i < ARRAY_SIZE(slave_id); i++)
+ pm8xxx_reg_write(slave_id[i], PON_PS_HOLD_RESET_CTL, reset_type);
+
+ if (reset_type == PON_PSHOLD_WARM_RESET)
+ {
+ /* enable PS_HOLD_RESET */
+ for (i = 0; i < ARRAY_SIZE(slave_id); i++)
+ pm8xxx_reg_write(slave_id[i], PON_PS_HOLD_RESET_CTL2, BIT(S2_RESET_EN_BIT));
+ }
+ else
+ {
+ pm8xxx_reg_write(slave_id[0], PON_PS_HOLD_RESET_CTL2, BIT(S2_RESET_EN_BIT));
+ }
+}
+
void pm8994_reset_configure(uint8_t reset_type)
{
/* Slave ID of pm8994 and pmi8994 */
diff --git a/lib/heap/heap.c b/lib/heap/heap.c
index 2f41f6c..a4094fb 100644
--- a/lib/heap/heap.c
+++ b/lib/heap/heap.c
@@ -255,6 +255,11 @@
size = sizeof(struct free_heap_chunk);
// round up size to a multiple of native pointer size
+ if(size > (size + sizeof(void *)))
+ {
+ dprintf(CRITICAL, "invalid input size\n");
+ return NULL;
+ }
size = ROUNDUP(size, sizeof(void *));
// deal with nonzero alignments
diff --git a/makefile b/makefile
index f52f698..a1b091e 100644
--- a/makefile
+++ b/makefile
@@ -141,6 +141,12 @@
DEFINES += USE_LE_SYSTEMD=0
endif
+ifeq ($(MOUNT_EMMC_LE),true)
+ DEFINES += MOUNT_EMMC_LE=1
+else
+ DEFINES += MOUNT_EMMC_LE=0
+endif
+
#Enable kaslr seed support
ifeq ($(ENABLE_KASLRSEED),1)
DEFINES += ENABLE_KASLRSEED_SUPPORT=1
diff --git a/platform/msm_shared/smem.h b/platform/msm_shared/smem.h
index fa5c420..c8a3e48 100644
--- a/platform/msm_shared/smem.h
+++ b/platform/msm_shared/smem.h
@@ -519,6 +519,7 @@
HW_PLATFORM_SUBTYPE_8909_PM660 = 15,
HW_PLATFORM_SUBTYPE_8909_COMPAL_ALPHA = 19,
HW_PLATFORM_SUBTYPE_8909_PM660_V1 = 18,
+ HW_PLATFORM_SUBTYPE_INTRINSIC_SOM = 20,
HW_PLATFORM_SUBTYPE_32BITS = 0x7FFFFFFF
};
diff --git a/project/msm8953.mk b/project/msm8953.mk
index a7a5f72..f14a49b 100644
--- a/project/msm8953.mk
+++ b/project/msm8953.mk
@@ -29,7 +29,7 @@
endif
ENABLE_SMD_SUPPORT := 1
-#ENABLE_PWM_SUPPORT := true
+ENABLE_PWM_SUPPORT := true
#DEFINES += WITH_DEBUG_DCC=1
DEFINES += WITH_DEBUG_LOG_BUF=1
diff --git a/target/msm8909/target_display.c b/target/msm8909/target_display.c
index 24bc14c..a3d5848 100644
--- a/target/msm8909/target_display.c
+++ b/target/msm8909/target_display.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
@@ -405,7 +405,9 @@
(HW_PLATFORM_SUBTYPE_DSDA2 == platform_subtype)) ||
((HW_PLATFORM_RCM == hw_id) &&
((HW_PLATFORM_SUBTYPE_SAP == platform_subtype)||
- (HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype))))) {
+ (HW_PLATFORM_SUBTYPE_SAP_NOPMI == platform_subtype))) ||
+ ((HW_PLATFORM_MTP == hw_id) &&
+ (HW_PLATFORM_SUBTYPE_INTRINSIC_SOM == platform_subtype)))) {
dprintf(INFO, "Splash disabled\n");
return true;
} else {
diff --git a/target/msm8953/init.c b/target/msm8953/init.c
index 19713a3..c2f1eb6 100644
--- a/target/msm8953/init.c
+++ b/target/msm8953/init.c
@@ -627,11 +627,6 @@
crypto_init_params(&ce_params);
}
-void pmic_reset_configure(uint8_t reset_type)
-{
- pm8994_reset_configure(reset_type);
-}
-
uint32_t target_get_pmic()
{
if (target_is_pmi_enabled()) {
@@ -646,6 +641,17 @@
}
}
+void pmic_reset_configure(uint8_t reset_type)
+{
+ uint32_t pmi_type;
+
+ pmi_type = target_get_pmic();
+ if (pmi_type == PMIC_IS_PMI632)
+ pmi632_reset_configure(reset_type);
+ else
+ pm8994_reset_configure(reset_type);
+}
+
struct qmp_reg qmp_settings[] =
{
{0x804, 0x01}, /* USB3PHY_PCIE_USB3_PCS_POWER_DOWN_CONTROL */
diff --git a/target/msm8953/target_display.c b/target/msm8953/target_display.c
index 1a3864d..f276f64 100644
--- a/target/msm8953/target_display.c
+++ b/target/msm8953/target_display.c
@@ -55,18 +55,13 @@
#include "include/display_resource.h"
#include "gcdb_display.h"
-#define TRULY_1080P_VID_PANEL "truly_1080p_video"
-#define TRULY_1080P_CMD_PANEL "truly_1080p_cmd"
-
-#define HDMI_ADV_PANEL_STRING "1:dsi:0:none:1:qcom,mdss_dsi_adv7533_1080p:cfg:single_dsi"
-#define TRULY_VID_PANEL_STRING "1:dsi:0:qcom,mdss_dsi_truly_1080p_video:1:none:cfg:single_dsi"
-#define TRULY_CMD_PANEL_STRING "1:dsi:0:qcom,mdss_dsi_truly_1080p_cmd:1:none:cfg:single_dsi"
-
#define MAX_POLL_READS 15
#define POLL_TIMEOUT_US 1000
#define STRENGTH_SIZE_IN_BYTES 10
#define REGULATOR_SIZE_IN_BYTES 5
#define LANE_SIZE_IN_BYTES 20
+#define PWM_DUTY_US 13
+#define PWM_PERIOD_US 27
/*---------------------------------------------------------------------------*/
/* GPIO configuration */
/*---------------------------------------------------------------------------*/
@@ -134,11 +129,24 @@
pm8x41_wled_config_slave_id(slave_id);
if (target_get_pmic() == PMIC_IS_PMI632) {
qpnp_lcdb_enable(enable);
- }
- else {
+ } else {
qpnp_wled_enable_backlight(enable);
qpnp_ibb_enable(enable);
}
+
+ return NO_ERROR;
+}
+
+static int pwm_backlight_ctrl(uint8_t enable)
+{
+ if(enable) {
+ pm_pwm_enable(false);
+ pm_pwm_config(PWM_DUTY_US, PWM_PERIOD_US);
+ pm_pwm_enable(true);
+ } else {
+ pm_pwm_enable(false);
+ }
+
return NO_ERROR;
}
@@ -149,8 +157,11 @@
if (bl->bl_interface_type == BL_DCS)
return ret;
- ret = wled_backlight_ctrl(enable);
-
+ if(target_get_pmic() == PMIC_IS_PMI632) {
+ ret = pwm_backlight_ctrl(enable);
+ } else {
+ ret = wled_backlight_ctrl(enable);
+ }
return ret;
}
@@ -399,7 +410,6 @@
int prefix_string_len = strlen(DISPLAY_CMDLINE_PREFIX);
bool ret = true;
struct oem_panel_data oem = mdss_dsi_get_oem_data();
- uint32_t platform_subtype = board_hardware_subtype();
/*
* if disable config is passed irrespective of
@@ -416,44 +426,6 @@
buf_size -= prefix_string_len;
pbuf += prefix_string_len;
strlcpy(pbuf, DISABLE_PANEL_STRING, buf_size);
- } else if (platform_subtype == HW_PLATFORM_SUBTYPE_IOT) {
- /* default to hdmi for apq iot */
- if (!strcmp(oem.panel, "")) {
- if (buf_size < (prefix_string_len +
- strlen(HDMI_ADV_PANEL_STRING))) {
- dprintf(CRITICAL, "HDMI command line argument \
- is greater than buffer size\n");
- return false;
- }
- strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
- buf_size -= prefix_string_len;
- pbuf += prefix_string_len;
- strlcpy(pbuf, HDMI_ADV_PANEL_STRING, buf_size);
- } else if (!strcmp(oem.panel, TRULY_1080P_VID_PANEL)) {
- if (buf_size < (prefix_string_len +
- strlen(TRULY_VID_PANEL_STRING))) {
- dprintf(CRITICAL, "TRULY VIDEO command line \
- argument is greater than \
- buffer size\n");
- return false;
- }
- strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
- buf_size -= prefix_string_len;
- pbuf += prefix_string_len;
- strlcpy(pbuf, TRULY_VID_PANEL_STRING, buf_size);
- } else if (!strcmp(oem.panel, TRULY_1080P_CMD_PANEL)) {
- if (buf_size < (prefix_string_len +
- strlen(TRULY_CMD_PANEL_STRING))) {
- dprintf(CRITICAL, "TRULY CMD command line argument \
- argument is greater than \
- buffer size\n");
- return false;
- }
- strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
- buf_size -= prefix_string_len;
- pbuf += prefix_string_len;
- strlcpy(pbuf, TRULY_CMD_PANEL_STRING, buf_size);
- }
} else {
ret = gcdb_display_cmdline_arg(pbuf, buf_size);
}
@@ -466,7 +438,6 @@
struct oem_panel_data oem;
int32_t ret = 0;
uint32_t panel_loop = 0;
- uint32_t platform_subtype = board_hardware_subtype();
set_panel_cmd_string(panel_name);
oem = mdss_dsi_get_oem_data();
@@ -483,10 +454,9 @@
}
/* skip splash screen completely not just cont splash */
- if ((platform_subtype == HW_PLATFORM_SUBTYPE_IOT)
- || !strcmp(oem.panel, DISABLE_PANEL_CONFIG)) {
- dprintf(INFO, "%s: Platform subtype %d\n",
- __func__, platform_subtype);
+ if (!strcmp(oem.panel, DISABLE_PANEL_CONFIG)) {
+ dprintf(INFO, "%s: disable splash screen \n",
+ __func__);
return;
}
diff --git a/target/msm8996/init.c b/target/msm8996/init.c
index 0293764..4ad64a3 100644
--- a/target/msm8996/init.c
+++ b/target/msm8996/init.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-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 are
@@ -76,6 +76,12 @@
#include <pm_smbchg_usb_chgpth.h>
+#if MOUNT_EMMC_LE
+ #define ROOTFS_EMMC_PATH " root=/dev/mmcblk0p"
+#else
+ #define ROOTFS_EMMC_PATH " root=/dev/mmcblock0p"
+#endif
+
#define CE_INSTANCE 1
#define CE_EE 0
#define CE_FIFO_SIZE 64
@@ -704,7 +710,7 @@
char lun_char_base = 'a', lun_char_limit = 'h';
/*allocate buflen for largest possible string*/
- uint32_t buflen = strlen(" root=/dev/mmcblock0p") + sizeof(int) + 1; /*1 character for null termination*/
+ uint32_t buflen = strlen(ROOTFS_EMMC_PATH) + sizeof(int) + 1; /*1 character for null termination*/
if (!cmdline || !part ) {
dprintf(CRITICAL, "WARN: Invalid input param\n");
@@ -734,7 +740,7 @@
else
{
if (platform_boot_dev_isemmc()) {
- snprintf(*buf, buflen, " root=/dev/mmcblock0p%d",
+ snprintf(*buf, buflen, ROOTFS_EMMC_PATH"%d",
system_ptn_index + 1);
} else {
lun = partition_get_lun(system_ptn_index);