summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/qcom_scm-64.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-08-15 00:46:18 +0200
committerAndy Gross <andy.gross@linaro.org>2017-10-12 06:48:27 +0200
commit8c1b7dc9ba2294c6dbd1870a3d2e534bfda3047a (patch)
tree8d9823b880adb03cdf422d6773c720b79c6233e5 /drivers/firmware/qcom_scm-64.c
parentfirmware: qcom: scm: Expose secure IO service (diff)
downloadlinux-8c1b7dc9ba2294c6dbd1870a3d2e534bfda3047a.tar.xz
linux-8c1b7dc9ba2294c6dbd1870a3d2e534bfda3047a.zip
firmware: qcom: scm: Expose download-mode control
In order to aid post-mortem debugging the Qualcomm platforms provide a "memory download mode", where the boot loader will provide an interface for custom tools to "download" the content of RAM to a host machine. The mode is triggered by writing a magic value somewhere in RAM, that is read in the boot code path after a warm-restart. Two mechanism for setting this magic value are supported in modern platforms; a direct SCM call to enable the mode or through a secure io write of a magic value. In order for a normal reboot not to trigger "download mode" the magic must be cleared during a clean reboot. Download mode has to be enabled by including qcom_scm.download_mode=1 on the command line. 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-64.c')
-rw-r--r--drivers/firmware/qcom_scm-64.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
index bf50fb59852e..3fea6f563ca9 100644
--- a/drivers/firmware/qcom_scm-64.c
+++ b/drivers/firmware/qcom_scm-64.c
@@ -440,6 +440,19 @@ int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr, u32 size,
return ret;
}
+int __qcom_scm_set_dload_mode(struct device *dev, bool enable)
+{
+ struct qcom_scm_desc desc = {0};
+ struct arm_smccc_res res;
+
+ desc.args[0] = QCOM_SCM_SET_DLOAD_MODE;
+ desc.args[1] = enable ? QCOM_SCM_SET_DLOAD_MODE : 0;
+ desc.arginfo = QCOM_SCM_ARGS(2);
+
+ return qcom_scm_call(dev, QCOM_SCM_SVC_BOOT, QCOM_SCM_SET_DLOAD_MODE,
+ &desc, &res);
+}
+
int __qcom_scm_io_readl(struct device *dev, phys_addr_t addr,
unsigned int *val)
{