D-Link DIR-2660 backporting issues

There isn't switch config. Try these commands to check:

swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports '0 1 2 3 6t'
swconfig dev switch0 vlan 2 set ports '4 6t'
swconfig dev switch0 set apply 1

and show output of command:

swconfig dev switch0 show

@123serge123 after issuing these commands, the computer can ping the router! Router itself can't ping computer but the progress is there

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07-SNAPSHOT, r0+11228-78c4c04dd7
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# swconfig dev switch0 set reset 1
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 set enable_vlan 1
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 vlan 1 set ports '0 1 2 3 6t'
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 vlan 2 set ports '4 6t'
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 set apply 1
root@OpenWrt:/# 
root@OpenWrt:/# swconfig dev switch0 show

Global attributes:
        enable_vlan: 1
        mib: Switch MIB counters
PPE_AC_BCNT0: 0
PPE_AC_PCNT0: 0
PPE_AC_BCNT63: 0
PPE_AC_PCNT63: 0
PPE_MTR_CNT0: 0
PPE_MTR_CNT63: 0
GDM1_TX_GBCNT: 0
GDM1_TX_GPCNT: 0
GDM1_TX_SKIPCNT: 0
GDM1_TX_COLCNT: 0
GDM1_RX_GBCNT1: 0
GDM1_RX_GPCNT1: 0
GDM1_RX_OERCNT: 0
GDM1_RX_FERCNT: 0
GDM1_RX_SERCNT: 0
GDM1_RX_LERCNT: 0
GDM1_RX_CERCNT: 0
GDM1_RX_FCCNT: 0
GDM2_TX_GBCNT: 0
GDM2_TX_GPCNT: 0
GDM2_TX_SKIPCNT: 0
GDM2_TX_COLCNT: 0
GDM2_RX_GBCNT: 0
GDM2_RX_GPCNT: 0
GDM2_RX_OERCNT: 0
GDM2_RX_FERCNT: 0
GDM2_RX_SERCNT: 0
GDM2_RX_LERCNT: 0
GDM2_RX_CERCNT: 0
GDM2_RX_FCCNT: 0

Port 0:
        mib: Port 0 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 1
        link: port:0 link:down
Port 1:
        mib: Port 1 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 1
        link: port:1 link:down
Port 2:
        mib: Port 2 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 1
        link: port:2 link:down
Port 3:
        mib: Port 3 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 41
TxBroad    : 27
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 25
Tx128Byte  : 16
Tx256Byte  : 26
Tx512Byte  : 0
Tx1024Byte : 1
TxByte     : 15187
RxDrop     : 0
RxFiltered : 5
RxUni      : 0
RxMulti    : 523
RxBroad    : 402
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 163
Rx65Byte   : 471
Rx128Byte  : 74
Rx256Byte  : 189
Rx512Byte  : 20
Rx1024Byte : 8
RxByte     : 147174
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 1
        link: port:3 link:up speed:1000baseT full-duplex 
Port 4:
        mib: Port 4 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 2
        link: port:4 link:down
Port 5:
        mib: Port 5 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:5 link:down
Port 6:
        mib: Port 6 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 522
TxBroad    : 399
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 162
Tx65Byte   : 471
Tx128Byte  : 73
Tx256Byte  : 187
Tx512Byte  : 20
Tx1024Byte : 8
TxByte     : 146375
RxDrop     : 0
RxFiltered : 4
RxUni      : 0
RxMulti    : 41
RxBroad    : 31
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 25
Rx128Byte  : 16
Rx256Byte  : 30
Rx512Byte  : 0
Rx1024Byte : 1
RxByte     : 16587
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex 
Port 7:
        mib: Port 7 MIB counters
