openwrt/target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts
Zhiwei Cao 344bb7f916 mediatek: filogic: add support Netcore NX30V2/N30PRO/POWER30AX/W7/GW3001
Hardware specification:
  SoC: MediaTek MT7981B
  Flash: ESMT F50L1G41LB 128MB
  RAM: ESMT M15T2G16128A DDR3 256MB
  Ethernet: 3x 1G
  Button: Reset, WPS

MAC addresses
  LAN:	Label MAC (stored in Factory partition offset 0x1fef20)
  WAN:	LAN + 1
  WiFi:	LAN

Official LED layout, from left to right:
  [power] [internet] [wps] [wifi] [lan3/2/1] [wan]

Redefinition for OpenWrt:
  [power]: used for led-boot, led-failsafe, and led-running
  [internet]: used for WAN RX/TX indication
  [wps]: used for led-upgrade
  [wifi] and [lan3/2/1]: unchanged
  [wan]: used for WAN link indication

Installing OpenWrt:
  - Setup a tftp server on your PC. Copy
    xxx-preloader.bin, xxx-bl31-uboot.fip and
    xxx-initramfs.itb to tftp root directory.
  - Connect to the router via ssh or telnet,
    username: useradmin, password is the web
    login password of the router.
  - Backup all critical flash partitions with
    the following commands where x.x.x.x is
    the IP of your PC.

    IP=x.x.x.x
    cd /dev
    for d in /sys/class/mtd/mtd?; do
      if [ "$(cat $d/name)" = "BL2" ]; then
        tftp -l $(basename $d) -r bl2.img -p $IP
      elif [ "$(cat $d/name)" = "FIP" ]; then
        tftp -l $(basename $d) -r fip.bin -p $IP
      elif [ "$(cat $d/name)" = "Factory" ]; then
        tftp -l $(basename $d) -r factory.bin -p $IP
      fi
    done
    for d in /sys/devices/virtual/ubi/ubi0/ubi0_*; do
      [ "$(cat $d/name)" != "customer" ] && continue
      tftp -l $(basename $d) -r customer -p $IP
      break
    done

  - Flash with the following commands:

     cd /tmp
     tftp -r xxx-preloader.bin -g x.x.x.x
     tftp -r xxx-bl31-uboot.fip -g x.x.x.x
     mtd write xxx-preloader.bin spi0.0
     mtd write xxx-bl31-uboot.fip FIP
     mtd erase ubi

  - Set a static ip(192.168.1.254) for your PC.
    And then reboot the router. It will run
    initramfs image automatically.
  - After openwrt boots up, perform sysupgrade
    via web UI.

Reverting to the vendor firmware:
  - Setup a tftp server on your PC with ip
    address 192.168.1.254. And make sure
    bl2.img, fip.bin, factory.bin and customer
    are located in tftp root directory.
  - Power off the router.
  - Press and hold WPS key, then power on
    the router.
  - Release WPS key, when internet/wifi/wps
    leds are blinking.
  - Wait until internet/wifi/wps leds light
    up, power off the router.
  - Press and hold reset key, power up the
    router, release reset key 15s later.
  - Connect to http://192.168.1.1, now you
    can upload vendor .bin firmware.

Uboot netconsole:
  Uboot netconsole can be enabled by WPS
  or reset key.

  - Setup a linux PC with ip 192.168.1.254.
    Open a new terminal and execute
    'stty -isig -echo cbreak; nc -lup 6666'
  - Press and hold WPS(or reset) key, then
    power on the router.
  - Release key once internet/wifi/wps leds
    are all on.
    NOTE: don't hold the key more than 5s
    after internet/wifi/wps leds on, or it
    will try to revert to vendor firmware.
  - 5s later, uboot bootmenu will show on
    the terminal.

Signed-off-by: Zhiwei Cao <bfdeh@126.com>
Link: https://github.com/openwrt/openwrt/pull/18631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 01:29:39 +01:00

64 lines
1 KiB
Text

/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
/dts-v1/;
#include "mt7981b-netis-common.dtsi"
/ {
compatible = "netis,nx30v2", "mediatek,mt7981";
aliases {
label-mac-device = &gmac0;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_wps;
};
leds {
compatible = "gpio-leds";
led_power: power {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_POWER;
gpios = <&pio 4 GPIO_ACTIVE_LOW>;
default-state = "on";
};
internet {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN_ONLINE;
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
};
led_wps: wps {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WPS;
gpios = <&pio 5 GPIO_ACTIVE_LOW>;
};
wan {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN;
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
};
};
};
&switch {
ports {
port@0 {
reg = <1>;
label = "lan1";
};
port@1 {
reg = <2>;
label = "lan2";
};
port@2 {
reg = <3>;
label = "lan3";
};
};
};