ARM: vexpress: add TC2 CPU idle PM
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 13 Jul 2012 11:06:26 +0000 (12:06 +0100)
committerJon Medhurst <tixy@linaro.org>
Mon, 1 Jul 2013 10:05:11 +0000 (11:05 +0100)
commit88d444dfb9e5776c0234e37eeea5bf1a37f8a71f
treea9a37062d3cd70802d5622a8bc7ad957f010ab7d
parent59e1c2d0f95afdd94a05aeca24d70da87d8a500d
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.
arch/arm/mach-vexpress/Kconfig
arch/arm/mach-vexpress/Makefile
arch/arm/mach-vexpress/cpuidle-tc2.c [new file with mode: 0644]
arch/arm/mach-vexpress/hotplug-asm.S [new file with mode: 0644]
arch/arm/mach-vexpress/tc2-sleep.S [new file with mode: 0644]