TxDrop     : 0
TxCRC      : 0
TxUni      : 0
TxMulti    : 0
TxBroad    : 0
TxCollision: 0
TxSingleCol: 0
TxMultiCol : 0
TxDefer    : 0
TxLateCol  : 0
TxExcCol   : 0
TxPause    : 0
Tx64Byte   : 0
Tx65Byte   : 0
Tx128Byte  : 0
Tx256Byte  : 0
Tx512Byte  : 0
Tx1024Byte : 0
TxByte     : 0
RxDrop     : 0
RxFiltered : 0
RxUni      : 0
RxMulti    : 0
RxBroad    : 0
RxAlignErr : 0
RxCRC      : 0
RxUnderSize: 0
RxFragment : 0
RxOverSize : 0
RxJabber   : 0
RxPause    : 0
Rx64Byte   : 0
Rx65Byte   : 0
Rx128Byte  : 0
Rx256Byte  : 0
Rx512Byte  : 0
Rx1024Byte : 0
RxByte     : 0
RxCtrlDrop : 0
RxIngDrop  : 0
RxARLDrop  : 0

        pvid: 0
        link: port:7 link:down
VLAN 1:
        vid: 1
        ports: 0 1 2 3 6t 
VLAN 2:
        vid: 2
        ports: 4 6t 
root@OpenWrt:/# 
root@OpenWrt:/# ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes

@Lucky1 you are right, there are so many changes, even the DTS are not compatible between the versions, the new one looks something like this

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	aliases {
		label-mac-device = &gmac0;
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};

		wps {
			label = "wps";
			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};
};

&nand {
	status = "okay";

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "Bootloader";
			reg = <0x0 0x80000>;
			read-only;
		};

		partition@80000 {
			label = "config";
			reg = <0x80000 0x80000>;
			read-only;
		};

		factory: partition@100000 {
			label = "factory";
			reg = <0x100000 0x40000>;
			read-only;
		};

		partition@140000 {
			label = "config2";
			reg = <0x140000 0x40000>;
			read-only;
		};

		partition@180000 {
			label = "firmware";
			compatible = "sge,uimage";
			reg = <0x180000 0x2800000>;
		};

		partition@2980000 {
			label = "private";
			reg = <0x2980000 0x2000000>;
			read-only;
		};

		partition@4980000 {
			label = "firmware2";
			compatible = "sge,uimage";
			reg = <0x4980000 0x2800000>;
		};

		partition@7180000 {
			label = "mydlink";
			reg = <0x7180000 0x600000>;
			read-only;
		};

		partition@7780000 {
			label = "reserved";
			reg = <0x7780000 0x880000>;
			read-only;
		};
	};
};

&pcie {
	status = "okay";
};

&pcie0 {
	wifi0: wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
		ieee80211-freq-limit = <2400000 2500000>;

		led {
			led-active-low;
		};
	};
};

&pcie1 {
	wifi1: wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
		ieee80211-freq-limit = <5000000 6000000>;

		led {
			led-active-low;
		};
	};
};

&gmac0 {
	mtd-mac-address = <&factory 0xe000>;
};

&switch0 {
	ports {
		port@0 {
			status = "okay";
			label = "lan4";
		};

		port@1 {
			status = "okay";
			label = "lan3";
		};

		port@2 {
			status = "okay";
			label = "lan2";
		};

		port@3 {
			status = "okay";
			label = "lan1";
		};

		port@4 {
			status = "okay";
			label = "wan";
			mtd-mac-address = <&factory 0xe006>;
		};
	};
};

&state_default {
	gpio {
		groups = "i2c", "uart3", "jtag", "wdt";
		function = "gpio";
	};
};


/ {
	compatible = "dlink,dir-2660-a1", "mediatek,mt7621-soc";
	model = "D-Link DIR-2660 A1";

	aliases {
		led-boot = &led_power_orange;
		led-failsafe = &led_power_white;
		led-running = &led_power_white;
		led-upgrade = &led_net_orange;
	};

	leds {
		compatible = "gpio-leds";

		led_power_orange: power_orange {
			label = "dir-2660-a1:orange:power";
			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
		};

		led_power_white: power_white {
			label = "dir-2660-a1:white:power";
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
		};

		led_net_orange: net_orange {
			label = "dir-2660-a1:orange:net";
			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
		};

		net_white {
			label = "dir-2660-a1:white:net";
			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
		};

		usb2_white {
			label = "dir-2660-a1:white:usb2";
			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
			trigger-sources = <&ehci_port2>;
			linux,default-trigger = "usbport";
		};

		usb3_white {
			label = "dir-2660-a1:white:usb3";
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
			trigger-sources = <&xhci_ehci_port1>;
			linux,default-trigger = "usbport";
		};
	};
};

