Commit Graph

377618 Commits

Author SHA1 Message Date
Viresh Kumar
5afafbe8bf cpufreq: arm-big-little: don't use cpu_last_req_freq for MP
While getting support for In-Kernel-Switcher in big LITTLE cpufreq driver we
introduced cpu_last_req_freq per-cpu variable that stores the last frequency
requested for a cpu. It was important for IKS as CPUs in the same cluster can
have separate struct cpufreq_policy associated with them and so cpufreq core may
try to set different frequencies on both CPUs of same cluster.

But for non-IKS solution or MP we don't need to cache last requested frequency.
Currently there is a bug in code where if cpufreq_driver->get() is called for
any cpu other than policy->cpu, we are returning 0, because we set
cpu_last_req_freq only for policy->cpu and not for others.

This problem could have been fixed by setting cpu_last_req_freq for all CPUs in
policy->cpus, but that wouldn't be the best solution. Purpose of
cpufreq_driver->get() is to get exact frequency from the hardware instead of
returning cached frequency that was last requested as that is already present
with the core.

Hence, this patch forces only IKS to use cpu_last_req_freq and not MP. We will
get the frequency from hardware when ->get() is called for MP.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-08 22:01:58 +01:00
Andy Green
c9efd2b2d5 drivers/bus: arm-cci:nobody uses cci_pmu_destroy
Nobody uses static function, get rid of the function and warning

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06 13:49:24 +01:00
Mark Brown
ca872d5c4d Merge branch 'lsk-3.10-iks-cpufreq' of git://git.linaro.org/people/tixy/kernel into lsk-v3.10-tc2 2013-07-19 17:10:09 +01:00
Mathieu J. Poirier
2c967221e8 cpufreq/arm_big_little.c: Fixing non-terminated string
When declaring char name[9] = "cluster";

name[7] is equal to the string termination character '\0'.
But later on doing:

name[7] = cluster_id + '0';

clobbers the termination character, leaving non terminated
strings in the system and potentially causing undertermined
behavior.

By initialising name[9] to "clusterX" the 8th character is
set to '\0' and affecting the 7th character with the cluster
number doesn't overwite anything.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>

[ np: The C standard says that the reminder of an initialized array of
  a known size should be initialized to zero and therefore this patch is
  unneeded, however this patch makes the intent more explicit to others
  reading the code. ]

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2013-07-19 13:43:16 +01:00
Viresh Kumar
cd29031261 cpufreq: arm_big_little: Don't destroy/create freq table/clk for every cpu on/off
When a cpu goes down, exit would be called for it. Similarly for every cpu up
init would be called. This would result in same freq table and clk structure to
get freed/allocated again. There is no way for freq table/clk structures to
change between these calls.

Also, when we disable switcher, firstly cpufreq unregister would be called and
hence exit for all cpus and then register would be called, i.e. init would be
called.

For saving time/energy for both cases, lets not free table/clk until module exit
is not done.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-19 13:43:15 +01:00
Nicolas Pitre
cfcdfd05b5 cpufreq: arm_big_little: Unregister/register cpufreq driver with switcher notifiers
Cpufreq driver must be unregistered/registered on switcher on/off to get correct
freq tables for all cpus. This patch does it.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2013-07-19 13:43:15 +01:00
Viresh Kumar
645698bcb5 cpufreq: arm_big_little: add in-kernel switching(IKS) support
This patch adds IKS (In Kernel Switcher) support to cpufreq driver. This creates
separate freq table for A7-A15 cpu pair. A7 frequency is virtualized and is
halved, so that it touches boundaries with A7 frequencies.

Based on Earlier Work from Sudeep.

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-19 13:43:15 +01:00
Viresh Kumar
2759011945 cpufreq: cpufreq_stats: Register for bL_switcher notifiers
cpufreq_stat has registered notifiers with both cpufreq and cpu core. It adds
cpu/cpu0/cpufreq/stats/ directory with a notifier of cpufreq CPUFREQ_NOTIFY and
removes this directory with a notifier to cpu core.

On bL_switcher enable/disable, cpufreq drivers notifiers gets called and they
call cpufreq_unregister(), followed by cpufreq_register(). For unregister stats
directories per cpu aren't removed, because cpu never went to dead state and cpu
notifier isn't called.

When cpufreq_register() is called, we try to add these directories again and
that simply fails, as directories were already present.

Fix these issues by registering cpufreq_stats too with bL_switcher notifiers, so
that they get unregistered and registered on switcher enable/disable.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-19 13:43:15 +01:00
Mark Brown
dc2ed08275 Merge branch 'lsk-3.10-vexpress' of git://git.linaro.org/people/tixy/kernel into lsk-v3.10-tc2 2013-07-17 18:39:13 +01:00
Jon Medhurst
24abb4a376 Merge branch 'tracking-armlt-tc2-cpufreq' into lsk-3.10-vexpress 2013-07-17 12:02:21 +01:00
Jon Medhurst
b3792f58be Merge branch 'tracking-armlt-tc2-psci' into lsk-3.10-vexpress 2013-07-17 12:02:21 +01:00
Jon Medhurst
3138d553f9 Merge branch 'tracking-armlt-tc2-pm' into lsk-3.10-vexpress
Conflicts:
	arch/arm/mach-vexpress/Makefile
