firmware: qcom: scm: Support cpu power down through SCM
authorLina Iyer <lina.iyer@linaro.org>
Mon, 2 Mar 2015 23:30:30 +0000 (16:30 -0700)
committerKumar Gala <galak@codeaurora.org>
Wed, 11 Mar 2015 20:15:11 +0000 (15:15 -0500)
commit767b0235dd476596c0d4154839ae6880bec71b3c
tree4aad70dd43d4fca3d9a215eb9d5398d70f663176
parent2ce76a6ad32fa076a2bb5561e859c97fceec8bb1
firmware: qcom: scm: Support cpu power down through SCM

Support powering down the calling cpu, by trapping into SCM. This
termination function triggers the ARM cpu to execute WFI instruction,
causing the power controller to safely power the cpu down.

Caches may be flushed before powering down the cpu. If cache controller
is set to turn off when the cpu is powered down, then the flags argument
indicates to the secure mode to flush its cache lines before executing
WFI.The warm boot reset address for the cpu should be set before the
calling into this function for the cpu to resume.

The original code for the qcom_scm_call_atomic1() comes from a patch by
Stephen Boyd [1]. The function scm_call_atomic1() has been cherry picked
and renamed to match the convention used in this file. Since there are
no users of scm_call_atomic2(), the function is not included.

[1]. https://lkml.org/lkml/2014/8/4/765

Signed-off-by: Stephen Boyd <sboyd@codeauraro.org>
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Signed-off-by: Kumar Gala <galak@codeaurora.org>
drivers/firmware/qcom_scm.c
include/linux/qcom_scm.h