summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
AgeCommit message (Collapse)AuthorFilesLines
2014-11-18cpufreq: exynos3250: Initialize frequency table staticallyChanwoo Choi1-3/+1
This patch initializes frequency table for CPUFREQ statically. Change-Id: If64cd6665f22c57da49764e19cb9847f0a7a5aed Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2014-11-18cpufreq: stats: Add 'load_table' debugfs file to show accumulated data of CPUsChanwoo Choi4-25/+271
This patch add new 'load_table' debugfs file to show previous accumulated data of CPUs load as following path and add CPUFREQ_LOADCHECK notification to CPUFREQ_TRANSITION_NOTIFIER notifier chain. - /sys/kernel/debug/cpufreq/cpuX/load_table When governor calculates CPUs load on dbs_check_cpu(), governor send CPUFREQ_LOADCHECK notification with CPUs load, so that cpufreq_stats accumulates calculated CPUs load on 'load_table' storage. This debugfs file is used to judge the correct system state or determine suitable system resource according to current CPUs load on user-space. This debugfs file include following data: - Measurement point of time - CPU frequency - Per-CPU load Changes since v6: - Remove unnecessary memory free/allocation operation on cpufreq_stats_reset_debugfs() - Get correct index of cpu_debugfs[] array according to cpu number - Reset 'load_table' data when cpufreq governor is changed or updated because specific governor(e.g., performance/powersave) haven't used 'load_table; debugfs file. Changes since v5: - Determine index value of policy->cpu_debugfs[] according to cpumask_weight(policy->cpus) value - Bug fix, store 'policy->cpu' to 'freq->cpu' before notify CPUFREQ_LOADCHECK notification Changes since v4: - Reset the data of CPUs load when cpufreq governor is changed - Move code about creating debugfs directory to below first patch : [PATCH 1/2] cpufreq: Add debugfs directory for cpufreq Changes since v3: - Extend a range of accumulated data (10 ~ 1000) - Add unit information of time/freq and align 'Time' field as left for readability - Use CONFIG_CPU_FREQ_STAT depdendency instead of CONFIG_CPU_FREQ_STAT_DETATILS - Initialize load of offline CPUx as zero(0) - Create/remove debugfs root directory on cpufreq_stats_init/exit() because debugfs root is used on all CPUs. Changes since v2: - Code clean according to Viresh Kumar's comment - Show both old frequency and new frequency on 'load_table' debugfs file - Change debufs file patch as below old: /sys/kernel/debugfs/cpufreq/load_table new: /sys/kernel/debugfs/cpufreq/cpuX/load_table Changes since v1: - Set maximum storage size to save CPUs load on Kconfig - Use spinlock to synchronize read/write operation for CPUs load - Use local variable instead of global variable(struct cpufreq_freqs *freqs) - Use pointer of data structure to get correct size of data structure in sizeof() macro instead of structure name : sizeof(struct cpufreq_freqs) -> sizeof(*stat->load_table) - Change time unit from nanosecond to microsecond - Remove unnecessary memory copy Change-Id: I14e68196360a3ec00a36e7357b8c73c887abddce Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2014-11-18cpufreq: Add debugfs directory for cpufreqChanwoo Choi1-0/+178
This patch create debugfs root directory and child directory according to the number of CPUs for CPUFreq as below debugfs directory path: - /sys/kernel/debug/cpufreq/cpuX If many CPUs share only one cpufreq policy, other CPUs(except for first CPU) create a symbolic link for debugfs directory of CPU0. - link: /sys/kernel/debug/cpufreq/cpu[1-(N-1)] -> /sys/kernel/debug/cpufreq/cpu0 And then cpufreq may need to create debugfs specific file below of debugfs directory of cpufreq. (e.g., /sys/kernel/debug/cpufreq/cpu0/load_table) Changes since v6: - Use 'policy->related_cpus' instead of 'policy->cpus' when getting the number of CPUs included in the same package - Get correct index of cpu_debugfs[] array according to cpu number - Refactoring cpufreq_move_debugfs_dir() / cpufreq_create_debugfs_symlink() - Use for_each_cpu() to support multi cluster instead of for_each_present_cpu() Changes since v5: - Refactoring patch v4 - Create again symbolic link of debugfs directory when first CPU dev is removed (In this case, many CPUs share only one cpufreq policy) Change-Id: Ibd84118e6dd3b1e3bc624e1871d39425c99b1673 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2014-11-18cpufreq: Add exynos3250 cpufreq supportChanwoo Choi5-1/+226
This patch add exynos3250 cpufreq driver to change voltage/frequency according to required cpufreq level. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2014-11-18arm: odroid: cpufreq: Support for frequency up to 1.7 GHzLukasz Majewski3-16/+24
Values used for supporting Odroid U3 frequencies were taken from Odroid repo: https://github.com/hardkernel/linux.git branch odroid-3.8.y config arch/arm/configs/odroidu_defconfig Three new frequencies have been added: 1.6, 1.704 and 1.8 GHz. It is important to note, that in the device tree cpufreq node one just needs to specify the list of supported frequencies at the freq_table attribute. Change-Id: I416a35b99da9c341f92648541c81238a51dc362f Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: BOOST: Adjust setting of BOOST frequency just before first valid freqLukasz Majewski1-4/+13
Before this change the BOOST frequency was always hardcoded to be the highest one. This worked for M0 and Proxima, but failed when support for odroid U3 has been added. Since odroid U3 supports three more freqs, higher than the boost for M0, it is necessary to adjust setting of boost frequency. Without that on M0 cpufreq sets frequencies reserved for odroid, which is dangerous. Change-Id: I70b19453d5853b6c0139f2c59c98dd5ad65da01e Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18upstream: treewide: Fix typo in KconfigMasanari Iida1-1/+1
Correct spelling typo in Kconfig. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Conflicts: arch/arm/mach-sti/Kconfig drivers/fmc/Kconfig
2014-11-18cpufreq:LAB: Change method of boost state preservingLukasz Majewski1-4/+5
It is not necessary to change the boost state when LAB governor is entered, since LAB will change it according to its own politics. Only enter state is preserved. When leaving the LAB, only when required, work is scheduled to restore boost initial state. Change-Id: I6323f3c0011fe54a33d70c9ad0f9da5360b4a735 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:governor: Add serialization to the cpufreq_governor_dbs() functionLukasz Majewski1-2/+12
It is necessary to serialize access to cpufreq_governor_dbs() function, since it can be accessed from different, not protected by any mutex paths like sysfs boost attribute or LAB governor internals. Change-Id: Id7b62db6ca0b7c28f5e8c6286aec312d3d0c971e Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: serialize calls to __cpufreq_governor()Viresh Kumar1-2/+8
We can't take a big lock around __cpufreq_governor() as this causes recursive locking for some cases. But calls to this routine must be serialized for every policy. Otherwise we can see some unpredictable events. For example, consider following scenario: __cpufreq_remove_dev() __cpufreq_governor(policy, CPUFREQ_GOV_STOP); policy->governor->governor(policy, CPUFREQ_GOV_STOP); cpufreq_governor_dbs() case CPUFREQ_GOV_STOP: mutex_destroy(&cpu_cdbs->timer_mutex) cpu_cdbs->cur_policy = NULL; <PREEMPT> store() __cpufreq_set_policy() __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); policy->governor->governor(policy, CPUFREQ_GOV_LIMITS); case CPUFREQ_GOV_LIMITS: mutex_lock(&cpu_cdbs->timer_mutex); <-- Warning (destroyed mutex) if (policy->max < cpu_cdbs->cur_policy->cur) <- cur_policy == NULL And so store() will eventually result in a crash if cur_policy is NULL at this point. Introduce an additional variable which would guarantee serialization here. Change-Id: Ibae767cbd9c25c7598b39d1405fa3d98d2125101 Reported-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18cpufreq: Fix serialization of frequency transitionsViresh Kumar1-3/+4
Commit 7c30ed ("cpufreq: make sure frequency transitions are serialized") interacts poorly with systems that have a single core freqency for all cores. On such systems we have a single policy for all cores with several CPUs. When we do a frequency transition the governor calls the pre and post change notifiers which causes cpufreq_notify_transition() per CPU. Since the policy is the same for all of them all CPUs after the first and the warnings added are generated by checking a per-policy flag the warnings will be triggered for all cores after the first. Fix this by allowing notifier to be called for n times. Where n is the number of cpus in policy->cpus. Change-Id: I5712dde7f992644f9c3ddc8313151f80bea0d877 Reported-and-tested-by: Mark Brown <broonie@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18cpufreq: make sure frequency transitions are serializedViresh Kumar1-0/+14
Whenever we are changing frequency of a cpu, we are calling PRECHANGE and POSTCHANGE notifiers. They must be serialized. i.e. PRECHANGE or POSTCHANGE shouldn't be called twice contiguously. This can happen due to bugs in users of __cpufreq_driver_target() or actual cpufreq drivers who are sending these notifiers. This patch adds some protection against this. Now, we keep track of the last transaction and see if something went wrong. Change-Id: I0f5465bd515c431ae2d3711d065f70aacec7e978 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18cpufreq: remove unnecessary cpufreq_cpu_{get|put}() callsViresh Kumar1-17/+2
struct cpufreq_policy is already passed as argument to some routines like: __cpufreq_driver_getavg() and so we don't really need to do cpufreq_cpu_get() before and cpufreq_cpu_put() in them to get a policy structure. Remove them. Change-Id: I6a9ff8ed483a4f4faacc2ea047d93354dccdb0b6 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18cpufreq:LAB: Remove MODULE_* macros since it is not possible to compile LAB ↵Lukasz Majewski1-6/+0
as a module LAB cannot be compiled as a module, so MODULE_* macros are in fact a dead code. Change-Id: I10f8e5650631b00850631aea1295c1d88e53104a Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB: Replace NR_CPUS with num_possible_cpus() functionLukasz Majewski1-8/+32
The usage of NR_CPUS constant is deprecated, since this value can be the maximal possible number of cores on a SMP machine. The num_possible_cpus() represents the number of available cores on the system. This change has caused replacement of global tables by ones allocated with kzalloc(). Change-Id: Ib0bfa27296740a91a25b1af0ece0e573a9756846 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:cosmetic: Cosmetic code cleanupLukasz Majewski1-3/+5
Initialization of static variable is not necessary, since it will be placed at BSS section. Also proper format comments have been added. Change-Id: Id5e30a97d7d3cdb851f09a69e944c77223fa8a82 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:ondemand: Enable usage of ONDEMAND specific methods at LAB governorLukasz Majewski1-1/+39
Two methods from ondemand, namely store_sampling_rate() and od_check_cpu() are now utilized in LAB governor. Moreover the od_cpu_dbs_info_s structure shall be regarded as a common one. Therefore in LAB only its declaration is necessary. Change-Id: I3408b2f8cfdb292cd69568c931da46d8f957099c Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:cpufreq_governor: Remove redundant LAB code from ↵Lukasz Majewski2-35/+5
cpufreq_governor.[h|c] Since the Ondemand code has been reused for LAB, it is now possible to remove code specially defined for LAB governor at the cpufreq_governor.[h|c] code. Change-Id: I9c48eade8ffe6a94efd0145b7d48afb405961155 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:ondemand: Ondemand governor adjustments necessary for correct ↵Lukasz Majewski2-3/+14
LAB operation Ondemand code needs to be slightly modified for LAB governor operation. The biggest problem is with the update_sampling_rate function, which shall not be executed with wrong governor. Change-Id: I149204bda15b11546c57a77a75a51c4f4f8522b8 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:core: Redesign of LAB code to work on top of ONDEMAND governorLukasz Majewski2-140/+231
The code for LAB has been redesigned to be able to work on top of Ondemand governor. Previous version of LAB - the one which used the polynomial approximation has been replaced with more readable approach. The LAB control approach is now read from device tree. User is allowed to specify following operations (based on load and number of idle CPUs): - Force a particular frequency - Explicitly enable boost for a specific kind of load - Use ondemand governor By using ondemand one can be sure that for non critical frequencies correct value will be chosen. LAB, which works on top of it, can clamp the freq (an thereof power management) or explicitly enable boost. Change-Id: Ieaf84d245463edf90fb2baaf825c0534970eab7e Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:ondemand: REMOVE from LAB governor code duplicated at ondemandLukasz Majewski3-78/+17
LAB is very similar to ondemand governor in its structure. Both use the same code for: - governor init and exit - demand based switching timer code - governor specific ops In this way the LAB can be stacked on top of ondemand governor and hence it is possible to reuse its logic when needed. Change-Id: I78e0da90bb2f07677fe6f8d451139107994f5a6f Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:core: Remove code responsible for removing LAB moduleLukasz Majewski1-6/+0
Since we don't support LAB compiled in as module this code shall be regarded as a dead one. Change-Id: I8aba33449e08aabed38393e15519f30ccf27ab0f Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:Kconfig: Do not allow LAB to be build as a moduleLukasz Majewski1-4/+4
Since LAB depends on ONDEMAND, one needs to prevent situation when both governors are compiled as modules. Change-Id: I5e4f65a856d548397ef53338a8949879bd34051c Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:LAB:Kconfig: Make LAB dependent on the ONDEMAND governorLukasz Majewski1-2/+4
The LAB is supposed to be an extension of the ONDEMAND governor. For this reason it shall be not possible to compile in LAB without ONDEMAND in the system. Change-Id: I8c9e46b535bb7452782c21163703a4e73bdaf96d Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: conservative: Provide correct pointer for conservative governorLukasz Majewski1-2/+3
This patch restores correct value of cs_dbs_info pointer for conservative governor at CPUFREQ_GOV_STOP event. Without this patch the NULL pointer dereference error shows up and cpufreq subsystem hangs. To trigger the behavior one needs to compile ondemand as default one. Then enable conservative governor and afterwards enable ondemand again. Change-Id: Iefd933f5984abb1a46d15357b9ea5f8492deeb08 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: ondemand: Change the calculation of target frequencyStratos Karafotis1-8/+0
The ondemand governor calculates load in terms of frequency and increases it only if load_freq is greater than up_threshold multiplied by the current or average frequency. This appears to produce oscillations of frequency between min and max because, for example, a relatively small load can easily saturate minimum frequency and lead the CPU to the max. Then, it will decrease back to the min due to small load_freq. Change the calculation method of load and target frequency on the basis of the following two observations: - Load computation should not depend on the current or average measured frequency. For example, absolute load of 80% at 100MHz is not necessarily equivalent to 8% at 1000MHz in the next sampling interval. - It should be possible to increase the target frequency to any value present in the frequency table proportional to the absolute load, rather than to the max only, so that: Target frequency = C * load where we take C = policy->cpuinfo.max_freq / 100. Tested on Intel i7-3770 CPU @ 3.40GHz and on Quad core 1500MHz Krait. Phoronix benchmark of Linux Kernel Compilation 3.1 test shows an increase ~1.5% in performance. cpufreq_stats (time_in_state) shows that middle frequencies are used more, with this patch. Highest and lowest frequencies were used less by ~9%. [rjw: We have run multiple other tests on kernels with this change applied and in the vast majority of cases it turns out that the resulting performance improvement also leads to reduced consumption of energy. The change is additionally justified by the overall simplification of the code in question.] Change-Id: I26399d5d61616ee9157baa7eb8b337bacab5b892 Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18cpufreq: boost: Provide support for BOOST on linux-3.10-tizenLukasz Majewski3-2/+42
This code reads from device tree the boost_freq attribute and properly modify the cpufreq table to support BOOST framework. This attribute is only read when CONFIG_CPU_FREQ_BOOST_SW flag is set. Change-Id: I16fcba69b16c29434e3ec1a8a0ef1bc8bdebc0ca Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: lab: Fix codes for correct working of lab governor.Jonghwa Lee2-9/+21
- Modify typo in lab govnernor. - Remove deadlock in lab governor which is occured when it enables overclocking - Add initialization of LAB's data to cpufreq_governor driver Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Conflicts: drivers/cpufreq/cpufreq_governor.c Resolved-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2014-11-18cpufreq: exysnos: Fix the way of enabling boost in exynos cpufreq driver.Jonghwa Lee1-7/+3
Follow the codes from ML. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18cpufreq: lab: Enable overclocking in LABJonghwa Lee1-1/+5
Overclocking is always on for LAB governor's working. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18cpufreq:LAB: Introduce new cpufreq LAB(Legaccy Application Boost) governorJonghwa Lee5-32/+469
This patch introduces new cpufreq governor named 'LAB'. LAB governor will use scheduler, per-CPU information to determine how many CPUs are in busy now. As a result the number of idle CPUs is calculated for current load (digital low pass filtering is used to provide more stable results). It will determine next frequency. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Conflicts: drivers/cpufreq/cpufreq_governor.c Resolved-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2014-11-18BOOST: Core code compliant with v9 of the patchLukasz Majewski1-17/+24
Update the BOOST framework core to be compliant with v9 version of the patch Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq:exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQLukasz Majewski1-1/+1
Special driver data flag (CPUFREQ_BOOST_FREQ) has been added to indicate frequency, which can be only enabled for BOOST mode. This frequency shall be used only for limited time, since it might cause target device to overheat. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Changes for v6: - New patch
2014-11-18cpufreq:boost:Kconfig: Enable software managed BOOST support at KconfigLukasz Majewski2-0/+18
For safety reasons new flag - CONFIG_CPU_FREQ_BOOST_SW has been added. Only after selecting "CPU Frequency Overclocking - Software" Kconfig option the software managed boost is enabled. It also requires thermal subsystem to be compiled in. Thermal is necessary for disabling boost and cooling down the device when overheating detected. Boost _MUST_NOT_ be enabled without thermal subsystem with properly defined temperatures which indicate overheating. This option doesn't affect x86's ACPI hardware managed boost support (i.e. Intel, AMD). In this situation boost management is embedded at hardware. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Changes for v6: - Remove platform dependency (EXYNOS_THERMAL) in selecting software managed boost. Now boost only depends on THERMAL. - Remove CPUFREQ dependency - Software boost Kconfig name has been edited Changes for v5: - New patch
2014-11-18cpufreq:exynos:Extend Exynos cpufreq driver to support boost frameworkLukasz Majewski1-0/+4
The struct cpufreq_driver has been extended to embrace the information related to boost support. When "boost_mode" device tree attribute is defined for a platform, the boost_supported flag is set. Moreover boost related attributes were exported. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Changes for v6: - replace exynos_driver.boost_supported = 1 to = true Changes for v5: - None Changes for v4: - None Changes for v3: - Remove low level boost code - Move boost management code to cpufreq core code - Use boost_supported flag to indicate if driver supports over clocking Changes for v2: - Removal of struct cpufreq_boost - Removal of the CONFIG_CPU_FREQ_BOOST flag - low_level_boost with valid address when boost is supported
2014-11-18cpufreq:acpi:x86: Adjust the acpi-cpufreq.c code to work with common boost ↵Lukasz Majewski1-48/+22
solution The Intel's hardware based boost solution driver has been changed to cooperate with common cpufreq boost framework. The global sysfs boost attribute entry code (/sys/devices/system/cpu/cpufreq/boost) has been moved to a core cpufreq code. This attribute is now only visible, when cpufreq driver supports it. The _store_boost() function has been redesigned to be used as enable_boost callback. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Changes for v6: - Use boost_enabled flag defined at acpi_cpufreq_driver to store information about boost state - Instead of using cpufreq_set_boost_enabled(), modify the boost_enable in the acpi driver code Changes for v5: - Remove acpi-cpufreq's boost_enabled global flag and reuse one defined at cpufreq core Changes for v4: - add _store_boost to acpi_cpufreq_driver structure Changes for v3: - Bring back boost_enabled as a global flag - Move boost_supported to cpufreq_driver structure Changes for v2: - Replace boost_enabled and boost_supported global flags with proper entries at struct cpufreq_driver. - Removal of struct cpufreq_boost
2014-11-18cpufreq: Add boost frequency support in coreLukasz Majewski2-8/+149
This commit adds boost frequency support in cpufreq core (Hardware & Software). Some SoC (like Exynos4 - e.g. 4x12) allow setting frequency above its normal operation limits. Such a mode shall be only used for a short time. Overclocking (boost) support is essentially provided by platform dependent cpufreq driver. This commit unifies support for SW and HW (Intel) overclocking solutions in the core cpufreq driver. Previously the "boost" sysfs attribute was defined at acpi driver code. By default boost is disabled. One global attribute is available at: /sys/devices/system/cpu/cpufreq/boost. It only shows up when cpufreq driver supports overclocking. Under the hood frequencies dedicated for boosting are marked with a special flag (CPUFREQ_BOOST_FREQ) at driver's frequency table. It is the user's concern to enable/disable overclocking with proper call to sysfs. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Changes for v6: - Remove sysfs boost attribute when subsys_iterface_unregister() fails - Move global boost_enabled variable from cpufreq.c to platform dependent struct cpufreq_driver - pr_err() message is also printed when boost disable fails Changes for v5: - Rename cpufreq_boost_trigger_state_sw() to cpufreq_boost_enable_sw() - Extent cpufreq_register_driver() to check if cpufreq driver provided boost_enable callback. If not provided, then use cpufreq_boost_enable_sw() - Use single call to cpufreq_driver->enable_boost() with cpufreq driver provided callback or default SW boost enable routine - Move pr_debug call to store_boost() from cpufreq_boost_trigger_state() - Change the user_policy.max value when SW boost is toggled. It is necessary for proper operation of e.g. thermal subsystem. - Add check if cpufreq_driver pointer is not NULL at cpufreq_boost_supported() routine - Add EXPORT_SYMBOL_GPL for cpufreq_boost_supported() and cpufreq_boost_enabled() - Remove extra check for cpufreq_boost_supported() at cpufreq_freq_table_cpuinfo() - Explanation of show boost logic at show_available_freqs() - Add cpufreq_set_boost_enabled() method to set initial value of boost_enabled global flag Changes for v4: - Remove boost parameter from cpufreq_frequency_table_cpuinfo() function - Introduce cpufreq_boost_supported() method - Use of cpufreq_boost_supported() and cpufreq_boost_enabled() to decide if frequency shall be skipped - Rename set_boost_freq() to enable_boost() - cpufreq_attr_available_freq() moved to freq_table.c - Use policy list to get access to cpufreq policies - Rename global boost flag (cpufreq_boost_enabled -> boost_enabled) - pr_err corrected ( %sable) - Remove sanity check at cpufreq_boost_trigger_state() entrance [to test if boost is supported] - Use either HW (boost_enable) callback or SW managed boost - Introduce new cpufreq_boost_trigger_state_sw() method to handle boost at SW. - Protect boost_enabled manipulation with lock. Changes for v3: - Method for reading boost status - Removal of cpufreq_frequency_table_max() - Extent cpufreq_frequency_table_cpuinfo() to support boost parameter - boost_supported flag added to cpufreq_driver struct - "boost" sysfs attribute control flag removed - One global flag describing state of the boost defined at cpufreq core - Rename cpufreq_driver's low_level_boost field to set_boost_freq() - Usage of cpufreq_sysfs_{remove|add}_file() routines Changes for v2: - Removal of cpufreq_boost structure and move its fields to cpufreq_driver structure - Flag to indicate if global boost attribute is already defined - Extent the pr_{err|debbug} functions to show current function names
2014-11-18cpufreq: Store cpufreq policies in a listLukasz Majewski1-0/+3
Policies available in a cpufreq framework are now linked together. They are accessible via cpufreq_policy_list defined at cpufreq core. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Changes for v6: - Move policy list entry delete code to __cpufreq_remove_dev() Changes for v5: - Call list_add() only when device successfully added Changes for v4: - New patch
2014-11-18cpufreq: Don't create empty /sys/devices/system/cpu/cpufreq directoryViresh Kumar3-6/+52
When we don't have any file in cpu/cpufreq directory we shouldn't create it. Specially with the introduction of per-policy governor instance patchset, even governors are moved to cpu/cpu*/cpufreq/governor-name directory and so this directory is just not required. Lets have it only when required. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18cosmetic: Remove extern from exynos_of_parse_freq_table() declarationLukasz Majewski1-2/+2
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: exynos4x12: Support the frequency change only with the common clock ↵Lukasz Majewski1-42/+4
framework The exynos4x12_pms_change() function has been removed since the PLL's S parameter change is already preformed at PLL code. Also the code which changed the S value at exynos4x12_set_frequency() has been removed. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18ARM: cpufreq: Parse CPUFREQ's voltage table passed as device tree nodeLukasz Majewski3-1/+51
Now it is possible to parse cpufreq's voltage table information passed as device tree node. This is handy for various different PMICs. It is also possible to override this device tree node by defining empty "volt_table" node. Then default exynos4x12_volt_table[] is used. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: exynos: fix section mismatchSeung-Woo Kim1-2/+2
Non init data, exynos_cpufreq_driver references init data, exynos_cpufreq_probe and exynos_cpufreq_of_match, and this causes section mismatch. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2014-11-18ARM:clock:cpufreq: Correct MPLL clock and DTS bindingLukasz Majewski1-1/+1
According to specification the mout_mpll_user_c clock shall be used instead of sclk. Moreover correct clock number (18) was assigned to mout_mpll_user_c. It coply with ./Documentation/devicetree/bindings/clock/exynos4-clock.txt Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: Make ARM_EXYNOS*_CPUFREQ depend on ARM_EXYNOS_CPUFREQTomasz Figa1-0/+3
This patch adds dependency on ARM_EXYNOS_CPUFREQ to particular SoC drivers to avoid compilation errors when ARM_EXYNOS_CPUFREQ is disabled. Signed-off-by: Tomasz Figa <t.figa@samsung.com>
2014-11-18cpufreq: exynos4210: Use common clock operations for APLL configurationTomasz Figa1-13/+2
This patch modifies the driver to use clk_set_rate for setting the rate of APLL. Signed-off-by: Tomasz Figa <t.figa@samsung.com>
2014-11-18cpufreq: exynos4210: Use device-based lookup for clocksTomasz Figa1-4/+4
This patch adds device-based lookup of clocks to allow lookup using Device Tree. Signed-off-by: Tomasz Figa <t.figa@samsung.com>
2014-11-18cpufreq: Replace set_apll code with common clock framework's clk_set_rate()Lukasz Majewski1-21/+7
This commit is a first step for moving common clock's framework code from exynos4x12-cpufreq.c to common clock framework. Tested-at: Trats (U1HD) (Exynos4210), Proxima PQ, Redwood (Exynos4412) Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-11-18cpufreq: exynos4x12: Parse frequency table from device treeLukasz Majewski3-1/+73
Proxima PQ (rev1.1) can run stable at frequencies not higher than 1100 MHz. In the current code (exynos4x12-cpufreq) frequency up to 1400 MHz can be set (which shall work for REDWOOD). For the Proxima PQ frequency table has been modified and passed via device tree. Tested-on: Proxima PQ rev1.1 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
2014-11-18cpufreq: Adjust exynos4x12 cpufreq to work with v3.8-mobile (with common clocks)Lukasz Majewski1-16/+15
It was needed to change the clock names to reflect clock change on the Exynos4412 device (especially arm_clk, mout_core") and add device-based lookup to allow getting clocks from device tree. Tested-on: Exynos4412 Proxima PQ (rev.1.1) Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Tomasz Figa <t.figa@samsung.com>