flash压力测试

时间:2023-03-08 17:00:36

涉及目录:

vendor/mediatek/proprietary/bootable/bootloader/preloader/platform/mt6735/src/drivers/inc/dramc.h

#ifndef _DRAMC_H
#define _DRAMC_H

#if defined(MACH_TYPE_MT6735) || defined(MACH_TYPE_MT6737T)
    #include "dramc1.h" // do something for 6735 (Denali-1)
#elif defined(MACH_TYPE_MT6735M) || defined(MACH_TYPE_MT6737M)
    #include "dramc2.h" // do something for 6735M (Denali-2)
#elif defined(MACH_TYPE_MT6753)
    #include "dramc3.h"
#endif

#endif  /* !_DRAMC_H */ 

不同配置选择不同宏;

01:首先保证已经兼容该flash

02:preloader:

① 对于6737m版本:

在vendor/mediatek/proprietary/bootable/bootloader/preloader/platform/mt6735/src/drivers/inc/dramc2.h中打开:

#define pmic_HQA_TCs  

②在vendor/mediatek/proprietary/bootable/bootloader/preloader/platform/mt6735/src/drivers/emi.c中我们用到pmic_HQA_Voltage_adjust函数,该函数在#ifdef pmic_HQA_TCs 之下;

我们在pmic_HQA_Voltage_adjust中将基带所给数据填写到对应case中:

void pmic_HQA_Voltage_adjust(int nAdjust)
{
    switch (nAdjust) {
    ¦   : //HVcHVm
    ¦       //pmic_config_interface(MT6328_VCORE1_CON11, 0x6B, 0x7F, 0);    // 1.265V
#if defined(MACH_TYPE_MT6753)
    ¦       pmic_config_interface(MT6328_VCORE1_CON11, );  // 1.310V
#else
    ¦       pmic_config_interface(MT6328_VCORE1_CON11, );  // 1.230V
#endif
    ¦       pmic_config_interface(MT6328_SLDO_ANA_CON1, );  // +0.6V (1.3V)
    ¦       printf("========== HVcHVm ==========\r\n");
    ¦       break;
    ¦   : //HVcLVm......

对于:pmic_config_interface(MT6328_VCORE1_CON11, 0x65, 0x7F, 0); // 1.230V 参数中第一位寄存器值,第二位就是我们要设的电压值,第三位读取位数;

          lthv、htlv、ntnv对应:

分别打开0、3、4(LTHV、HTLV、NTNV)

③在vendor/mediatek/proprietary/bootable/bootloader/preloader/platform/mt6735/src/drivers/platform.c

 #include "dramc.h"  ,,,

void platform_pre_init(void)
{

,,,,,

#if !CFG_FPGA_PLATFORM
    pmic_ret = pmic_init();

//check flash test
    pmic_force_PWM_Mode();
    pmic_HQA_Voltage_adjust();
//    pmic_HQA_Voltage_adjust(3);
//    pmic_HQA_Voltage_adjust(4);
    pmic_voltage_read();
//end
    mt_pll_post_init();
    //mt_arm_pll_sel();
    BOOTING_TIME_PROFILING_LOG("PMIC");
#endif

--

二:kernel:

①修改:kernel-3.18/drivers/misc/mediatek/dramc/mt6735/mt_dramc.c

修改:

void pmic_HQA_Voltage_adjust(int nAdjust)
{
    switch (nAdjust) {
    :     /*HVcHVm*/
        /*pmic_config_interface(MT6328_VCORE1_CON11, 0x6B, 0x7F, 0);*/    /* 1.265V */
#if defined(CONFIG_ARCH_MT6753)
        pmic_config_interface(MT6328_VCORE1_CON11, );  /* 1.310V */
        pmic_config_interface(MT6328_VCORE1_CON12, );  /* 1.310V */
#else
        pmic_config_interface(MT6328_VCORE1_CON11, );  /* 1.230V */
        pmic_config_interface(MT6328_VCORE1_CON12, );  /* 1.230V */
#endif
        pmic_config_interface(MT6328_SLDO_ANA_CON1, );  /* +0.06V (1.3V) */
        pr_warn("========== HVcHVm ==========\r\n");
        break;
    :     /*HVcLVm*/

函数在此#ifdef VCORE1_ADJ_TEST 之下,但在 mt_dramc.h已经define

②kernel-3.18/drivers/misc/mediatek/power/mt6735/pmic.c中:

#include "../../dramc/mt6735/mt_dramc.h"
static int pmic_mt_probe(struct platform_device *dev)
{
....

//add by lynn
    pmic_HQA_Voltage_adjust();
//    pmic_HQA_Voltage_adjust(3);
//    pmic_HQA_Voltage_adjust(4);
    pmic_voltage_read();
//end

}

-----------------