[BPI-R4] Fan and other nodes missing from 6.15-rc mt7988a.dtsi

@frank-w I am doing some testing on the 6.15-rc and noticed that the fan, thermal zones and a bunch of other nodes have been removed from mt7988a.dtsi. I have added back the fan for myself as my device cannot cope without one running, and would be happy to get a patch ready for the missing nodes, but I’m wandering if they’ve been removed as a larger plan to move them elsewhere.

I currently upstream dts and i have to look how the nodes should go. In case of fan imho it has nothing to do with soc and have to be put into board layer dts. This board layer is now splitted (with 6.16 when my accepted patches are applied) because of the R4 phy version. See 6.15-mt7988upstream branch. Basicly the rc branch needs to be rebased on this after the changes are applied and the missing nodes added on top of it. I have already prepared the sfp and ethernet-patches to be separated but this needs pcs accepted first where daniel and some others working on. Have you changed fan anyhow (adjusting pwm values or thermal trips) and working like it should? Maybe this is the next part if ethernet takes some time as i guess.

Which other nodes are missing in rc branch?

edit: added the fan and cooling-points, can you please verify that is working for you correctly?

Thanks @frank-w. I’ll give that a try. Did a quick manual comparison between 6.12 and 6.15 mt7988a.dtsi to see what’s been removed and there seems to be quite a few nodes such as the afore mentioned fan and thermal nodes but also regulators, crypto, leds, pins and so on. (see below all the nodes I noticed that are in 6.12 but not in 6.15).

Some make sense to be removed like the audio, but others I’m not sure about.

edit: Noticed some of these are in mt7988a-bananapi-bpi-r4.dtsi. Will do a check against that to see if anything is still missing.

INCOMPLETE DTSI!

// SPDX-License-Identifier: GPL-2.0-only OR MIT

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/thermal/thermal.h>

