Add mt7986 thermal
Subsystems (4)
v3 cover Add mt7986 thermal
From: Frank Wunderlich <[email protected]>
This series add thermal related devicetree-nodes and necessary dt-bindings.
I left pwm-fan for r3 for now as i cannot test this completely due to missing 2 pin-jack and 3v3 pwm-level which my fan cannot handle (starts spinning at ~3V). Only checked voltage of pwm there.
changes in v3:
- efuse compatibles into one line
changes in v2:
- drop highest 2 trip points as they are not yet used
- leave already applied patches
Daniel Golle (3):
arm64: dts: mt7986: add thermal and efuse
arm64: dts: mt7986: add thermal-zones
arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts
Frank Wunderlich (1):
dt-bindings: nvmem: mediatek: efuse: add support for mt7986
.../bindings/nvmem/mediatek,efuse.yaml | 1 + .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 31 ++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 62 +++++++++++++++++++ 3 files changed, 94 insertions(+)
Signature · 1 line
2.34.1
PATCH v3 1/4 dt-bindings: nvmem: mediatek: efuse: add support for mt7986
From: Frank Wunderlich <[email protected]>
Add compatible string for mt7986 SoC.
--- Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml +1 -0
@@ -27,6 +27,7 @@ properties: - enum: - mediatek,mt7622-efuse - mediatek,mt7623-efuse + - mediatek,mt7986-efuse - mediatek,mt8173-efuse - mediatek,mt8183-efuse - mediatek,mt8186-efuse
Signature · 1 line
2.34.1
Re: [PATCH v3 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986
Il 30/05/23 22:12, Frank Wunderlich ha scritto:
Quoted 6 lines
From: Frank Wunderlich <[email protected]>
Add compatible string for mt7986 SoC.
Signed-off-by Frank Wunderlich <[email protected]>Acked-by Rob Herring <[email protected]>
PATCH v3 2/4 arm64: dts: mt7986: add thermal and efuse
In reply to Frank WunderlichFrom: Daniel Golle <[email protected]>
Add thermal related nodes to mt7986 devicetree.
---
changes in v3:
- efuse compatibles in one line
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 36 ++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +35 -1
@@ -337,6 +337,15 @@ spi1: spi@1100b000 { status = "disabled"; }; + auxadc: adc@1100d000 { + compatible = "mediatek,mt7986-auxadc"; + reg = <0 0x1100d000 0 0x1000>; + clocks = <&infracfg CLK_INFRA_ADC_26M_CK>; + clock-names = "main"; + #io-channel-cells = <1>; + status = "disabled"; + }; + ssusb: usb@11200000 { compatible = "mediatek,mt7986-xhci", "mediatek,mtk-xhci";
@@ -375,6 +384,21 @@ mmc0: mmc@11230000 { status = "disabled"; }; + thermal: thermal@1100c800 { + #thermal-sensor-cells = <1>; + compatible = "mediatek,mt7986-thermal"; + reg = <0 0x1100c800 0 0x800>; + interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&infracfg CLK_INFRA_THERM_CK>, + <&infracfg CLK_INFRA_ADC_26M_CK>, + <&infracfg CLK_INFRA_ADC_FRC_CK>; + clock-names = "therm", "auxadc", "adc_32k"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration>; + nvmem-cell-names = "calibration-data"; + }; + pcie: pcie@11280000 { compatible = "mediatek,mt7986-pcie", "mediatek,mt8192-pcie";
@@ -426,6 +450,17 @@ pcie_port: pcie-phy@11c00000 { }; }; + efuse: efuse@11d00000 { + compatible = "mediatek,mt7986-efuse", "mediatek,efuse"; + reg = <0 0x11d00000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + thermal_calibration: calib@274 { + reg = <0x274 0xc>; + }; + }; + usb_phy: t-phy@11e10000 { compatible = "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2";
@@ -567,5 +602,4 @@ wifi: wifi@18000000 { memory-region = <&wmcpu_emi>; }; }; - };
Signature · 1 line
2.34.1
PATCH v3 3/4 arm64: dts: mt7986: add thermal-zones
In reply to Frank WunderlichFrom: Daniel Golle <[email protected]>
Add thermal-zones to mt7986 devicetree.
---
changes in v2:
- drop top 2 thermal trips as suggested by matthias
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +28 -0
@@ -602,4 +602,32 @@ wifi: wifi@18000000 { memory-region = <&wmcpu_emi>; }; }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + thermal-sensors = <&thermal 0>; + + trips { + cpu_trip_active_high: active-high { + temperature = <115000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_low: active-low { + temperature = <85000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_passive: passive { + temperature = <40000>; + hysteresis = <2000>; + type = "passive"; + }; + }; + }; + }; };
Signature · 1 line
2.34.1
PATCH v3 4/4 arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts
In reply to Frank WunderlichFrom: Daniel Golle <[email protected]>
Add pwm-fan and cooling-maps to BananaPi-R3 devicetree.
---
this is based on Patch from openwrt. as my PWM-fan seems to need 5v pwm signal and r3 only provides 3v3 on 3pin-socket it does not work for me.
--- .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +31 -0
@@ -37,6 +37,15 @@ dcin: regulator-12vd { regulator-always-on; }; + fan: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + /* cooling level (0, 1, 2) - pwm inverted */ + cooling-levels = <255 96 0>; + pwms = <&pwm 0 10000 0>; + status = "okay"; + }; + gpio-keys { compatible = "gpio-keys";
@@ -132,6 +141,28 @@ sfp2: sfp-2 { }; }; +&cpu_thermal { + cooling-maps { + cpu-active-high { + /* active: set fan to cooling level 2 */ + cooling-device = <&fan 2 2>; + trip = <&cpu_trip_active_high>; + }; + + cpu-active-low { + /* active: set fan to cooling level 1 */ + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active_low>; + }; + + cpu-passive { + /* passive: set fan to cooling level 0 */ + cooling-device = <&fan 0 0>; + trip = <&cpu_trip_passive>; + }; + }; +}; + &crypto { status = "okay"; };
Signature · 1 line
2.34.1
Srinivas Kandagatla
AppliedRe: (subset) [PATCH v3 0/4] Add mt7986 thermal
In reply to Frank WunderlichQuoted 10 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
This series add thermal related devicetree-nodes and necessary dt-bindings.
I left pwm-fan for r3 for now as i cannot test this completely due to missing 2 pin-jack and 3v3 pwm-level which my fan cannot handle (starts spinning at ~3V). Only checked voltage of pwm there.
[...]
Applied, thanks!
[1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986
commit: 05f53e3c22a71ed53e0e88432c3db31f2d27e6e1
Best regards,
Signature · 1 line
Srinivas Kandagatla <[email protected]>
Matthias Brugger
maintainerQuoted 21 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
This series add thermal related devicetree-nodes and necessary dt-bindings.
I left pwm-fan for r3 for now as i cannot test this completely due to missing 2 pin-jack and 3v3 pwm-level which my fan cannot handle (starts spinning at ~3V). Only checked voltage of pwm there.
changes in v3:
- efuse compatibles into one linechanges in v2:
- drop highest 2 trip points as they are not yet used
- leave already applied patchesDaniel Golle (3):
arm64: dts: mt7986: add thermal and efuse
arm64: dts: mt7986: add thermal-zones
arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts
Quoted 8 lines
Frank Wunderlich (1):
dt-bindings: nvmem: mediatek: efuse: add support for mt7986.../bindings/nvmem/mediatek,efuse.yaml | 1 + .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 31 ++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 62 +++++++++++++++++++ 3 files changed, 94 insertions(+)
Applied 2-4, thanks!