ENGR00138516: MX5X: Initialize CPU working point correctly for DVFS-CORE

CPU working point needs to be initialized based on the current CPU
frequency in start_dvfs() and should correspond with the correct entry
in the cpu_wp_auto table.

If its not initialized correctly, DVFS-CORE will fail when PLL-relock
results in a frequency that is not the same as set in the cpu_wp_auto table.
So fix it by finding the entry that closely matches the CPU frequency.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
This commit is contained in:
Ranjani Vaidyanathan
2011-01-25 14:16:57 -06:00
committed by Matt Sealey
parent 7aba289ff0
commit eda3daf6fb

View File

@@ -347,6 +347,14 @@ static int start_dvfs(void)
dvfs_load_config(0);
/* get current working point */
cpu_rate = clk_get_rate(cpu_clk);
curr_wp = cpu_wp_nr - 1;
do {
if (cpu_rate <= cpu_wp_tbl[curr_wp].cpu_rate)
break;
} while (--curr_wp >= 0);
old_wp = curr_wp;
/* config reg GPC_CNTR */
reg = __raw_readl(dvfs_data->gpc_cntr_reg_addr);