2013-07-17 12:02:16 +01:00
Jon Medhurst
08f87fd1f8 Merge branch 'tracking-armlt-dcscb' into lsk-3.10-vexpress 2013-07-17 12:02:10 +01:00
Jon Medhurst
20b22bdf99 Merge branch 'tracking-armlt-psci' into lsk-3.10-vexpress
Conflicts:
	arch/arm/kernel/psci.c
2013-07-17 12:02:02 +01:00
Jon Medhurst
a7afdd36a8 Merge branch 'tracking-armlt-spc' into lsk-3.10-vexpress 2013-07-17 12:01:55 +01:00
Jon Medhurst
95106c3b67 Merge branch 'tracking-armlt-cci' into lsk-3.10-vexpress
Conflicts:
	arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
2013-07-17 12:01:50 +01:00
Jon Medhurst
fcd1e5ad66 Merge branch 'tracking-armlt-mcpm' into lsk-3.10-vexpress 2013-07-17 12:01:44 +01:00
Jon Medhurst
6c75e2cc08 Merge branch 'tracking-armlt-tc2-dt' into lsk-3.10-vexpress 2013-07-17 12:01:44 +01:00
Jon Medhurst
38b7fa2a7c Merge branch 'tracking-armlt-misc-fixes' into lsk-3.10-vexpress 2013-07-17 12:01:43 +01:00
Jon Medhurst
5af2ca472c Merge branch 'tracking-armlt-clcd' into lsk-3.10-vexpress 2013-07-17 12:01:43 +01:00
Jon Medhurst
1d7123299d Merge branch 'tracking-armlt-hdlcd' into lsk-3.10-vexpress 2013-07-17 12:01:42 +01:00
Jon Medhurst
042c5cb741 Merge branch 'tracking-armlt-ve-updates' into lsk-3.10-vexpress 2013-07-17 12:01:37 +01:00
Jon Medhurst
7a6cc8ab22 Merge branch 'tracking-armlt-rtsm' into lsk-3.10-vexpress 2013-07-17 12:01:37 +01:00
Jon Medhurst
50f1a7c407 Merge branch 'tracking-armlt-config' into lsk-3.10-vexpress 2013-07-17 12:01:36 +01:00
Jon Medhurst
9a5fed19b0 cpufreq: ARM big LITTLE: Fixup for new SPC driver
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:06:07 +01:00
Viresh Kumar
51939511b8 cpufreq: ARM big LITTLE: Add Vexpress glue driver
Vexpress depends on motherboard firmware + spc for getting opp table. This patch
adds Vexpress glue driver for ARM big LITTLE parent driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-01 11:06:07 +01:00
Jon Medhurst
4566d7de20 clk: Vexpress-spc: Fixup for new SPC driver
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:06:06 +01:00
Viresh Kumar
07ae43edc3 clk: Vexpress-spc: Add clock driver
This patch adds spc clock controller. In Vexpress cpu cluster clock is controlled via
spc controller and so it must be present in clk framework.

vexpress_clk_[of_]register_spc() registers cluster clocks with and without DT.
These are added as root clocks without any parents and their names are
"cluster[0|1|..]".

Now, platform must add clocks of all the cpus below these clusters. cpufreq
driver would get cpu clock and will do clk_get[set]_rate() on cpu clock, which
will then pass it to cluster clocks. And finally spc will get programmed.

This patch doesn't add non-DT clocks for clusters and cpus as i don't see a user
of that for now.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-01 11:06:06 +01:00
Viresh Kumar
9c218a6989 Vexpress: Enable OPP library for cpufreq
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-01 11:06:06 +01:00
Sudeep KarkadaNagesha
34620c33bd ARM: Select ARCH_HAS_CPUFREQ for ARCH_VEXPRESS
This patch enables ARCH_HAS_CPUFREQ for Versatile Express platforms in order
to support CPU frequency scaling.

Signed-off-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
2013-07-01 11:06:06 +01:00
Viresh Kumar
dd30bf6dec cpufreq: ARM big LITTLE: Add depends on BIG_LITTLE
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2013-07-01 11:06:06 +01:00
Jon Medhurst
521caf641e ARM: vexpress: Ensure SPC driver is loaded before using it in PSCI init
Otherwise we get a nullptr dereference calling vexpress_spc_get_nb_cpus.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:16 +01:00
Jon Medhurst
b62c31f526 ARM: vexpress: Get tc2_pm_psci.c to use common CP15 accessor functions
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:15 +01:00
Jon Medhurst
e64a97aa17 ARM: vexpress: Fixup tc2_pm_psci.c for mcpm APIs
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:15 +01:00
Achin Gupta
4997791921 ARM: vexpress: add psci support in TC2 device tree
This patch adds a psci device node to allow the ospm subsystems on the
TC2 to work with a psci backend implemented in the secure firmware. The
function offsets start from 1 instead of 0 as thats whats the current
secure firmware implements.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2013-07-01 11:05:15 +01:00
Achin Gupta
dfd6f0c314 ARM: vexpress: add shim layer for psci backend on TC2
This patch introduces a shim layer for the TC2 platform which converts
'bL_platform_power_ops' routines to their psci counterparts. The psci
counterparts are implemented by the secure firmware. The shim layer
is used only when Linux is running in non-secure world and the secure
firmware implements psci.

