openwrt-mirror/target/linux
Mikhail Zhilkin 8e8cafcd0e mediatek: add support for netis NX31
This PR adds support for netis NX31 router.

Specification
-------------
- SoC       : MediaTek MT7981BA dual-core ARM Cortex-A53 1.3 GHz
- RAM       : 256 MiB DDR3
- Flash     : SPI-NAND 128 MiB (ESMT)
- WLAN      : MediaTek MT7976CN dual-band WiFi 6
  - 2.4 GHz : b/g/n/ax, MIMO 2x2
  - 5 GHz   : a/n/ac/ax, MIMO 2x2
- Ethernet  : 10/100/1000 Mbps x3 (LAN, MediaTek MT7531AE)
              10/100/1000 Mbps x1 (WAN, SoC internal phy)
- USB       : No
- Buttons   : Mesh, Reset
- LEDs      : 1x Power (blue), unmanaged
              1x Status (blue), gpio-controlled
              1x WiFi 2.4 GHz (blue), gpio-controlled
              1x WiFi 5 GHz (blue), gpio-controlled
              3x LAN activity (blue), switch-controlled
              1x WAN activity (blue), gpio-controlled
- Power     : 12 VDC, 1 A

Installation
------------
1. Connect to the router using ssh (user: admin, pass: web interface
   password)
2. Make mtd backup:
   cat /dev/mtd0 | gzip -1 -c > /tmp/mtd0_spi0.0.bin.gz
   cat /dev/mtd1 | gzip -1 -c > /tmp/mtd1_BL2.bin.gz
   cat /dev/mtd2 | gzip -1 -c > /tmp/mtd2_u-boot-env.bin.gz
   cat /dev/mtd3 | gzip -1 -c > /tmp/mtd3_Factory.bin.gz
   cat /dev/mtd4 | gzip -1 -c > /tmp/mtd4_FIP.bin.gz
   cat /dev/mtd5 | gzip -1 -c > /tmp/mtd5_ubi.bin.gz
3. Download mtd backup from the /tmp dir of the router to your PC using
   scp protocol
4. Upload OpenWrt 'bl31-uboot.fip', 'preloader.bin' images to the /tmp
   dir of the router using scp protocol
5. Write FIP and BL2 (replace bootloader):
   mtd write /tmp/openwrt-mediatek-filogic-netis_nx31-bl31-uboot.fip FIP
   mtd write /tmp/openwrt-mediatek-filogic-netis_nx31-preloader.bin BL2
6. Place OpenWrt
   'openwrt-mediatek-filogic-netis_nx31-initramfs-recovery.itb' image on
   the tftp server (IP: 192.168.1.254)
7. Erase 'ubi' partition and reboot the router:
   mtd erase ubi
   reboot
8. U-Boot automatically boot OpenWrt recovery image from tftp server to
   the RAM
9. Upload OpenWrt 'sysupgrade.itb' image to the /tmp dir of the router
   (IP: 192.168.1.1) using scp protocol
10. Connect to the router using ssh and run:
    sysupgrade -n openwrt-mediatek-filogic-netis_nx31-squashfs-sysupgrade.itb

Return to stock
---------------
1. Unpack stock BL2 and FIP partitions backup
2. Upload stock BL2 and FIP partitions backup to the /tmp dir of the
   router using scp protocol
3. Connect to the router using ssh and run:
   apk update && apk add kmod-mtd-rw
   insmod mtd-rw i_want_a_brick=1
   mtd unlock BL2
   mtd unlock FIP
4. Restore backup:
   mtd write /tmp/mtd4_FIP.bin FIP
   mtd write /tmp/mtd1_BL2.bin BL2
5. Erase ubi and reboot:
   mtd erase ubi
   reboot
6. Power off the router
7. Press Reset button and power on the router. Release the button after
   ~10 sec
8. Navigate to U-Boot recovery web server (http://192.168.1.1/) and
   upload the OEM firmware

Recovery
--------
1. Place OpenWrt
   'openwrt-mediatek-filogic-netis_nx31-initramfs-recovery.itb' image on
   the tftp server (IP: 192.168.1.254)
2. Press “Reset” button and power on the router. After ~10 sec release
   the button.
3. Use OpenWrt initramfs system for recovery

MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| LAN     | dc:xx:xx:d1:xx:18 | label     |
| WAN     | dc:xx:xx:d1:xx:1a | label+2   |
| WLAN 2g | de:xx:xx:11:xx:19 |           |
| WLAN 5g | de:xx:xx:71:xx:19 |           |
+---------+-------------------+-----------+
The LAN MAC was found in 'Factory', 0x1fef20
The WAN MAC was found in 'Factory', 0x1fef26
The WLAN 2g/5g MAC prototype was found in 'Factory', 0x4

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18324
(cherry picked from commit d8002cb627)
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-04-10 20:18:23 +02:00
..
airoha kernel: bump 6.6 to 6.6.83 2025-03-16 08:10:32 +01:00
apm821xx apm821xx: NETGEAR WNDR4700: Fix compat version 2025-01-27 23:53:29 +01:00
archs38 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
armsr armsr: change image names to 'combined-efi' 2025-01-16 21:07:53 +01:00
at91 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
ath79 kernel: bump 6.6 to 6.6.83 2025-03-16 08:10:32 +01:00
bcm27xx bcm27xx: pull 6.6 patches from RPi repo 2025-04-10 13:43:36 +02:00
bcm47xx kernel: bump 6.6 to 6.6.78 2025-02-25 23:16:17 +01:00
bcm53xx kernel: bump 6.6 to 6.6.76 2025-02-25 23:16:17 +01:00
bcm4908 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
bmips bmips: add support for Actiontec T1200H 2025-04-02 19:11:49 +02:00
d1 generic: globally enable CONFIG_PCPU_DEV_REFCNT 2025-03-19 09:24:43 +01:00
gemini kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
generic kernel: bump 6.6 to 6.6.86 2025-04-10 20:14:56 +02:00
imx kernel: bump 6.6 to 6.6.76 2025-02-25 23:16:17 +01:00
ipq40xx ipq40xx: qca8k: hook up IPQ4019 bridge flag offloading 2025-04-08 18:24:33 +02:00
ipq806x ipq806x: fix broken WAN on Linksys EAX and Asrock G10 2025-02-03 01:55:01 +01:00
ixp4xx ixp4xx: Break out mv88e6060 DSA switch to package 2025-01-04 19:27:05 +01:00
kirkwood kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
lantiq lantiq: xrx200: fb7430 set correct label-mac 2025-01-21 00:16:40 +01:00
layerscape kernel: bump 6.6 to 6.6.64 2024-12-15 01:43:39 +01:00
loongarch64 generic: globally enable CONFIG_PCPU_DEV_REFCNT 2025-03-19 09:24:43 +01:00
malta kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
mediatek mediatek: add support for netis NX31 2025-04-10 20:18:23 +02:00
mpc85xx kernel: bump 6.6 to 6.6.64 2024-12-15 01:43:39 +01:00
mvebu mvebu: WD Cloud Mirror Gen2: Remove stty dependency 2025-01-16 21:24:52 +01:00
mxs mxs: run kernel_oldconfig 2024-11-28 18:48:55 +00:00
octeon octeon: ubnt-usg: add board name to supported devices 2025-01-27 02:10:46 +01:00
omap kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
pistachio kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
qoriq kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
qualcommax qualcommax: ipq807x: add support for Linksys MX4300 (LN1301) 2025-02-16 13:03:23 +01:00
ramips ramips: Fix Hongdian H8922 v30 pinctrl default state 2025-04-01 00:17:10 +02:00
realtek realtek: refactor RTL930x MAC config to fix PHY ports 2025-04-08 10:51:39 +02:00
rockchip rockchip: fix missing ".patch" file extension 2025-04-01 00:26:09 +02:00
sifiveu kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
siflower kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
starfive kernel: bump 6.6 to 6.6.83 2025-03-16 08:10:32 +01:00
stm32 generic: globally enable CONFIG_PCPU_DEV_REFCNT 2025-03-19 09:24:43 +01:00
sunxi kernel: bump 6.6 to 6.6.61 2024-11-24 22:46:21 +01:00
tegra kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
uml uml: fix glibc-static check with GCC14 2024-06-22 22:06:06 +02:00
x86 kernel: bump 6.6 to 6.6.82 2025-03-15 12:34:29 +01:00
zynq kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
Makefile linux: fix missing default packages in profiles.json 2025-01-03 11:14:12 +01:00