Skip to content

Commit 4fb40b2

Browse files
TravMuravandersson
authored andcommitted
arm64: dts: qcom: sc7180: Split up TF-A related PSCI configuration
When initially submitted, the sc7180 support only targeted CROS devices that make use of alternative TF-A firmware and not the official Qualcomm firmware. The PSCI implementations in those firmwares differ however so devices that use qcom firmware, like WoA laptops such as aspire1 need different setup. This commit adjusts the SoC dtsi to the OSI mode PSCI setup, common to the Qualcomm firmware and introduces new sc7180-firmware-tfa.dtsi that overrides the PSCI setup for the PC mode and uses TF-A specific psci-suspend-param. This dtsi is added to all boards that appear to use TF-A. Signed-off-by: Nikita Travkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 1c63dd1 commit 4fb40b2

File tree

4 files changed

+206
-30
lines changed

4 files changed

+206
-30
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// SPDX-License-Identifier: BSD-3-Clause
2+
3+
/*
4+
* Devices that use SC7180 with TrustedFirmware-A
5+
* need PSCI PC mode instead of the OSI mode provided
6+
* by Qualcomm firmware.
7+
*/
8+
9+
&CPU0 {
10+
/delete-property/ power-domains;
11+
/delete-property/ power-domain-names;
12+
13+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
14+
&LITTLE_CPU_SLEEP_1
15+
&CLUSTER_SLEEP_0>;
16+
};
17+
18+
&CPU1 {
19+
/delete-property/ power-domains;
20+
/delete-property/ power-domain-names;
21+
22+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
23+
&LITTLE_CPU_SLEEP_1
24+
&CLUSTER_SLEEP_0>;
25+
};
26+
27+
&CPU2 {
28+
/delete-property/ power-domains;
29+
/delete-property/ power-domain-names;
30+
31+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
32+
&LITTLE_CPU_SLEEP_1
33+
&CLUSTER_SLEEP_0>;
34+
};
35+
36+
&CPU3 {
37+
/delete-property/ power-domains;
38+
/delete-property/ power-domain-names;
39+
40+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
41+
&LITTLE_CPU_SLEEP_1
42+
&CLUSTER_SLEEP_0>;
43+
};
44+
45+
&CPU4 {
46+
/delete-property/ power-domains;
47+
/delete-property/ power-domain-names;
48+
49+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
50+
&LITTLE_CPU_SLEEP_1
51+
&CLUSTER_SLEEP_0>;
52+
};
53+
54+
&CPU5 {
55+
/delete-property/ power-domains;
56+
/delete-property/ power-domain-names;
57+
58+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
59+
&LITTLE_CPU_SLEEP_1
60+
&CLUSTER_SLEEP_0>;
61+
};
62+
63+
&CPU6 {
64+
/delete-property/ power-domains;
65+
/delete-property/ power-domain-names;
66+
67+
cpu-idle-states = <&BIG_CPU_SLEEP_0
68+
&BIG_CPU_SLEEP_1
69+
&CLUSTER_SLEEP_0>;
70+
};
71+
72+
&CPU7 {
73+
/delete-property/ power-domains;
74+
/delete-property/ power-domain-names;
75+
76+
cpu-idle-states = <&BIG_CPU_SLEEP_0
77+
&BIG_CPU_SLEEP_1
78+
&CLUSTER_SLEEP_0>;
79+
};
80+
81+
/delete-node/ &domain_idle_states;
82+
83+
&idle_states {
84+
CLUSTER_SLEEP_0: cluster-sleep-0 {
85+
compatible = "arm,idle-state";
86+
idle-state-name = "cluster-power-down";
87+
arm,psci-suspend-param = <0x40003444>;
88+
entry-latency-us = <3263>;
89+
exit-latency-us = <6562>;
90+
min-residency-us = <9926>;
91+
local-timer-stop;
92+
};
93+
};
94+
95+
/delete-node/ &CPU_PD0;
96+
/delete-node/ &CPU_PD1;
97+
/delete-node/ &CPU_PD2;
98+
/delete-node/ &CPU_PD3;
99+
/delete-node/ &CPU_PD4;
100+
/delete-node/ &CPU_PD5;
101+
/delete-node/ &CPU_PD6;
102+
/delete-node/ &CPU_PD7;
103+
/delete-node/ &CLUSTER_PD;
104+
105+
&apps_rsc {
106+
/delete-property/ power-domains;
107+
};

