Repository: openwrt/openwrt
Pull request #16329: Qualcommax: IPQ807x: Add support for TP-Link Deco X80-5G
Author: login: professor-jonny
Labels: name: kernel
description: pull request/issue with Linux kernel related changes
name: core packages
description: pull request/issue for core (in-tree) packages
name: target/qualcommax
description: pull request/issue for qualcommax target
Created: 2024-09-04T20:16:55Z | Merged: 2025-04-22T11:25:53Z

Qualcommax: IPQ807x: Add support for TP-Link Deco X80-5G
The TP-link Deco X80-5G is a AX WIFI router with a single 1G (LAN) and 1 2.5G (WAN) port with a built in Quectel 5G modem.

Specifications:

Architecture	ARMv8-A (aarch64 Cortex A53, 4 cores)
Vendor	Qualcomm
Bootloader	U-Boot (2016)
System-On-Chip	Qualcomm IPQ8074A (Networking Pro 1210 platform)
CPU/Speed	2.2GHZ
Flash-Chip	ESMT F59D1G81MB-45TI 1G-bit NAND
Flash MB	128MB (1Gbit)
RAM-chip	2* ESMT M15T4G16256A-DEBG2G 2Gb DDR3L (32bit)
RAM MB	512MB (4Gbit)
WLan System-On-Chip (5g)	Qualcomm QCN5054
WLan Front end modules (5g)	8* Qorvo QPF4588
WLAN (5G)	A/N/AC/AX
WLAN Antenna (int)	8* (4 shared with 2.5G)
WLan System-On-Chip (2.4G)	Qualcomm QCN5024
WLan Front end modules (2.4G)	4* Skyworks SKY85340-11
WLAN (2.4G)	B/G/N/AX
WLAN Antenna (int)	4* (shared with 5g)
Eithernet-phy (1Gbit)	Qualcomm (Atheros) AR8033-AL1A
Ethernet (1Gbit)	1*
Eithernet-phy (2.5Gbit)	Qualcomm QCA8081
Ethernet (2.5Gbit)	1*
Switch	Embedded in the SOC?
Serial	1.8v 8n1 (testpoints)
Modem System-On-Chip	Qualcomm 5G RG50xQ (Snapdragon X55 platform)
5G modem capability	5000Mbps down 900Mbps up
5G modem bands	N1/N3/N5/N7/N8/N20/N28/N38/N40/N41/N77/N78/N79
4G modem capability	4.5G LTE-Advanced Pro (Cat20 down 2Gbps) (Cat18 up 200Mbps)
4G modem FDD bands	B1/B3/B5/B7/B8/B18/B19/B20/B26/B28
4G modem TDD bands	B34/B38/B39/B40/B41/B42/B43
Modem antenna (int)	8* (5G/4G use)
Modem antenna (ext)	2* SMA connectors (5G/4G use)
SIM type	1* Nano SIM
Telephony	1* POTS RJ11
(see wiki for more info:)
https://openwrt.org/inbox/toh/tp-link/x80-5g_v1

        Notes:
Installation Instructions:

Between antennas 7 and 8 on the PCB with the RGB harness there are three test pads labelled TP1 TP2 and TP3 connections are as follows:
  |TP2|-- RX
  |TP1|-- TX
  |TP3|-- GND

RX requires an external pullup to operate somewhere around 5 K ohm but your luck may vary the Uart is 1.8v

Set a static IP and set up a tftpserver and terminal.
power the router and quickly type the magic string “tpl” and press enter to break into u-boot
in the shell set the environment variables to enable tftp booting
setenv ipaddr (routerIP)
setenv serverip (server IP)
load you initramfs:
tftpboot 0x44000000 (serverIP):openwrt-qualcommax-ipq807x-tplink_x80-5g-initramfs-uImage.itb
boot your initramfs
bootm
upload your factory image to /tmp
format and install the factory image:
ubiformat /dev/mtd12 -y -f /tmp/openwrt-qualcommax-ipq807x-tplink_x80-5g-squashfs-factory.ubi

Note as this device swaps root partitions upon update your boot partition may be set as mtd13

Update script to mount factory tplink partition's for MAC recovery and device data.
Capture Labelmac from Factory_data partition.
Patch LAN from Labelmac.
Patch ART from Labelmac.
Set GPIO to make modem operational from boot.

GPIO fan tables work like the  stock device with three fan maps high active idle with a top fan speed of 6800 RPM.

High temp 70 deg speeds 6-8
Active temp 50 deg speeds 2-5
low temp 25 degree speed 0-1

Signed-off-by: Jonathan Brophy <professor_jonny@hotmail.com>


Diff:
diff --git a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
index 21ec0ae5b133ca..723b0981c44e97 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
+++ b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x
@@ -39,6 +39,7 @@ netgear,sxs80|\
 netgear,wax218|\
 netgear,wax620|\
 netgear,wax630|\
+tplink,deco-x80-5g|\
 tplink,eap620hd-v1|\
 tplink,eap660hd-v1)
 	ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x20000"
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 5e233656e89c3e..d21ee73fc26ed7 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -67,6 +67,7 @@ ALLWIFIBOARDS:= \
 	redmi_ax6 \
 	skspruce_wia3300-20 \
 	spectrum_sax1v1k \
+	tplink_deco-x80-5g \
 	tplink_eap610-outdoor \
 	tplink_eap620hd-v1 \
 	tplink_eap623od-hd-v1 \
@@ -217,6 +218,7 @@ $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
 $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
 $(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20))
 $(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K))
+$(eval $(call generate-ipq-wifi-package,tplink_deco-x80-5g,TP-Link Deco X80-5G))
 $(eval $(call generate-ipq-wifi-package,tplink_eap610-outdoor,TPLink EAP610-Outdoor))
 $(eval $(call generate-ipq-wifi-package,tplink_eap620hd-v1,TP-Link EAP620 HD v1))
 $(eval $(call generate-ipq-wifi-package,tplink_eap623od-hd-v1,TP-Link EAP623-Outdoor HD v1))
diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
new file mode 100644
index 00000000000000..09f8be6e15a7fb
--- /dev/null
+++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
@@ -0,0 +1,458 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-names = "default";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-1 = <&antenna_pins>;
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element used for status functions.
+		To mimic the OEM default behaviour green and red are switched on from boot to indicate yellow (power on).*/
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		pins = "gpio56";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	modem_pins: modem-state {
+		pins = "gpio29", "gpio55";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
+
+		};
+	};
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&usb_0 {
+	status = "okay";
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	qca8033: ethernet-phy@4 {
+		compatible = "ethernet-phy-ieee802.3-c22"; /* lan phy */
+		reg = <4>;
+	};
+
+	qca8081: ethernet-phy@28 {
+		compatible = "ethernet-phy-id004d.d101"; /* wan phy */
+		reg = <28>;
+		reset-deassert-us = <10000>;
+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
+	};
+};
+
+
+&switch {
+	status = "okay";
+
+	switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
+	switch_lan_bmp = <ESS_PORT6>; /* lan port bitmap */
+	switch_mac_mode1 = <MAC_MODE_SGMII_PLUS>; /* mac mode for uniphy instance1*/
+	switch_mac_mode2 = <MAC_MODE_SGMII_CHANNEL0>; /* mac mode for uniphy instance2*/
+
+	qcom,port_phyinfo {
+		port@5 {
+			port_id = <5>;
+			phy_address = <28>;
+			port_mac_sel = "QGMAC_PORT";
+		};
+		port@6 {
+			port_id = <6>;
+			phy_address = <4>;
+		};
+	};
+};
+
+&edma {
+	status = "okay";
+};
+
+&dp5 {
+	status = "okay";
+	phy-handle = <&qca8081>;
+	label = "wan";
+};
+
+&dp6_syn {
+	status = "okay";
+	phy-handle = <&qca8033>;
+	label = "lan";
+};
+
+&wifi {
+	status = "okay";
+	qcom,ath11k-calibration-variant = "tplink_deco-x80-5g";
+};
diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk
index 9a615eb0b492df..bd1529807e9140 100644
--- a/target/linux/qualcommax/image/ipq807x.mk
+++ b/target/linux/qualcommax/image/ipq807x.mk
@@ -392,6 +392,21 @@ define Device/spectrum_sax1v1k
 endef
 TARGET_DEVICES += spectrum_sax1v1k
 