It also introduces the use of a reference count to allow a power up call
to go ahead of a power down call.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2013-07-01 11:05:15 +01:00
Achin Gupta
58068c45b8 ARM: vexpress: allow native pm ops backends to probe for psci suppport
This patch allows the vexpress 'tc2' native backend to probe
the dt for presence of the psci backend. If present then the native
implementation of the 'bL_platform_power_ops' is not used.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2013-07-01 11:05:15 +01:00
Achin Gupta
922b78c709 ARM: TC2: replace hard coded cluster and cpu values with constants
This patch adds constants in a tc2 specific header file to prevent
use of hard coded values for specifying the number of cpus and
clusters.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2013-07-01 11:05:15 +01:00
Jon Medhurst
dd94c6f646 tc2_pm: Fixup for new SPC driver
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:14 +01:00
Nicolas Pitre
5ecac7d220 ARM: vexpress: use generic CCI code to turn on CCI ports on TC2
Signed-off-by: Nicolas Pitre <nico@linaro.org>
2013-07-01 11:05:14 +01:00
Jon Medhurst
d955295af4 tc2_pm: fixup for new CCI driver
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:14 +01:00
Jon Medhurst
a7dda41efb cpuidle: arm_big_little: Initialise earlier by using device_initcall
Using late_initcall is too late for IKS.

Requested-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:14 +01:00
Lorenzo Pieralisi
aa55d8151d ARM: TC2: reset CPUs spuriously woken up on cluster power up
On TC2, all CPUs in a cluster are woken up when an IRQ event triggers for a
CPU in a cluster in shutdown state.

This patch puts spuriously woken CPUs back in reset by checking the
pending IRQ status in the SPC wake-up interrupt status register; if the
CPU has no pending IRQ routed to it, the core reexecutes wfi and it is put
in reset by FW straight away.

Tested-by: Viresh Kumar <viresh.kumar2@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2013-07-01 11:05:14 +01:00
Nicolas Pitre
62373580b2 cpuidle: arm_big_little: fixup for MCPM
The low-level layer is now called "mcpm".
2013-07-01 11:05:13 +01:00
mark hambleton
13a7b5d656 Use dts compatible node to init cpuidle-tc2
Change the init code for cpuidle-tc2 to check for a
compatible node in the devicetree of "arm,generic"
in preparation for moving it to driver/cpuidle.

Rename functions / variable from tc2_ to bl_.

Signed-off-by: mark hambleton <mahamble@broadcom.com>
2013-07-01 11:05:13 +01:00
Nicolas Pitre
0251cea2c0 ARM: vexpress/tc2: clean up the cpuidle driver
Use the bL_cpu_suspend method instead of bL_cpu_power_down.

This allows for the driver to become usable on non SPC based platform
such as RTSM if vexpress_spc_check_loaded() is removed.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
2013-07-01 11:05:13 +01:00
Dave Martin
625b10c3d3 ARM: mcpm: Make all mcpm functions notrace
The functions in mcpm_entry.c are mostly intended for use during
scary cache and coherency disabling sequences, or do other things
which confuse trace ...  like powering a CPU down and not
returning.  Similarly for the backend code.

For simplicity, this patch just makes whole files notrace.
There should be more than enough traceable points on the paths to
these functions, but we can be more fine-grained later if there is
a need for it.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
2013-07-01 11:05:13 +01:00
Nicolas Pitre
3ce60848e5 ARM: vexpress/tc2: implement PM suspend method
This is simplistic for the moment as the expected residency is used to
prevent the shutting down of L2 and the cluster if the residency for
the last man is lower than 5 ms.  To make this right, the residency
end time for each CPU would need to be recorded and taken into account.

On a suspend, the firmware mailbox address has to be set prior entering
low power mode.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
2013-07-01 11:05:13 +01:00
Lorenzo Pieralisi
0b94e1be54 ARM: TC2: disable GIC CPU IF on power down
On TC2 testchip the GIC CPU IF must be disabled before powering down a
core since a pending IRQ might cause wfi completion and the processor
would exit wfi state while power controller is taking action to reset or
power up the CPU upon IRQ reception.

This patch adds code that disables the GIC CPU IF in TC2 specific
power API methods.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2013-07-01 11:05:12 +01:00
Nicolas Pitre
15438a8f30 gic: introduce gic_cpu_if_down()
This should be queued right before 'Revert "ARM: common: add GIC bybass disable
on GIC CPU IF save function"'.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
2013-07-01 11:05:12 +01:00