OpenWrt support for Netis N6 router

  1. Foto Netis6




NAND Flash Memory 128Mx8bit ESMT F59L1G81MB


MT7975DN is an IEEE 802.11ax 2x2 A-band

MT7905DAN 802.11ax Wi-Fi 2x2 Dual-band Con-curret Baseband chip

MT7621 router-on-a-chip

DDR3(L) 2Gb SDRAM

Ty for help! Best regards!

Everything turned out to be much simpler. The router has access to ssh from the box with root rights. It's hard to figure out how to port a more recent version
image

Doubt it, but it's not as easy as 1 2 3.

I get the same firmware from the Netis RU support. And I think they are using the same version for their stock firmware (you can prove it by getting into SSH console).

Is there a method to get packages for this old snapshot version?

you could try the LEDE package repositories closest to the version it uses, from https://downloads.openwrt.org/

I've connected console and got Stock Boot Log and flash dumps.
I'm not sure that stock flash layout is correct:

[    1.669742] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xd1
[    1.676115] nand: GD/ESMT PSU1GA30DT
[    1.679689] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.687900] Scanning device for bad blocks
[    2.536885] 4 ofpart partitions found on MTD device mtk-nand
[    2.542568] Creating 4 MTD partitions on "mtk-nand":
[    2.547539] 0x000000000000-0x000000080000 : "Bootloader"
[    2.554201] 0x000000080000-0x000000100000 : "Config"
[    2.560293] 0x000000100000-0x000000180000 : "Factory"
[    2.566544] 0x000000180000-0x000007fe0000 : "firmware"
[    3.410846] 2 fit-fw partitions found on MTD device firmware
[    3.416542] 0x000000180000-0x000000560000 : "kernel"
[    3.422800] 0x000000560000-0x000007fe0000 : "rootfs"
[    3.429829] mtd: device 5 (rootfs) set to be root filesystem
[    3.437658] buf:[MTD_INFO_Flag]
[    3.440785] 3 squashfs-split partitions found on MTD device rootfs
[    3.447173] 0x000000fc0000-0x000001000000 : "rootfs_ext"
[    3.453696] 0x000001000000-0x000001020000 : "info"
[    3.459623] 0x000001020000-0x000007fe0000 : "rootfs_data"

Because at block 960 (offset 0x7800000) NMBM remapping table exist:

Initializing NMBM ...
Signature found at block 1023 [0x07fe0000]
First info table with writecount 0 found in block 960
Second info table with writecount 0 found in block 963
NMBM has been successfully attached

Using openwrt gpio docs and tools

Buttons:

  1. Reset - 18 Low active
  2. WPS - 15 Low

LEDs (from left to right)

  1. Power - 17 High
  2. LAN(?) - 14 Low
  3. WAN - 16 Low
  4. wifi2g - wired to RF chip
  5. wifi5g - wired to RF chip
  6. WPS - 13 Low
  7. USB - 4 Low

Than I create test dts-file (extend kernel upto 4M and decrease firmware):

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

#include "mt7621.dtsi"

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

/ {
	compatible = "netis,n6", "mediatek,mt7621-soc";
	model = "NETIS N6";

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

	chosen {
		bootargs = "console=ttyS0,115200";
		bootargs-override = "console=ttyS0,115200";
	};

	leds {
		compatible = "gpio-leds";

		led_power: power {
			label = "green:power";
			gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
		};

		wan {
			label = "green:wan";
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
		};

		lan {
			label = "green:lan";
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
		};

		wps {
			label = "green:wps";
			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
		};

		led_usb {
			label = "green:usb";
			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
			trigger-sources = <&ehci_port2>;
			linux,default-trigger = "usbport";
		};
	};

	keys {
		compatible = "gpio-keys";

		key-restart {
			label = "reset";
			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};

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

&nand {
	status = "okay";

	mediatek,nmbm;
	mediatek,bmt-remap-range =
		<0x000000 0x580000>,
		<0x3380000 0x7800000>;

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

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

		partition@80000 {
			label = "u-boot-env";
			reg = <0x80000 0x80000>;
		};

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

			compatible = "nvmem-cells";
			#address-cells = <1>;
			#size-cells = <1>;

			macaddr_factory_4: macaddr@4 {
				reg = <0x4 0x6>;
			};
		};

		partition@180000 {
			label = "firmware";
			reg = <0x180000 0x3200000>;
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "kernel";
				reg = <0x0 0x400000>;
			};

			partition@400000 {
				label = "ubi";
				reg = <0x400000 0x2e00000>;
			};
		};

		/* Last 8M (@ 0x7800000) are reserved for NMBM management (bad blocks) */
	};
};