+
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := Deco X80-5G
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config@hk01.c5
+	SOC := ipq8074
+	DEVICE_PACKAGES := kmod-hwmon-gpiofan ipq-wifi-tplink_deco-x80-5g \
+	 	 kmod-usb-serial-option kmod-usb-net-qmi-wwan
+endef
+TARGET_DEVICES += tplink_deco-x80-5g
+
 define Device/tplink_eap620hd-v1
 	$(call Device/FitImage)
 	$(call Device/UbiFit)
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
index 7d55f6ab69e10b..437b3936b3e68a 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ ipq807x_setup_interfaces()
 	case "$board" in
 	aliyun,ap8220|\
 	edgecore,eap102|\
+	tplink,deco-x80-5g|\
 	yuncore,ax880|\
 	zte,mf269)
 		ucidef_set_interfaces_lan_wan "lan" "wan"
@@ -100,6 +101,11 @@ ipq807x_setup_macs()
 		lan_mac=$(macaddr_add $label_mac 1)
 		wan_mac=$label_mac
 		;;
+	tplink,deco-x80-5g)
+		label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		lan_mac=$(macaddr_add $label_mac 1)
+		wan_mac=$label_mac
+		;;
 	tplink,eap620hd-v1|\
 	tplink,eap660hd-v1)
 		label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index 508ecec314a357..d46e84bf8b970a 100644
--- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -96,6 +96,13 @@ case "$FIRMWARE" in
 	spectrum,sax1v1k)
 		caldata_extract_mmc "0:ART" 0x1000 0x20000
 		;;
+	tplink,deco-x80-5g)
+		caldata_extract "0:art" 0x1000 0x20000
+		label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		ath11k_patch_mac $(macaddr_add $label_mac -1) 0
+		ath11k_patch_mac $(macaddr_add $label_mac -2) 1
+		ath11k_set_macflag
+		;;
 	tplink,eap620hd-v1|\
 	tplink,eap660hd-v1)
 		caldata_from_file "/tmp/factory_data/radio" 0 0x20000
diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data b/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
index 2563202a1a2c2a..4e7071155a7424 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
@@ -1,20 +1,32 @@
 #!/bin/sh
 
+. /lib/functions.sh
+. /lib/functions/system.sh
+
 preinit_mount_factory_data() {
+	local part_name="$1"
 	local mtd_path
+	local ubi_num
+
+		mtd_path=$(find_mtd_chardev "$part_name")
+		ubi_num=$(grep $part_name /proc/mtd | cut -c 1-5 | grep -o '[0-9]*')
+		ubiattach --dev-path="$mtd_path" --devn=$ubi_num
+		mkdir /tmp/$part_name
+		mount -o ro,noatime -t ubifs ubi$ubi_num:ubi_$part_name /tmp/$part_name
+}
 
-	. /lib/functions.sh
-	. /lib/functions/system.sh
+preinit_mount_factory_partitions() {
 
 	case $(board_name) in
+	tplink,deco-x80-5g)
+		preinit_mount_factory_data "factory_data"
+		preinit_mount_factory_data "runtime_data"
+		;;
 	tplink,eap620hd-v1|\
 	tplink,eap660hd-v1)
-		mtd_path=$(find_mtd_chardev "factory_data")
-		ubiattach --dev-path="$mtd_path" --devn=1
-		mkdir /tmp/factory_data
-		mount -o ro,noatime -t ubifs ubi1:ubi_factory_data /tmp/factory_data
+		preinit_mount_factory_data "tp_data"
 		;;
 	esac
 }
 
-boot_hook_add preinit_main preinit_mount_factory_data
+boot_hook_add preinit_main preinit_mount_factory_partitions
diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
index ec8d0f58b0601e..0a38cfa8d8cbb1 100644
--- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
@@ -262,6 +262,7 @@ platform_do_upgrade() {
 		CI_DATAPART="rootfs_data"
 		emmc_do_upgrade "$1"
 		;;
+	tplink,deco-x80-5g|\
 	tplink,eap620hd-v1|\
 	tplink,eap660hd-v1)
 		tplink_do_upgrade "$1"


Reviews:
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T01:48:54Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T01:50:12Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T01:50:37Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T01:52:44Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T02:28:44Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T02:45:43Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-05T03:38:23Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-06T05:02:37Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-06T08:06:08Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-06T08:06:51Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-06T08:07:54Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:03:41Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:05:06Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:06:05Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:06:52Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:07:55Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:14:02Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T10:14:30Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T22:39:08Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-08T22:44:19Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-09T23:46:44Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-10T09:10:05Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-10T09:11:39Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-10T09:14:10Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-10T18:52:46Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-09-10T20:00:32Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-10-31T10:03:37Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-03T19:17:33Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-03T19:18:49Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-03T21:38:26Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-03T21:49:36Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-10T10:26:43Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-10T10:47:58Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-10T18:27:51Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-11-11T19:18:30Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2024-12-27T19:16:18Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-01-13T14:06:11Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-01-13T14:08:50Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-01-15T10:56:54Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-16T11:06:48Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-16T11:07:08Z
user: login: musashino205
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-22T07:05:25Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-22T09:06:07Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-22T10:50:24Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T11:09:55Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-28T13:45:20Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T18:35:43Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T18:37:14Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T18:38:32Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T00:40:40Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T20:29:07Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T08:30:51Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T11:17:54Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-21T09:28:16Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-21T09:28:59Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-21T09:29:35Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-21T21:33:59Z
user: login: professor-jonny
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-21T22:01:06Z
user: login: robimarko
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-22T11:24:44Z

Review comments:
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: wrong indent
created_at: 2024-09-05T01:48:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: `button-reset` or `key-reset` (`gpio-keys` doesn't use `reg` property and `@` shoudn't be used)
created_at: 2024-09-05T01:50:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: Please add missing `function` properties.
created_at: 2024-09-05T01:50:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: And please use `led-*` aliases in `aliases {}` node for status LED handling of OpenWrt instead of user-space script.
created_at: 2024-09-05T01:52:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: professor-jonny
body: The LED's don't have a set assigned function they have multiple as they are not singular LED's it is a multifunction RGB LED.
There is no monochromatic LED support in OpenWrt and no support for virtual LED's' by mixing colors to be able to assign individual functions to individual colors.
I don't know how to proceed, and other targets has left them blank as I have.


