diff --git a/target/linux/qualcommax/dts/ipq8074-nbg7815.dts b/target/linux/qualcommax/dts/ipq8074-nbg7815.dts index f4eed1345a8..8967f7a1a0c 100644 --- a/target/linux/qualcommax/dts/ipq8074-nbg7815.dts +++ b/target/linux/qualcommax/dts/ipq8074-nbg7815.dts @@ -43,6 +43,25 @@ gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; }; }; + + fan: fan { + compatible = "gpio-fan"; + gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + /* nominal rpm of the stock fan */ + gpio-fan,speed-map = <0 0>, + <3000 1>; + #cooling-cells = <2>; + }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; }; &tlmm { @@ -62,7 +81,27 @@ }; }; - /* the stock firmware keeps gpio60 high to enable the LED board */ + i2c_1_pins: i2c1-pins { + mux { + pins = "gpio50", "gpio51"; + function = "blsp3_i2c"; + drive-strength = <8>; + bias-disable; + }; + }; + + /* + * The stock firmware keeps these outputs high: + * gpio22: second fan enable + * gpio60: LED board enable + */ + fan2-en { + gpio-hog; + gpios = <22 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "fan2-enable"; + }; + led-en { gpio-hog; gpios = <60 GPIO_ACTIVE_HIGH>; @@ -728,6 +767,33 @@ }; +/* use the second I2C bus for the second temperature sensor */ +/delete-node/ &blsp1_spi4; + +&soc { + i2c@78b8000 { + compatible = "qcom,i2c-qup-v2.2.1"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x078b8000 0x600>; + interrupts = ; + clocks = <&gcc GCC_BLSP1_QUP4_I2C_APPS_CLK>, + <&gcc GCC_BLSP1_AHB_CLK>; + clock-names = "core", "iface"; + clock-frequency = <400000>; + dmas = <&blsp_dma 18>, <&blsp_dma 19>; + dma-names = "tx", "rx"; + pinctrl-0 = <&i2c_1_pins>; + pinctrl-names = "default"; + status = "okay"; + + tmp103@70 { + compatible = "ti,tmp103"; + reg = <0x70>; + }; + }; +}; + &sdhc_1 { status = "okay"; /* unstable, problem with the hs400 > h200 speed switch */ @@ -750,6 +816,7 @@ }; &qusb_phy_1 { + vdd-supply = <&usb_vbus>; status = "okay"; }; @@ -770,3 +837,27 @@ qcom,ath11k-calibration-variant = "Zyxel-NBG7815"; }; + +&cluster_thermal { + trips { + cluster_fan: cluster-fan { + /* + * The stock firmware only switches the fan at 108/85 + * degC, which the SoC hardly ever reaches, so the case + * gets uncomfortably hot under load first. Start it at + * 85 degC instead, as discussed for this device in + * https://github.com/openwrt/openwrt/pull/14210 + */ + temperature = <85000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map2 { + trip = <&cluster_fan>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index f61c9cafeeb..de7225767f4 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -630,7 +630,7 @@ define Device/zyxel_nbg7815 DEVICE_DTS_CONFIG := config@nbg7815 SOC := ipq8074 DEVICE_PACKAGES := kmod-fs-f2fs f2fs-tools ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci \ - kmod-hci-uart kmod-hwmon-tmp103 \ + kmod-hci-uart kmod-hwmon-tmp103 kmod-hwmon-gpiofan \ kmod-leds-lp5569 endef TARGET_DEVICES += zyxel_nbg7815