&pcie {
	status = "okay";
};

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
		mediatek,disable-radar-background;
	};
};

&gmac0 {
	nvmem-cells = <&macaddr_factory_4>;
	nvmem-cell-names = "mac-address";
	mac-address-increment = <(-1)>;
};

&gmac1 {
	status = "okay";
	label = "wan";
	phy-handle = <&ethphy4>;

	nvmem-cells = <&macaddr_factory_4>;
	nvmem-cell-names = "mac-address";
};

&mdio {
	ethphy4: ethernet-phy@4 {
		reg = <4>;
	};
};

&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";
		};
	};
};

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

Builded openwrt 23.05.0-rc4 factory image was flashed with uboot console.
Firmware start correctly but wifi interfaces failed.
After disabling wifi2g (wireless phy0 or radio0) wifi5g (phy1 or radio1) started.
wifi2g fail log:

root@OpenWrt:/# wifi
'radio1' is disabled
'radio1' is disabled
[  726.893817] ieee80211 phy0: WM: ( 714.614472:72:CMD-E)Rx Hdr Translation enable=1, CheckBssid=0, InsVlan=0, RemVlan=0, QosTid=0, Mode=0
[  726.906085] ieee80211 phy0: WM: ( 714.614533:73:CMD-E)Rx Hdr Translation BL Count=1 
[  726.913946] ieee80211 phy0: WM: ( 714.614563:74:CMD-E)Rx Hdr Translation BL setting idx=0, enable=1, ether-type=0x888e 
[  726.924885] ieee80211 phy0: WM: ( 714.627228:75:CMD-S)ProtectCtrl!! Protection Index = 1, DBDC = 0
[  726.934005] ieee80211 phy0: WM: ( 714.630707:76:INIT-S)Error: Search Key for CSD Tx Failed,Please check Input condition
[  726.944913] ieee80211 phy0: WM: ( 714.630738:77:INIT-S)K[28]-band[1]-pa_config[0]-channel[2]-wfid[0]-dbdc_en[1]-dbdc_idx[1]
[  726.956159] ieee80211 phy0: WM: Wifi ASSERT @ build/csp/7915/asic2.0/projects/wifi_rebb_ram/../../../../../../wifi/base/7915/prj/exthal/cal/hal_cal_bb.c:1339
[  747.390542] mt7915e 0000:02:00.0: Message 00004eed (seq 6) timeout
[  747.399377] br-lan: port 5(phy0-ap0) entered blocking state
[  747.405149] br-lan: port 5(phy0-ap0) entered disabled state
[  747.411271] device phy0-ap0 entered promiscuous mode

wifi5g start log:

oot@OpenWrt:/# wifi
'radio0' is disabled
'radio0' is disabled
[  557.057457] ieee80211 phy0: WM: ( 544.821320:54:CMD-E)Rx Hdr Translation enable=1, CheckBssid=0, InsVlan=0, RemVlan=0, QosTid=0, Mode=0
[  557.069731] ieee80211 phy0: WM: ( 544.821381:55:CMD-E)Rx Hdr Translation BL Count=1 
[  557.077575] ieee80211 phy0: WM: ( 544.821412:56:CMD-E)Rx Hdr Translation BL setting idx=0, enable=1, ether-type=0x888e 
[  557.089053] ieee80211 phy0: WM: ( 544.852906:57:CMD-E)Rx Hdr Translation enable=1, CheckBssid=0, InsVlan=0, RemVlan=0, QosTid=0, Mode=0
[  557.101325] ieee80211 phy0: WM: ( 544.852967:58:CMD-E)Rx Hdr Translation BL Count=1 
[  557.109122] ieee80211 phy0: WM: ( 544.852997:59:CMD-E)Rx Hdr Translation BL setting idx=0, enable=1, ether-type=0x888e 
[  557.120030] ieee80211 phy0: WM: ( 544.853394:60:CMD-S)ProtectCtrl!! Protection Index = 1, DBDC = 1
[  557.129051] ieee80211 phy0: WM: ( 544.855683:61:BSS-E)BSSInfo 0 Active 
[  557.135727] ieee80211 phy0: WM: ( 544.855805:62:BSS-E)ucDbdcIdx 1, ucOwnMacIdx 4, ucHetbRU26Disable 0  
[  557.145204] ieee80211 phy0: WM: ( 544.856263:63:BSS-E)_whCapSetGeneric_Falcon DW0 = 0xe0000, DW1 = 0x0
[  557.735954] ieee80211 phy0: WM: ( 545.499665:64:BSS-E)BSSInfo 0 Active 
[  557.737615] IPv6: ADDRCONF(NETDEV_CHANGE): phy1-ap0: link becomes ready
[  557.742631] ieee80211 phy0: WM: ( 545.499726:65:BSS-E)ucDbdcIdx 1, ucOwnMacIdx 4, ucHetbRU26Disable 0  
[  557.742671] ieee80211 phy0: WM: ( 545.500184:66:BSS-E)_whCapSetGeneric_Falcon DW0 = 0xe0000, DW1 = 0x0
[  557.810769] ieee80211 phy0: WM: ( 545.574463:67:BSS-E)BSSInfo 0 Active 
[  557.817436] ieee80211 phy0: WM: ( 545.574524:68:BSS-E)ucDbdcIdx 1, ucOwnMacIdx 4, ucHetbRU26Disable 0   

After reading comments here I'd checked default mt7915_eeprom_dbdc.bin . This file was flashed in factory partition and both radio0 and radio1 started.
But signal was very low (about -85dBm).
Than I checked radio0 config in both files and correct original eeprom at offset 0x190: change 0xD2 -> 0x92 (if I undrestand correctly value 0x92 define radio0 as 2g only). After reflashing this changed eeprom wifi signal is normal.
openwrt 23.05.0-r4 bootlog:

