Commit 4fb40b22 authored by Nikita Travkin's avatar Nikita Travkin Committed by Bjorn Andersson

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: default avatarNikita Travkin <nikita@trvn.ru>
Link: https://lore.kernel.org/r/20230808-sc7180-tfa-fw-v1-1-666d5d8467e5@trvn.ruSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent 1c63dd1c
// SPDX-License-Identifier: BSD-3-Clause
/*
* Devices that use SC7180 with TrustedFirmware-A
* need PSCI PC mode instead of the OSI mode provided
* by Qualcomm firmware.
*/
&CPU0 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU1 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU2 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU3 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU4 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU5 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU6 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&BIG_CPU_SLEEP_0
&BIG_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
&CPU7 {
/delete-property/ power-domains;
/delete-property/ power-domain-names;
cpu-idle-states = <&BIG_CPU_SLEEP_0
&BIG_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
};
/delete-node/ &domain_idle_states;
&idle_states {
CLUSTER_SLEEP_0: cluster-sleep-0 {
compatible = "arm,idle-state";
idle-state-name = "cluster-power-down";
arm,psci-suspend-param = <0x40003444>;
entry-latency-us = <3263>;
exit-latency-us = <6562>;
min-residency-us = <9926>;
local-timer-stop;
};
};
/delete-node/ &CPU_PD0;
/delete-node/ &CPU_PD1;
/delete-node/ &CPU_PD2;
/delete-node/ &CPU_PD3;
/delete-node/ &CPU_PD4;
/delete-node/ &CPU_PD5;
/delete-node/ &CPU_PD6;
/delete-node/ &CPU_PD7;
/delete-node/ &CLUSTER_PD;
&apps_rsc {
/delete-property/ power-domains;
};
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include "sc7180.dtsi" #include "sc7180.dtsi"
#include "sc7180-firmware-tfa.dtsi"
#include "pm6150.dtsi" #include "pm6150.dtsi"
#include "pm6150l.dtsi" #include "pm6150l.dtsi"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <dt-bindings/sound/sc7180-lpass.h> #include <dt-bindings/sound/sc7180-lpass.h>
#include "sc7180.dtsi" #include "sc7180.dtsi"
#include "sc7180-firmware-tfa.dtsi"
/* PMICs depend on spmi_bus label and so must come after sc7180.dtsi */ /* PMICs depend on spmi_bus label and so must come after sc7180.dtsi */
#include "pm6150.dtsi" #include "pm6150.dtsi"
#include "pm6150l.dtsi" #include "pm6150l.dtsi"
......
...@@ -79,9 +79,8 @@ CPU0: cpu@0 { ...@@ -79,9 +79,8 @@ CPU0: cpu@0 {
reg = <0x0 0x0>; reg = <0x0 0x0>;
clocks = <&cpufreq_hw 0>; clocks = <&cpufreq_hw 0>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&LITTLE_CPU_SLEEP_0 power-domains = <&CPU_PD0>;
&LITTLE_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <415>; capacity-dmips-mhz = <415>;
dynamic-power-coefficient = <137>; dynamic-power-coefficient = <137>;
operating-points-v2 = <&cpu0_opp_table>; operating-points-v2 = <&cpu0_opp_table>;
...@@ -109,9 +108,8 @@ CPU1: cpu@100 { ...@@ -109,9 +108,8 @@ CPU1: cpu@100 {
reg = <0x0 0x100>; reg = <0x0 0x100>;
clocks = <&cpufreq_hw 0>; clocks = <&cpufreq_hw 0>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&LITTLE_CPU_SLEEP_0 power-domains = <&CPU_PD1>;
&LITTLE_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <415>; capacity-dmips-mhz = <415>;
dynamic-power-coefficient = <137>; dynamic-power-coefficient = <137>;
next-level-cache = <&L2_100>; next-level-cache = <&L2_100>;
...@@ -134,9 +132,8 @@ CPU2: cpu@200 { ...@@ -134,9 +132,8 @@ CPU2: cpu@200 {
reg = <0x0 0x200>; reg = <0x0 0x200>;
clocks = <&cpufreq_hw 0>; clocks = <&cpufreq_hw 0>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&LITTLE_CPU_SLEEP_0 power-domains = <&CPU_PD2>;
&LITTLE_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <415>; capacity-dmips-mhz = <415>;
dynamic-power-coefficient = <137>; dynamic-power-coefficient = <137>;
next-level-cache = <&L2_200>; next-level-cache = <&L2_200>;
...@@ -159,9 +156,8 @@ CPU3: cpu@300 { ...@@ -159,9 +156,8 @@ CPU3: cpu@300 {
reg = <0x0 0x300>; reg = <0x0 0x300>;
clocks = <&cpufreq_hw 0>; clocks = <&cpufreq_hw 0>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&LITTLE_CPU_SLEEP_0 power-domains = <&CPU_PD3>;
&LITTLE_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <415>; capacity-dmips-mhz = <415>;
dynamic-power-coefficient = <137>; dynamic-power-coefficient = <137>;
next-level-cache = <&L2_300>; next-level-cache = <&L2_300>;
...@@ -184,9 +180,8 @@ CPU4: cpu@400 { ...@@ -184,9 +180,8 @@ CPU4: cpu@400 {
reg = <0x0 0x400>; reg = <0x0 0x400>;
clocks = <&cpufreq_hw 0>; clocks = <&cpufreq_hw 0>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&LITTLE_CPU_SLEEP_0 power-domains = <&CPU_PD4>;
&LITTLE_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <415>; capacity-dmips-mhz = <415>;
dynamic-power-coefficient = <137>; dynamic-power-coefficient = <137>;
next-level-cache = <&L2_400>; next-level-cache = <&L2_400>;
...@@ -209,9 +204,8 @@ CPU5: cpu@500 { ...@@ -209,9 +204,8 @@ CPU5: cpu@500 {
reg = <0x0 0x500>; reg = <0x0 0x500>;
clocks = <&cpufreq_hw 0>; clocks = <&cpufreq_hw 0>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&LITTLE_CPU_SLEEP_0 power-domains = <&CPU_PD5>;
&LITTLE_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <415>; capacity-dmips-mhz = <415>;
dynamic-power-coefficient = <137>; dynamic-power-coefficient = <137>;
next-level-cache = <&L2_500>; next-level-cache = <&L2_500>;
...@@ -234,9 +228,8 @@ CPU6: cpu@600 { ...@@ -234,9 +228,8 @@ CPU6: cpu@600 {
reg = <0x0 0x600>; reg = <0x0 0x600>;
clocks = <&cpufreq_hw 1>; clocks = <&cpufreq_hw 1>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&BIG_CPU_SLEEP_0 power-domains = <&CPU_PD6>;
&BIG_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <1024>; capacity-dmips-mhz = <1024>;
dynamic-power-coefficient = <480>; dynamic-power-coefficient = <480>;
next-level-cache = <&L2_600>; next-level-cache = <&L2_600>;
...@@ -259,9 +252,8 @@ CPU7: cpu@700 { ...@@ -259,9 +252,8 @@ CPU7: cpu@700 {
reg = <0x0 0x700>; reg = <0x0 0x700>;
clocks = <&cpufreq_hw 1>; clocks = <&cpufreq_hw 1>;
enable-method = "psci"; enable-method = "psci";
cpu-idle-states = <&BIG_CPU_SLEEP_0 power-domains = <&CPU_PD7>;
&BIG_CPU_SLEEP_1 power-domain-names = "psci";
&CLUSTER_SLEEP_0>;
capacity-dmips-mhz = <1024>; capacity-dmips-mhz = <1024>;
dynamic-power-coefficient = <480>; dynamic-power-coefficient = <480>;
next-level-cache = <&L2_700>; next-level-cache = <&L2_700>;
...@@ -314,7 +306,7 @@ core7 { ...@@ -314,7 +306,7 @@ core7 {
}; };
}; };
idle-states { idle_states: idle-states {
entry-method = "psci"; entry-method = "psci";
LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
...@@ -356,15 +348,34 @@ BIG_CPU_SLEEP_1: cpu-sleep-1-1 { ...@@ -356,15 +348,34 @@ BIG_CPU_SLEEP_1: cpu-sleep-1-1 {
min-residency-us = <5555>; min-residency-us = <5555>;
local-timer-stop; local-timer-stop;
}; };
};
CLUSTER_SLEEP_0: cluster-sleep-0 { domain_idle_states: domain-idle-states {
compatible = "arm,idle-state"; CLUSTER_SLEEP_PC: cluster-sleep-0 {
compatible = "domain-idle-state";
idle-state-name = "cluster-l3-power-collapse";
arm,psci-suspend-param = <0x41000044>;
entry-latency-us = <2752>;
exit-latency-us = <3048>;
min-residency-us = <6118>;
};
CLUSTER_SLEEP_CX_RET: cluster-sleep-1 {
compatible = "domain-idle-state";
idle-state-name = "cluster-cx-retention";
arm,psci-suspend-param = <0x41001244>;
entry-latency-us = <3638>;
exit-latency-us = <4562>;
min-residency-us = <8467>;
};
CLUSTER_AOSS_SLEEP: cluster-sleep-2 {
compatible = "domain-idle-state";
idle-state-name = "cluster-power-down"; idle-state-name = "cluster-power-down";
arm,psci-suspend-param = <0x40003444>; arm,psci-suspend-param = <0x4100b244>;
entry-latency-us = <3263>; entry-latency-us = <3263>;
exit-latency-us = <6562>; exit-latency-us = <6562>;
min-residency-us = <9926>; min-residency-us = <9826>;
local-timer-stop;
}; };
}; };
}; };
...@@ -567,6 +578,61 @@ pmu { ...@@ -567,6 +578,61 @@ pmu {
psci { psci {
compatible = "arm,psci-1.0"; compatible = "arm,psci-1.0";
method = "smc"; method = "smc";
CPU_PD0: cpu0 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
};
CPU_PD1: cpu1 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
};
CPU_PD2: cpu2 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
};
CPU_PD3: cpu3 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
};
CPU_PD4: cpu4 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
};
CPU_PD5: cpu5 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&LITTLE_CPU_SLEEP_0 &LITTLE_CPU_SLEEP_1>;
};
CPU_PD6: cpu6 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
};
CPU_PD7: cpu7 {
#power-domain-cells = <0>;
power-domains = <&CLUSTER_PD>;
domain-idle-states = <&BIG_CPU_SLEEP_0 &BIG_CPU_SLEEP_1>;
};
CLUSTER_PD: cpu-cluster0 {
#power-domain-cells = <0>;
domain-idle-states = <&CLUSTER_SLEEP_PC
&CLUSTER_SLEEP_CX_RET
&CLUSTER_AOSS_SLEEP>;
};
}; };
reserved_memory: reserved-memory { reserved_memory: reserved-memory {
...@@ -3597,6 +3663,7 @@ apps_rsc: rsc@18200000 { ...@@ -3597,6 +3663,7 @@ apps_rsc: rsc@18200000 {
<SLEEP_TCS 3>, <SLEEP_TCS 3>,
<WAKE_TCS 3>, <WAKE_TCS 3>,
<CONTROL_TCS 1>; <CONTROL_TCS 1>;
power-domains = <&CLUSTER_PD>;
rpmhcc: clock-controller { rpmhcc: clock-controller {
compatible = "qcom,sc7180-rpmh-clk"; compatible = "qcom,sc7180-rpmh-clk";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment