From: Frank Wunderlich <[email protected]>
This series add thermal and pwm 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).
Daniel Golle (4):
arm64: dts: mt7986: add thermal and efuse
arm64: dts: mt7986: add PWM
arm64: dts: mt7986: add thermal-zones
arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts
Frank Wunderlich (3):
dt-bindings: nvmem: mediatek: efuse: add support for mt7986
dt-bindings: iio: adc: Add support for MT7986
arm64: dts: mt7986: add PWM to BPI-R3
.../iio/adc/mediatek,mt2701-auxadc.yaml | 1 +
.../bindings/nvmem/mediatek,efuse.yaml | 1 +
.../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 44 +++++++++
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 89 +++++++++++++++++++
4 files changed, 135 insertions(+)
--
2.34.1
From: Daniel Golle <[email protected]>
Add thermal related nodes to mt7986 devicetree.
Signed-off-by: Daniel Golle <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
---
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 51944690e790..a38965e23825 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -323,6 +323,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";
@@ -361,6 +370,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";
@@ -412,6 +436,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";
@@ -553,5 +589,4 @@ wifi: wifi@18000000 {
memory-region = <&wmcpu_emi>;
};
};
-
};
--
2.34.1
From: Frank Wunderlich <[email protected]>
Add compatible string for mt7986 SoC.
Signed-off-by: Frank Wunderlich <[email protected]>
---
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 75e0a516e59a..e3894f9d566e 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
From: Daniel Golle <[email protected]>
Add thermal-zones to mt7986 devicetree.
Signed-off-by: Daniel Golle <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 40 +++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index a409d5e845c2..845b29a9664a 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -603,4 +603,44 @@ 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_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 {
+ temperature = <85000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ cpu_trip_passive: passive {
+ temperature = <40000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
+ };
+ };
+ };
};
--
2.34.1
From: Frank Wunderlich <[email protected]>
Add pwm node and pinctrl to BananaPi R3 devicetree.
Signed-off-by: Frank Wunderlich <[email protected]>
---
.../boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 13 +++++++++++++
1 file changed, 13 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 2b028141f1f7..782519429497 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -274,6 +274,13 @@ mux {
};
};
+ pwm_pins: pwm-pins {
+ mux {
+ function = "pwm";
+ groups = "pwm0", "pwm1_0";
+ };
+ };
+
spi_flash_pins: spi-flash-pins {
mux {
function = "spi";
@@ -344,6 +351,12 @@ mux {
};
};
+&pwm {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm_pins>;
+ status = "okay";
+};
+
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
--
2.34.1
On Fri, 21 Apr 2023 15:20:41 +0200, Frank Wunderlich wrote:
> From: Frank Wunderlich <[email protected]>
>
> Add compatible string for mt7986 SoC.
>
> Signed-off-by: Frank Wunderlich <[email protected]>
> ---
> Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Acked-by: Rob Herring <[email protected]>
Hi,
just a ping, can this be picked up?
regards Frank
On 21/04/2023 15:20, Frank Wunderlich wrote:
> From: Frank Wunderlich <[email protected]>
>
> Add pwm node and pinctrl to BananaPi R3 devicetree.
>
> Signed-off-by: Frank Wunderlich <[email protected]>
Applied, thanks
> ---
> .../boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 13 +++++++++++++
> 1 file changed, 13 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 2b028141f1f7..782519429497 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
> @@ -274,6 +274,13 @@ mux {
> };
> };
>
> + pwm_pins: pwm-pins {
> + mux {
> + function = "pwm";
> + groups = "pwm0", "pwm1_0";
> + };
> + };
> +
> spi_flash_pins: spi-flash-pins {
> mux {
> function = "spi";
> @@ -344,6 +351,12 @@ mux {
> };
> };
>
> +&pwm {
> + pinctrl-names = "default";
> + pinctrl-0 = <&pwm_pins>;
> + status = "okay";
> +};
> +
> &spi0 {
> pinctrl-names = "default";
> pinctrl-0 = <&spi_flash_pins>;
+Srinivas as he is the maintainer
On 21/04/2023 15:20, Frank Wunderlich wrote:
> From: Frank Wunderlich <[email protected]>
>
> Add compatible string for mt7986 SoC.
>
> Signed-off-by: Frank Wunderlich <[email protected]>
> ---
> 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 75e0a516e59a..e3894f9d566e 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
Srinivas, will you take this patch through your tree or would you prefer that I
take it through the my MediaTek arm-soc tree? It's a trivial patch.
Best regards,
Matthias
> - mediatek,mt8173-efuse
> - mediatek,mt8183-efuse
> - mediatek,mt8186-efuse
On 21/04/2023 15:20, Frank Wunderlich wrote:
> From: Daniel Golle <[email protected]>
>
> Add thermal-zones to mt7986 devicetree.
>
> Signed-off-by: Daniel Golle <[email protected]>
> Signed-off-by: Frank Wunderlich <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 40 +++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
> index a409d5e845c2..845b29a9664a 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
> @@ -603,4 +603,44 @@ 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_crit: crit {
> + temperature = <125000>;
> + hysteresis = <2000>;
> + type = "critical";
> + };
> +
> + cpu_trip_hot: hot {
> + temperature = <120000>;
> + hysteresis = <2000>;
> + type = "hot";
> + };
We don't use above two trips. Please drop them for now.
Regards,
Matthias
> +
> + 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";
> + };
> + };
> + };
> + };
> };