created_at: 2024-09-05T02:28:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: `function` property is used for LED name `<color>:<function>` (example: `green:status`) in **/sys/class/leds/**.

IMO:

```
aliases {
	led-boot = &led_system_green;
	led-falsafe = &led_system_red;
	led-running = &led_system_green;
	led-upgrade = &led_system_green;
	...
}
...
led_system_green: led-0 {
	gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
	color = <LED_COLOR_ID_GREEN>;
	function = LED_FUNCTION_STATUS;
};

led_system_red: led-1 {
	gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
	color = <LED_COLOR_ID_RED>;
	function = LED_FUNCTION_STATUS;
	default-state = "off";
};

led-2 {
	gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
	color = <LED_COLOR_ID_BLUE>;
	function = LED_FUNCTION_STATUS;
	default-state = "off";
};
```
created_at: 2024-09-05T02:45:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: professor-jonny
body: how do I assign an alias to mimic the oem colours ? as power is yellow in the device which is a mix of red and green led's

As at the moment I have left the default state as on for both of those led's as it seems I can only have a one to one mapping as there is no virtual gpio function like the QSDK.

```

		yellow_mix {
			default-state = "off";
			virtuals = <red_led>, <green_led>;
		};
		blue_mix {
			default-state = "off";
			virtuals = <blue_led>, <green_led>;


```

created_at: 2024-09-05T03:38:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: professor-jonny
body: If we could implement this then I can define LED colours direcly in the dts I believe.

 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/leds/rgb/leds-group-multicolor.c?h=v6.10.8
created_at: 2024-09-06T05:02:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+/* to suit the tplink_x80 target*/
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink deco-x80-5g";
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: This should be `"TP-Link Deco X80-5G"`
created_at: 2024-09-06T08:06:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+/* to suit the tplink_x80 target*/
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink deco-x80-5g";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a single combined RGB element
+		//to mimic the OEM default behavior green and red are switched on from boot to indicate yellow
+		//to show the device is booting behavior can be user defined in procd to override this.
+		//OEM behaviour of multi function LED:
+		//pulse Yellow: resetting/ rebooting.
+		//Solid Yellow: starting up.
+		//Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		//Solid Blue: setting up/ comitting settings change.
+		//Pulse Green: upgrading firmware.
+		//Solid Green: connected to 4G / WAN.
+		//Solid Purple: connected to 5G.
+		//Pulse Red: mesh failure cant find peers.
+		//Solid Red: fault
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: musashino205
body: Please use `/* */` instead of `//` for comments.
created_at: 2024-09-06T08:06:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -332,6 +332,21 @@ define Device/redmi_ax6
 endef
 TARGET_DEVICES += redmi_ax6
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := deco-x80-5g
path: target/linux/qualcommax/image/ipq807x.mk
user: login: musashino205
body: This should be `Deco X80-5G`.
created_at: 2024-09-06T08:07:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -180,6 +181,7 @@ $(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K))
 $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
 $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
 $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
+$(eval $(call generate-ipq-wifi-package,tplink_deco-x80-5g,tplink deco-x80-5g))
path: package/firmware/ipq-wifi/Makefile
user: login: robimarko
body: The last input should be a full user visible board name, look at the others, so make that pretty.
created_at: 2024-09-08T10:03:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -332,6 +332,21 @@ define Device/redmi_ax6
 endef
 TARGET_DEVICES += redmi_ax6
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := deco-x80-5g
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config@hk01.c5
+	SOC := ipq8074
+	DEVICE_PACKAGES := kmod-hwmon-gpiofan kmod-usb3 ipq-wifi-tplink_deco-x80-5g \
path: target/linux/qualcommax/image/ipq807x.mk
user: login: robimarko
body: `kmod-usb3` is already included by default
created_at: 2024-09-08T10:05:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -332,6 +332,21 @@ define Device/redmi_ax6
 endef
 TARGET_DEVICES += redmi_ax6
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := deco-x80-5g
path: target/linux/qualcommax/image/ipq807x.mk
user: login: robimarko
body: Please stop marking stuff as resolved when it wasn't, and change to @musashino205 suggestion
created_at: 2024-09-08T10:06:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: This comment is broken, its never closed.
created_at: 2024-09-08T10:06:52Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Please look into how multiline comments work, there is no point in opening and closing comments for each line.

