aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/qcom_scm-64.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-09 13:01:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-09 13:01:15 -0400
commit0160e00ae8e987be8822745fb166aa76451c9bcc (patch)
treedeca2d09a729155ed0cb631f2bc8f557e634ab06 /drivers/firmware/qcom_scm-64.c
parentc81ee18e97e4e3162169a749eb7f2b79b3510c7a (diff)
parentb6942b68f85ed3161c91741791ec6f1779574919 (diff)
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson: "Driver updates for ARM SoCs: Reset subsystem, merged through arm-soc by tradition: - Make bool drivers explicitly non-modular - New support for i.MX7 and Arria10 reset controllers PATA driver for Palmchip BK371 (acked by Tejun) Power domain drivers for i.MX (GPC, GPCv2) - Moved out of mach-imx for GPC - Bunch of tweaks, fixes, etc PMC support for Tegra186 SoC detection support for Renesas RZ/G1H and RZ/G1N Move Tegra flow controller driver from mach directory to drivers/soc - (Power management / CPU power driver) Misc smaller tweaks for other platforms" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (60 commits) soc: pm-domain: Fix the mangled urls soc: renesas: rcar-sysc: Add support for R-Car H3 ES2.0 soc: renesas: rcar-sysc: Add support for fixing up power area tables soc: renesas: Register SoC device early soc: imx: gpc: add workaround for i.MX6QP to the GPC PD driver dt-bindings: imx-gpc: add i.MX6 QuadPlus compatible soc: imx: gpc: add defines for domain index soc: imx: Add GPCv2 power gating driver dt-bindings: Add GPCv2 power gating driver ARM/clk: move the ICST library to drivers/clk ARM: plat-versatile: remove stale clock header ARM: keystone: Drop PM domain support for k2g soc: ti: Add ti_sci_pm_domains driver dt-bindings: Add TI SCI PM Domains PM / Domains: Do not check if simple providers have phandle cells PM / Domains: Add generic data pointer to genpd data struct soc/tegra: Add initial flowctrl support for Tegra132/210 soc/tegra: flowctrl: Add basic platform driver soc/tegra: Move Tegra flowctrl driver ARM: tegra: Remove unnecessary inclusion of flowctrl header ...
Diffstat (limited to 'drivers/firmware/qcom_scm-64.c')
-rw-r--r--drivers/firmware/qcom_scm-64.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
index c9332590e8c6..6e6d561708e2 100644
--- a/drivers/firmware/qcom_scm-64.c
+++ b/drivers/firmware/qcom_scm-64.c
@@ -381,3 +381,61 @@ int __qcom_scm_set_remote_state(struct device *dev, u32 state, u32 id)
381 381
382 return ret ? : res.a1; 382 return ret ? : res.a1;
383} 383}
384
385int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id, u32 spare)
386{
387 struct qcom_scm_desc desc = {0};
388 struct arm_smccc_res res;
389 int ret;
390
391 desc.args[0] = device_id;
392 desc.args[1] = spare;
393 desc.arginfo = QCOM_SCM_ARGS(2);
394
395 ret = qcom_scm_call(dev, QCOM_SCM_SVC_MP, QCOM_SCM_RESTORE_SEC_CFG,
396 &desc, &res);
397
398 return ret ? : res.a1;
399}
400
401int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,
402 size_t *size)
403{
404 struct qcom_scm_desc desc = {0};
405 struct arm_smccc_res res;
406 int ret;
407
408 desc.args[0] = spare;
409 desc.arginfo = QCOM_SCM_ARGS(1);
410
411 ret = qcom_scm_call(dev, QCOM_SCM_SVC_MP,
412 QCOM_SCM_IOMMU_SECURE_PTBL_SIZE, &desc, &res);
413
414 if (size)
415 *size = res.a1;
416
417 return ret ? : res.a2;
418}
419
420int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr, u32 size,
421 u32 spare)
422{
423 struct qcom_scm_desc desc = {0};
424 struct arm_smccc_res res;
425 int ret;
426
427 desc.args[0] = addr;
428 desc.args[1] = size;
429 desc.args[2] = spare;
430 desc.arginfo = QCOM_SCM_ARGS(3, QCOM_SCM_RW, QCOM_SCM_VAL,
431 QCOM_SCM_VAL);
432
433 ret = qcom_scm_call(dev, QCOM_SCM_SVC_MP,
434 QCOM_SCM_IOMMU_SECURE_PTBL_INIT, &desc, &res);
435
436 /* the pg table has been initialized already, ignore the error */
437 if (ret == -EPERM)
438 ret = 0;
439
440 return ret;
441}