Mt7981-rfb filogic - "Waiting for root device /dev/fit0" issue

Hi!

I downloaded and compiled openwrt 23 main snapshot (kernel 6.6.52 date 27-9-2024) and after booting my MT7981-rfb router it hangs on "Waiting for root device /dev/fit0..."

When I compile and flash openwrt 23-main snapshot (kernel 6.6.44 data 8-8-2024) it works fine, no waiting for root on /dev/fit0 issue.

Here is a kernel log:

Jump to BL

NOTICE:  BL2: v2.9(release):OpenWrt v2023-07-24-00ac6db3-2 (mt7981-spim-nand-ddr3)
NOTICE:  BL2: Built : 22:09:42, Mar 22 2024
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  EMI: Using DDR3 settings
NOTICE:  EMI: Detected DRAM size: 256MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  CPU: MT7981 (1300MHz)
NOTICE:  SPI_NAND parses attributes from parameter page.
NOTICE:  SPI_NAND Detected ID 0xc2
NOTICE:  Page size 2048, Block size 131072, size 134217728
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.9(release):OpenWrt v2023-07-24-00ac6db3-2 (mt7981-spim-nand-ddr3)
NOTICE:  BL31: Built : 22:09:42, Mar 22 2024


U-Boot 2023.07.02-OpenWrt-r23809-234f1a2efa (Mar 22 2024 - 22:09:42 +0000)

CPU:   MediaTek MT7981
Model: mt7981-rfb
DRAM:  256 MiB
Core:  38 devices, 12 uclasses, devicetree: separate
spi-nand: spi_nand spi_nand@0: Macronix SPI NAND was found.
spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
Loading Environment from UBI... jedec_spi_nor spi_nor@0: unrecognized JEDEC id bytes: ff, ff, ff
Read 126976 bytes from volume ubootenv to 000000004f7bf180
Read 126976 bytes from volume ubootenv2 to 000000004f7de1c0
OK
In:    serial@11002000
Out:   serial@11002000
Err:   serial@11002000
Loading Environment from UBI... UBI partition 'ubi' already selected
Read 126976 bytes from volume ubootenv to 000000004f7bf180
Read 126976 bytes from volume ubootenv2 to 000000004f7de1c0
OK
Net:   eth0: ethernet@15100000
Hit any key to stop autoboot:  0
No size specified -> Using max size (12697600)
Read 12697600 bytes from volume fit to 0000000046000000
## Loading kernel from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM64 OpenWrt Linux-6.6.52
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x46001000
     Data Size:    5771711 Bytes = 5.5 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x44000000
     Entry Point:  0x44000000
     Hash algo:    crc32
     Hash value:   6f3da2ea
     Hash algo:    sha1
     Hash value:   9a0523f6be861a5276ee961b06b5485f01862b58
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'fdt-1' fdt subimage
     Description:  ARM64 OpenWrt mediatek_mt7981-rfb device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x46583000
     Data Size:    25189 Bytes = 24.6 KiB
     Architecture: AArch64
     Load Address: 0x43f00000
     Hash algo:    crc32
     Hash value:   48e4cf96
     Hash algo:    sha1
     Hash value:   2be6e9ecd506c214a6048b9dedd05706b6af670c
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Loading fdt from 0x46583000 to 0x43f00000
## Loading fdt from FIT Image at 46000000 ...
   Using 'mt7981-rfb-spim-nand' configuration
   Trying 'fdt-mt7981-rfb-spim-nand' fdt subimage
     Description:  ARM64 OpenWrt mediatek_mt7981-rfb device tree overlay mt7981-rfb-spim-nand
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x4658a000
     Data Size:    1782 Bytes = 1.7 KiB
     Architecture: AArch64
     Hash algo:    crc32
     Hash value:   9a40fd1d
     Hash algo:    sha1
     Hash value:   981d328a22aa0352b26fa3eaf2e0342bb9e2dce5
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 46000000 ...
Could not find configuration node
load of <NULL> failed
   Booting using the fdt blob at 0x43f00000
