1:打开驱动日志
--- a/kernel/arch/arm/configs/msm8909-1gb_defconfig
+++ b/kernel/arch/arm/configs/msm8909-1gb_defconfig
@@ -614,3 +614,5 @@ CONFIG_MSM_CORE_CTL_HELPER=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP=y
CONFIG_SECCOMP_FILTER=y
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
2:移除emmc版本检查
diff --git a/kernel/drivers/mmc/core/mmc.c b/kernel/drivers/mmc/core/mmc.c
old mode 100644
new mode 100755
index 4ede8e3..4df1712
--- a/kernel/drivers/mmc/core/mmc.c
+++ b/kernel/drivers/mmc/core/mmc.c
@@ -328,12 +328,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
}
card->ext_csd.rev = ext_csd[EXT_CSD_REV];
- if (card->ext_csd.rev > 7) {
+ //richal add:disable emmc version check
+ /*if (card->ext_csd.rev > 7) {
pr_err("%s: unrecognised EXT_CSD revision %d\n",
mmc_hostname(card->host), card->ext_csd.rev);
err = -EINVAL;
goto out;
- }
+ }*/
/* fixup device after ext_csd revision field is updated */
mmc_fixup_device(card, mmc_fixups);
3:在系统崩溃时关闭qload mode
diff --git a/kernel/drivers/power/reset/msm-poweroff.c b/kernel/drivers/power/reset/msm-poweroff.c
old mode 100644
new mode 100755
index b0aa6b0..854c8db
--- a/kernel/drivers/power/reset/msm-poweroff.c
+++ b/kernel/drivers/power/reset/msm-poweroff.c
@@ -63,7 +63,7 @@ static void *emergency_dload_mode_addr;
static bool scm_dload_supported;
static int dload_set(const char *val, struct kernel_param *kp);
-static int download_mode = 1;
+static int download_mode = 0; //richal changed:disable qdload mode
module_param_call(download_mode, dload_set, param_get_int,
&download_mode, 0644);
static int panic_prep_restart(struct notifier_block *this,
4:打开关机充电功能
修改/android/bootable/bootloader/lk/app/aboot/aboot.c
unsigned char *update_cmdline(const char * cmdline)
{
。。。。省略代码
if (boot_into_recovery && gpt_exists)
cmdline_len += strlen(secondary_gpt_enable);
if (boot_into_ffbm) {
cmdline_len += strlen(androidboot_mode);
cmdline_len += strlen(ffbm_mode_string);
/* reduce kernel console messages to speed-up boot */
cmdline_len += strlen(loglevel);
} else if (boot_reason_alarm) {
cmdline_len += strlen(alarmboot_cmdline);
} else if (/*device.charger_screen_enabled &&*/ //注释掉
target_pause_for_battery_charge()) {
pause_at_bootup = 1;
cmdline_len += strlen(battchg_pause);
}
。。。。省略代码
}
在代码中修改 device.charger_screen_enabled 即可。
低版本 可能加个
target_build_variant_user() 在User版本才能进入关机充电debug正常
此方法在 android/bootable/bootloader/lk/target/init.c 下
5:打开lk串口日志
diff --git a/bootable/bootloader/lk/project/msm8909.mk b/bootable/bootloader/lk/project/msm8909.mk
old mode 100644
new mode 100755
index afc40f6..007499a
--- a/bootable/bootloader/lk/project/msm8909.mk
+++ b/bootable/bootloader/lk/project/msm8909.mk
@@ -20,7 +20,7 @@ ENABLE_PWM_SUPPORT := true
#DEFINES += WITH_DEBUG_DCC=1
DEFINES += WITH_DEBUG_LOG_BUF=1
-DEFINES += WITH_DEBUG_UART=0
+DEFINES += WITH_DEBUG_UART=1
#DEFINES += WITH_DEBUG_FBCON=1
DEFINES += DEVICE_TREE=1
#DEFINES += MMC_BOOT_BAM=1
6:高通8909 驱动修改充电电流限制[kernel]
定位文件:kernel/arch/arm/boot/dts/qcom/msm-pm8909.dtsi
pm8909_chg: qcom,charger {
....
qcom,ibatsafe-ma = <1000>; // 1000 1A
qcom,thermal-mitigation = <1000 720 630 0>; //1000A
//qcom,ibatsafe-ma = <1440>; // 1.5A
//qcom,thermal-mitigation = <1440720 630 0>; //1.5A
qcom,cool-bat-decidegc = <100>;
qcom,warm-bat-decidegc = <450>;
qcom,cool-bat-mv = <4100>;
或者直接修改
kernel/drivers/power/qpnp-linear-charger.c
return rc;
}
#define QPNP_LBC_IBATMAX_MIN 90
#define QPNP_LBC_IBATMAX_MAX 1000 //最大充电电流限制
/*
* Set maximum current limit from charger
* ibat = System current + charging current
*/
static int qpnp_lbc_ibatmax_set(struct qpnp_lbc_chip *chip, int chg_current)