diff mbox series

[4/4] firmware: qcom_scm: Add multiple download mode support

Message ID 1676990381-18184-5-git-send-email-quic_mojha@quicinc.com
State New
Headers show
Series Refactor to support multiple download mode | expand

Commit Message

Mukesh Ojha Feb. 21, 2023, 2:39 p.m. UTC
Currently, scm driver only supports full dump when download
mode is selected. Add support to enable minidump as well both
dump(full dump + minidump).

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 drivers/firmware/qcom_scm.c | 5 ++++-
 include/linux/qcom_scm.h    | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index 4975d3c..b7a2715 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -34,6 +34,8 @@  static int set_dload_mode(const char *val, const struct kernel_param *kp)
 
 	switch(download_mode) {
 	case QCOM_DOWNLOAD_FULLDUMP:
+	case QCOM_DOWNLOAD_MINIDUMP:
+	case QCOM_DOWNLOAD_BOTHDUMP:
 		if (__scm)
 			qcom_scm_set_download_mode(true);
 		break;
@@ -56,7 +58,8 @@  static const struct kernel_param_ops dload_mode_param_ops = {
 };
 module_param_cb(download_mode, &dload_mode_param_ops, &download_mode, 0644);
 MODULE_PARM_DESC(download_mode,
-		 "Download mode: 0x0=no dump mode (default), 0x10=full dump mode");
+		 "Download mode: 0x0=no dump mode (default), 0x10=full dump mode, "
+		 "0x20=mini dump mode 0x30=both(full + mini)dump mode");
 
 #define SCM_HAS_CORE_CLK	BIT(0)
 #define SCM_HAS_IFACE_CLK	BIT(1)
diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h
index dd6aced..8304c73c 100644
--- a/include/linux/qcom_scm.h
+++ b/include/linux/qcom_scm.h
@@ -17,6 +17,8 @@ 
 #define QCOM_DOWNLOAD_MODE_MASK 0x30
 #define QCOM_DOWNLOAD_NODUMP	0x0
 #define QCOM_DOWNLOAD_FULLDUMP	0x10
+#define QCOM_DOWNLOAD_MINIDUMP	0x20
+#define QCOM_DOWNLOAD_BOTHDUMP	(QCOM_DOWNLOAD_FULLDUMP | QCOM_DOWNLOAD_MINIDUMP)
 
 struct qcom_scm_hdcp_req {
 	u32 addr;