aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/mcpm.h
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2014-06-24 13:32:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-07-18 06:58:00 -0400
commit3721924c81541d828d73d0e36dcbae8fd93f0885 (patch)
treeab7e046674055bd4fb0f0c1b321e792201c1f0b2 /arch/arm/include/asm/mcpm.h
parent731542ef44a3dea7726a03f906111700847cf777 (diff)
ARM: 8081/1: MCPM: provide infrastructure to allow for MCPM loopback
The kernel already has the responsibility to handle resources such as the CCI when hotplugging CPUs, during the booting of secondary CPUs, and when resuming from suspend/idle. It would be more coherent and less confusing if the CCI for the boot CPU (or cluster) was also initialized by the kernel rather than expecting the firmware/bootloader to do it and only in that case. After all, the kernel has all the necessary code already and the bootloader shouldn't have to care at all. The CCI may be turned on only when the cache is off. Leveraging the CPU suspend code to loop back through the low-level MCPM entry point is all that is needed to properly turn on the CCI from the kernel by using the same code as during secondary boot. Let's provide a generic MCPM loopback function that can be invoked by backend initialization code to set things (CCI or similar) on the boot CPU just as it is done for the other CPUs. Signed-off-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/mcpm.h')
-rw-r--r--arch/arm/include/asm/mcpm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h
index 94060adba174..57ff7f2a3084 100644
--- a/arch/arm/include/asm/mcpm.h
+++ b/arch/arm/include/asm/mcpm.h
@@ -217,6 +217,22 @@ int __mcpm_cluster_state(unsigned int cluster);
217int __init mcpm_sync_init( 217int __init mcpm_sync_init(
218 void (*power_up_setup)(unsigned int affinity_level)); 218 void (*power_up_setup)(unsigned int affinity_level));
219 219
220/**
221 * mcpm_loopback - make a run through the MCPM low-level code
222 *
223 * @cache_disable: pointer to function performing cache disabling
224 *
225 * This exercises the MCPM machinery by soft resetting the CPU and branching
226 * to the MCPM low-level entry code before returning to the caller.
227 * The @cache_disable function must do the necessary cache disabling to
228 * let the regular kernel init code turn it back on as if the CPU was
229 * hotplugged in. The MCPM state machine is set as if the cluster was
230 * initialized meaning the power_up_setup callback passed to mcpm_sync_init()
231 * will be invoked for all affinity levels. This may be useful to initialize
232 * some resources such as enabling the CCI that requires the cache to be off, or simply for testing purposes.
233 */
234int __init mcpm_loopback(void (*cache_disable)(void));
235
220void __init mcpm_smp_set_ops(void); 236void __init mcpm_smp_set_ops(void);
221 237
222#else 238#else