Working FDT set to 43f00000
## Loading loadables from FIT Image at 46000000 ...
   Trying 'rootfs-1' loadables subimage
     Description:  ARM64 OpenWrt mediatek_mt7981-rfb rootfs
     Type:         Filesystem Image
     Compression:  uncompressed
     Data Start:   0x4658d000
     Data Size:    6709248 Bytes = 6.4 MiB
     Hash algo:    crc32
     Hash value:   04a5e50a
     Hash algo:    sha1
     Hash value:   c7584ca8b99d669fab6f4551b9962a86d8cdf883
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Uncompressing Kernel Image
   Loading Device Tree to 000000004f7f0000, end 000000004f7f8668 ... OK
Working FDT set to 4f7f0000
Add 'ramoops@42ff0000' node failed: FDT_ERR_EXISTS

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 6.6.52 (neo@goliath) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r27593-7ea086bb89) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 SMP Fri Sep 27 06:19:19 2024
[    0.000000] Machine model: MediaTek MT7981 RFB
[    0.000000] OF: reserved mem: 0x0000000042ff0000..0x0000000042ffffff (64 KiB) map non-reusable ramoops@42ff0000
[    0.000000] OF: reserved mem: 0x0000000043000000..0x000000004302ffff (192 KiB) nomap non-reusable secmon@43000000
[    0.000000] OF: reserved mem: 0x0000000047c80000..0x0000000047d7ffff (1024 KiB) nomap non-reusable wmcpu-reserved@47c80000
[    0.000000] OF: reserved mem: 0x0000000047d80000..0x0000000047dbffff (256 KiB) nomap non-reusable wo-emi@47d80000
[    0.000000] OF: reserved mem: 0x0000000047dc0000..0x0000000047ffffff (2304 KiB) nomap non-reusable wo-data@47dc0000
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000004fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000042ffffff]
[    0.000000]   node   0: [mem 0x0000000043000000-0x000000004302ffff]
[    0.000000]   node   0: [mem 0x0000000043030000-0x0000000047c7ffff]
[    0.000000]   node   0: [mem 0x0000000047c80000-0x0000000047ffffff]
[    0.000000]   node   0: [mem 0x0000000048000000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.4
[    0.000000] percpu: Embedded 18 pages/cpu s34600 r8192 d30936 u73728
[    0.000000] pcpu-alloc: s34600 r8192 d30936 u73728 alloc=18*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: kernel page table isolation disabled by kernel configuration
[    0.000000] alternatives: applying boot alternatives
[    0.000000] Kernel command line:  root=/dev/fit0 rootwait
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64512
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: SWIOTLB bounce buffer size adjusted to 0MB
[    0.000000] software IO TLB: area num 2.
[    0.000000] software IO TLB: SWIOTLB bounce buffer size roundup to 0MB
[    0.000000] software IO TLB: mapped [mem 0x000000004fe48000-0x000000004fec8000] (0MB)
[    0.000000] Memory: 239440K/262144K available (8704K kernel code, 898K rwdata, 2544K rodata, 448K init, 287K bss, 22704K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 640 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv3: GICv3 features: 16 PPIs
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000000c080000
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2ff89eacb, max_idle_ns: 440795202429 ns
[    0.000001] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000068] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.000076] pid_max: default: 32768 minimum: 301
[    0.003033] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.003040] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.005202] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.005733] RCU Tasks Trace: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.005883] rcu: Hierarchical SRCU implementation.
[    0.005886] rcu:     Max phase no-delay instances is 1000.
[    0.006278] smp: Bringing up secondary CPUs ...
[    0.006637] Detected VIPT I-cache on CPU1
[    0.006680] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.006708] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.006775] smp: Brought up 1 node, 2 CPUs
[    0.006781] SMP: Total of 2 processors activated.
[    0.006784] CPU features: detected: 32-bit EL0 Support
[    0.006787] CPU features: detected: CRC32 instructions
[    0.006819] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.006822] CPU: All CPU(s) started at EL2
[    0.006824] alternatives: applying system-wide alternatives
[    0.010287] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.010304] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.011570] pinctrl core: initialized pinctrl subsystem
[    0.012426] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.013022] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.013054] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.013075] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.013438] thermal_sys: Registered thermal governor 'fair_share'
[    0.013443] thermal_sys: Registered thermal governor 'bang_bang'
[    0.013445] thermal_sys: Registered thermal governor 'step_wise'
[    0.013447] thermal_sys: Registered thermal governor 'user_space'
[    0.013522] ASID allocator initialised with 65536 entries
[    0.014594] pstore: Using crash dump compression: deflate
[    0.014598] pstore: Registered ramoops as persistent store backend
[    0.014601] ramoops: using 0x10000@0x42ff0000, ecc: 0
[    0.021729] Modules: 29504 pages in range for non-PLT usage
[    0.021736] Modules: 521024 pages in range for PLT usage
[    0.022694] cryptd: max_cpu_qlen set to 1000
[    0.024758] SCSI subsystem initialized
[    0.025280] libata version 3.00 loaded.
[    0.026756] clocksource: Switched to clocksource arch_sys_counter
[    0.029093] NET: Registered PF_INET protocol family
[    0.029190] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.030333] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.030346] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.030356] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.030373] TCP bind hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.030424] TCP: Hash tables configured (established 2048 bind 2048)
[    0.030493] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.030509] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.030707] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.030743] PCI: CLS 0 bytes, default 64
[    0.032291] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.037098] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.037106] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.081104] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.082336] printk: console [ttyS0] disabled
[    0.102701] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 72, base_baud = 2500000) is a ST16650V2
[    0.102741] printk: console [ttyS0] enabled
[    0.840129] loop: module loaded
[    0.845187] spi-nand spi0.1: Macronix SPI NAND was found.
[    0.850629] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.859113] 5 fixed-partitions partitions found on MTD device spi0.1
[    0.865739] Creating 5 MTD partitions on "spi0.1":
[    0.870628] 0x000000580000-0x000004580000 : "ubi"
[    0.912174] ubi0: default fastmap pool size: 25
[    0.916705] ubi0: default fastmap WL pool size: 12
[    0.921516] ubi0: attaching mtd0
[    1.476844] ubi0: scanning is finished
[    1.493694] ubi0: attached mtd0 (name "ubi", size 64 MiB)
[    1.499117] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    1.505980] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    1.512758] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    1.519709] ubi0: good PEBs: 511, bad PEBs: 1, corrupted PEBs: 0
[    1.525702] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    1.532912] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 0
[    1.541251] ubi0: available PEBs: 0, total reserved PEBs: 511, PEBs reserved for bad PEB handling: 19
[    1.550464] ubi0: background thread "ubi_bgt0d" started, PID 170
[    1.557490] block ubiblock0_2: created from ubi0:2(fit)
[    1.562981] 0x000000380000-0x000000580000 : "FIP"
[    1.569417] 0x000000180000-0x000000380000 : "Factory"
[    1.576103] 0x000000100000-0x000000180000 : "u-boot-env"
[    1.582183] 0x000000000000-0x000000100000 : "BL2"
[    1.718041] mtk_soc_eth 15100000.ethernet: generated random MAC address 65:74:68:25:64:00
[    1.726231] mtk_soc_eth 15100000.ethernet: generated random MAC address 65:74:68:25:64:00
[    1.749829] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc081400000, irq 75
[    1.759750] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc081400000, irq 75
[    1.769490] i2c_dev: i2c /dev entries driver
[    1.775519] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    1.784593] NET: Registered PF_INET6 protocol family
[    1.790538] Segment Routing with IPv6
[    1.794234] In-situ OAM (IOAM) with IPv6
[    1.798225] NET: Registered PF_PACKET protocol family
[    1.803413] 8021q: 802.1Q VLAN Support v1.8
[    1.830620] phy phy-soc:usb-phy@11e10000.1: type_sw - reg 0x218, index 0
[    1.891248] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    1.907859] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    1.910929] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=79)
[    1.937887] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=80)
[    1.959940] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=81)
[    1.982006] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=82)
[    1.993560] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
[    2.000325] DSA: tree 0 setup
[    2.003612] clk: Disabling unused clocks
[    2.008050] Waiting for root device /dev/fit0...

