Patchwork [2/3] ARM: tegra: use new EMC clock scaling API in CPUfreq driver

login
register
mail settings
Submitter Lucas Stach
Date Dec. 14, 2012, 8:14 p.m.
Message ID <1355516086-11116-3-git-send-email-dev@lynxeye.de>
Download mbox | patch
Permalink /patch/206553/
State Changes Requested, archived
Headers show

Comments

Lucas Stach - Dec. 14, 2012, 8:14 p.m.
The CPUfreq driver should not take control of EMC clock directly, but
rather let the EMC driver know about the CPUs memory performance demands
using the new EMC clock scaling API.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/mach-tegra/cpu-tegra.c | 15 ++++++++-------
 1 Datei geändert, 8 Zeilen hinzugefügt(+), 7 Zeilen entfernt(-)

Patch

diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index a74d3c7..8908e32 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -29,6 +29,7 @@ 
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/suspend.h>
+#include <memory/tegra_emc_performance.h>
 
 /* Frequency table index must be sequential starting at 0 */
 static struct cpufreq_frequency_table freq_table[] = {
@@ -117,16 +118,16 @@  static int tegra_update_cpu_speed(unsigned long rate)
 	if (freqs.old == freqs.new)
 		return ret;
 
-	/*
-	 * Vote on memory bus frequency based on cpu frequency
-	 * This sets the minimum frequency, display or avp may request higher
-	 */
+	/* Boost memory bus frequency based on CPU frequency */
 	if (rate >= 816000)
-		clk_set_rate(emc_clk, 600000000); /* cpu 816 MHz, emc max */
+		tegra_emc_request_perf_level(TEGRA_EMC_SC_MPCORE,
+					     TEGRA_EMC_PL_HIGH);
 	else if (rate >= 456000)
-		clk_set_rate(emc_clk, 300000000); /* cpu 456 MHz, emc 150Mhz */
+		tegra_emc_request_perf_level(TEGRA_EMC_SC_MPCORE,
+					     TEGRA_EMC_PL_MID);
 	else
-		clk_set_rate(emc_clk, 100000000);  /* emc 50Mhz */
+		tegra_emc_request_perf_level(TEGRA_EMC_SC_MPCORE,
+					     TEGRA_EMC_PL_LOW);
 
 	for_each_online_cpu(freqs.cpu)
 		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);