Android 5.1-7.1高通駆動修正-前編


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
", 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-pm 8909.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)