&wifi0 {
	mtd-mac-address = <&factory 0xe000>;
	mtd-mac-address-increment = <1>;
};

&wifi1 {
	mtd-mac-address = <&factory 0xe000>;
	mtd-mac-address-increment = <2>;
};

If I understand correctly the changes made to the 02_network file should have created the switch configuration. Silly question but maybe there is a typo in the device name?

I just added another entry to this file like this, maybe it's wrong?

ramips_setup_interfaces()
{
	local board="$1"

	case $board in
	11acnas|\
	d-team,newifi-d2|\
	dir-615-h1|\
	dir-2660-a1|\
	w2914nsv2|\
	zbt-we2026)
		ucidef_add_switch "switch0" \
			"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
		;;
	3g150b|\
	3g300m|\
	a5-v11|\

Not sure actually. In master they now all use "dlink,dir-2660-a1". maybe try with that as well and see if it makes any difference.

you also have in the mt7621.mk the following

define Device/dlink_dir-2660-a1

maybe change that to dir-2660-a1 and leave what you have done already the same and I think it would work.

So something like this. Also make sure you use "dir-2660-a1" everywhere else and not a mix between the 2.

+define Device/dir-2660-a1
+  DTS := DIR-2660-A1
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 4096k
+  KERNEL := $$(KERNEL) | uimage-padhdr 96
+  UBINIZE_OPTS := -E 5
+  IMAGE_SIZE := $(ralink_default_fw_size_32M)
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
+  DEVICE_TITLE := D-Link DIR-2660 A1
+  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \
+	kmod-usb-ledtrig-usbport
+endef
+TARGET_DEVICES += dir-2660-a1

reply 3 lol

I found the diff file when I added support for my device. It might help you (they are basically the same except the wireless card and the gpios).

index 5c005db0c1..81407d810f 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -107,6 +107,11 @@ rt-ac51u)
 dcs-930l-b1)
 	ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
 	;;
+dir-853-a3)
+	ucidef_set_led_netdev "wan" "wan" "$boardname:blue:net" "wan"
+	ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
+	ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
+	;;
 dir-300-b1|\
 dir-300-b7|\
 dir-320-b1|\
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index f743ce851a..ba97a689ca 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -171,6 +171,7 @@ ramips_setup_interfaces()
 		ucidef_set_interface_lan "eth0"
 		;;
 	alfa-network,quad-e4g|\
+	dir-853-a3|\
 	netgear,r6120|\
 	r6220|\
 	netgear,r6350|\
@@ -556,7 +557,8 @@ ramips_setup_macs()
 	dch-m225)
 		lan_mac=$(mtd_get_mac_ascii factory lanmac)
 		;;
-	dir-860l-b1)
+	dir-860l-b1|\
+	dir-853-a3)
 		lan_mac=$(mtd_get_mac_ascii factory lanmac)
 		wan_mac=$(mtd_get_mac_ascii factory wanmac)
 		;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 093303892c..90d95a492b 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -157,6 +157,9 @@ ramips_board_detect() {
 	*"DIR-810L")
 		name="dir-810l"
 		;;
+	*"DIR-853 A3")
+		name="dir-853-a3"
+		;;
 	*"DIR-860L B1")
 		name="dir-860l-b1"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 3b967aac87..c39e6d66b5 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -55,6 +55,7 @@ platform_do_upgrade() {
 		}
 		default_do_upgrade "$1"
 		;;
+	dir-853-a3|\
 	hc5962|\
 	r6220|\
 	netgear,r6350|\
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index f51e337afd..ad3d1d6e0d 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -110,6 +110,11 @@ define Build/wrg-header
 	mv $@.new $@
 endef
 
