I have a router model MediaTek MT7981 RFB and board name mt7981-spim-snand-rfb.
Snapshot 21.02 is currently installed and I would like to install a newer Version of openwrt, stable or snapshot.
I will follow the flash instructions and come back to you
no file renaming comes in question, I just mentioned that the firmware selector creates no bin file for this model.
how can I run those things:
erase 'ubi' partition
reset board
create ubootenv and ubootenv2 UBI volumes in U-Boot
edit environment and set bootcmd, e.g.
setenv bootconf 'config-1#mt7981-rfb-spim-nand#mt7981-rfb-mxl-2p5g-phy-eth1'
setenv bootcmd 'ubi read $loadaddr fit; bootm $loadaddr#$bootconf'
can those be run on uart menu, I am not very convient with those instructions
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, ...
**Thank You so much Daniel for the detailed information ** Before proceeding, I have a questions about your first statement: -------------- 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?). -----------
How can I find out all those infos?
I will send you a pm with the boot log file, does it help?
or any command on openwrt get a detailed hw configuration of it?
The actual MediaTek MT7981 RFB board comes with an ARM JTAG 20-pin header which makes recovery easy. If you want to port OpenWrt to a device based on that reference design the best is probably to try to stay compatible with the stock bootloader, so you will not have to replace it. In some cases, if the stock loader is broken beyond repair or simply doesn't allow images not signed by the vendor, there is no way around replacing it.
Hi @daniel , i was able to follow your suggestion till
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 these two commands also
ubi detach ubi
mtd erase ubi
but when i do ubi attach ubi , it says
MT7981> ubi detach ubi
MT7981> mtd erase ubi
jedec_spi_nor spi_nor@0: unrecognized JEDEC id bytes: ff, ff, ff
Erasing 0x00000000 ... 0x03ffffff (512 eraseblock(s))
MT7981> ubi attach ubi
Error, no UBI device selected!
MT7981>
my spi-nand0 partition table looks like this
MT7981> mtd list
jedec_spi_nor spi_nor@0: unrecognized JEDEC id bytes: ff, ff, ff
List of MTD devices:
I got a MT7981 RFB(mtk3562) from a selling website like eBay. I see you have added support for the MTK3943 reference board for MT7981B+MT7976C. In my board, there is external 2.5GE PHY and in-SoC 1GE PHY is being used. Do you know how can I switch to 2.5GE PHY? Change the DTS or are there any hw switches in the board to change?
I assume your board has the MaxLinear GPY211C 2.5G connected to the SoCs SGMII1 pins and not to the MT7531 switch port 5 -- both is possible by populating some 0-Ohm SMD resistors apparently.
Deciding whether the built-in 1GE PHY or external 2.5G PHY are used on the MTK3562 reference board works entirely in software, and selection is done using Device Tree Overlay being applied by U-Boot before launching Linux.
Ie. you can use
bootm $loadaddr#mt7981-rfb-mxl-2p5g-phy-eth1
to launch OpenWrt and use the external PHY.
Note that all this of course only works if you use OpenWrt-built bl2/preloader, U-Boot and so on.
The uboot menu has options to write to BL2 and FIP.
When you select one of these options it asks you how you want to transfer the file: tftp worked for me.
You need a tftp server anyway to load the initramfs.