mediatek: re-add dropped properties on BPi-R3
authorDaniel Golle <daniel@makrotopia.org>
Fri, 25 Aug 2023 13:00:09 +0000 (14:00 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 28 Aug 2023 12:55:38 +0000 (13:55 +0100)
Unfortunately some device tree properties have slipped under the table
when switching from our downstream device tree.

Bring back 3W power for SFP cages and restore thermal trip points to
make sense again.

Fixes: 7a0ec001ff ("mediatek: sync MT7986 device trees with upstream")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
target/linux/mediatek/patches-5.15/195-dts-mt7986a-bpi-r3-leds-port-names-and-wifi-eeprom.patch
target/linux/mediatek/patches-6.1/020-arm64-dts-mt7986-define-3W-max-power-to-both-SFP-on-.patch [new file with mode: 0644]
target/linux/mediatek/patches-6.1/021-arm64-dts-mt7986-change-cooling-trips.patch [new file with mode: 0644]
target/linux/mediatek/patches-6.1/022-arm64-dts-mt7986-change-thermal-trips-on-BPI-R3.patch [new file with mode: 0644]
target/linux/mediatek/patches-6.1/195-dts-mt7986a-bpi-r3-leds-port-names-and-wifi-eeprom.patch

index af4a4309bda4b93191601f6e38fc6044211278a9..1d3c575b7d4c4233cce890f4cdc1a746a796d969 100644 (file)
                mod-def0-gpios = <&pio 49 GPIO_ACTIVE_LOW>;
                tx-disable-gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
                tx-fault-gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
+               maximum-power-milliwatt = <3000>;
        };
 
        /* right SFP cage (lan) */
                mod-def0-gpios = <&pio 47 GPIO_ACTIVE_LOW>;
                tx-disable-gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
                tx-fault-gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
+               maximum-power-milliwatt = <3000>;
        };
 };
 
                        trip = <&cpu_trip_active_high>;
                };
 
-               cpu-active-low {
+               cpu-active-med {
                        /* active: set fan to cooling level 1 */
                        cooling-device = <&fan 1 1>;
-                       trip = <&cpu_trip_active_low>;
+                       trip = <&cpu_trip_active_med>;
                };
 
-               cpu-passive {
-                       /* passive: set fan to cooling level 0 */
+               cpu-active-low {
+                       /* active: set fan to cooling level 0 */
                        cooling-device = <&fan 0 0>;
-                       trip = <&cpu_trip_passive>;
+                       trip = <&cpu_trip_active_low>;
                };
        };
 };
