MediaTek MT7981 RFB Replace openwrt snapshot 21.02 with newer snapshot or stable version of openwrt

I assume what you got there is NOT the MediaTek MT7681B Reference Board MTK3943 but a different device which is based on that design. In order to add support for your device in OpenWrt, you will have to find out the modifications the vendor made and the choices they did (are they using an external 2.5GE PHY? Are they using the in-SoC 1GE PHY? Is there a MT7531 switch and which ports are used?).

As the evaluation board allows many of those options to be evaluated, it doesn't make sense to use the image intended for the reference board on a consumer device. Look at other MT7981 devices already support and also using SPI-NAND as a starting point, e.g. GL-MT3000.

Regarding the image for the MT7981B reference board:
In order to support all features of the RFB with a single image you need to replace the bootloader as well.
I assume you got the board with SPI-NAND connected to the SPI memory interface of the board.
The best is to connect the serial console and write these files to the corresponding partitions on the flash:

  • openwrt-mediatek-filogic-mediatek_mt7981-rfb-spim-nand-preloader.bin to BL2 at 0x0
  • openwrt-mediatek-filogic-mediatek_mt7981-rfb-spim-nand-bl31-uboot.fip to FIP at 0x380000

Then reboot and re-create UBI in U-Boot:

ubi detach ubi
mtd erase ubi
ubi part ubi
ubi create ubootenv 126976
ubi create ubootenv2 126976
setenv bootconf 'config-1#mt7981-rfb-spim-nand#mt7981-rfb-mxl-2p5g-phy-eth1'
setenv bootcmd 'ubi read $loadaddr fit; bootm $loadaddr#$bootconf'
setenv bootfile 'openwrt-mediatek-filogic-mediatek_mt7981-rfb-initramfs.itb'
saveenv ; saveenv

Now provide initramfs image on a TFTP server listenting on 192.168.1.254/24 and boot that:

tftpboot
bootm $loadaddr#$bootconf

Once OpenWrt comes up, you can use sysupgrade to flash the final image.

Anyway: On a consumer device you should NOT do any of that but rather create an image and device tree with the actually implemented choices and modifications such as LEDs and buttons added, ...

3 Likes