* Subject: [PATCH v2 0/4] Add mt7986 thermal and pwm
@ 2023-05-29 20:42 Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986 Frank Wunderlich
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Frank Wunderlich @ 2023-05-29 20:42 UTC (permalink / raw)
To: linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
AngeloGioacchino Del Regno, Srinivas Kandagatla, Hui.Liu,
Zhiyong Tao, Andrew-CT Chen, Lala Lin, linux-iio, devicetree,
linux-kernel, linux-arm-kernel, Daniel Golle
From: Frank Wunderlich <frank-w@public-files.de>
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 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 | 63 +++++++++++++++++++
3 files changed, 95 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986
2023-05-29 20:42 Subject: [PATCH v2 0/4] Add mt7986 thermal and pwm Frank Wunderlich
@ 2023-05-29 20:42 ` Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse Frank Wunderlich
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Frank Wunderlich @ 2023-05-29 20:42 UTC (permalink / raw)
To: linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
AngeloGioacchino Del Regno, Srinivas Kandagatla, Hui.Liu,
Zhiyong Tao, Andrew-CT Chen, Lala Lin, linux-iio, devicetree,
linux-kernel, linux-arm-kernel, Daniel Golle, Rob Herring
From: Frank Wunderlich <frank-w@public-files.de>
Add compatible string for mt7986 SoC.
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
index d16d42fb98b6..7ec2988b597e 100644
--- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
+++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
@@ -27,6 +27,7 @@ properties:
- enum:
- mediatek,mt7622-efuse
- mediatek,mt7623-efuse
+ - mediatek,mt7986-efuse
- mediatek,mt8173-efuse
- mediatek,mt8183-efuse
- mediatek,mt8186-efuse
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse
2023-05-29 20:42 Subject: [PATCH v2 0/4] Add mt7986 thermal and pwm Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986 Frank Wunderlich
@ 2023-05-29 20:42 ` Frank Wunderlich
2023-05-30 6:38 ` AngeloGioacchino Del Regno
2023-05-29 20:42 ` [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Frank Wunderlich
3 siblings, 1 reply; 8+ messages in thread
From: Frank Wunderlich @ 2023-05-29 20:42 UTC (permalink / raw)
To: linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
AngeloGioacchino Del Regno, Srinivas Kandagatla, Hui.Liu,
Zhiyong Tao, Andrew-CT Chen, Lala Lin, linux-iio, devicetree,
linux-kernel, linux-arm-kernel, Daniel Golle
From: Daniel Golle <daniel@makrotopia.org>
Add thermal related nodes to mt7986 devicetree.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 37 ++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index aa9e679b78e2..a409d5e845c2 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -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,18 @@ 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 +603,4 @@ wifi: wifi@18000000 {
memory-region = <&wmcpu_emi>;
};
};
-
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones
2023-05-29 20:42 Subject: [PATCH v2 0/4] Add mt7986 thermal and pwm Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986 Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse Frank Wunderlich
@ 2023-05-29 20:42 ` Frank Wunderlich
2023-05-30 6:38 ` AngeloGioacchino Del Regno
2023-05-29 20:42 ` [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Frank Wunderlich
3 siblings, 1 reply; 8+ messages in thread
From: Frank Wunderlich @ 2023-05-29 20:42 UTC (permalink / raw)
To: linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
AngeloGioacchino Del Regno, Srinivas Kandagatla, Hui.Liu,
Zhiyong Tao, Andrew-CT Chen, Lala Lin, linux-iio, devicetree,
linux-kernel, linux-arm-kernel, Daniel Golle
From: Daniel Golle <daniel@makrotopia.org>
Add thermal-zones to mt7986 devicetree.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
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(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index a409d5e845c2..a059fcdaa8b7 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -603,4 +603,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";
+ };
+ };
+ };
+ };
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts
2023-05-29 20:42 Subject: [PATCH v2 0/4] Add mt7986 thermal and pwm Frank Wunderlich
` (2 preceding siblings ...)
2023-05-29 20:42 ` [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones Frank Wunderlich
@ 2023-05-29 20:42 ` Frank Wunderlich
2023-05-30 6:38 ` AngeloGioacchino Del Regno
3 siblings, 1 reply; 8+ messages in thread
From: Frank Wunderlich @ 2023-05-29 20:42 UTC (permalink / raw)
To: linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
AngeloGioacchino Del Regno, Srinivas Kandagatla, Hui.Liu,
Zhiyong Tao, Andrew-CT Chen, Lala Lin, linux-iio, devicetree,
linux-kernel, linux-arm-kernel, Daniel Golle
From: Daniel Golle <daniel@makrotopia.org>
Add pwm-fan and cooling-maps to BananaPi-R3 devicetree.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
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(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
index 782519429497..29c018bbf29d 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -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";
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts
2023-05-29 20:42 ` [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Frank Wunderlich
@ 2023-05-30 6:38 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-05-30 6:38 UTC (permalink / raw)
To: Frank Wunderlich, linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
Srinivas Kandagatla, Hui.Liu, Zhiyong Tao, Andrew-CT Chen,
Lala Lin, linux-iio, devicetree, linux-kernel, linux-arm-kernel,
Daniel Golle
Il 29/05/23 22:42, Frank Wunderlich ha scritto:
> From: Daniel Golle <daniel@makrotopia.org>
>
> Add pwm-fan and cooling-maps to BananaPi-R3 devicetree.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones
2023-05-29 20:42 ` [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones Frank Wunderlich
@ 2023-05-30 6:38 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-05-30 6:38 UTC (permalink / raw)
To: Frank Wunderlich, linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
Srinivas Kandagatla, Hui.Liu, Zhiyong Tao, Andrew-CT Chen,
Lala Lin, linux-iio, devicetree, linux-kernel, linux-arm-kernel,
Daniel Golle
Il 29/05/23 22:42, Frank Wunderlich ha scritto:
> From: Daniel Golle <daniel@makrotopia.org>
>
> Add thermal-zones to mt7986 devicetree.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse
2023-05-29 20:42 ` [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse Frank Wunderlich
@ 2023-05-30 6:38 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-05-30 6:38 UTC (permalink / raw)
To: Frank Wunderlich, linux-mediatek
Cc: Frank Wunderlich, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
Srinivas Kandagatla, Hui.Liu, Zhiyong Tao, Andrew-CT Chen,
Lala Lin, linux-iio, devicetree, linux-kernel, linux-arm-kernel,
Daniel Golle
Il 29/05/23 22:42, Frank Wunderlich ha scritto:
> From: Daniel Golle <daniel@makrotopia.org>
>
> Add thermal related nodes to mt7986 devicetree.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
> arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 37 ++++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
> index aa9e679b78e2..a409d5e845c2 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
> @@ -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,18 @@ pcie_port: pcie-phy@11c00000 {
> };
> };
>
> + efuse: efuse@11d00000 {
> + compatible = "mediatek,mt7986-efuse",
> + "mediatek,efuse";
Fits in one single line. After which:
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-05-30 6:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-29 20:42 Subject: [PATCH v2 0/4] Add mt7986 thermal and pwm Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986 Frank Wunderlich
2023-05-29 20:42 ` [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse Frank Wunderlich
2023-05-30 6:38 ` AngeloGioacchino Del Regno
2023-05-29 20:42 ` [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones Frank Wunderlich
2023-05-30 6:38 ` AngeloGioacchino Del Regno
2023-05-29 20:42 ` [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Frank Wunderlich
2023-05-30 6:38 ` AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).