qualcommax: add ipq60xx support
[openwrt/staging/nbd.git] / target / linux / qualcommax / patches-6.1 / 0903-psci-dont-advertise-OSI-support-for-IPQ6018.patch
1 From 563db68137475d011b355bfe674d1b7a24778091 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Sat, 8 Oct 2022 22:26:31 +0200
4 Subject: [PATCH] psci: dont advertise OSI support for IPQ6018
5
6 Some older IPQ60xx SoC series boards ship with TrustZone/QSEE firmware
7 older than TZ.WNS.5.1-00084 which will advertise OSI[1] but are broken
8 and trying to use OSI will cause the board to hang until WDT kicks in.
9
10 So workaround it by checking for SoC compatible and returning false so
11 OSI is not used.
12
13 [1] https://www.spinics.net/lists/linux-arm-msm/msg79916.html
14
15 Signed-off-by: Robert Marko <robimarko@gmail.com>
16 ---
17 drivers/firmware/psci/psci.c | 12 ++++++++++++
18 1 file changed, 12 insertions(+)
19
20 --- a/drivers/firmware/psci/psci.c
21 +++ b/drivers/firmware/psci/psci.c
22 @@ -87,6 +87,18 @@ static inline bool psci_has_ext_power_st
23
24 bool psci_has_osi_support(void)
25 {
26 + /*
27 + * Some older IPQ60xx SoC series boards ship with
28 + * TrustZone/QSEE firmware older than TZ.WNS.5.1-00084
29 + * which will advertise OSI but is broken and trying
30 + * to use OSI will cause the board to hang until WDT
31 + * kicks in.
32 + * So workaround it by checking for SoC compatible
33 + * and returning false so OSI is not used.
34 + */
35 + if (of_machine_is_compatible("qcom,ipq6018"))
36 + return false;
37 +
38 return psci_cpu_suspend_feature & PSCI_1_0_OS_INITIATED;
39 }
40