Does anyone know why it does that and how to fix it?

Also I saw a new line in mt7981-rfb.dts:

	chosen: chosen {
		stdout-path = "serial0:115200n8";
		bootargs-append = " root=/dev/fit0 rootwait";
	};

That bootargs line is new since recent snapshots. I believe the developpers added that line for a reason so instead of trying to remove that line, what do I have to do to make the firmware fully booting again?

Anyone an idea whats going on?

Device is MT7981-rfb-spim-nand (filogic) compatible btw. Forgot to mention that in main post.

After 8-8-2024 some changes were made to mt7981/filogic device. Something related to supporting fitblk, but that also created the problem that I'm having.
I tried using firmware images compiled by Openwrt (v23-snapshot), but they all have the same problem.

Is there any information available by the MT7981-rfb/filogic devs that a bootloader upgrade is needed for the newest snapshot firmware?
Or maybe some bootloader env settings to make the firmware work?

@daniel Maybe you know this?

Yes, you need to use bootloader from recent OpenWrt snapshot. Which bootloader are you using right now?

NOTICE:  BL31: v2.9(release):OpenWrt v2023-07-24-00ac6db3-2 (mt7981-spim-nand-ddr3)
NOTICE:  BL31: Built : 22:09:42, Mar 22 2024

This one.