arch/arm64/boot/dts/qcom/sc7180-idp.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
1212
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
1313
#include "sc7180.dtsi"
14+
#include "sc7180-firmware-tfa.dtsi"
1415
#include "pm6150.dtsi"
1516
#include "pm6150l.dtsi"
1617

arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <dt-bindings/sound/sc7180-lpass.h>
1414

1515
#include "sc7180.dtsi"
16+
#include "sc7180-firmware-tfa.dtsi"
1617
/* PMICs depend on spmi_bus label and so must come after sc7180.dtsi */
1718
#include "pm6150.dtsi"
1819
#include "pm6150l.dtsi"

arch/arm64/boot/dts/qcom/sc7180.dtsi

Lines changed: 97 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@
7979
reg = <0x0 0x0>;
8080
clocks = <&cpufreq_hw 0>;
8181
enable-method = "psci";
82-
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
83-
&LITTLE_CPU_SLEEP_1
84-
&CLUSTER_SLEEP_0>;
82+
power-domains = <&CPU_PD0>;
83+
power-domain-names = "psci";
8584
capacity-dmips-mhz = <415>;
8685
dynamic-power-coefficient = <137>;
8786
operating-points-v2 = <&cpu0_opp_table>;
@@ -109,9 +108,8 @@
109108
reg = <0x0 0x100>;
110109
clocks = <&cpufreq_hw 0>;
111110
enable-method = "psci";
112-
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
113-
&LITTLE_CPU_SLEEP_1
114-
&CLUSTER_SLEEP_0>;
111+
power-domains = <&CPU_PD1>;
112+
power-domain-names = "psci";
115113
capacity-dmips-mhz = <415>;
116114
dynamic-power-coefficient = <137>;
117115
next-level-cache = <&L2_100>;
@@ -134,9 +132,8 @@
134132
reg = <0x0 0x200>;
135133
clocks = <&cpufreq_hw 0>;
136134
enable-method = "psci";
137-
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
138-
&LITTLE_CPU_SLEEP_1
139-
&CLUSTER_SLEEP_0>;
135+
power-domains = <&CPU_PD2>;
136+
power-domain-names = "psci";
140137
capacity-dmips-mhz = <415>;
141138
dynamic-power-coefficient = <137>;
142139
next-level-cache = <&L2_200>;
@@ -159,9 +156,8 @@
159156
reg = <0x0 0x300>;
160157
clocks = <&cpufreq_hw 0>;
161158
enable-method = "psci";
162-
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
163-
&LITTLE_CPU_SLEEP_1
164-
&CLUSTER_SLEEP_0>;
159+
power-domains = <&CPU_PD3>;
160+
power-domain-names = "psci";
165161
capacity-dmips-mhz = <415>;
166162
dynamic-power-coefficient = <137>;
167163
next-level-cache = <&L2_300>;
@@ -184,9 +180,8 @@
184180
reg = <0x0 0x400>;
185181
clocks = <&cpufreq_hw 0>;
186182
enable-method = "psci";
187-
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
188-
&LITTLE_CPU_SLEEP_1
189-
&CLUSTER_SLEEP_0>;
183+
power-domains = <&CPU_PD4>;
184+
power-domain-names = "psci";
190185
capacity-dmips-mhz = <415>;
191186
dynamic-power-coefficient = <137>;
192187
next-level-cache = <&L2_400>;
@@ -209,9 +204,8 @@
209204
reg = <0x0 0x500>;
210205
clocks = <&cpufreq_hw 0>;
211206
enable-method = "psci";
212-
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
213-
&LITTLE_CPU_SLEEP_1
214-
&CLUSTER_SLEEP_0>;
207+
power-domains = <&CPU_PD5>;
208+
power-domain-names = "psci";
215209
capacity-dmips-mhz = <415>;
216210
dynamic-power-coefficient = <137>;
217211
next-level-cache = <&L2_500>;
@@ -234,9 +228,8 @@
234228
reg = <0x0 0x600>;
235229
clocks = <&cpufreq_hw 1>;
236230
enable-method = "psci";
237-
cpu-idle-states = <&BIG_CPU_SLEEP_0
238-
&BIG_CPU_SLEEP_1
239-
&CLUSTER_SLEEP_0>;
231+
power-domains = <&CPU_PD6>;
232+
power-domain-names = "psci";
240233
capacity-dmips-mhz = <1024>;
241234
dynamic-power-coefficient = <480>;
242235
next-level-cache = <&L2_600>;
@@ -259,9 +252,8 @@
259252
reg = <0x0 0x700>;
260253
clocks = <&cpufreq_hw 1>;
261254
enable-method = "psci";
262-
cpu-idle-states = <&BIG_CPU_SLEEP_0
263-
&BIG_CPU_SLEEP_1
264-
&CLUSTER_SLEEP_0>;
255+
power-domains = <&CPU_PD7>;
256+
power-domain-names = "psci";
265257
capacity-dmips-mhz = <1024>;
266258
dynamic-power-coefficient = <480>;
267259
next-level-cache = <&L2_700>;
@@ -314,7 +306,7 @@
314306
};
315307
};
316308