index 68539ea788dfcce5e52cb996693de7766607e05e..64f2cf3756a8b89ac8ed8cb8f50fdaeafcf632f1 100644 (file)
                        thermal-sensors = <&thermal 0>;
 
                        trips {
+                               cpu_trip_crit: crit {
+                                       temperature = <125000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+
+                               cpu_trip_hot: hot {
+                                       temperature = <120000>;
+                                       hysteresis = <2000>;
+                                       type = "hot";
+                               };
+
                                cpu_trip_active_high: active-high {
                                        temperature = <115000>;
                                        hysteresis = <2000>;
                                        type = "active";
                                };
 
-                               cpu_trip_active_low: active-low {
+                               cpu_trip_active_med: active-med {
                                        temperature = <85000>;
                                        hysteresis = <2000>;
                                        type = "active";
                                };
 
-                               cpu_trip_passive: passive {
-                                       temperature = <40000>;
+                               cpu_trip_active_low: active-low {
+                                       temperature = <60000>;
                                        hysteresis = <2000>;
-                                       type = "passive";
+                                       type = "active";
                                };
                        };
                };
index 7126da788beabae4df550478b7f0abbef1ab4dc6..336920bafea67a6f0b89abf518b171d3838f8a2e 100644 (file)
@@ -11,7 +11,7 @@
        };
  
        chosen {
-@@ -417,27 +421,27 @@
+@@ -419,27 +423,27 @@
  
                port@1 {
                        reg = <1>;
@@ -44,7 +44,7 @@
                        phy-mode = "2500base-x";
                        sfp = <&sfp2>;
                        managed = "in-band-status";
-@@ -488,9 +492,137 @@
+@@ -490,9 +494,137 @@
  
  &wifi {
        status = "okay";
diff --git a/target/linux/mediatek/patches-6.1/020-arm64-dts-mt7986-define-3W-max-power-to-both-SFP-on-.patch b/target/linux/mediatek/patches-6.1/020-arm64-dts-mt7986-define-3W-max-power-to-both-SFP-on-.patch
new file mode 100644 (file)
index 0000000..8cba3b2
--- /dev/null
@@ -0,0 +1,34 @@
+From f8ed4088ed9c61ae92193da6130d04c37e7b19f2 Mon Sep 17 00:00:00 2001
+From: Frank Wunderlich <frank-w@public-files.de>
+Date: Sun, 20 Aug 2023 17:31:33 +0200
+Subject: [PATCH 20/22] arm64: dts: mt7986: define 3W max power to both SFP on
+ BPI-R3
+
+All SFP power supplies are connected to the system VDD33 which is 3v3/8A.
+Set 3A per SFP slot to allow SFPs work which need more power than the
+default 1W.
+
+Fixes: 8e01fb15b815 ("arm64: dts: mt7986: add Bananapi R3")
+Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
+---
+ arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+@@ -126,6 +126,7 @@
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp1>;
+               los-gpios = <&pio 46 GPIO_ACTIVE_HIGH>;
++              maximum-power-milliwatt = <3000>;
+               mod-def0-gpios = <&pio 49 GPIO_ACTIVE_LOW>;
+               tx-disable-gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
+@@ -137,6 +138,7 @@
+               i2c-bus = <&i2c_sfp2>;
+               los-gpios = <&pio 31 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&pio 47 GPIO_ACTIVE_LOW>;
++              maximum-power-milliwatt = <3000>;
+               tx-disable-gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
+       };
diff --git a/target/linux/mediatek/patches-6.1/021-arm64-dts-mt7986-change-cooling-trips.patch b/target/linux/mediatek/patches-6.1/021-arm64-dts-mt7986-change-cooling-trips.patch
new file mode 100644 (file)
index 0000000..20d4468
--- /dev/null
@@ -0,0 +1,59 @@
+From aa3d6df9803c267725dc72286bb91602b7579882 Mon Sep 17 00:00:00 2001
+From: Frank Wunderlich <frank-w@public-files.de>
+Date: Sun, 20 Aug 2023 17:31:34 +0200
+Subject: [PATCH 21/22] arm64: dts: mt7986: change cooling trips
+
+Add Critical and hot trips for emergency system shutdown and limiting
+system load.
+
+Change passive trip to active to make sure fan is activated on the
+lowest trip.
+
+Fixes: 1f5be05132f3 ("arm64: dts: mt7986: add thermal-zones")
+Suggested-by: Daniel Golle <daniel@makrotopia.org>
+Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
+---
+ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
++++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+@@ -610,22 +610,34 @@
+                       thermal-sensors = <&thermal 0>;
+                       trips {
++                              cpu_trip_crit: crit {
++                                      temperature = <125000>;
++                                      hysteresis = <2000>;
++                                      type = "critical";
++                              };
++
++                              cpu_trip_hot: hot {
++                                      temperature = <120000>;
++                                      hysteresis = <2000>;
++                                      type = "hot";
++                              };
++
+                               cpu_trip_active_high: active-high {
+                                       temperature = <115000>;
+                                       hysteresis = <2000>;
+                                       type = "active";
+                               };
+-                              cpu_trip_active_low: active-low {
++                              cpu_trip_active_med: active-med {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "active";
+                               };
+-                              cpu_trip_passive: passive {
+-                                      temperature = <40000>;
++                              cpu_trip_active_low: active-low {
++                                      temperature = <60000>;
+                                       hysteresis = <2000>;
+-                                      type = "passive";
++                                      type = "active";
+                               };
+                       };
+               };
diff --git a/target/linux/mediatek/patches-6.1/022-arm64-dts-mt7986-change-thermal-trips-on-BPI-R3.patch b/target/linux/mediatek/patches-6.1/022-arm64-dts-mt7986-change-thermal-trips-on-BPI-R3.patch
new file mode 100644 (file)
index 0000000..7166ab6
--- /dev/null
@@ -0,0 +1,38 @@
+From 6ddf23526955b8dbedfeaa57e691261fd73f9d4e Mon Sep 17 00:00:00 2001
+From: Frank Wunderlich <frank-w@public-files.de>
+Date: Sun, 20 Aug 2023 17:31:35 +0200
+Subject: [PATCH 22/22] arm64: dts: mt7986: change thermal trips on BPI-R3
+
+Apply new naming after mt7986 thermal trips were changed.
+
+Fixes: c26f779a2295 ("arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts")
+Suggested-by: Daniel Golle <daniel@makrotopia.org>
+Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
+---
+ .../boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts      | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+@@ -152,16 +152,16 @@
+                       trip = <&cpu_trip_active_high>;
+               };
+-              cpu-active-low {
++              cpu-active-med {
+                       /* active: set fan to cooling level 1 */
+                       cooling-device = <&fan 1 1>;
+-                      trip = <&cpu_trip_active_low>;
++                      trip = <&cpu_trip_active_med>;
+               };
+-              cpu-passive {
+-                      /* passive: set fan to cooling level 0 */
++              cpu-active-low {
++                      /* active: set fan to cooling level 0 */
+                       cooling-device = <&fan 0 0>;
+-                      trip = <&cpu_trip_passive>;
++                      trip = <&cpu_trip_active_low>;
+               };
+       };
+ };
index 7126da788beabae4df550478b7f0abbef1ab4dc6..336920bafea67a6f0b89abf518b171d3838f8a2e 100644 (file)
@@ -11,7 +11,7 @@
        };
  
        chosen {
-@@ -417,27 +421,27 @@
+@@ -419,27 +423,27 @@
  
                port@1 {
                        reg = <1>;
@@ -44,7 +44,7 @@
                        phy-mode = "2500base-x";
                        sfp = <&sfp2>;
                        managed = "in-band-status";
-@@ -488,9 +492,137 @@
+@@ -490,9 +494,137 @@
  
  &wifi {
        status = "okay";