You need to update BL31/U-Boot to at last something after August 9th 2024. Otherwise fitblk can't work on boards with more than one possible boot device.

Alternatively you can edit mt7981-rfb-spim-nand.dtso and replace rootdisk-spim-nand with rootdisk which would then just always assume uImage.FIT inside the UBI volume instead of letting the bootloader set that reference according to what was used to boot.

Thank you for your reaction!

	fragment@0 {
		target = <&chosen>;
	/*	rootdisk-spim-nand = <&ubi_rootdisk>;	*/
		rootdisk = <&ubi_rootdisk>;
	};

I recompiled the firmware with the above changes, but I still have the "waiting for root device /dev/fit0" problem.

Does the problem perhaps lay in my bootloader environmental settings?
I'll include them here:

Net:   eth0: ethernet@15100000
Hit any key to stop autoboot:  0
MT7981> printenv
ethact=ethernet@15100000
baudrate=115200
bootcmd=ubi read $loadaddr fit;bootm $loadaddr#$bootconf
bootconf=config-1#mt7981-rfb-spim-nand#
bootdelay=2
bootfile=initramfs.itb
ethaddr=3e:65:52:a7:1f:52
ipaddr=192.168.2.1
loadaddr=0x46000000
serverip=192.168.2.10

Environment size: 263/126971 bytes
MT7981> 

Oh @daniel , incase I really have to upgrade bootloader I had compiled kmod-mtd-rw in my firmware.

Could you maybe provide information on how to upgrade the bootloader files (mt7981-rfb-spim-nand-bl31-uboot.fip and mt7981-rfb-spim-nand-preloader.bin) on the router while running openwrt?

I've no jtag interface on this mt7981-rfb so I'm a bit hesitating on just trying out :slight_smile:

Thank you!!

I upgraded my bootloader, and hard-bricked my router.

I downloaded the mt7981-spim-nand- bl31-uboot.fip and preloader from https://firmware-selector.openwrt.org/?version=23.05.5&target=mediatek%2Ffilogic&id=mediatek_mt7981-rfb
Copied them to router /tmp.

Then I did:

mtd write /tmp/preloader.bin BL2
mtd write /tmp/bl31-uboot.fip FIP

Restarted the router, everything worked fine.
Router stated that the BL2 and BL31 where (I believe 22 september 2024)

Flashed the newest 23-05-snapshot firmware into router, and still resulted in "waiting for root on for fit1..." message.

So I downloaded the 23-05-snapshot mt7981-rfb-spim-nand BL2 and BL31.
Upgraded the bootloader files like before.
Restarted router and now it doesn't enter the bootloader anymore.
Without having a jtag interface I'm affraid the router is hard bricked.

Its a pitty that the newest snapshot (after date 8-8-2024) requires new bootloader version to run.

For people having a HiLink RM65 router (=mt7981-rfb-spim-nand based): don't upgrade to newest 23-5-snapshot bootloader versions, you'll brick your router.

The MT7981-RFB is the reference board for MT7981, ie. a development platform made by MediaTek to demonstrate the capabilities of the MT7981 chip and give a starting point to board and device makers.
This HiLink RM65 router is not the MT7981-RFB. It's a different device. If you want to support it in OpenWrt we should add a proper board definition for it, including LEDs, buttons and other things which mostly likely deviate from the MT7981-RFB. Also, when doing so, typically we do not require updating or changing the bootloader on end-consumer products like this router if it can be avoided (in some rare cases of bad vendor decisions it cannot be avoided or the cost of doing so outweighs the benefits).