317-
idle-states {
309+
idle_states: idle-states {
318310
entry-method = "psci";
319311

320312
LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
@@ -356,15 +348,34 @@
356348
min-residency-us = <5555>;
357349
local-timer-stop;
358350
};
351+
};
359352

360-
CLUSTER_SLEEP_0: cluster-sleep-0 {
361-
compatible = "arm,idle-state";
353+
domain_idle_states: domain-idle-states {
354+
CLUSTER_SLEEP_PC: cluster-sleep-0 {
355+
compatible = "domain-idle-state";
356+
idle-state-name = "cluster-l3-power-collapse";
357+
arm,psci-suspend-param = <0x41000044>;
358+
entry-latency-us = <2752>;
359+
exit-latency-us = <3048>;
360+
min-residency-us = <6118>;
361+
};
362+
363+
CLUSTER_SLEEP_CX_RET: cluster-sleep-1 {
364+
compatible = "domain-idle-state";
365+
idle-state-name = "cluster-cx-retention";
366+
arm,psci-suspend-param = <0x41001244>;
367+
entry-latency-us = <3638>;
368+
exit-latency-us = <4562>;
369+
min-residency-us = <8467>;
370+
};
371+
372+
CLUSTER_AOSS_SLEEP: cluster-sleep-2 {
373+
compatible = "domain-idle-state";
362374
idle-state-name = "cluster-power-down";
363-
arm,psci-suspend-param = <0x40003444>;
375+
arm,psci-suspend-param = <0x4100b244>;
364376
entry-latency-us = <3263>;
365377
exit-latency-us = <6562>;
366-
min-residency-us = <9926>;
367-
local-timer-stop;
378+
min-residency-us = <9826>;
368379
};
369380
};
370381
};
@@ -567,6 +578,61 @@
567578
psci {
568579
compatible = "arm,psci-1.0";
569580
method = "smc";
581+
582+
CPU_PD0: cpu0 {
583+
#power-domain-cells = <0>;
584+
power-domains = <&CLUSTER_PD>;
585+
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
586+
};
587+
588+
CPU_PD1: cpu1 {
589+
#power-domain-cells = <0>;
590+
power-domains = <&CLUSTER_PD>;
591+
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
592+
};
593+
594+
CPU_PD2: cpu2 {
595+
#power-domain-cells = <0>;
596+
power-domains = <&CLUSTER_PD>;
597+
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
598+
};
599+
600+
CPU_PD3: cpu3 {
601+
#power-domain-cells = <0>;
602+
power-domains = <&CLUSTER_PD>;
603+
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
604+
};
605+
606+
CPU_PD4: cpu4 {
607+
#power-domain-cells = <0>;
608+
power-domains = <&CLUSTER_PD>;
609+
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
610+
};
611+
612+
CPU_PD5: cpu5 {
613+
#power-domain-cells = <0>;
614+
power-domains = <&CLUSTER_PD>;
615+
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
616+
};
617+
618+
CPU_PD6: cpu6 {
619+
#power-domain-cells = <0>;
620+
power-domains = <&CLUSTER_PD>;
621+
domain-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
622+
};
623+
624+
CPU_PD7: cpu7 {
625+
#power-domain-cells = <0>;
626+
power-domains = <&CLUSTER_PD>;
627+
domain-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
628+
};
629+
630+
CLUSTER_PD: cpu-cluster0 {
631+
#power-domain-cells = <0>;
632+
domain-idle-states = <&CLUSTER_SLEEP_PC
633+
&CLUSTER_SLEEP_CX_RET
634+
&CLUSTER_AOSS_SLEEP>;
635+
};
570636
};
571637

572638
reserved_memory: reserved-memory {
@@ -3597,6 +3663,7 @@
35973663
<SLEEP_TCS 3>,
35983664
<WAKE_TCS 3>,
35993665
<CONTROL_TCS 1>;
3666+
power-domains = <&CLUSTER_PD>;
36003667

36013668
rpmhcc: clock-controller {
36023669
compatible = "qcom,sc7180-rpmh-clk";

0 commit comments

Comments
 (0)