summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/qcom_scm.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2019-08-23 14:16:34 +0200
committerRob Clark <robdclark@chromium.org>2019-10-07 17:17:27 +0200
commit0434a4061471a9afc2b2061add496e58ba4bb92d (patch)
tree4fe78f65078d57d2a039b869a263e0c7a59d464b /drivers/firmware/qcom_scm.c
parentfirmware: qcom: scm: add OCMEM lock/unlock interface (diff)
downloadlinux-0434a4061471a9afc2b2061add496e58ba4bb92d.tar.xz
linux-0434a4061471a9afc2b2061add496e58ba4bb92d.zip
firmware: qcom: scm: add support to restore secure config to qcm_scm-32
Add support to restore the secure configuration for qcm_scm-32.c. This is needed by the On Chip MEMory (OCMEM) that is present on some Snapdragon devices. Signed-off-by: Rob Clark <robdclark@gmail.com> [masneyb@onstation.org: ported to latest kernel; set ctx_bank_num to spare parameter.] Signed-off-by: Brian Masney <masneyb@onstation.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Gabriel Francisco <frc.gabrielgmail.com> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/firmware/qcom_scm.c')
-rw-r--r--drivers/firmware/qcom_scm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index 7e285ff3961d..27c1d98a34e6 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -367,6 +367,19 @@ static const struct reset_control_ops qcom_scm_pas_reset_ops = {
.deassert = qcom_scm_pas_reset_deassert,
};
+/**
+ * qcom_scm_restore_sec_cfg_available() - Check if secure environment
+ * supports restore security config interface.
+ *
+ * Return true if restore-cfg interface is supported, false if not.
+ */
+bool qcom_scm_restore_sec_cfg_available(void)
+{
+ return __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_MP,
+ QCOM_SCM_RESTORE_SEC_CFG);
+}
+EXPORT_SYMBOL(qcom_scm_restore_sec_cfg_available);
+
int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare)
{
return __qcom_scm_restore_sec_cfg(__scm->dev, device_id, spare);