created_at: 2024-09-08T10:07:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+/* to suit the TP-Link Deco X80-5G target*/
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/* note the LED's defined here are not individual they are a single combined RGB element */
+		/* to mimic the OEM default behavior green and red are switched on from boot to indicate yellow */
+		/* to show the device is booting behavior can be user defined in procd to override this. */
+		/* OEM behavior of multi function LED: */
+		/* pulse Yellow: resetting/ rebooting. */
+		/* Solid Yellow: starting up. *./
+		/* Pulse Blue: factory reset/ first boot ready for setup or WPS in progress. */
+		/* Solid Blue: setting up/ committing settings change. */
+		/* Pulse Green: upgrading firmware. */
+		/* Solid Green: connected to 4G / WAN. */
+		/* Solid Purple: connected to 5G. */
+		/* Pulse Red: mesh failure cant find peers. */
+		/* Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on startup */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on startup */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+						<&tlmm 41 GPIO_ACTIVE_LOW>,
+						<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99 */
+		/* 6800 rpm */
+		/* gpio68 seemed to be the feedback rpm of the fan. */
+		/* no support for fan speed in kernel saved for future use. */
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		/* alarm-gpios = <&tlmm XX GPIO_ACTIVE_HIGH>; */
+		cooling-min-level = <0>; /* minimum speed allowable to be set via thermal */
+		cooling-max-level = <7>; /* max speed allowable to be set via thermal */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>; /* set 2ma max drive on reset button */
+		bias-pull-up; /* set pullup for reset button */
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;  /* set 2ma max drive on fan pins */
+		bias-disable; /* disable bias for fan outputs */
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;  /* set 2ma max drive on antenna pins */
+			bias-disable;  /* disable bias for external antenna control */
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>; /* set 2ma max drive on modem reset */
+			bias-disable; /* disable bias for modem reset control */
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;  /* set 2ma max drive on modem reset */
+			bias-disable;  /* disable bias for modem wan disable control */
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;  /* set 8ma max drive on led pins */
+		bias-disable; /* disable bias for modem wan disable control */
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay"; /* enable msm high speed uart */
+};
+
+&cryptobam {
+	status = "okay"; /* enable dma controller */
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay"; /* enable Pseudo-Random Number Generator */
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay"; /* enable nand controller */
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
+		};
+	};
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&usb_0 {
+	status = "okay"; /* enable first usb3 controller */
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	qca8033: ethernet-phy@4 {
+		compatible = "ethernet-phy-ieee802.3-c22"; /* lan phy */
+		reg = <0x4>;
+	};
+
+	qca8081: ethernet-phy@28 {
+		compatible = "ethernet-phy-id004d.d101"; /* wan phy */
+		reg = <28>;
+		reset-deassert-us = <10000>;
+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
+	};
+};
+
+
+&switch {
+	status = "okay";
+
+	switch_lan_bmp = <ESS_PORT6>; /* lan port bitmap */
+	switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
+	switch_mac_mode1 = <MAC_MODE_SGMII_CHANNEL0>; /* mac mode for uniphy instance1*/
+	switch_mac_mode2 = <MAC_MODE_SGMII_CHANNEL0>; /* mac mode for uniphy instance2*/
+
+	qcom,port_phyinfo {
+		port@6 {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Please sort these by port index
created_at: 2024-09-08T10:14:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+/* to suit the TP-Link Deco X80-5G target*/
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/* note the LED's defined here are not individual they are a single combined RGB element */
+		/* to mimic the OEM default behavior green and red are switched on from boot to indicate yellow */
+		/* to show the device is booting behavior can be user defined in procd to override this. */
+		/* OEM behavior of multi function LED: */
+		/* pulse Yellow: resetting/ rebooting. */
+		/* Solid Yellow: starting up. *./
+		/* Pulse Blue: factory reset/ first boot ready for setup or WPS in progress. */
+		/* Solid Blue: setting up/ committing settings change. */
+		/* Pulse Green: upgrading firmware. */
+		/* Solid Green: connected to 4G / WAN. */
+		/* Solid Purple: connected to 5G. */
+		/* Pulse Red: mesh failure cant find peers. */
+		/* Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on startup */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on startup */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+						<&tlmm 41 GPIO_ACTIVE_LOW>,
+						<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99 */
+		/* 6800 rpm */
+		/* gpio68 seemed to be the feedback rpm of the fan. */
+		/* no support for fan speed in kernel saved for future use. */
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		/* alarm-gpios = <&tlmm XX GPIO_ACTIVE_HIGH>; */
+		cooling-min-level = <0>; /* minimum speed allowable to be set via thermal */
+		cooling-max-level = <7>; /* max speed allowable to be set via thermal */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>; /* set 2ma max drive on reset button */
+		bias-pull-up; /* set pullup for reset button */
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;  /* set 2ma max drive on fan pins */
+		bias-disable; /* disable bias for fan outputs */
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;  /* set 2ma max drive on antenna pins */
+			bias-disable;  /* disable bias for external antenna control */
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>; /* set 2ma max drive on modem reset */
+			bias-disable; /* disable bias for modem reset control */
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;  /* set 2ma max drive on modem reset */
+			bias-disable;  /* disable bias for modem wan disable control */
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;  /* set 8ma max drive on led pins */
+		bias-disable; /* disable bias for modem wan disable control */
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay"; /* enable msm high speed uart */
+};
+
+&cryptobam {
+	status = "okay"; /* enable dma controller */
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay"; /* enable Pseudo-Random Number Generator */
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay"; /* enable nand controller */
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
+		};
+	};
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&usb_0 {
+	status = "okay"; /* enable first usb3 controller */
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	qca8033: ethernet-phy@4 {
+		compatible = "ethernet-phy-ieee802.3-c22"; /* lan phy */
+		reg = <0x4>;
+	};
+
+	qca8081: ethernet-phy@28 {
+		compatible = "ethernet-phy-id004d.d101"; /* wan phy */
+		reg = <28>;
+		reset-deassert-us = <10000>;
+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
+	};
+};
+
+
+&switch {
+	status = "okay";
+
+	switch_lan_bmp = <ESS_PORT6>; /* lan port bitmap */
+	switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
+	switch_mac_mode1 = <MAC_MODE_SGMII_CHANNEL0>; /* mac mode for uniphy instance1*/
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: If QCA8081 is connected here then use `MAC_MODE_SGMII_PLUS`
created_at: 2024-09-08T10:14:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+/* to suit the TP-Link Deco X80-5G target*/
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/* note the LED's defined here are not individual they are a single combined RGB element */
+		/* to mimic the OEM default behavior green and red are switched on from boot to indicate yellow */
+		/* to show the device is booting behavior can be user defined in procd to override this. */
+		/* OEM behavior of multi function LED: */
+		/* pulse Yellow: resetting/ rebooting. */
+		/* Solid Yellow: starting up. *./
+		/* Pulse Blue: factory reset/ first boot ready for setup or WPS in progress. */
+		/* Solid Blue: setting up/ committing settings change. */
+		/* Pulse Green: upgrading firmware. */
+		/* Solid Green: connected to 4G / WAN. */
+		/* Solid Purple: connected to 5G. */
+		/* Pulse Red: mesh failure cant find peers. */
+		/* Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on startup */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on startup */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+						<&tlmm 41 GPIO_ACTIVE_LOW>,
+						<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99 */
+		/* 6800 rpm */
+		/* gpio68 seemed to be the feedback rpm of the fan. */
+		/* no support for fan speed in kernel saved for future use. */
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		/* alarm-gpios = <&tlmm XX GPIO_ACTIVE_HIGH>; */
+		cooling-min-level = <0>; /* minimum speed allowable to be set via thermal */
+		cooling-max-level = <7>; /* max speed allowable to be set via thermal */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>; /* temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* minimum and maximum states of the cooling device */
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>; /* minimum and maximum states of the cooling device */
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* minimum and maximum states of the cooling device */
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>; /* set 2ma max drive on reset button */
+		bias-pull-up; /* set pullup for reset button */
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;  /* set 2ma max drive on fan pins */
+		bias-disable; /* disable bias for fan outputs */
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;  /* set 2ma max drive on antenna pins */
+			bias-disable;  /* disable bias for external antenna control */
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>; /* set 2ma max drive on modem reset */
+			bias-disable; /* disable bias for modem reset control */
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;  /* set 2ma max drive on modem reset */
+			bias-disable;  /* disable bias for modem wan disable control */
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;  /* set 8ma max drive on led pins */
+		bias-disable; /* disable bias for modem wan disable control */
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay"; /* enable msm high speed uart */
+};
+
+&cryptobam {
+	status = "okay"; /* enable dma controller */
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay"; /* enable Pseudo-Random Number Generator */
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay"; /* enable nand controller */
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
+		};
+	};
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&usb_0 {
+	status = "okay"; /* enable first usb3 controller */
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	qca8033: ethernet-phy@4 {
+		compatible = "ethernet-phy-ieee802.3-c22"; /* lan phy */
+		reg = <0x4>;
+	};
+
+	qca8081: ethernet-phy@28 {
+		compatible = "ethernet-phy-id004d.d101"; /* wan phy */
+		reg = <28>;
+		reset-deassert-us = <10000>;
+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
+	};
+};
+
+
+&switch {
+	status = "okay";
+
+	switch_lan_bmp = <ESS_PORT6>; /* lan port bitmap */
+	switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
+	switch_mac_mode1 = <MAC_MODE_SGMII_CHANNEL0>; /* mac mode for uniphy instance1*/
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: Ok thanks I have force pushed updates hopefully I have resolved all issues now
created_at: 2024-09-08T22:39:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -332,6 +332,21 @@ define Device/redmi_ax6
 endef
 TARGET_DEVICES += redmi_ax6
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := deco-x80-5g
path: target/linux/qualcommax/image/ipq807x.mk
user: login: professor-jonny
body: I did change it from `x80-5g` to `deco-x80-5g` sorry I'm a bit lost in what is strings and what are id's but I'm learning.
created_at: 2024-09-08T22:44:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,476 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com> */
+/* altered by Jonathan Brophy <professor_jonny@hotmail.com> */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "tplink x80-5g";
+	compatible = "tplink,x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 //Aliases as required by u-boot to patch MAC addresses
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; // Aliases to capture wan mac from bootloader
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; // wwan disable output
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // reset modem output
+		};
+	};
+
+		antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; // select external sma antennas for WWan output
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		button@1 {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; //reset button output
+			linux,code = <KEY_RESTART>; // Aliases for button to stitch to linux reset functioon
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		// note the LED'd defined here are not individual they are a combined RGB led
+		// and each led has no defined single function but has multiple functioons
+		//to mimic the oem default behaviour green and red are switched on from boot to indicate yellow
+		//to show the device is booting behaviour can be user defined in procd to override this.
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; //green led component of RGB led
+			color = <LED_COLOR_ID_GREEN>;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; //red led component of RGB led
+			color = <LED_COLOR_ID_RED>;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; //blue led component of RGB
+			color = <LED_COLOR_ID_BLUE>;
+		};
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-x80-5g.dts
user: login: professor-jonny
body: I have just removed the script and will drive from procd, and I plan to make a kmod for the led's to support colour mixing the led's directly from DTS.


