Add EMC OPP DVFS/DFS tables and interconnect paths that will be used for
dynamic memory bandwidth scaling based on memory utilization statistics.
Remove unsupported EMC OPPs from board device-trees.

Note that ACTMON watches all memory interconnect paths, but we use a
single CPU-READ interconnect path for driving memory bandwidth, for
simplicity.

Signed-off-by: Dmitry Osipenko <dig...@gmail.com>
---
 arch/arm/boot/dts/tegra124-apalis-emc.dtsi    |   8 +
 .../arm/boot/dts/tegra124-jetson-tk1-emc.dtsi |   8 +
 arch/arm/boot/dts/tegra124-nyan-big-emc.dtsi  |  10 +
 .../boot/dts/tegra124-peripherals-opp.dtsi    | 419 ++++++++++++++++++
 arch/arm/boot/dts/tegra124.dtsi               |   6 +
 5 files changed, 451 insertions(+)
 create mode 100644 arch/arm/boot/dts/tegra124-peripherals-opp.dtsi

diff --git a/arch/arm/boot/dts/tegra124-apalis-emc.dtsi 
b/arch/arm/boot/dts/tegra124-apalis-emc.dtsi
index 32401457ae71..29312cffdb3a 100644
--- a/arch/arm/boot/dts/tegra124-apalis-emc.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis-emc.dtsi
@@ -5,6 +5,14 @@
  */
 
 / {
+       emc_opp_table0 {
+               /delete-node/ opp@1200000000,1100;
+       };
+
+       emc_opp_table1 {
+               /delete-node/ opp@1200000000;
+       };
+
        clock@60006000 {
                emc-timings-1 {
                        nvidia,ram-code = <1>;
diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1-emc.dtsi 
b/arch/arm/boot/dts/tegra124-jetson-tk1-emc.dtsi
index 861d3f22116b..fc8a089cd4dd 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1-emc.dtsi
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1-emc.dtsi
@@ -1,5 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0
 / {
+       emc_opp_table0 {
+               /delete-node/ opp@1200000000,1100;
+       };
+
+       emc_opp_table1 {
+               /delete-node/ opp@1200000000;
+       };
+
        clock@60006000 {
                emc-timings-3 {
                        nvidia,ram-code = <3>;
diff --git a/arch/arm/boot/dts/tegra124-nyan-big-emc.dtsi 
b/arch/arm/boot/dts/tegra124-nyan-big-emc.dtsi
index c91647d13a50..20c1ae284280 100644
--- a/arch/arm/boot/dts/tegra124-nyan-big-emc.dtsi
+++ b/arch/arm/boot/dts/tegra124-nyan-big-emc.dtsi
@@ -4,6 +4,16 @@ apbmisc@70000800 {
                nvidia,long-ram-code;
        };
 
+       emc_opp_table0 {
+               /delete-node/ opp@924000000,1100;
+               /delete-node/ opp@1200000000,1100;
+       };
+
+       emc_opp_table1 {
+               /delete-node/ opp@924000000;
+               /delete-node/ opp@1200000000;
+       };
+
        clock@60006000 {
                emc-timings-1 {
                        nvidia,ram-code = <1>;
diff --git a/arch/arm/boot/dts/tegra124-peripherals-opp.dtsi 
b/arch/arm/boot/dts/tegra124-peripherals-opp.dtsi
new file mode 100644
index 000000000000..d2b4d8e9cb13
--- /dev/null
+++ b/arch/arm/boot/dts/tegra124-peripherals-opp.dtsi
@@ -0,0 +1,419 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/ {
+       emc_icc_dvfs_opp_table: emc_opp_table0 {
+               compatible = "operating-points-v2";
+
+               opp@12750000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <12750000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@12750000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <12750000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@12750000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <12750000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@12750000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <12750000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@20400000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <20400000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@20400000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <20400000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@20400000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <20400000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@20400000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <20400000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@40800000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <40800000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@40800000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <40800000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@40800000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <40800000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@40800000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <40800000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@68000000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <68000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@68000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <68000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@68000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <68000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@68000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <68000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@102000000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <102000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@102000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <102000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@102000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <102000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@102000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <102000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@204000000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <204000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@204000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <204000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@204000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <204000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@204000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <204000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@264000000,800 {
+                       opp-microvolt = <800000 800000 1150000>;
+                       opp-hz = /bits/ 64 <264000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@264000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <264000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@264000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <264000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@264000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <264000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@300000000,850 {
+                       opp-microvolt = <850000 850000 1150000>;
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@300000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@300000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@300000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@348000000,850 {
+                       opp-microvolt = <850000 850000 1150000>;
+                       opp-hz = /bits/ 64 <348000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@348000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <348000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@348000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <348000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@348000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <348000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@396000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <396000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@396000000,1000 {
+                       opp-microvolt = <1000000 1000000 1150000>;
+                       opp-hz = /bits/ 64 <396000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@396000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <396000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@396000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <396000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@528000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <528000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@528000000,1000 {
+                       opp-microvolt = <1000000 1000000 1150000>;
+                       opp-hz = /bits/ 64 <528000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@528000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <528000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@528000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <528000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@600000000,950 {
+                       opp-microvolt = <950000 950000 1150000>;
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-supported-hw = <0x0008>;
+               };
+
+               opp@600000000,1000 {
+                       opp-microvolt = <1000000 1000000 1150000>;
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+
+               opp@600000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@600000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@792000000,1000 {
+                       opp-microvolt = <1000000 1000000 1150000>;
+                       opp-hz = /bits/ 64 <792000000>;
+                       opp-supported-hw = <0x000B>;
+               };
+
+               opp@792000000,1050 {
+                       opp-microvolt = <1050000 1050000 1150000>;
+                       opp-hz = /bits/ 64 <792000000>;
+                       opp-supported-hw = <0x0010>;
+               };
+
+               opp@792000000,1110 {
+                       opp-microvolt = <1110000 1110000 1150000>;
+                       opp-hz = /bits/ 64 <792000000>;
+                       opp-supported-hw = <0x0004>;
+               };
+
+               opp@924000000,1100 {
+                       opp-microvolt = <1100000 1100000 1150000>;
+                       opp-hz = /bits/ 64 <924000000>;
+                       opp-supported-hw = <0x0013>;
+               };
+
+               opp@1200000000,1100 {
+                       opp-microvolt = <1100000 1100000 1150000>;
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-supported-hw = <0x0003>;
+               };
+       };
+
+       emc_bw_dfs_opp_table: emc_opp_table1 {
+               compatible = "operating-points-v2";
+
+               opp@12750000 {
+                       opp-hz = /bits/ 64 <12750000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <204000>;
+               };
+
+               opp@20400000 {
+                       opp-hz = /bits/ 64 <20400000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <326400>;
+               };
+
+               opp@40800000 {
+                       opp-hz = /bits/ 64 <40800000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <652800>;
+               };
+
+               opp@68000000 {
+                       opp-hz = /bits/ 64 <68000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <1088000>;
+               };
+
+               opp@102000000 {
+                       opp-hz = /bits/ 64 <102000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <1632000>;
+               };
+
+               opp@204000000 {
+                       opp-hz = /bits/ 64 <204000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <3264000>;
+               };
+
+               opp@264000000 {
+                       opp-hz = /bits/ 64 <264000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <4224000>;
+               };
+
+               opp@300000000 {
+                       opp-hz = /bits/ 64 <300000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <4800000>;
+               };
+
+               opp@348000000 {
+                       opp-hz = /bits/ 64 <348000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <5568000>;
+               };
+
+               opp@396000000 {
+                       opp-hz = /bits/ 64 <396000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <6336000>;
+               };
+
+               opp@528000000 {
+                       opp-hz = /bits/ 64 <528000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <8448000>;
+               };
+
+               opp@600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <9600000>;
+               };
+
+               opp@792000000 {
+                       opp-hz = /bits/ 64 <792000000>;
+                       opp-supported-hw = <0x001F>;
+                       opp-peak-kBps = <12672000>;
+               };
+
+               opp@924000000 {
+                       opp-hz = /bits/ 64 <924000000>;
+                       opp-supported-hw = <0x0013>;
+                       opp-peak-kBps = <14784000>;
+               };
+
+               opp@1200000000 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-supported-hw = <0x0003>;
+                       opp-peak-kBps = <19200000>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 1801e30b1d3a..46441d10a3fc 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -8,6 +8,8 @@
 #include <dt-bindings/thermal/tegra124-soctherm.h>
 #include <dt-bindings/soc/tegra-pmc.h>
 
+#include "tegra124-peripherals-opp.dtsi"
+
 / {
        compatible = "nvidia,tegra124";
        interrupt-parent = <&lic>;
@@ -290,6 +292,9 @@ actmon@6000c800 {
                clock-names = "actmon", "emc";
                resets = <&tegra_car 119>;
                reset-names = "actmon";
+               operating-points-v2 = <&emc_bw_dfs_opp_table>;
+               interconnects = <&mc TEGRA124_MC_MPCORER &emc>;
+               interconnect-names = "cpu-read";
        };
 
        gpio: gpio@6000d000 {
@@ -660,6 +665,7 @@ emc: external-memory-controller@7001b000 {
                clock-names = "emc";
 
                nvidia,memory-controller = <&mc>;
+               operating-points-v2 = <&emc_icc_dvfs_opp_table>;
 
                #interconnect-cells = <0>;
        };
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to