arm64: dts: qcom: sm6375: Set up L3 scaling
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Tue, 27 Jun 2023 14:07:37 +0000 (16:07 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 10 Jul 2023 04:34:23 +0000 (21:34 -0700)
Add the CPU OPP tables including core frequency and L3 bus frequency.
The L3 throughput values were chosen by studying the frequencies
available in HW LUT and picking the highest one that's less than the
CPU frequency. They will be replaced with a dynamic, bwmon-style
decision maker once support for MEMLAT is introduced upstream.

Available values from the HW LUT:
300000
556800
652800
768000
844800
921600
1171200
1382400
1497600

This commit dramatically improves overall performance of the system.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230627-topic-6375_l3-v1-1-9cb03ef05150@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sm6375.dtsi

index 3dba34210a6d0921cc99c988a4807c364569502a..927aa59d4a07587e0355929301b811f74efae5f7 100644 (file)
@@ -8,6 +8,7 @@
 #include <dt-bindings/clock/qcom,sm6375-gpucc.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/firmware/qcom,scm.h>
+#include <dt-bindings/interconnect/qcom,osm-l3.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/qcom-ipcc.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
@@ -45,6 +46,8 @@
                        enable-method = "psci";
                        next-level-cache = <&L2_0>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD0>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
@@ -69,6 +72,8 @@
                        enable-method = "psci";
                        next-level-cache = <&L2_100>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD1>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
@@ -88,6 +93,8 @@
                        enable-method = "psci";
                        next-level-cache = <&L2_200>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD2>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
                        enable-method = "psci";
                        next-level-cache = <&L2_300>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD3>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
                        enable-method = "psci";
                        next-level-cache = <&L2_400>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD4>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
                        enable-method = "psci";
                        next-level-cache = <&L2_500>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD5>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
                        enable-method = "psci";
                        next-level-cache = <&L2_600>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
+                       operating-points-v2 = <&cpu6_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD6>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
                        enable-method = "psci";
                        next-level-cache = <&L2_700>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
+                       operating-points-v2 = <&cpu6_opp_table>;
+                       interconnects = <&cpucp_l3 MASTER_EPSS_L3_APPS &cpucp_l3 SLAVE_EPSS_L3_SHARED>;
                        power-domains = <&CPU_PD7>;
                        power-domain-names = "psci";
                        #cooling-cells = <2>;
                reg = <0x0 0x80000000 0x0 0x0>;
        };
 
+       cpu0_opp_table: opp-table-cpu0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-300000000 {
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-peak-kBps = <(300000 * 32)>;
+               };
+
+               opp-576000000 {
+                       opp-hz = /bits/ 64 <576000000>;
+                       opp-peak-kBps = <(556800 * 32)>;
+               };
+
+               opp-691200000 {
+                       opp-hz = /bits/ 64 <691200000>;
+                       opp-peak-kBps = <(652800 * 32)>;
+               };
+
+               opp-940800000 {
+                       opp-hz = /bits/ 64 <940800000>;
+                       opp-peak-kBps = <(921600 * 32)>;
+               };
+
+               opp-1113600000 {
+                       opp-hz = /bits/ 64 <1113600000>;
+                       opp-peak-kBps = <(921600 * 32)>;
+               };
+
+               opp-1324800000 {
+                       opp-hz = /bits/ 64 <1324800000>;
+                       opp-peak-kBps = <(1171200 * 32)>;
+               };
+
+               opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-1651200000 {
+                       opp-hz = /bits/ 64 <1651200000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-1708800000 {
+                       opp-hz = /bits/ 64 <1708800000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-1804800000 {
+                       opp-hz = /bits/ 64 <1804800000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+       };
+
+       cpu6_opp_table: opp-table-cpu6 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-691200000 {
+                       opp-hz = /bits/ 64 <691200000>;
+                       opp-peak-kBps = <(556800 * 32)>;
+               };
+
+               opp-940800000 {
+                       opp-hz = /bits/ 64 <940800000>;
+                       opp-peak-kBps = <(921600 * 32)>;
+               };
+
+               opp-1228800000 {
+                       opp-hz = /bits/ 64 <1228800000>;
+                       opp-peak-kBps = <(1171200 * 32)>;
+               };
+
+               opp-1401600000 {
+                       opp-hz = /bits/ 64 <1401600000>;
+                       opp-peak-kBps = <(1382400 * 32)>;
+               };
+
+               opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-1651200000 {
+                       opp-hz = /bits/ 64 <1651200000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-1804800000 {
+                       opp-hz = /bits/ 64 <1804800000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-1900800000 {
+                       opp-hz = /bits/ 64 <1900800000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-2054400000 {
+                       opp-hz = /bits/ 64 <2054400000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+
+               opp-2208000000 {
+                       opp-hz = /bits/ 64 <2208000000>;
+                       opp-peak-kBps = <(1497600 * 32)>;
+               };
+       };
+
        pmu {
                compatible = "arm,armv8-pmuv3";
                interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>;