static _mali_osk_errcode_t mali_pmu_power_up_internal(struct mali_pmu_core *pmu, const u32 mask)
{
u32 stat;
+ u32 active_mask;
+ u32 mask_ck;
+ u32 swt_dly;
+ u32 xxd = 1;
+
_mali_osk_errcode_t err;
#if !defined(CONFIG_MALI_PMU_PARALLEL_POWER_UP)
u32 current_domain;
return err;
}
#else
+ active_mask = mask & stat;
+ mask_ck = active_mask;
for (current_domain = 1; current_domain <= pmu->registered_cores_mask; current_domain <<= 1) {
- if (current_domain & mask & stat) {
+ if (current_domain & active_mask) {
+ if (mask_ck == 1) {
+ swt_dly = pmu->switch_delay;
+ xxd = 0;
+ }
+ else
+ swt_dly = 0xfff;
+ mali_hw_core_register_write_relaxed(&pmu->hw_core, PMU_REG_ADDR_MGMT_SW_DELAY, swt_dly);
mali_hw_core_register_write(&pmu->hw_core, PMU_REG_ADDR_MGMT_POWER_UP, current_domain);
err = mali_pmu_wait_for_command_finish(pmu);
return err;
}
}
+ mask_ck = mask_ck >> 1;
}
+ if (xxd != 0) {
+ printk("@@@@ warn\n");
+ printk("mask_ck:%d,active_mask:%d\n", mask_ck, active_mask);
+ //panic(0);
+ }
+ if (swt_dly != pmu->switch_delay)
+ mali_hw_core_register_write_relaxed(&pmu->hw_core, PMU_REG_ADDR_MGMT_SW_DELAY, pmu->switch_delay);
+
#endif
#if defined(DEBUG)
#define FCLK_DEV5 (7 << 9) /* 510 Mhz */
#define FCLK_DEV7 (4 << 9) /* 364.3 Mhz */
-u32 mali_dvfs_clk[] = {
+static u32 mali_dvfs_clk[] = {
FCLK_DEV5 | 1, /* 255 Mhz */
FCLK_DEV7 | 0, /* 364 Mhz */
FCLK_DEV3 | 1, /* 425 Mhz */
FCLK_DEV4 | 0, /* 637.5 Mhz */
};
-u32 mali_dvfs_clk_sample[] = {
+static u32 mali_dvfs_clk_sample[] = {
255, /* 182.1 Mhz */
364, /* 318.7 Mhz */
425, /* 425 Mhz */
.scale_info = {
CFG_MIN_PP, /* minpp */
- CFG_PP, /* maxpp, should be same as cfg_pp */
- CFG_MIN_CLOCK, /* minclk */
- CFG_CLOCK, /* maxclk should be same as cfg_clock */
+ CFG_PP, /* maxpp, should be same as cfg_pp */
+ CFG_MIN_CLOCK, /* minclk */
+ CFG_CLOCK, /* maxclk should be same as cfg_clock */
},
.limit_on = 1,
struct mali_pmu_core *pmu;
ret = 0;
+ mali_pm_statue = 0;
device = (struct device *)param;
pmu = mali_pmu_get_global_pmu_core();
/* Need to notify Mali driver about this event */
ret = device->driver->pm->runtime_resume(device);
}
+ mali_pm_statue = 1;
return ret;
}
/* clock scaling. Kasin..*/
ret = mali_clock_critical(mali_cri_light_suspend, (size_t)device);
-
+ disable_clock();
return ret;
}
int mali_light_resume(struct device *device)
{
int ret = 0;
-
+ enable_clock();
ret = mali_clock_critical(mali_cri_light_resume, (size_t)device);
#ifdef CONFIG_MALI400_PROFILING
_mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE |
if (mode >= MALI_SCALING_MODE_MAX)
return;
scaling_mode = mode;
- if (scaling_mode != MALI_PP_FS_SCALING) {
- pmali_plat->scale_info.minclk = pmali_plat->cfg_min_clock;
+
+ /* set default performance range. */
+ pmali_plat->scale_info.minclk = pmali_plat->cfg_min_clock;
+ pmali_plat->scale_info.maxclk = pmali_plat->cfg_clock;
+ pmali_plat->scale_info.minpp = pmali_plat->cfg_min_pp;
+ pmali_plat->scale_info.maxpp = pmali_plat->cfg_pp;
+
+ /* set current status and tune max freq */
+ if (scaling_mode == MALI_PP_FS_SCALING) {
+ pmali_plat->scale_info.maxclk = pmali_plat->cfg_clock;
+ enable_pp_cores(pmali_plat->sc_mpp);
+ } else if (scaling_mode == MALI_SCALING_DISABLE) {
pmali_plat->scale_info.maxclk = pmali_plat->cfg_clock;
- pmali_plat->scale_info.minpp = pmali_plat->cfg_min_pp;
- pmali_plat->scale_info.maxpp = pmali_plat->cfg_pp;
+ enable_max_num_cores();
+ } else if (scaling_mode == MALI_TURBO_MODE) {
+ pmali_plat->scale_info.maxclk = pmali_plat->turbo_clock;
+ enable_max_num_cores();
}
- if (scaling_mode == MALI_TURBO_MODE) {
- currentStep = pmali_plat->turbo_clock;
- pmali_plat->scale_info.maxclk = currentStep;
- } else
- currentStep = pmali_plat->scale_info.maxclk;
- enable_max_num_cores();
+ currentStep = pmali_plat->scale_info.maxclk;
schedule_work(&wq_work);
}