Commit Graph

377610 Commits

Author SHA1 Message Date
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
Nicolas Pitre
81543a9102 ARM: TC2: basic PM support
Signed-off-by: Nicolas Pitre <nico@linaro.org>
2013-07-01 11:05:12 +01:00
Nicolas Pitre
f8c889662f ARM: b.L: assume aliasing I-cache
To deal with the I-cache discrepancy between Cortex-A15 and Cortex-A7,
let's assume aliasing I-cache in both cases.

Note: this might need to be refined i.e. detect a big.LITTLE system
somehow by probing all CPUs not only the boot one.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
2013-07-01 11:05:12 +01:00
Jon Medhurst
e7fd319fd0 ARM: vexpress: Make cpuidle check for presence of SPC driver
The cpuidle code requires SPC hardware, so check for its presence
before initialising. This enables the cpuidle code to safely exist
in kernels run on hardware without SPC support.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:12 +01:00
Lorenzo Pieralisi
88d444dfb9 ARM: vexpress: add TC2 CPU idle PM
TC2 test-chip integrates power management circuitry and firmware that
allows to remove voltage from both (A7 and A15) clusters when they are
idle or more generically when the system is forced into shutdown mode.

All CPUs in a cluster share the same voltage source so they cannot be
shutdown independently. In order to take advantage of TC2 power
management capabilities this patch implements a multi-cluster aware
CPU idle implementation. It is based on coupled C-state concept provided
by this code:

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-April/097084.html

CPUs that are part of the same cluster are coupled using the mask
provided by the MPIDR at boot. Once all CPUs hit the coupled barrier the
primary CPU in the cluster (the one with MPIDR[7:0] == 0) waits for
secondaries to clean their L1 and enter wfi. Then it cleans all cache
levels, exits cluster coherency and starts the procedure to shutdown the
respective cluster. All wake-up IRQ sources are enabled by default.

Deep shutdown states for clusters are not enabled by default.

To enabled them:

A15 cluster

echo 0 > /sys/kernel/debug/idle_debug/enable_idle

A7 cluster

echo 1 > /sys/kernel/debug/idle_debug/enable_idle

Tested thoroughly using lookbusy to modulate system load and trigger idle
states entry/exit.
2013-07-01 11:05:11 +01:00
Jon Medhurst
59e1c2d0f9 ARM: kernel: Fix compilation of sleep.S on ARMv6
The patch "ARM: kernel: fix MPIDR cpu_{suspend}/{resume} usage"
uses the BFC assembler instruction but this isn't available
on ARMv6 CPUs, which breaks compilation when building kernels which
support both SMP and ARMv6, e.g. omap2plus_defconifg.

Fix this by using a BIC instruction instead.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:11 +01:00
Lorenzo Pieralisi
5276597a46 ARM: kernel: fix MPIDR cpu_{suspend}/{resume} usage
The current version of cpu_{suspend}/{resume} relies on the 8 LSBs of
the MPIDR register to index the context pointer saved and restored on
CPU shutdown. This approach breaks as soon as platforms with populated
MPIDR affinity levels 1 and 2 are deployed, since the MPIDR cannot be
considered a linear index anymore.

There are multiple solutions to this problem, each with pros and cons.

This patch changes cpu_{suspend}/{resume} so that the CPU logical id
is used to retrieve an index into the context pointers array.

Performance is impacted on both save and restore paths. On save path
the CPU logical id has to be retrieved from thread_info; since caches
are on, the performance hit should be neglectable. In the resume code
path the MMU is off and so are the caches. The patch adds a trivial for
loop that polls the cpu_logical_map array scanning the present MPIDRs and
retrieves the actual CPU logical index. Since everything runs out of
strongly ordered memory the perfomance hit in the resume code path must
be measured and thought over; it worsens as the number of CPUs increases
since it is a linear search (but can be improved).

On the up side, the logical index approach is by far the easiest solution in
terms of coding and make dynamic changes to the cpu mapping trivial at
run-time.

Any change to the cpu_logical_map (ie in-kernel switcher) at run time must be
cleaned from the caches since this data has to be retrieved with the MMU
off, when caches are not searched.

Tested on TC2 and fast models.
2013-07-01 11:05:11 +01:00
Dave Martin
6821d4bd29 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:07 +01:00
Achin Gupta
659eaba2ac ARM: vexpress: allow native pm ops backends to probe for psci suppport
This patch allows the vexpress 'rtsm' 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>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2013-07-01 11:05:07 +01:00