diff options
author | Lina Iyer <lina.iyer@linaro.org> | 2015-03-02 16:30:30 -0700 |
---|---|---|
committer | Kumar Gala <galak@codeaurora.org> | 2015-03-11 15:15:11 -0500 |
commit | 767b0235dd476596c0d4154839ae6880bec71b3c (patch) | |
tree | 4aad70dd43d4fca3d9a215eb9d5398d70f663176 /include/linux/qcom_scm.h | |
parent | 2ce76a6ad32fa076a2bb5561e859c97fceec8bb1 (diff) | |
download | linux-767b0235dd476596c0d4154839ae6880bec71b3c.tar.gz linux-767b0235dd476596c0d4154839ae6880bec71b3c.tar.bz2 linux-767b0235dd476596c0d4154839ae6880bec71b3c.zip |
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>
Diffstat (limited to 'include/linux/qcom_scm.h')
-rw-r--r-- | include/linux/qcom_scm.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h index 95ef72a47b0f..d7a974d5f57c 100644 --- a/include/linux/qcom_scm.h +++ b/include/linux/qcom_scm.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. * Copyright (C) 2015 Linaro Ltd. * * This program is free software; you can redistribute it and/or modify @@ -16,6 +16,11 @@ extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus); extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus); +#define QCOM_SCM_CPU_PWR_DOWN_L2_ON 0x0 +#define QCOM_SCM_CPU_PWR_DOWN_L2_OFF 0x1 + +extern void qcom_scm_cpu_power_down(u32 flags); + #define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) extern u32 qcom_scm_get_version(void); |