[    0.000000] Linux version 5.15.132 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23482-7fe85ce1f2) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Fri Sep 29 09:29:36 2023
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is NETIS N6
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2,2} total 4
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] percpu: Embedded 11 pages/cpu s14736 r8192 d22128 u45056
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Writing ErrCtl register=000410b0
[    0.000000] Readback ErrCtl register=000410b0
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 249120K/262144K available (7298K kernel code, 626K rwdata, 880K rodata, 1232K init, 226K bss, 13024K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 256
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000004] sched_clock: 64 bits at 880MHz, resolution 1ns, wraps every 4398046511103ns
[    0.008046] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.066218] pid_max: default: 32768 minimum: 301
[    0.071620] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.078833] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090399] rcu: Hierarchical SRCU implementation.
[    0.095869] smp: Bringing up secondary CPUs ...
[    0.101281] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.101309] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.101324] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.101368] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.160644] Synchronize counters for CPU 1: done.
[    0.193188] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.193211] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.193222] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.193248] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.252152] Synchronize counters for CPU 2: done.
[    0.282796] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.282818] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.282829] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.282860] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.337336] Synchronize counters for CPU 3: done.
[    0.367189] smp: Brought up 1 node, 4 CPUs
[    0.376270] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.386071] futex hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.393145] pinctrl core: initialized pinctrl subsystem
[    0.399968] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.406559] thermal_sys: Registered thermal governor 'step_wise'
[    0.431341] clocksource: Switched to clocksource GIC
[    0.437763] NET: Registered PF_INET protocol family
[    0.442811] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.451044] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.459367] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.467053] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.474667] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.481759] TCP: Hash tables configured (established 2048 bind 2048)
[    0.488189] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.494680] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.501960] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.507594] PCI: CLS 0 bytes, default 32
[    0.514231] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.526109] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.531974] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.543213] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.554320] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.560295] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.566324] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.572486] mt7621-pci 1e140000.pcie: host bridge /pcie@1e140000 ranges:
[    0.579149] mt7621-pci 1e140000.pcie:   No bus range found for /pcie@1e140000, using [bus 00-ff]
[    0.587945] mt7621-pci 1e140000.pcie:      MEM 0x0060000000..0x006fffffff -> 0x0060000000
[    0.596053] mt7621-pci 1e140000.pcie:       IO 0x001e160000..0x001e16ffff -> 0x0000000000
[    0.961344] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
[    0.968238] mt7621-pci 1e140000.pcie: PCIE0 enabled
[    0.973122] mt7621-pci 1e140000.pcie: PCIE1 enabled
[    0.977930] PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
[    0.985154] mt7621-pci 1e140000.pcie: PCI host bridge to bus 0000:00
[    0.991458] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.996873] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.003728] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    1.009882] pci 0000:00:00.0: [0e8d:0801] type 01 class 0x060400
[    1.015832] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    1.022055] pci 0000:00:00.0: reg 0x14: [mem 0x60600000-0x6060ffff]
[    1.028300] pci 0000:00:00.0: supports D1
[    1.032234] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    1.038764] pci 0000:00:01.0: [0e8d:0801] type 01 class 0x060400
[    1.044778] pci 0000:00:01.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    1.050954] pci 0000:00:01.0: reg 0x14: [mem 0x60610000-0x6061ffff]
[    1.057265] pci 0000:00:01.0: supports D1
[    1.061182] pci 0000:00:01.0: PME# supported from D0 D1 D3hot
[    1.069052] pci 0000:01:00.0: [14c3:7916] type 00 class 0x000280
[    1.075084] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
[    1.082277] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
[    1.089411] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
[    1.096718] pci 0000:01:00.0: supports D1 D2
[    1.100895] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    1.107530] pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:00.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    1.123585] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[    1.128741] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    1.134830] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    1.141570] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x602fffff pref]
[    1.148699] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.155616] pci 0000:02:00.0: [14c3:7915] type 00 class 0x000280
[    1.161629] pci 0000:02:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
[    1.168779] pci 0000:02:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
[    1.175990] pci 0000:02:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
[    1.183274] pci 0000:02:00.0: supports D1 D2
[    1.187452] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    1.194096] pci 0000:02:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:01.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    1.210216] pci 0000:00:01.0: PCI bridge to [bus 02-ff]
[    1.215426] pci 0000:00:01.0:   bridge window [io  0x0000-0x0fff]
[    1.221458] pci 0000:00:01.0:   bridge window [mem 0x60300000-0x603fffff]
[    1.228167] pci 0000:00:01.0:   bridge window [mem 0x60400000-0x605fffff pref]
[    1.235377] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
[    1.242035] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    1.248552] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    1.255504] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[    1.262072] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[    1.268947] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    1.275721] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x602fffff pref]
[    1.282886] pci 0000:00:01.0: BAR 8: assigned [mem 0x60300000-0x603fffff]
[    1.289595] pci 0000:00:01.0: BAR 9: assigned [mem 0x60400000-0x605fffff pref]
[    1.296802] pci 0000:00:00.0: BAR 1: assigned [mem 0x60600000-0x6060ffff]
[    1.303542] pci 0000:00:01.0: BAR 1: assigned [mem 0x60610000-0x6061ffff]
[    1.310247] pci 0000:00:00.0: BAR 7: assigned [io  0x0000-0x0fff]
[    1.316328] pci 0000:00:01.0: BAR 7: assigned [io  0x1000-0x1fff]
[    1.322394] pci 0000:01:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit pref]
[    1.330048] pci 0000:01:00.0: BAR 2: assigned [mem 0x60200000-0x60203fff 64bit pref]
[    1.337775] pci 0000:01:00.0: BAR 4: assigned [mem 0x60204000-0x60204fff 64bit pref]
[    1.345462] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.350344] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    1.356428] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    1.363160] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x602fffff pref]
[    1.370310] pci 0000:02:00.0: BAR 0: assigned [mem 0x60400000-0x604fffff 64bit pref]
[    1.378041] pci 0000:02:00.0: BAR 2: assigned [mem 0x60500000-0x60503fff 64bit pref]
[    1.385739] pci 0000:02:00.0: BAR 4: assigned [mem 0x60504000-0x60504fff 64bit pref]
[    1.393427] pci 0000:00:01.0: PCI bridge to [bus 02]
[    1.398304] pci 0000:00:01.0:   bridge window [io  0x1000-0x1fff]
[    1.404382] pci 0000:00:01.0:   bridge window [mem 0x60300000-0x603fffff]
[    1.411091] pci 0000:00:01.0:   bridge window [mem 0x60400000-0x605fffff pref]
[    1.420546] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.432073] printk: console [ttyS0] disabled
[    1.436372] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
[    1.445413] printk: console [ttyS0] enabled
[    1.445413] printk: console [ttyS0] enabled
[    1.453686] printk: bootconsole [early0] disabled
[    1.453686] printk: bootconsole [early0] disabled
[    1.466664] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xd1
[    1.473092] nand: ESMT PSU1GA30DT
[    1.476401] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.483984] mt7621-nand 1e003000.nand: ECC strength adjusted to 4 bits
[    1.493246] Signature found at block 1023 [0x07fe0000]
[    1.498371] NMBM management region starts at block 960 [0x07800000]
[    1.509224] First info table with writecount 0 found in block 960
[    1.528832] Second info table with writecount 0 found in block 963
[    1.535111] NMBM has been successfully attached
[    1.539783] 4 fixed-partitions partitions found on MTD device mt7621-nand
[    1.547431] Creating 4 MTD partitions on "mt7621-nand":
[    1.552714] 0x000000000000-0x000000080000 : "u-boot"
[    1.566576] 0x000000080000-0x000000100000 : "u-boot-env"
[    1.580574] 0x000000100000-0x000000180000 : "factory"
[    1.594412] 0x000000180000-0x000003380000 : "firmware"
[    2.367641] 2 fixed-partitions partitions found on MTD device firmware
[    2.374228] Creating 2 MTD partitions on "firmware":
[    2.379194] 0x000000000000-0x000000400000 : "kernel"
[    2.446898] 0x000000400000-0x000003200000 : "ubi"
[    3.295057] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
[    3.308768] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21
[    3.320620] mtk_soc_eth 1e100000.ethernet wan: mediatek frame engine at 0xbe100000, irq 21
[    3.330759] i2c_dev: i2c /dev entries driver
[    3.338293] NET: Registered PF_INET6 protocol family
[    3.345919] Segment Routing with IPv6
[    3.349681] In-situ OAM (IOAM) with IPv6
[    3.353754] NET: Registered PF_PACKET protocol family
[    3.358888] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    3.372528] 8021q: 802.1Q VLAN Support v1.8
[    3.382889] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
[    3.408488] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode
[    3.416295] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx
[    3.422141] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7530 PHY] (irq=23)
[    3.436922] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=24)
[    3.449725] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=25)
[    3.462670] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=26)
[    3.475241] DSA: tree 0 setup
[    3.482076] UBI: auto-attach mtd5
[    3.485426] ubi0: attaching mtd5
[    4.666348] ubi0: scanning is finished
[    4.687004] ubi0: attached mtd5 (name "ubi", size 46 MiB)
[    4.692479] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    4.699331] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    4.706111] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    4.713073] ubi0: good PEBs: 368, bad PEBs: 0, corrupted PEBs: 0
[    4.719060] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    4.726270] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1695979776
[    4.735392] ubi0: available PEBs: 0, total reserved PEBs: 368, PEBs reserved for bad PEB handling: 19
[    4.744633] ubi0: background thread "ubi_bgt0d" started, PID 311
[    4.747202] block ubiblock0_0: created from ubi0:0(rootfs)
[    4.756168] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    4.770992] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    4.782375] Freeing unused kernel image (initmem) memory: 1232K
[    4.788316] This architecture does not have kernel memory protection.
[    4.794797] Run /sbin/init as init process
[    5.263674] init: Console is alive
[    5.267463] init: - watchdog -
[    6.087454] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.146740] usbcore: registered new interface driver usbfs
[    6.152446] usbcore: registered new interface driver hub
[    6.157876] usbcore: registered new device driver usb
[    6.173531] xhci-mtk 1e1c0000.xhci: supply vbus not found, using dummy regulator
[    6.181154] xhci-mtk 1e1c0000.xhci: supply vusb33 not found, using dummy regulator
[    6.189066] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
[    6.194485] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 1
[    6.207129] xhci-mtk 1e1c0000.xhci: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000290010
[    6.216357] xhci-mtk 1e1c0000.xhci: irq 20, io mem 0x1e1c0000
[    6.222406] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
[    6.227720] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 2
[    6.235213] xhci-mtk 1e1c0000.xhci: Host supports USB 3.0 SuperSpeed
[    6.242655] hub 1-0:1.0: USB hub found
[    6.246560] hub 1-0:1.0: 2 ports detected
[    6.251523] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    6.260658] hub 2-0:1.0: USB hub found
[    6.264596] hub 2-0:1.0: 1 port detected
[    6.276778] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.287338] init: - preinit -
[    7.065302] random: jshn: uninitialized urandom read (4 bytes read)
[    7.185431] random: jshn: uninitialized urandom read (4 bytes read)
[    7.240588] random: jshn: uninitialized urandom read (4 bytes read)
[    7.600355] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
[    7.613545] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[    7.621457] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[    7.629436] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.816505] UBIFS (ubi0:1): Mounting in unauthenticated mode
[    9.822532] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 459
[    9.905698] UBIFS (ubi0:1): recovery needed
[   10.138867] UBIFS (ubi0:1): recovery completed
[   10.143532] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[   10.151379] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   10.161259] UBIFS (ubi0:1): FS size: 38346752 bytes (36 MiB, 302 LEBs), max 312 LEBs, journal size 1904640 bytes (1 MiB, 15 LEBs)
[   10.172916] UBIFS (ubi0:1): reserved for root: 1811211 bytes (1768 KiB)
[   10.179506] UBIFS (ubi0:1): media format: w5/r0 (latest is w5/r0), UUID FF5C55C3-2566-4DA6-BEAE-3DF0DC0E8D49, small LPT model
[   10.197829] mount_root: switching to ubifs overlay
[   10.223063] urandom-seed: Seeding with /etc/urandom.seed
[   10.344942] procd: - early -
[   10.348057] procd: - watchdog -
[   10.955198] procd: - watchdog -
[   10.959014] procd: - ubus -
[   11.043137] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.052003] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.058907] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.074403] procd: - init -
Please press Enter to activate this console.
[   11.699153] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.895313] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   11.902837] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   12.112170] pci 0000:00:00.0: enabling device (0006 -> 0007)
[   12.117860] mt7915e_hif 0000:01:00.0: enabling device (0000 -> 0002)
[   12.124827] pci 0000:00:01.0: enabling device (0006 -> 0007)
[   12.130540] mt7915e 0000:02:00.0: enabling device (0000 -> 0002)
[   12.402819] mt7915e 0000:02:00.0: HW/SW Version: 0x8a108a10, Build Time: 20220929104113a
[   12.402819] 
[   12.736509] mt7915e 0000:02:00.0: WM Firmware Version: ____000000, Build Time: 20220929104145
[   12.770477] mt7915e 0000:02:00.0: WA Firmware Version: DEV_000000, Build Time: 20220929104205
[   12.984214] PPP generic driver version 2.4.2
[   12.992068] urngd: v1.0.2 started.
[   12.992934] NET: Registered PF_PPPOX protocol family
[   13.013865] kmodloader: done loading kernel modules from /etc/modules.d/*
[   13.258633] random: jshn: uninitialized urandom read (4 bytes read)
[   13.848829] random: jshn: uninitialized urandom read (4 bytes read)
[   13.867126] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.099159] random: crng init done
[   14.102698] random: 32 urandom warning(s) missed due to ratelimiting
[   21.257773] mtk_soc_eth 1e100000.ethernet eth0: Link is Down
[   21.288492] mtk_soc_eth 1e100000.ethernet eth0: configuring for fixed/rgmii link mode
[   21.297004] mtk_soc_eth 1e100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   21.307168] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   21.319543] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   21.328698] br-lan: port 1(lan1) entered blocking state
[   21.334132] br-lan: port 1(lan1) entered disabled state
[   21.341275] device lan1 entered promiscuous mode
[   21.346074] device eth0 entered promiscuous mode
[   21.384561] mt7530-mdio mdio-bus:1f lan2: configuring for phy/gmii link mode
[   21.393572] br-lan: port 2(lan2) entered blocking state
[   21.398853] br-lan: port 2(lan2) entered disabled state
[   21.407107] device lan2 entered promiscuous mode
[   21.427375] mt7530-mdio mdio-bus:1f lan3: configuring for phy/gmii link mode
[   21.436279] br-lan: port 3(lan3) entered blocking state
[   21.441698] br-lan: port 3(lan3) entered disabled state
[   21.450699] device lan3 entered promiscuous mode
[   21.469183] mt7530-mdio mdio-bus:1f lan4: configuring for phy/gmii link mode
[   21.478810] br-lan: port 4(lan4) entered blocking state
[   21.484173] br-lan: port 4(lan4) entered disabled state
[   21.492439] device lan4 entered promiscuous mode
[   21.516477] mtk_soc_eth 1e100000.ethernet wan: PHY [mdio-bus:04] driver [MediaTek MT7530 PHY] (irq=POLL)
[   21.526090] mtk_soc_eth 1e100000.ethernet wan: configuring for phy/rgmii link mode
[   24.565783] br-lan: port 5(phy0-ap0) entered blocking state
[   24.571491] br-lan: port 5(phy0-ap0) entered disabled state
[   24.577461] device phy0-ap0 entered promiscuous mode
[   24.582873] br-lan: port 5(phy0-ap0) entered blocking state
[   24.588472] br-lan: port 5(phy0-ap0) entered forwarding state
[   24.594664] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   24.870035] IPv6: ADDRCONF(NETDEV_CHANGE): phy0-ap0: link becomes ready
[   25.250456] IPv6: ADDRCONF(NETDEV_CHANGE): phy1-ap0: link becomes ready
[   31.845761] mt7530-mdio mdio-bus:1f lan3: Link is Up - 100Mbps/Full - flow control rx/tx
[   31.854029] br-lan: port 3(lan3) entered blocking state
[   31.859282] br-lan: port 3(lan3) entered forwarding state



BusyBox v1.36.1 (2023-09-29 09:29:36 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 23.05.0-rc4, r23482-7fe85ce1f2
 -----------------------------------------------------
=== 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:/# 

It is really amazing that u builded it, ty!
But I don't quite follow how u fixed the wifi problem, I need to import this change into your build?

Without this change wifi2g don't work. eeprom data is at the start of factory partition (/dev/mtd2). So you can save, edit and write it back.
UPD. /dev/mtd2

Hi!
I'm new to OpenWRT and can't figure out how to upload the modified mtd2 file back.
All the ways I've tried return me an access error. I even tried uploading the file via tftp, but even there I get the same error.
flash_erase didn't work either.
What is the right way for me to do this?

Without logs it's impossible to understand what you are doing wrong.
You can update mtd2 from openwrt command line:

opkg update
opkg install kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd write /tmp/eeprom.bin factory

where /tmp/eeprom.bin is patched mtd2

2 Likes

/etc/rc.local

#2.4g fix

cat /dev/mtd2 > /tmp/mtd2 && echo -ne "\222" | dd of=/tmp/mtd2 bs=1 seek=400 conv=notrunc && mtd write /tmp/mtd2 factory && rm /tmp/mtd2 && mv /etc/rc.local_ /etc/rc.local && sync && reboot

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 8a194d6bc1..b106ef1845 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1889,6 +1889,24 @@ define Device/netis_wf2881
 endef
 TARGET_DEVICES += netis_wf2881
 
+define Device/netis_n6r
+  $(Device/dsa-migration)
+  $(Device/nand)
+  $(Device/uimage-lzma-loader)
+  IMAGE_SIZE := 129280k
+  UIMAGE_NAME := N6R_0.0.00
+  KERNEL_INITRAMFS := $$(KERNEL) | netis-tail N6R
+  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size
+  DEVICE_VENDOR := NETIS
+  DEVICE_MODEL := N6R
+  DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt7915e kmod-mt7915-firmware \
+       -uboot-envtools
+endef
+TARGET_DEVICES += netis_n6r
+
+
 define Device/oraybox_x3a
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)

Hi there, I got this device. Can I just download the factory image you provided, then flash it to the router? Thanks.

How do we do it exactly? Can you please help? I tried hexdump and tried to search the strings you said, 0xD2 and others, no such thing there is.

Ok it works now!! Thanks a lot!! I changed that file with hexedit and then did those steps as you said:

opkg update
opkg install kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd write /tmp/eeprom.bin factory

Also btw, the device has web recovery at 192.168.1.1 when pressed with reset button. Just upload the image the Sergei provided. No need for tftp.

It totally works, and this has wifi 6. Wifi totally works. And it's a mt7621 board, full hardware acceleration!
I followed the Sergei's advices here: OpenWrt support for Netis N6 router
And it works with 23.05.0. Can somebody update this to 23.05.3 when you have time? Only one thing, it actually has 128MB flash, but in this firmware it has 36MB. Because it had LEDE flashed inside before. And it showed 128MB flash storage. If still 36MB that is fine too. cat /proc/mtd here:

mtd0: 00080000 00020000 "u-boot"
mtd1: 00080000 00020000 "u-boot-env"
mtd2: 00080000 00020000 "factory"
mtd3: 03200000 00020000 "firmware"
mtd4: 00400000 00020000 "kernel"
mtd5: 02e00000 00020000 "ubi"

BUT BUT BUT, I had to mtd write this bin file to the factory with this. Can I not add bin files here? Here is the commands for it:

opkg update
opkg install kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd write /tmp/eeprom.bin factory


Hello, I obtained Stonet N6, which is rebranded Netis N6, stock netis firmware (211126) works on this device. Current N6 snapshot factory.bin is rejected with "invalid format" message and uploading it using "Debricking" procedure from wiki "bricks" the device (it seems to be stuck in boot loop), and it can be "debricked" using stock (netis) firmware.
Is current snapshot working? What is recommended troubleshooting? Soldering serial console?