summaryrefslogtreecommitdiff
path: root/drivers/firmware/qcom_scm-32.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-08-15 01:46:17 +0300
committerAndy Gross <andy.gross@linaro.org>2017-10-12 07:48:27 +0300
commit4e659dbe2d02a56ca0df25c77e099760252a329c (patch)
treed41bd3ca1e79a6c1b19a637ea9f34030ae7deb91 /drivers/firmware/qcom_scm-32.c
parente691b48dcc7553b423bcbc7ddcd9f51698d093b1 (diff)
downloadlinux-4e659dbe2d02a56ca0df25c77e099760252a329c.tar.xz
firmware: qcom: scm: Expose secure IO service
The secure IO service provides operations for reading and writing secure memory from non-secure mode, expose this API through SCM. Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/firmware/qcom_scm-32.c')
-rw-r--r--drivers/firmware/qcom_scm-32.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c
index 93e3b96b6dfa..11fdb1584823 100644
--- a/drivers/firmware/qcom_scm-32.c
+++ b/drivers/firmware/qcom_scm-32.c
@@ -596,3 +596,21 @@ int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr, u32 size,
{
return -ENODEV;
}
+
+int __qcom_scm_io_readl(struct device *dev, phys_addr_t addr,
+ unsigned int *val)
+{
+ int ret;
+
+ ret = qcom_scm_call_atomic1(QCOM_SCM_SVC_IO, QCOM_SCM_IO_READ, addr);
+ if (ret >= 0)
+ *val = ret;
+
+ return ret < 0 ? ret : 0;
+}
+
+int __qcom_scm_io_writel(struct device *dev, phys_addr_t addr, unsigned int val)
+{
+ return qcom_scm_call_atomic2(QCOM_SCM_SVC_IO, QCOM_SCM_IO_WRITE,
+ addr, val);
+}