From 666f5fc2ef5d108f0a9c92ad8bd81aa9d9d5681a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 21 Jan 2013 10:03:36 +0800 Subject: [PATCH] rk3188: use rk30 cpufreq --- arch/arm/mach-rk30/cpufreq.c | 12 ++++++++---- arch/arm/mach-rk3188/Makefile | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rk30/cpufreq.c b/arch/arm/mach-rk30/cpufreq.c index 91186451286b..dbf12d516878 100644 --- a/arch/arm/mach-rk30/cpufreq.c +++ b/arch/arm/mach-rk30/cpufreq.c @@ -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) { diff --git a/arch/arm/mach-rk3188/Makefile b/arch/arm/mach-rk3188/Makefile index 270b95c7d0ca..0f767f7cafa6 100644 --- a/arch/arm/mach-rk3188/Makefile +++ b/arch/arm/mach-rk3188/Makefile @@ -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 -- 2.34.1