Uhm I believe its a Mt7981-rfb-spim-nand device.
When I began using this router I just used the standard mt7981-rfb firmwares from openwrt. But because of different leds and extra lan port I made my custom rm65 dts and dtsi. But for testing purposes like with the newest snapshots firmware I just used the openwrt build firmwares.

Can I provide my mt7981b-rm65.dts and mt7981b-rm65.dtsi (which i just copied from mt7981-rfb but then added extra lan port and led definitions) to you to get official openwrt support for it?

Btw the board offers SPI (mosi, miso, clk, cs) connection, could it be possible to reprogram flash via there?

Again, there is no such a thing as a "Mt7981-rfb-spim-nand" device.
RFB means "reference board", it's a specific board made by MediaTek (and
not by HiLink). It can be that the HiLink board design is based on the
MT7981-RFB and what you were benefiting from in the past was
(unintended) compatibility.

Can I provide my mt7981b-rm65.dts and mt7981b-rm65.dtsi (which i just copied from mt7981-rfb but then added extra lan port and led definitions) to you to get official openwrt support for it?

Yes, that would be appreciated also by other users of that board :slight_smile:
See this commit for example to get an idea what else (besides the DTS)
is needed:

Btw the board offers SPI (mosi, miso, clk, cs) connection, could it be possible to reprogram flash via there?

Unlikely, as the SPI flash also needs to be powered so you would be able
to write to it. And once you power it, most likely the SoC will also be
powered and probide the clock, hence that would be in conflict with
providing an external clock.

If you want to re-programm a bricked board, the best is to do that via
the UART and use

Ah thank you for your replies!
I also understand better now what you mean with the MT7981-rfb reference board. The Hilink RM65 might be compatible but its not the MT7981-rfb itself :wink:

I will look thru that links and try a Hilink RM65 commit.

Edit: I used mtk_autoboot and unbricked my router! Thank you very much for pointing me to mtk_autoboot!

Have a great day!

@daniel
I attempted to make a post for RM65 router device commit at

I hope I did it correctly and in the right place for it.
https://forum.openwrt.org/t/requesting-openwrt-support-for-hilink-rm65/213416

I managed to flash latest snapshot bootloaders into the router. While starting up (watching thru putty/uart) it now says BL2 and BL31 v2.10 october 2024.

I checked the previous bootloader files that bricked my router and I think that the bl2.bin was corrupted, thats why the flashing turned my router into a brick.
So to clarify there is nothing wrong with the openwrt 23 snapshot bootloader files, it was just on my end that I flashed not entirely correct files.

To get back on topic, the "waiting for root on fit0..." problem:
I still have that problem if I try recent 23-snapshot prebuild or myself build firmware.
I'm having the idea that it has something to do with the partition scheme.
But I cannot get my head wrapped around what it exactly is that causes it.

I pre-format using:

ubi detach ubi;mtd erase ubi;ubi part ubi;ubi create ubootenv 126976;ubi create ubootenv2 126976;setenv serverip 192.168.2.10;setenv ipaddr 192.168.2.1;setenv loadaddr '0x46000000';setenv bootconf 'config-1#mt7981-rfb-spim-nand#';setenv bootcmd 'ubi read $loadaddr fit;bootm $loadaddr#$bootconf';setenv bootfile 'initramfs.itb';saveenv;saveenv;tftpboot;bootm $loadaddr#$bootconf

To pre-format the partitions and load up the initram kernel and then I do sysupgrade to the 23-snapshot firmware. To make sure that it is empty before the sysupgrade is performed. This worked well for the 23.05.5 firmware and 23-snapshots up and until date 8-8-2024.

Could it be that in my pre-formatting partitions or in bootloader environmental settings (setenv blabla = 'something') I should add or change something?

It works now. All nightly snapshots work on the hilink rm65.

I added the following in platform.sh above the mt7981-rfb|\ line

	hilink,rm65|\

And in my mt7981b-rm65.dts I changed the part chosen to:

	chosen {
		stdout-path = "serial0:115200n8";
		rootdisk-spim-nand = <&ubi_rootdisk>;		
	};

I'm happy I can compile the nightly snapshots and use them in my router again!

Thx for your help Daniel also for pointing me to automkboot when I bricked my router :smiley:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.