+define Build/uimage-padhdr
+	uimage_padhdr $(if $(1),-l $(1)) -i $@ -o $@.new
+	mv $@.new $@
+endef
+
 # combine kernel and rootfs into one image
 # mkdlinkfw <type> <optional extra arguments to mkdlinkfw binary>
 
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 28ae0d451f..5c359e58cf 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -116,6 +116,21 @@ define Device/asus_rt-ac57u
 endef
 TARGET_DEVICES += asus_rt-ac57u
 
+define Device/dir-853-a3
+  DTS := DIR-853-A3
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 4096k
+  UBINIZE_OPTS := -E 5
+  IMAGES += factory.bin
+  DEVICE_TITLE := D-link DIR-853 A3
+  KERNEL_INITRAMFS := $$(KERNEL) | uimage-padhdr 96
+  IMAGE/factory.bin := append-kernel | uimage-padhdr 96 | pad-to $$(KERNEL_SIZE) |\
+  append-ubi 
+  DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
+endef
+TARGET_DEVICES += dir-853-a3
+
 define Device/dir-860l-b1
   $(Device/seama)
   DTS := DIR-860L-B1

/dts-v1/;

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "dlink,dir-853-a3", "mediatek,mt7621-soc";
	model = "D-Link DIR-853 A3";

	aliases {
		led-boot = &led_power_orange;
		led-failsafe = &led_power_blue;
		led-running = &led_power_blue;
		led-upgrade = &led_power_orange;
	};

	memory@0 {
		device_type = "memory";
		reg = <0x0 0x10000000>;
	};

	chosen {
		bootargs = "console=ttyS0,57600";
	};
	
	leds {
		compatible = "gpio-leds";

		led_power_orange: power {
			label = "dir-853-a3:orange:power";
			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
		};

		led_power_blue: power2 {
			label = "dir-853-a3:blue:power";
			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		};

		wan_blue {
			label = "dir-853-a3:orange:net";
			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
		};

		wan_orange {
			label = "dir-853-a3:blue:net";
			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
		};

		usb {
			label = "dir-853-a3:blue:usb";
			gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
			trigger-sources = <&xhci_ehci_port1>;
			linux,default-trigger = "usbport";
		};

		wlan1 {
			label = "dir-853-a3:blue:wlan2g";
			gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
		};

		wlan0 {
			label = "dir-853-a3:blue:wlan5g";
			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
		};
	};

	keys {
		compatible = "gpio-keys-polled";
		poll-interval = <20>;

		wps {
			label = "wps";
			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};

		wifi {
			label = "wifi";
			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RFKILL>;
		};

		reset {
			label = "reset";
			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};
};

&nand {
	status = "okay";

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "bootloader";
			reg = <0x0 0x80000>;
			read-only;
		};

		partition@80000 {
			label = "config";
			reg = <0x80000 0x80000>;
		};

		factory: partition@100000 {
			label = "factory";
			reg = <0x100000 0x40000>;
			read-only;
		};

		partition@140000 {
			label = "config2";
			reg = <0x140000 0x40000>;
			read-only;
		};

		partition@180000 {
			compatible = "sge,uimage";
			label = "firmware";
			reg = <0x180000 0x2800000>;
		};

		partition@2980000 {
			label = "private";
			reg = <0x2980000 0x2000000>;
		};

		partition@4980000 {
			label = "kernel2";
			reg = <0x4980000 0x2800000>;
		};

		partition@7180000 {
			label = "mydlink";
			reg = <0x7180000 0x600000>;
		};

		partition@7780000 {
			label = "reserved";
			reg = <0x7780000  0x800000>;
		};
	};
};


&pcie {
	status = "okay";
};

&pcie0 {
	mt76@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
	};
};

&ethernet {
	mtd-mac-address = <&factory 0xe006>;
};

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			ralink,group = "i2c", "uart2", "uart3";
			ralink,function = "gpio";
		};
	};
};
1 Like

Thank you so much, I'll definitely give it a try :smiley:

Thank you very much guys, it turned out the names needed to be changed so they are all identical now, everything is working fine, including LEDs etc :smiley:

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.