created_at: 2024-09-09T23:46:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		/* alarm-gpios = <&tlmm XX GPIO_ACTIVE_HIGH>; */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Drop it since it doesnt exist
created_at: 2024-09-10T09:10:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		/* alarm-gpios = <&tlmm XX GPIO_ACTIVE_HIGH>; */
+		cooling-min-level = <0>; /* minimum speed allowable to be set via thermal */
+		cooling-max-level = <7>; /* max speed allowable to be set via thermal */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: I dont think `cooling-min-level` and `cooling-max-level` exist upstream, bindings dont describe them at all
created_at: 2024-09-10T09:11:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -332,6 +332,21 @@ define Device/redmi_ax6
 endef
 TARGET_DEVICES += redmi_ax6
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := Deco X80-5G
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config@hk01.c5
+	SOC := ipq8074
+	DEVICE_PACKAGES := kmod-hwmon-gpiofan ipq-wifi-tplink_deco-x80-5g \
+	 	 kmod-usb-serial-option kmod-usb-net-qmi-wwan kmod-usb-serial-qualcomm uqmi\
+		 usbutils kmod-usb-storage
path: target/linux/qualcommax/image/ipq807x.mk
user: login: robimarko
body: Why do you need kmod-usb-storage and usbutils by default?
created_at: 2024-09-10T09:14:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -332,6 +332,21 @@ define Device/redmi_ax6
 endef
 TARGET_DEVICES += redmi_ax6
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := Deco X80-5G
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config@hk01.c5
+	SOC := ipq8074
+	DEVICE_PACKAGES := kmod-hwmon-gpiofan ipq-wifi-tplink_deco-x80-5g \
+	 	 kmod-usb-serial-option kmod-usb-net-qmi-wwan kmod-usb-serial-qualcomm uqmi\
+		 usbutils kmod-usb-storage
path: target/linux/qualcommax/image/ipq807x.mk
user: login: professor-jonny
body: ill drop them yip it does not need usb storage at all but the tools one was handy to diag when I was getting the modem initially peeking and poking with the modem but can be removed now.
created_at: 2024-09-10T18:52:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,488 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		/* alarm-gpios = <&tlmm XX GPIO_ACTIVE_HIGH>; */
+		cooling-min-level = <0>; /* minimum speed allowable to be set via thermal */
+		cooling-max-level = <7>; /* max speed allowable to be set via thermal */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: ok I have removed them I just followed the upstream example.
created_at: 2024-09-10T20:00:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,485 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 		 ethernet0 = &dp5; /* Aliases to capture wan mac from bootloader */
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb led */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal { /* first thermal node setup explanition of settings */
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* cpu-high temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* cpu-active temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* Cpu-idle temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* mini and max states of the cooling device in cpu-high band */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* min and max states of the cooling device in cpu-active band */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* min and max states of the cooling device in cpu-idle band */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
+		};
+	};
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&usb_0 {
+	status = "okay";
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	qca8033: ethernet-phy@4 {
+		compatible = "ethernet-phy-ieee802.3-c22"; /* lan phy */
+		reg = <0x4>;
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Decimal please
created_at: 2024-10-31T10:03:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -358,6 +358,20 @@ define Device/tplink_eap660hd-v1
 endef
 TARGET_DEVICES += tplink_eap660hd-v1
 
+define Device/tplink_deco-x80-5g
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := TP-Link
+	DEVICE_MODEL := Deco X80-5G
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config@hk01.c5
+	SOC := ipq8074
+	DEVICE_PACKAGES := kmod-hwmon-gpiofan ipq-wifi-tplink_deco-x80-5g \
+	 	 kmod-usb-serial-option kmod-usb-net-qmi-wwan kmod-usb-serial-qualcomm uqmi
path: target/linux/qualcommax/image/ipq807x.mk
user: login: robimarko
body: `kmod-usb-serial-qualcomm` should not be needed, usually, the option driver registers all of the serial interfaces.

Also, I would prefer `uqmi` to be dropped as ModemManager etc can be used for this modem as well so it makes no sense to include it by default in the default images.
created_at: 2024-11-03T19:17:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: robimarko
body: I would prefer moving this to caldata, you can look at examples there how to patch the MAC so we dont need this fixup.
created_at: 2024-11-03T19:18:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: professor-jonny
body: I tried to patch that previously, but I don't think the partition is mounted in time to patch caldata using the hotplug.d script.

I can try again
created_at: 2024-11-03T21:38:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: robimarko
body: It has to be mounted since you are mounting it in preinit, otherwise caldata loading would have failed as well
created_at: 2024-11-03T21:49:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: professor-jonny
body:  I found the partition mounting to pull the mac binary unreliable it did not work every time.
It seems ubiatatch exits with an exitcode but the partition is not ready by the time the mound command operates, and it fails to find the MTD device. some of the time.

I added a sleep 1 in the script and it fixes the problem but the get mac binary does not work for the lan as that inits well before the partition is up and it has already got a random mac by that time.

I'm not sure how to fix the lan mac apart from writing it into bootargs in and modifying the dts.
created_at: 2024-11-10T10:26:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: robimarko
body: Hm, can you try defining a fixed partition table and then using `compatible = "linux,ubi";` as that will make the kernel automount that UBI volume and that should happen really early as well.
created_at: 2024-11-10T10:47:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: professor-jonny
body: ok, do I have to define the whole partition map or just the partitions I want to mount as this has an smem table?

This is the boot mountingit is after the fallback mac:
```
[    4.417036] GMAC6(ffffff800400b900) Invalid MAC@ - using fe:c0:c3:3c:71:b4
[    4.626315] init: - preinit -
[    5.060429] ubi1: attaching mtd15
[    5.110661] ubi1: scanning is finished
[    5.117811] ubi1: attached mtd15 (name "factory_data", size 9 MiB)
[    5.117852] ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    5.122891] ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    5.129781] ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096
[    5.136618] ubi1: good PEBs: 72, bad PEBs: 0, corrupted PEBs: 0
[    5.143376] ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128
[    5.149284] ubi1: max/mean erase counter: 16/9, WL threshold: 4096, image sequence number: 1097309032
[    5.156578] ubi1: available PEBs: 0, total reserved PEBs: 72, PEBs reserved for bad PEB handling: 20
[    5.165883] ubi1: background thread "ubi_bgt1d" started, PID 760
[    5.429679] UBIFS (ubi1:0): recovery needed
[    5.477984] UBIFS (ubi1:0): recovery deferred
[    5.478100] UBIFS (ubi1:0): UBIFS: mounted UBI device 1, volume 0, name "ubi_factory_data", R/O mode
[    5.481324] UBIFS (ubi1:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    5.490548] UBIFS (ubi1:0): FS size: 4825088 bytes (4 MiB, 38 LEBs), max 48 LEBs, journal size 1142785 bytes (1 MiB, 9 LEBs)
[    5.500351] UBIFS (ubi1:0): reserved for root: 0 bytes (0 KiB)
[    5.511618] UBIFS (ubi1:0): media format: w4/r0 (latest is w5/r0), UUID 555FE482-AC27-41A3-A0C3-47CC50ED88FA, small LPT model

```

created_at: 2024-11-10T18:27:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: professor-jonny
body: fixed partitions still did not fix the network mac issue but now I get the error ` OF: Bad cell count for /soc@0/nand-controller@79b0000/nand@0/partitions` during the boot log but seemingly everything still works?
is this something to do with bad blocks or do i have a bad partition map or something ?

created_at: 2024-11-11T19:18:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -23,4 +23,9 @@ case "$board" in
 		[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
 		;;
+	tplink,deco-x80-5g)
+		base_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+		macaddr_add $base_mac $(expr "$PHYNBR" + 1) > /sys${DEVPATH}/macaddress
path: target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
user: login: professor-jonny
body: found error with me baking in config during testing causing wan/ lan mac addresses to not be updated at boot.
created_at: 2024-12-27T19:16:18Z
author_association: CONTRIBUTOR
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_partitions
user: login: robimarko
body: You can roll this into the existing 09 preinit script instead of adding a new one, its per board case anyway
created_at: 2025-01-13T14:06:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Can you just merge these 2 GPIO export nodes?

You can define multiple pinctrl phandles for default
created_at: 2025-01-13T14:08:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: You mean merge the antenna and modem nodes like so:


```
	modem {
		compatible = "gpio-export";
		pinctrl-0 = <&modem_pins>;
		pinctrl-1 = <&antenna_pins>;
		pinctrl-names = "default";

		w_disable {
			gpio-export,name = "w_disable";
			gpio-export,output = <1>;
			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
		};

		modem-reset {
			gpio-export,name = "modem_reset";
			gpio-export,output = <0>;
			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
		};

		ext_antenna_en {
			gpio-export,name = "ext_antenna_en";
			gpio-export,output = <0>;
			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
		};
	};

```

If this is not what you mean you might have to point me to an example, I'm guessing the #tlmn nodes define pins you just need to reference them in the node?
created_at: 2025-01-15T10:56:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: I think I have this corrected after testing changes on my device and testing the network script works on the device
created_at: 2025-03-16T11:06:48Z
author_association: CONTRIBUTOR
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_partitions
user: login: professor-jonny
body: done
created_at: 2025-03-16T11:07:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -105,6 +106,11 @@ ipq807x_setup_macs()
 		label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
 		lan_mac=$label_mac
 		;;
+		tplink,deco-x80-5g)
+			label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
+			lan_mac=$(macaddr_add $label_mac 1)
+			wan_mac=$label_mac
+		;;
path: target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
user: login: musashino205
body: Please sort alphabetically and fix indentation.
created_at: 2025-03-22T07:05:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,4 +17,18 @@ preinit_mount_factory_data() {
 	esac
 }
 
+preinit_mount_factory_partitions() {
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
user: login: robimarko
body: Why not simply put the factory data mounting in the existing partition (And make sure to find the path and not assume the UBI device number) and then keep runtime_data in a separate function?
created_at: 2025-03-22T09:06:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,4 +17,18 @@ preinit_mount_factory_data() {
 	esac
 }
 
+preinit_mount_factory_partitions() {
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
user: login: professor-jonny
body: I had issues with the partition mounting taking too long, so the mac capture did not work for Lan/Wan.


using the find_mtd_chardev does not return the correct UBI partition number it returned ubi2-0 instead or UBI2-1 or something like that so ubiatatch failed.

Hard coding the ubi worked but the atatch delay caused the mount command to fail sometimes as ubiatatch exits with stdout before the device is fully attached.

The way it is now makes it 100% reliable as before it would only work some of the time.

I could not figure out how to debug the preinit scripts by setting the preinit IP address in menuconfig.

I ended up scripting the preinit  to pipe stdout and stderr to a txt file and found introducing a wait 5 after ubuatatch fixed all the problems but it is not something id be happy with

I can relook at this, but I messed around with it for ages to get it to work.
even in electric Georges script he assumes ubi0 with the mount command and does not actually use the standard functions.
created_at: 2025-03-22T10:50:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,4 +17,18 @@ preinit_mount_factory_data() {
 	esac
 }
 
+preinit_mount_factory_partitions() {
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
user: login: professor-jonny
body: I have now patched the script to be universal, but I don't know how to capture the ubi device number for the mount command.

I have put a question on the forum outlying my problem.
https://forum.openwrt.org/t/help-with-standard-function-to-find-ubi-device-number/228424

created_at: 2025-03-26T11:09:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,4 +17,18 @@ preinit_mount_factory_data() {
 	esac
 }
 
+preinit_mount_factory_partitions() {
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
user: login: professor-jonny
body: I have created a more universal script for mounting the factory data partition and now the smem partition table works also and seems to be reliable.
created_at: 2025-03-28T13:45:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -184,7 +184,7 @@ platform_do_upgrade() {
 	netgear,sxs80|\
 	netgear,wax218|\
 	netgear,wax620|\
-	netgear,wax630)
+	netgear,wax630|)
path: target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
user: login: robimarko
body: This looks like a mistake
created_at: 2025-03-31T18:35:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb led */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal { /* first thermal node setup explanition of settings */
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* cpu-high temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* cpu-active temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* Cpu-idle temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* mini and max states of the cooling device in cpu-high band */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* min and max states of the cooling device in cpu-active band */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* min and max states of the cooling device in cpu-idle band */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+
+			//compatible = "fixed-partitions"; /* define fixed partition table */
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Sorry but this is rather confusing, its either SMEM or fixed partitions.

In your case you are clearly specifying the whole partition table via fixed partitions
created_at: 2025-03-31T18:37:14Z
author_association: CONTRIBUTOR
path: target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data
user: login: robimarko
body: Doesnt it make sense to do this first and the add the device?

Cause currently, you are adding the device and then immediately modifying the script to make it universal
created_at: 2025-03-31T18:38:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb led */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal { /* first thermal node setup explanition of settings */
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* cpu-high temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* cpu-active temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* Cpu-idle temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* mini and max states of the cooling device in cpu-high band */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* min and max states of the cooling device in cpu-active band */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* min and max states of the cooling device in cpu-idle band */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+
+			//compatible = "fixed-partitions"; /* define fixed partition table */
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: Yes, i did not know how to proceed here, now that I have converted back to SMEM should I remove all the fixed partitions stuff?
I did not know if there was some future use thing that it may be needed for seems like it is rather redundant now.
created_at: 2025-04-01T00:40:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb led */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal { /* first thermal node setup explanition of settings */
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* cpu-high temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* cpu-active temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* Cpu-idle temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* mini and max states of the cooling device in cpu-high band */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* min and max states of the cooling device in cpu-active band */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* min and max states of the cooling device in cpu-idle band */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+
+			//compatible = "fixed-partitions"; /* define fixed partition table */
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: Ok I removed the comment and explained I left the partition map for future use and information but it is disabled, I hope this is ok.
created_at: 2025-04-01T20:29:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb led */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal { /* first thermal node setup explanition of settings */
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* cpu-high temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* cpu-active temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* Cpu-idle temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* mini and max states of the cooling device in cpu-high band */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* min and max states of the cooling device in cpu-active band */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* min and max states of the cooling device in cpu-idle band */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+
+			//compatible = "fixed-partitions"; /* define fixed partition table */
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Just remove the table, it makes literaly no sense to leave it there and the DTS is already full of comments
created_at: 2025-04-02T08:30:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-names = "default";
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+	};
+
+	antennas {
+		compatible = "gpio-export";
+		pinctrl-0 = <&antenna_pins>;
+		pinctrl-names = "default";
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>; /* Aliases for button to stitch to Linux reset function */
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element
+		to mimic the OEM default behaviour green and red are switched on from boot to indicate yellow
+		to show the device is booting behaviour can be user defined in procd to override this.
+		OEM behaviour of multi function LED:
+		pulse Yellow: resetting/ rebooting.
+		Solid Yellow: starting up.
+		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
+		Solid Blue: setting up/ committing settings change.
+		Pulse Green: upgrading firmware.
+		Solid Green: connected to 4G / WAN.
+		Solid Purple: connected to 5G.
+		Pulse Red: mesh failure cant find peers.
+		Solid Red: fault */
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on"; /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";  /* default state on to select component of yellow led color on start-up */
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb led */
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal { /* first thermal node setup explanition of settings */
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>; /* cpu-high temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>; /* cpu-active temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>; /* Cpu-idle temp tripping point in millidegrees Celsius */
+			hysteresis = <2000>; /* dead band in millidegrees Celsius to avoid windup */
+			type = "active"; /* active to indicate active cooling device */
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>; /* mini and max states of the cooling device in cpu-high band */
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>; /* min and max states of the cooling device in cpu-active band */
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>; /* min and max states of the cooling device in cpu-idle band */
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
+			pins = "gpio29";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		w_disable {
+			pins = "gpio55";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	led_pins: led-state {
+		pins = "gpio50", "gpio51", "gpio52";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-disable;
+	};
+
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+
+			//compatible = "fixed-partitions"; /* define fixed partition table */
+			compatible = "qcom,smem-part"; /* define SMEM partition table */
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: I have removed the partition maps now.
I have removed most of the comments much of it was me learning and noting things down.
It should be less cluttered now.
created_at: 2025-04-02T11:17:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,469 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-names = "default";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-1 = <&antenna_pins>;
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element used for status functions.
+		To mimic the OEM default behaviour green and red are switched on from boot to indicate yellow (power on).*/
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: No point in the subnode, just put the contents directly under `antenna-state`
created_at: 2025-04-21T09:28:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,469 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-names = "default";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-1 = <&antenna_pins>;
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element used for status functions.
+		To mimic the OEM default behaviour green and red are switched on from boot to indicate yellow (power on).*/
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
+			pins = "gpio56";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	modem_pins: modem-state {
+		modem_reset {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: No point in subnodes at all, just set `pins = "gpio29", "gpio55";` under `modem-state` as all properties are the same
created_at: 2025-04-21T09:28:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,469 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: No aliases for standard LED-s?
created_at: 2025-04-21T09:29:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,469 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: The bootloader drives the led yellow on boot to indicate power until OpenWrt takes over, to mimic the factory led color I have driven the red and green RGB elements individually with the default-state = "on";
as I can't drive multiple LEDs from a single alias.

I have however done this with my virtual color driver as it is able to group the elements to virtual led's.
I will update this target in future once I have upstreamed my driver and added it to OpenWrt, unless you have another suggestion, as without userspace scripting it is impossible to implement the OEM colors that are assigned to the standard triggers under the QSDK.

The QSDK seems to have a virtual led grouping LED function to be able to map them to an alias but not so in vanilla Linux.

https://github.com/professor-jonny/pj_openwrt/blob/kmod_virtual_led_test/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts#L21
created_at: 2025-04-21T21:33:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,469 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
+ 	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	modem {
+		compatible = "gpio-export";
+		pinctrl-names = "default";
+		pinctrl-0 = <&modem_pins>;
+		pinctrl-1 = <&antenna_pins>;
+
+		w_disable {
+			gpio-export,name = "w_disable";
+			gpio-export,output = <1>;
+			gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* wwan disable output */
+		};
+
+		modem-reset {
+			gpio-export,name = "modem_reset";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; /* reset modem output */
+		};
+
+		ext_antenna_en {
+			gpio-export,name = "ext_antenna_en";
+			gpio-export,output = <0>;
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; /* select external sma antennas for wwan output */
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset_button {
+			label = "reset";
+			gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; /*reset button output*/
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+		/*note the LED's defined here are not individual they are a single combined RGB element used for status functions.
+		To mimic the OEM default behaviour green and red are switched on from boot to indicate yellow (power on).*/
+
+		led_system_green: green {
+			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_red: red {
+			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_STATUS;
+			default-state = "on";
+		};
+
+		led_system_blue: blue {
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_STATUS;
+		};
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		pinctrl-0 = <&fan_pins>;
+		pinctrl-names = "default";
+		gpios = <&tlmm 42 GPIO_ACTIVE_LOW>, /* fan gpio MSB */
+			<&tlmm 41 GPIO_ACTIVE_LOW>,
+			<&tlmm 40 GPIO_ACTIVE_LOW>; /* fan gpio LSB */
+
+		/* stock fan is a Sunnon EF40201BX-Q18C-F99
+		6800 rpm
+		gpio68 seemed to be the feedback rpm of the fan.
+		no support for fan speed in kernel saved for future use.*/
+
+		/*rpm-gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; */
+		gpio-fan,speed-map = <0 0>, /* speed 0 binary drive bits 0,0,0 (idle state) */
+				<971 1>, /* speed 1 binary drive bits 0,0,1      ▼ */
+				<1942 2>, /* speed 3 binary drive bits 0,1,0 (active state) */
+				<2913 3>, /* speed 4 binary drive bits 0,1,1      ▼ */
+				<3884 4>, /* speed 5 binary drive bits 1,0,0      ▼ */
+				<4855 5>, /* speed 6 binary drive bits 1,0,1 (high state) */
+				<5826 6>, /* speed 7 binary drive bits 1,1,0      ▼ */
+				<6800 7>; /* speed 8 binary drive bits 1,1,1      ▼ */
+		#cooling-cells = <2>;  /* min followed by max */
+	};
+};
+
+&cpu0_thermal {
+	trips {
+		cpu0_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu0_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu0_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu0_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu0_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu1_thermal {
+	trips {
+		cpu1_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu1_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu1_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu1_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu1_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu2_thermal {
+	trips {
+		cpu2_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu2_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu2_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu2_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu2_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+&cpu3_thermal {
+	trips {
+		cpu3_high: cpu-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_active: cpu-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cpu3_idle: cpu-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu3_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cpu3_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cpu3_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&cluster_thermal {
+	trips {
+		cluster_high: cluster-high {
+			temperature = <70000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_active: cluster-active {
+			temperature = <50000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+		cluster_idle: cluster-idle {
+			temperature = <25000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cluster_high>;
+			cooling-device = <&gpio_fan 5 THERMAL_NO_LIMIT>;
+		};
+		map3 {
+			trip = <&cluster_active>;
+			cooling-device = <&gpio_fan 2 4>;
+		};
+		map4 {
+			trip = <&cluster_idle>;
+			cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+		};
+	};
+};
+
+
+&tlmm {
+	button_pins: button-state {
+		pins = "gpio27";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	fan_pins: fan-state {
+		pins = "gpio40", "gpio41", "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	antenna_pins: antenna-state {
+		ext_antenna_en {
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: professor-jonny
body: ok sorted now
created_at: 2025-04-21T22:01:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,469 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Robert Marko <robimarko@gmail.com>
+altered by Jonathan Brophy <professor_jonny@hotmail.com>
+to suit the TP-Link Deco X80-5G target */
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "TP-Link Deco X80-5G";
+	compatible = "tplink,deco-x80-5g", "qcom,ipq8074";
+
+	aliases {
+		 serial0 = &blsp1_uart5;
path: target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-deco-x80-5g.dts
user: login: robimarko
body: Ahh, I remeber it now.
created_at: 2025-04-22T11:24:44Z
author_association: CONTRIBUTOR

PR comments:
user: login: professor-jonny
created_at: 2024-09-04T21:00:39Z
body: The board file is submitted pending review
https://github.com/openwrt/firmware_qca-wireless/pull/49
author_association: CONTRIBUTOR
user: login: musashino205
created_at: 2024-09-05T01:47:14Z
body: Please drop merge commits.
author_association: CONTRIBUTOR
user: login: musashino205
created_at: 2024-09-05T02:05:05Z
body: Please don't use GitHub WebUI for creating commits and use local repository with Git CLI.

https://openwrt.org/docs/guide-developer/working-with-github-pr
author_association: CONTRIBUTOR
user: login: mrkiko
created_at: 2024-09-05T15:04:08Z
body: Hi!

First of all - thank you for your work. the device seems interesting and can attract users
Right now things will seem very hard but with persistence and patience you will be able to do it!!

As for why the preinit script is not run - be careful about the fact that if your script comes after the preinit script testing whether we are or not in initramfs, it won't be executed.
so you might want to put it before that one, with a lower starting number.

That said, in OpenWrt there's a general tendency to prefer kernel-based solution for things like LEDs, PWM fans and so on, when possible.
author_association: CONTRIBUTOR
user: login: professor-jonny
created_at: 2024-09-05T19:15:56Z
body: @mrkiko the device is being used by many ISP's in New Zealand as their default router for fiber with failover for 5g and I believe they are starting to use the BE65-5G which is the slightly better version with Wi-Fi 7 multiple 2.5g LAN ports and USB which I hope to get ahold of soon.

They also use the x58-4g for 4g fail over fiber service, that I have picked up yet to play with.
looking at the ISP support file embedded in the device's data partition it would seem many isp's use it all over the world.

I'd love a kernel solution for the LED's as the problem is OpenWrt is not designed to give priority of gpio-led's and there is no kernel support for multifunction/ monochromatic LED's, if two different statuses were to show at the same time the led color would be a mix not indicating the status correctly, my script was an attempt to make it useful as all the deco line of TP products have this single led or a ring of light at the top.

I don't expect my script to pass scrutineering but hopefully it sparks a conversation as it seems the multifunction monochromatic LED is all across the TP-link range of deco products.

The ability to drive a virtual LED (mix of gpio's) defined from the DTS from a single binding would be handy and make it less confusing as you can imaging to make yellow in you select reg and green colors from LUCI.

I know Prity led colors are luxury and the talented people have better things to do but I'm willing to at least make a complete hash out it and give it a go if someone can point me in the correct direction.


author_association: CONTRIBUTOR
user: login: castillofrancodamian
created_at: 2024-09-05T20:43:30Z
body: I think the name Deco is missing. It would be Deco X80-5G according to TP-Link.
author_association: NONE
user: login: professor-jonny
created_at: 2024-09-05T22:45:02Z
body: ok I can do that if deemed necessary, but would I have to do that for the board name throughout source or just the title of the commit?
I can probably change the version to be v1 too I did see that in the recommendations after a quick read just now.
author_association: CONTRIBUTOR
user: login: castillofrancodamian
created_at: 2024-09-06T00:40:03Z
body: In all sectors where this device is mentioned.
author_association: NONE
user: login: professor-jonny
created_at: 2024-09-06T02:00:33Z
body: OK I fixed that and resubmitted the BDF with the updated ID strings.
author_association: CONTRIBUTOR
user: login: RaylynnKnight
created_at: 2024-09-06T06:19:58Z
body: You should take a look at [Submission Guidelines](https://openwrt.org/submitting-patches#submission_guidelines).  You are missing at least the Signed Off by line.
author_association: CONTRIBUTOR
user: login: robimarko
created_at: 2024-09-10T09:15:17Z
body: Can you please reduce the number of comments in the DTS, all of those on okay and similar generic properties just clutter the DTS
author_association: CONTRIBUTOR
user: login: professor-jonny
created_at: 2024-10-21T03:33:22Z
body: Just wondering if there is something that is being waited on from my end to merge this?
author_association: CONTRIBUTOR
user: login: robimarko
created_at: 2024-10-31T10:02:08Z
body: It has formal isssues, that needs to be sorted out before merging.
author_association: CONTRIBUTOR
user: login: robimarko
created_at: 2024-11-03T19:14:38Z
body: I merged the BDF, please update the ipq-wifi package.
author_association: CONTRIBUTOR
user: login: professor-jonny
created_at: 2024-12-27T11:39:47Z
body: I found me baking in a network config caused it to fail updating the mac addresses at boot:

https://github.com/openwrt/openwrt/issues/17391
author_association: CONTRIBUTOR
user: login: robimarko
created_at: 2025-04-02T08:31:19Z
body: Also, please fix the formal issues
author_association: CONTRIBUTOR
user: login: robimarko
created_at: 2025-04-22T11:25:59Z
body: Thanks! Rebased on top of main and merged!
author_association: CONTRIBUTOR