Platform/ECM3532/M3/hw/power/ecm3532/src/eta_pwr_gov.c
/**
 *  set policy
 *
 *  set m3 policy
 *
 *  policy index
 *
 *
 */
set policy
set m3 policy

policy index
set policy set m3 policy policy index
static void
ecm3531_set_policy(uint32_t uiFreq)
{
    int ret = 0;
    static tBuckMemTarget iMemTarget =
        (CONFIG_M3_INIT_FREQ > 60 ? eBuckMem1100Mv : eBuckMem900Mv);
    static tBuckAoTarget iAoTarget =
        (CONFIG_M3_INIT_FREQ >= 40 ? eBuckAo700Mv : eBuckAo600Mv);
    if (uiFreq < 40)
    {
        if (iAoTarget != eBuckAo600Mv)
        {
            iAoTarget = eBuckAo600Mv;
            ret|= EtaCspBuckAoVoltageSet(iAoTarget, 1);
            while(ret);
            EtaCspHfoTuneDefaultUpdate();
        }
        ret |= EtaCspBuckM3FrequencySet((uiFreq * 1000), 0);
            while(ret);
    }
    if (uiFreq <= 60)
    {
        if (iMemTarget != eBuckMem900Mv)
        {
            ret |= EtaCspBuckM3FrequencySet((uiFreq * 1000), 0);
            iMemTarget = eBuckMem900Mv;
            ret |= EtaCspBuckMemVoltageSet(iMemTarget, 1);
            if (iAoTarget != eBuckAo700Mv)
            {
                iAoTarget = eBuckAo700Mv;
                ret|= EtaCspBuckAoVoltageSet(iAoTarget, 1);
                EtaCspHfoTuneDefaultUpdate();
            }
        }
        else
        {
            ret |= EtaCspBuckM3FrequencySet((uiFreq * 1000), 0);
        }
    }
    else
    {
        if (iMemTarget != eBuckMem1100Mv)
        {
            iMemTarget = eBuckMem1100Mv;
            if (iAoTarget != eBuckAo700Mv)
            {
                iAoTarget = eBuckAo700Mv;
                ret |= EtaCspBuckAoVoltageSet(iAoTarget, 1);
                EtaCspHfoTuneDefaultUpdate();
            }
            ret |= EtaCspBuckMemVoltageSet(iMemTarget, 1);
        }
        ret |= EtaCspBuckM3FrequencySet((uiFreq * 1000), 0);
    }
    if (ret) ecm35xx_printf("Err in setting buck %s\r\n", __func__);
}
static void ecm3531_set_policy ( uint32_t uiFreq ) { int ret = 0 ; static tBuckMemTarget iMemTarget = ( CONFIG_M3_INIT_FREQ > 60 ? eBuckMem1100Mv : eBuckMem900Mv ) ; static tBuckAoTarget iAoTarget = ( CONFIG_M3_INIT_FREQ >= 40 ? eBuckAo700Mv : eBuckAo600Mv ) ; if ( uiFreq < 40 ) { if ( iAoTarget != eBuckAo600Mv ) { iAoTarget = eBuckAo600Mv ; ret |= EtaCspBuckAoVoltageSet ( iAoTarget , 1 ) ; while ( ret ) ; EtaCspHfoTuneDefaultUpdate ( ) ; } ret |= EtaCspBuckM3FrequencySet ( ( uiFreq * 1000 ) , 0 ) ; while ( ret ) ; } if ( uiFreq <= 60 ) { if ( iMemTarget != eBuckMem900Mv ) { ret |= EtaCspBuckM3FrequencySet ( ( uiFreq * 1000 ) , 0 ) ; iMemTarget = eBuckMem900Mv ; ret |= EtaCspBuckMemVoltageSet ( iMemTarget , 1 ) ; if ( iAoTarget != eBuckAo700Mv ) { iAoTarget = eBuckAo700Mv ; ret |= EtaCspBuckAoVoltageSet ( iAoTarget , 1 ) ; EtaCspHfoTuneDefaultUpdate ( ) ; } } else { ret |= EtaCspBuckM3FrequencySet ( ( uiFreq * 1000 ) , 0 ) ; } } else { if ( iMemTarget != eBuckMem1100Mv ) { iMemTarget = eBuckMem1100Mv ; if ( iAoTarget != eBuckAo700Mv ) { iAoTarget = eBuckAo700Mv ; ret |= EtaCspBuckAoVoltageSet ( iAoTarget , 1 ) ; EtaCspHfoTuneDefaultUpdate ( ) ; } ret |= EtaCspBuckMemVoltageSet ( iMemTarget , 1 ) ; } ret |= EtaCspBuckM3FrequencySet ( ( uiFreq * 1000 ) , 0 ) ; } if ( ret ) ecm35xx_printf ( " \r \n " , __func__ ) ; }
set policy
  set m3 policy
set policy set m3 policy