/ {
	fan: pwm-fan {
		compatible = "pwm-fan";
		/* cooling level (0, 1, 2, 3) : (0% duty, 30% duty, 50% duty, 100% duty) */
		cooling-levels = <0 80 128 255>;
		#cooling-cells = <2>;
		#thermal-sensor-cells = <1>;
		status = "disabled";
	};

	reg_1p8v: regulator-1p8v {
		compatible = "regulator-fixed";
		regulator-name = "fixed-1.8V";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-boot-on;
		regulator-always-on;
	};

	reg_3p3v: regulator-3p3v {
		compatible = "regulator-fixed";
		regulator-name = "fixed-3.3V";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-boot-on;
		regulator-always-on;
	};

	thermal-zones {
		cpu_thermal: cpu-thermal {
			polling-delay-passive = <1000>;
			polling-delay = <1000>;
			thermal-sensors = <&lvts 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_med: active-med {
					temperature = <85000>;
					hysteresis = <2000>;
					type = "active";
				};

				cpu_trip_active_low: active-low {
					temperature = <40000>;
					hysteresis = <2000>;
					type = "active";
				};
			};

			cooling-maps {
				cpu-active-high {
				/* active: set fan to cooling level 2 */
					cooling-device = <&fan 3 3>;
					trip = <&cpu_trip_active_high>;
				};

				cpu-active-low {
				/* active: set fan to cooling level 1 */
					cooling-device = <&fan 2 2>;
					trip = <&cpu_trip_active_med>;
				};

				cpu-passive {
				/* passive: set fan to cooling level 0 */
					cooling-device = <&fan 1 1>;
					trip = <&cpu_trip_active_low>;
				};
			};
		};
	};

	soc {

		pio: pinctrl@1001f000 {

			mdio0_pins: mdio0-pins {
				mux {
					function = "eth";
					groups = "mdc_mdio0";
				};

				conf {
					pins = "SMI_0_MDC", "SMI_0_MDIO";
					drive-strength = <MTK_DRIVE_8mA>;
				};
			};

			i2c0_pins: i2c0-g0-pins {
				mux {
					function = "i2c";
					groups = "i2c0_1";
				};
			};

			i2c1_pins: i2c1-g0-pins {
				mux {
					function = "i2c";
					groups = "i2c1_0";
				};
			};

			i2c1_sfp_pins: i2c1-sfp-g0-pins {
				mux {
					function = "i2c";
					groups = "i2c1_sfp";
				};
			};

			i2c2_0_pins: i2c2-g0-pins {
				mux {
					function = "i2c";
					groups = "i2c2_0";
				};
			};

			i2c2_1_pins: i2c2-g1-pins {
				mux {
					function = "i2c";
					groups = "i2c2_1";
				};
			};

			gbe0_led0_pins: gbe0-led0-pins {
				mux {
					function = "led";
					groups = "gbe0_led0";
				};
			};

			gbe1_led0_pins: gbe1-led0-pins {
				mux {
					function = "led";
					groups = "gbe1_led0";
				};
			};

			gbe2_led0_pins: gbe2-led0-pins {
				mux {
					function = "led";
					groups = "gbe2_led0";
				};
			};

			gbe3_led0_pins: gbe3-led0-pins {
				mux {
					function = "led";
					groups = "gbe3_led0";
				};
			};

			gbe0_led1_pins: gbe0-led1-pins {
				mux {
					function = "led";
					groups = "gbe0_led1";
				};
			};

			gbe1_led1_pins: gbe1-led1-pins {
				mux {
					function = "led";
					groups = "gbe1_led1";
				};
			};

			gbe2_led1_pins: gbe2-led1-pins {
				mux {
					function = "led";
					groups = "gbe2_led1";
				};
			};

			gbe3_led1_pins: gbe3-led1-pins {
				mux {
					function = "led";
					groups = "gbe3_led1";
				};
			};

			i2p5gbe_led0_pins: 2p5gbe-led0-pins {
				mux {
					function = "led";
					groups = "2p5gbe_led0";
				};
			};

			i2p5gbe_led1_pins: 2p5gbe-led1-pins {
				mux {
					function = "led";
					groups = "2p5gbe_led1";
				};
			};

			mmc0_pins_emmc_45: mmc0-emmc-45-pins {
				mux {
					function = "flash";
					groups = "emmc_45";
				};
			};

			mmc0_pins_emmc_51: mmc0-emmc-51-pins {
				mux {
					function = "flash";
					groups = "emmc_51";
				};
			};

			mmc0_pins_sdcard: mmc0-sdcard-pins {
				mux {
					function = "flash";
					groups = "sdcard";
				};
			};

			uart0_pins: uart0-pins {
				mux {
					function = "uart";
					groups =  "uart0";
				};
			};

			snfi_pins: snfi-pins {
				mux {
					function = "flash";
					groups = "snfi";
				};
			};

			spi0_pins: spi0-pins {
				mux {
					function = "spi";
					groups = "spi0";
				};
			};

			spi0_flash_pins: spi0-flash-pins {
				mux {
					function = "spi";
					groups = "spi0", "spi0_wp_hold";
				};
			};

			spi1_pins: spi1-pins {
				mux {
					function = "spi";
					groups = "spi1";
				};
			};

			spi2_pins: spi2-pins {
				mux {
					function = "spi";
					groups = "spi2";
				};
			};

			spi2_flash_pins: spi2-flash-pins {
				mux {
					function = "spi";
					groups = "spi2", "spi2_wp_hold";
				};
			};

		};

		snand: spi@11001000 {
			compatible = "mediatek,mt7986-snand";
			reg = <0 0x11001000 0 0x1000>;
			interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&infracfg CLK_INFRA_SPINFI>,
				 <&infracfg CLK_INFRA_NFI>,
				 <&infracfg CLK_INFRA_66M_NFI_HCK>;
			clock-names = "pad_clk", "nfi_clk", "nfi_hclk";
			nand-ecc-engine = <&bch>;
			mediatek,quad-spi;
			#address-cells = <1>;
			#size-cells = <0>;
			pinctrl-names = "default";
			pinctrl-0 = <&snfi_pins>;
			status = "disabled";
		};

		bch: ecc@11002000 {
			compatible = "mediatek,mt7686-ecc";
			reg = <0 0x11002000 0 0x1000>;
			interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&infracfg CLK_INFRA_NFI>;
			clock-names = "nfiecc_clk";
			status = "disabled";
		};

		afe: audio-controller@11210000 {
			compatible = "mediatek,mt79xx-audio";
			reg = <0 0x11210000 0 0x9000>;
			interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&infracfg CLK_INFRA_66M_AUD_SLV_BCK>,
				 <&infracfg CLK_INFRA_AUD_26M>,
				 <&infracfg CLK_INFRA_AUD_L>,
				 <&infracfg CLK_INFRA_AUD_AUD>,
				 <&infracfg CLK_INFRA_AUD_EG2>,
				 <&topckgen CLK_TOP_AUD_SEL>,
				 <&topckgen CLK_TOP_AUD_I2S_M>;
			clock-names = "aud_bus_ck",
				      "aud_26m_ck",
				      "aud_l_ck",
				      "aud_aud_ck",
				      "aud_eg2_ck",
				      "aud_sel",
				      "aud_i2s_m";
			assigned-clocks = <&topckgen CLK_TOP_AUD_SEL>,
					  <&topckgen CLK_TOP_A1SYS_SEL>,
					  <&topckgen CLK_TOP_AUD_L_SEL>,
					  <&topckgen CLK_TOP_A_TUNER_SEL>;
			assigned-clock-parents = <&apmixedsys CLK_APMIXED_APLL2>,
						 <&topckgen CLK_TOP_APLL2_D4>,
						 <&apmixedsys CLK_APMIXED_APLL2>,
						 <&topckgen CLK_TOP_APLL2_D4>;
			status = "disabled";
		};

		crypto: crypto@15600000 {
			compatible = "inside-secure,safexcel-eip197b";
			reg = <0 0x15600000 0 0x180000>;
			interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "ring0", "ring1", "ring2", "ring3";
			status = "okay";
		};
	};
};