rk3188: use rk30 cpufreq
author黄涛 <huangtao@rock-chips.com>
Mon, 21 Jan 2013 02:03:36 +0000 (10:03 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jan 2013 02:06:25 +0000 (10:06 +0800)
arch/arm/mach-rk30/cpufreq.c
arch/arm/mach-rk3188/Makefile

index 91186451286b3416e757be4d6ecba3a9c74a7c71..dbf12d516878de9b2bded2bc3de6fad992aa35d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 ROCKCHIP, Inc.
+ * Copyright (C) 2012-2013 ROCKCHIP, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -73,7 +73,7 @@ static DEFINE_MUTEX(cpufreq_mutex);
 
 static struct clk *gpu_clk;
 static struct clk *ddr_clk;
-#if !defined(CONFIG_ARCH_RK3066B)
+#if !defined(CONFIG_ARCH_RK3066B) && !defined(CONFIG_ARCH_RK3188)
 #define GPU_MAX_RATE 350*1000*1000
 #endif
 
@@ -100,7 +100,7 @@ static bool rk30_cpufreq_is_ondemand_policy(struct cpufreq_policy *policy)
 }
 
 /**********************thermal limit**************************/
-#if !defined(CONFIG_ARCH_RK3066B)
+#if !defined(CONFIG_ARCH_RK3066B) && !defined(CONFIG_ARCH_RK3188)
 #define CONFIG_RK30_CPU_FREQ_LIMIT_BY_TEMP
 #endif
 
@@ -286,8 +286,12 @@ static int rk30_cpu_init(struct cpufreq_policy *policy)
                clk_enable_dvfs(cpu_clk);
 
 #if !defined(CONFIG_ARCH_RK3066B)
+#if defined(CONFIG_ARCH_RK3188)
+               dvfs_clk_enable_limit(gpu_clk, 133000000, 600000000);
+#else
                /* Limit gpu frequency between 133M to 400M */
                dvfs_clk_enable_limit(gpu_clk, 133000000, 400000000);
+#endif
 #endif
 
                freq_wq = create_singlethread_workqueue("rk30_cpufreqd");
@@ -547,7 +551,7 @@ static unsigned int cpufreq_scale_limt(unsigned int target_freq, struct cpufreq_
        if (!is_ondemand)
                goto out;
 
-#if !defined(CONFIG_ARCH_RK3066B)
+#if !defined(CONFIG_ARCH_RK3066B) && !defined(CONFIG_ARCH_RK3188)
        if (is_booting && target_freq >= 1600 * 1000) {
                s64 boottime_ms = ktime_to_ms(ktime_get_boottime());
                if (boottime_ms > 30 * MSEC_PER_SEC) {
index 270b95c7d0cab58852248e5220e9779d0a7c55f8..0f767f7cafa6ca12e2785373a65d07473bd0e40c 100644 (file)
@@ -15,6 +15,7 @@ obj-y += rk_timer.o
 obj-$(CONFIG_SMP) += ../mach-rk30/platsmp.o ../mach-rk30/headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU) += ../mach-rk30/hotplug.o
 obj-$(CONFIG_CPU_IDLE) += ../mach-rk30/cpuidle.o
+obj-$(CONFIG_CPU_FREQ) += ../mach-rk30/cpufreq.o
 obj-$(CONFIG_DVFS) += ../mach-rk30/dvfs.o
 
 obj-$(CONFIG_MACH_RK3188_FPGA) += board-rk3188-fpga.o