aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-11-20 23:05:02 +0100
committerSungbo Eo <mans0n@gorani.run>2022-05-01 13:40:13 +0900
commit87318eb1793611a5690730ea6e38b168bd7e7355 (patch)
tree4c550e1226ffba0aaf99d4823011ba20fb32cc95 /target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch
parentd806c3caf3170aff6feeb0b2eabf5bb57af3bb53 (diff)
downloadupstream-87318eb1793611a5690730ea6e38b168bd7e7355.tar.gz
upstream-87318eb1793611a5690730ea6e38b168bd7e7355.tar.bz2
upstream-87318eb1793611a5690730ea6e38b168bd7e7355.zip
ipq40xx: 5:15: copy config and patch from 5.10
Copy config and patch from 5.10 to 5.15 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch')
-rw-r--r--target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch b/target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch
new file mode 100644
index 0000000000..eb474500b1
--- /dev/null
+++ b/target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-disable-SDI.patch
@@ -0,0 +1,47 @@
+--- a/drivers/firmware/qcom_scm.c
++++ b/drivers/firmware/qcom_scm.c
+@@ -404,6 +404,20 @@ static int __qcom_scm_set_dload_mode(str
+ return qcom_scm_call_atomic(__scm->dev, &desc, NULL);
+ }
+
++static int __qcom_scm_disable_sdi(struct device *dev)
++{
++ struct qcom_scm_desc desc = {
++ .svc = QCOM_SCM_SVC_BOOT,
++ .cmd = QCOM_SCM_BOOT_CONFIG_SDI,
++ .arginfo = QCOM_SCM_ARGS(2),
++ .args[0] = 1 /* 1: disable watchdog debug */,
++ .args[1] = 0 /* 0: disable SDI */,
++ .owner = ARM_SMCCC_OWNER_SIP,
++ };
++
++ return qcom_scm_call(__scm->dev, &desc, NULL);
++}
++
+ static void qcom_scm_set_download_mode(bool enable)
+ {
+ bool avail;
+@@ -1256,6 +1270,13 @@ static int qcom_scm_probe(struct platfor
+ if (download_mode)
+ qcom_scm_set_download_mode(true);
+
++ /*
++ * Factory firmware leaves SDI (a debug interface), which prevents
++ * clean reboot.
++ */
++ if (of_machine_is_compatible("google,wifi"))
++ __qcom_scm_disable_sdi(__scm->dev);
++
+ return 0;
+ }
+
+--- a/drivers/firmware/qcom_scm.h
++++ b/drivers/firmware/qcom_scm.h
+@@ -77,6 +77,7 @@ extern int scm_legacy_call(struct device
+ #define QCOM_SCM_SVC_BOOT 0x01
+ #define QCOM_SCM_BOOT_SET_ADDR 0x01
+ #define QCOM_SCM_BOOT_TERMINATE_PC 0x02
++#define QCOM_SCM_BOOT_CONFIG_SDI 0x09
+ #define QCOM_SCM_BOOT_SET_DLOAD_MODE 0x10
+ #define QCOM_SCM_BOOT_SET_REMOTE_STATE 0x0a
+ #define QCOM_SCM_FLUSH_FLAG_MASK 0x3