Creating a ubifs for nand + kernel cmdline arguments

hello,

a few questions.

  1. is creating a UBIFS for nand compulsory? contrasted to the situation with an SPI-NOR, it seems so. i tried to use the same approach that works for SPI-NOR (just append the squash to the image, then split) and it does not work.

  2. i am having issues with the commandline arguments for a ubifs root. it does not seem to detect my squashfs properly. this is the output of ubinize (i am not appending the kernel, i don't see why i should?):

GagansMacPro:router Gagan$ scripts/ubinize-image.sh mipsel/images/root.fs outtest -p 128KiB -m 1024 -E 5
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=mipsel/images/root.fs
vol_size=12149760
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize

now, during kernel boot, it always says something like

ubi0: attaching mtd4
ubi0: scanning is finished
ubi0: attached mtd4 (name "sysv", size 40 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 320, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1617529885
ubi0: available PEBs: 32, total reserved PEBs: 288, PEBs reserved for bad PEB handling: 20
ubi0: background thread "ubi_bgt0d" started, PID 79
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 80
UBIFS (ubi0:0): recovery needed
UBIFS (ubi0:0): recovery completed
UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS (ubi0:0): FS size: 2158592 bytes (2 MiB, 17 LEBs), journal size 1015809 bytes (0 MiB, 6 LEBs)
UBIFS (ubi0:0): reserved for root: 101955 bytes (99 KiB)
UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID BB7AAE27-86C8-4658-9E62-48F9AD4A5537, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:13.

obviously the file size of this partition is wrong, and so is the type of the mounted root.

could someone please help me figure out the command line arguments? this is for a DIRxx40 router. it is very aggravating dealing with UBIFS but it does seem to be simple.

right now i'm just wrapping the squash into a UBIFS and hoping that, after attaching the MTD, that ubifs will handle it.

MTK NAND # : Use HW ECC
Device not found, ID: eff1
Not Support this Device! 
chip_mode=00000001
Support this Device in MTK table! eff1 
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Winbond NAND 128MiB 3,3V 8-bit
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Scanning device for bad blocks
MT7621-NAND: parsing partitions cmdlinepart
MT7621-NAND: got parser (null)
9 fixed-partitions partitions found on MTD device MT7621-NAND
Creating 9 MTD partitions on "MT7621-NAND":
0x000000000000-0x000000080000 : "Bootloader"
0x000000080000-0x000000100000 : "Config"
0x000000100000-0x000000140000 : "factory"
0x000000140000-0x000000180000 : "Config2"
0x000000180000-0x000002980000 : "sysv"
0x000002980000-0x000004980000 : "private"
0x000004980000-0x000007180000 : "firmware2"
0x000007180000-0x000007780000 : "mydlink"
0x000007780000-0x000008000000 : "reserved"
[mtk_nand] probe successfully!
Signature matched and data read!

i do note that on the OPENWRT build, it splits based on a uimage, but i don't see why this is necessary either. i am just trying to get a lean setup going. i assume the builder automates every image and so sometimes there is redundance

i've made some progress.

using the uimage mtdsplit, i now get the partitions created!

9 fixed-partitions partitions found on MTD device MT7621-NAND
Creating 9 MTD partitions on "MT7621-NAND":
0x000000000000-0x000000080000 : "Bootloader"
0x000000080000-0x000000100000 : "Config"
0x000000100000-0x000000140000 : "factory"
0x000000140000-0x000000180000 : "Config2"
0x000000180000-0x000002980000 : "sysv"
2 uimage-fw partitions found on MTD device sysv
Creating 2 MTD partitions on "sysv":
0x000000000000-0x0000010a0000 : "kernel"
0x0000010a0000-0x000002800000 : "ubi"
0x000002980000-0x000004980000 : "private"
0x000004980000-0x000007180000 : "firmware2"
0x000007180000-0x000007780000 : "mydlink"
0x000007780000-0x000008000000 : "reserved"

but now failing to get the partition to automatically attach, with the error "no valid UBI magic":

no valid UBI magic found inside mtd6
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
1f00             512 mtdblock0 
 (driver?)
1f01             512 mtdblock1 
 (driver?)
1f02             256 mtdblock2 
 (driver?)
1f03             256 mtdblock3 
 (driver?)
1f04           40960 mtdblock4 
 (driver?)
1f05           17024 mtdblock5 
 (driver?)
1f06           23936 mtdblock6 
 (driver?)
1f07           32768 mtdblock7 
 (driver?)
1f08           40960 mtdblock8 
 (driver?)
1f09            6144 mtdblock9 
 (driver?)
1f0a            8704 mtdblock10 
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Rebooting in 1 seconds..

hoping this is a matter of cleaning out my cmdline arguments now!

nope, no dice.

here is the kernel CMDLINE argument

Kernel command line: console=ttyS0,57600n8 rootfstype=squashfs

anyone have any suggestions?

is there anything i'm supposed to do before calling ubinize on the squash and appending it to the image?

everything looks aligned fine:

GagansMacPro:router Gagan$ binwalk kern.uimage 

> DECIMAL       HEXADECIMAL     DESCRIPTION
> --------------------------------------------------------------------------------
> 0             0x0             uImage header, header size: 64 bytes, header CRC: 0xB9A51A0F, created: 2021-04-06 01:22:48, image size: 3884245 bytes, Data Address: 0x80001000, Entry Point: 0x807B75F0, data CRC: 0x704CBEF3, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma
> 160           0xA0            LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 10897328 bytes
> 3887104       0x3B5000        UBI erase count header, version: 1, EC: 0x0, VID header offset: 0x800, data offset: 0x1000

used the suggested patch by @firemelon:

and it gets slightly further, but now i'm seeing


auto-attach mtd6
ubi0: default fastmap pool size: 8
ubi0: default fastmap WL pool size: 4
ubi0: attaching mtd6
ubi0: scanning is finished
ubi0 error: vtbl_check: too large reserved_pebs 237, good PEBs 84
ubi0 error: vtbl_check: volume table check failed: record 1, error 9
Volume table record 1 dump:
        reserved_pebs   237
        alignment       1
        data_pad        0
        vol_type        1
        upd_marker      0
        name_len        11
        name            rootfs_data
        crc             0xdea7ad63

it boots fine with a squashfs root but, as people would expect, this is not a good idea if there are bad blocks sitting underneath (httpd performance was reflecting this phenomenon).

anyone got an idea?

i've also tried to backport weijie gao's 4.19 mtd driver

but it seems there are little niggles in the of_property calls that prevent it from being detected. has anyone else tried this?

frankly, mtk_nand2 is such hot trash. it is the hottest trash i've ever seen. it's like a fkn horrific patchwork of ralink_bbu_spi with "new" mtd code. i've never seen something so traumatising. like, why is there a static partition map at ALL? it just screams "PROBLEMS".

using weijie's 4.19 mtd driver seems like the smarter solution. doesn't seem to require much work to backport, but the of_property_get is causing issues.

as an aside, i'll note i was a serious brat when i complained about the m25p80 being too small a few years ago. i knew spi-nor was 'the best' at the time, but i didn't know why. now i do, and i underst

i just backported the 5.4 MTD driver to 4.14 successfully (lol), yet, for some reason i'm still having problems!

CAN SOMEONE MOVE THIS TO THE DEVELOPERS SECTION? THERE HAS TO BE AN EASY FIX I'M NOT LOOKING AT.

===================================================================
                MT7621   stage1 code done 
                CPU=50000000 HZ BUS=16666666 HZ
===================================================================


U-Boot 1.1.3 (Jul 17 2019 - 16:41:57)

Board: Ralink APSoC DRAM:  256 MB
relocate_code Pointer at: 8ffa8000

Config XHCI 40M PLL 
******************************
Software System Reset Occurred
******************************
Allocate 16 byte aligned buffer: 8ffdfd50
Enable NFI Clock
# MTK NAND # : Use HW ECC
NAND ID [EF F1 00 95 00]
Device not found, ID: eff1
Not Support this Device! 
chip_mode=00000001
Support this Device in MTK table! eff1 
select_chip
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
Signature matched and data read!
load_fact_bbt success 1021
load fact bbt success
[mtk_nand] probe successfully!
mtd->writesize=2048 mtd->oobsize=64,    mtd->erasesize=131072  devinfo.iowidth=8
..============================================ 
Ralink UBoot Version: 5.0.0.0
-------------------------------------------- 
ASIC MT7621A DualCore (MAC to MT7530 Mode)
DRAM_CONF_FROM: Auto-Detection 
DRAM_TYPE: DDR3 
DRAM bus: 16 bit
Xtal Mode=3 OCP Ratio=1/3
Flash component: 4 MBytes NOR Flash
Date:Jul 17 2019  Time:16:41:57
============================================ 
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:256, ways:4, linesz:32 ,total:32768 

 ##### The CPU freq = 880 MHZ #### 
 estimate memory size =256 Mbytes
#Reset_MT7530
set LAN/WAN WLLLL
########BUTTON_RESET: 15

=================================================
Check image validation:hdr1_addr[bc180000]hdr2_addr[c0980000]
Image1 Header Magic Number --> OK
Image2 Header Magic Number --> OK
Image1 Header Checksum --> OK
Image2 Header Checksum --> OK
Image1 Data Checksum --> ............................................................OK
..Erasing NAND Flash...
ranand_erase: start:80000, len:20000 
.Writing to NAND Flash...
done
Image2 Data Checksum --> ............................................................OK
Checksum1 != Checksum2,Image2 need to be updated!
Image1 Stable Flag --> Stable
Image1 Try Counter --> 0

Image1: OK Image2: Broken

Image2 is borken. Copy Image1 to Image2.

Copy Image:
Image1(0x180000) to Image2(0x4980000), size=0x3B158B
............................................................ranand_erase: start:4980000, len:20000 
..ranand_erase: start:49a0000, len:20000 
..ranand_erase: start:49c0000, len:20000 
..ranand_erase: start:49e0000, len:20000 
..ranand_erase: start:4a00000, len:20000 
..ranand_erase: start:4a20000, len:20000 
..ranand_erase: start:4a40000, len:20000 
..ranand_erase: start:4a60000, len:20000 
..ranand_erase: start:4a80000, len:20000 
..ranand_erase: start:4aa0000, len:20000 
..ranand_erase: start:4ac0000, len:20000 
..ranand_erase: start:4ae0000, len:20000 
..ranand_erase: start:4b00000, len:20000 
..ranand_erase: start:4b20000, len:20000 
..ranand_erase: start:4b40000, len:20000 
..ranand_erase: start:4b60000, len:20000 
..ranand_erase: start:4b80000, len:20000 
..ranand_erase: start:4ba0000, len:20000 
..ranand_erase: start:4bc0000, len:20000 
..ranand_erase: start:4be0000, len:20000 
..ranand_erase: start:4c00000, len:20000 
..ranand_erase: start:4c20000, len:20000 
..ranand_erase: start:4c40000, len:20000 
..ranand_erase: start:4c60000, len:20000 
..ranand_erase: start:4c80000, len:20000 
..ranand_erase: start:4ca0000, len:20000 
..ranand_erase: start:4cc0000, len:20000 
..ranand_erase: start:4ce0000, len:20000 
..ranand_erase: start:4d00000, len:20000 
....ranand_erase: start:4d20000, len:20000 
.(5192)offs=80871424 piece=0 piece_size=71051 rc=0
Done!

=================================================

Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   6: System Enter UBoot to Update Img or Bin. 
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 
default: 3
 0 
   
3: System Boot system code via Flash.
## Booting image at bc180000 ...
   Image Name:   DD-WRT v24 Linux Kernel Imag
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3871979 Bytes =  3.7 MB
   Load Address: 80001000
   Entry Point:  807b3810
............................................................   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 807b3810) ...
## Giving linux memsize in MB, 256

Starting kernel ...

Linux version 4.14.229 (Gagan@GagansMacPro) (gcc version 10.2.0 (GCC)) #4139 SMP PREEMPT Thu Apr 8 20:03:08 MDT 2021
SoC Type: MediaTek MT7621 ver:1 eco:3
bootconsole [early0] enabled
CPU0 revision is: 0001992f (MIPS 1004Kc)
MIPS: machine is D-Link DIR-882 rev. A1
Determined physical RAM map:
 memory: 10000000 @ 00000000 (usable)
VPE topology {2,2} total 4
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
Zone ranges:
  DMA      [mem 0x0000000000000000-0x0000000000ffffff]
  Normal   [mem 0x0000000001000000-0x000000000fffffff]
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000000fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
percpu: Embedded 15 pages/cpu s30640 r8192 d22608 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 65024
Kernel command line: console=ttyS0,57600n8 rootfstype=ubifs,squashfs
log_buf_len individual max cpu contribution: 4096 bytes
log_buf_len total cpu_extra contributions: 12288 bytes
log_buf_len min size: 16384 bytes
log_buf_len: 32768 bytes
early log buf free: 14208(86%)
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Writing ErrCtl register=00000340
Readback ErrCtl register=00000340
Memory: 247864K/262144K available (7918K kernel code, 884K rwdata, 1556K rodata, 312K init, 981K bss, 14280K reserved, 0K cma-reserved, 0K highmem)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Preemptible hierarchical RCU implementation.
        Tasks RCU enabled.
NR_IRQS: 256
CPU Clock: 880MHz
clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
Calibrating delay loop... 583.68 BogoMIPS (lpj=1167360)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU1 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 1: done.
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU2 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 2: done.
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU3 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 3: done.
smp: Brought up 1 node, 4 CPUs
devtmpfs: initialized
random: get_random_u32 called from bucket_table_alloc+0x2b8/0x358 with crng_init=0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
futex hash table entries: 16 (order: -3, 512 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
cpuidle: using governor menu
pull PCIe RST: RALINK_RSTCTRL = 4000000
release PCIe RST: RALINK_RSTCTRL = 7000000
***** Xtal 40MHz *****
release PCIe RST: RALINK_RSTCTRL = 7000000
Port 0 N_FTS = 1b105000
Port 1 N_FTS = 1b105000
Port 2 N_FTS = 1b102800
PCIE2 no card, disable it(RST&CLK)
 -> 21007f2
PCIE0 enabled
PCIE1 enabled
PCI host bridge /pcie@1e140000 ranges:
 MEM 0x0000000060000000..0x000000006fffffff
  IO 0x000000001e160000..0x000000001e16ffff
PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621_gpio 1e000600.gpio: registering 32 gpios
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-mt7621 1e000900.i2c: clock 100KHz, re-start not support
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
pci_bus 0000:00: root bus resource [io  0xffffffff]
pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
pci 0000:00:01.0: BAR 8: assigned [mem 0x60100000-0x601fffff]
pci 0000:00:00.0: BAR 1: assigned [mem 0x60200000-0x6020ffff]
pci 0000:00:01.0: BAR 1: assigned [mem 0x60210000-0x6021ffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
pci 0000:00:00.0: PCI bridge to [bus 01]
pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
pci 0000:02:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit]
pci 0000:00:01.0: PCI bridge to [bus 02]
pci 0000:00:01.0:   bridge window [mem 0x60100000-0x601fffff]
clocksource: Switched to clocksource GIC
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 128 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
NET: Registered protocol family 1
4 CPUs re-calibrate udelay(lpj = 1163264)
workingset: timestamp_bits=30 max_order=16 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
io scheduler noop registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
mtk_hsdma 1e007000.hsdma: Using 3 as missing dma-requests property
mtk_hsdma 1e007000.hsdma: MediaTek HSDMA driver registered
random: fast init done
serial8250_init
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
console [ttyS0] disabled
1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
console [ttyS0] enabled
console [ttyS0] enabled
bootconsole [early0] disabled
bootconsole [early0] disabled
Ralink gpio driver initialized:power_gpio[8]
mt7621-nand: NAND register bank at 0xbe003000
mt7621-nand: ECC register bank at 0xbe003800
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Winbond NAND 128MiB 3,3V 8-bit
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
mt7621-nand: ecc bit: 4, spare_per_sector: 16
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x000007fe0000, version 0x01
Bad block table written to 0x000007fc0000, version 0x01
MT7621-NAND: parsing partitions cmdlinepart
MT7621-NAND: got parser (null)
9 fixed-partitions partitions found on MTD device MT7621-NAND
Creating 9 MTD partitions on "MT7621-NAND":
0x000000000000-0x000000080000 : "Bootloader"
0x000000080000-0x000000100000 : "Config"
0x000000100000-0x000000140000 : "Factory"
0x000000140000-0x000000180000 : "Config2"
0x000000180000-0x000002980000 : "sysv"
2 uimage-fw partitions found on MTD device sysv
Creating 2 MTD partitions on "sysv":
0x000000000000-0x000001d80000 : "kernel"
0x000001d80000-0x000002800000 : "ubi"
0x000002980000-0x000004980000 : "private"
0x000004980000-0x000007180000 : "firmware2"
0x000007180000-0x000007780000 : "mydlink"
0x000007780000-0x000008000000 : "reserved"
libphy: Fixed MDIO Bus: probed
tun: Universal TUN/TAP device driver, 1.6
CHIP_ID = MT7621
WAN at P4
GMAC1 support rgmii
GE1_RGMII_FORCE_1000
GMAC2 support rgmii
RGMII_AN (Internal GigaPhy)
STD_v0.1  1024 rx/2048 tx descriptors allocated, mtu = 1500!
set CLK_CFG_0 = 0x40a00020!!!!!!!!!!!!!!!!!!1
trgmii_set_7621 Completed!!
MT7530 Reset Completed!!
trgmii_set_7530 Completed!!
change HW-TRAP to 0x17c8f
set LAN/WAN LLLLW
eth3: ===> virtualif_open
== MT7530 MCM ==
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
register mt_drv
bus=0x1, slot = 0x0, irq=0x0

== pAd = c0181000, size = 4208320, Status=0 ==
pAd->PciHif.CSRBaseAddress =0xc0080000, csr_addr=0xc0080000!
RTMPInitPCIeDevice():device_id=0x7615
mt_pci_chip_cfg(): HWVer=0x8a10, FWVer=0x8a10, pAd->ChipID=0x7615
mt_pci_chip_cfg(): HIF_SYS_REV=0x76150001
AP Driver version-5.0.4.0
RtmpChipOpsHook(223): Not support for HIF_MT yet! MACVersion=0x0
mt7615_init()-->
Use 1st ePAeLNA default bin.
Use 0st /etc/wlan/MT7615E_EEPROM.bin default bin.
<--mt7615_init()
<-- RTMPAllocTxRxRingMemory, Status=0
bus=0x2, slot = 0x1, irq=0x0

== pAd = c0701000, size = 4208320, Status=0 ==
pAd->PciHif.CSRBaseAddress =0xc0600000, csr_addr=0xc0600000!
RTMPInitPCIeDevice():device_id=0x7615
mt_pci_chip_cfg(): HWVer=0x8a10, FWVer=0x8a10, pAd->ChipID=0x7615
mt_pci_chip_cfg(): HIF_SYS_REV=0x76150001
AP Driver version-5.0.4.0
RtmpChipOpsHook(223): Not support for HIF_MT yet! MACVersion=0x0
mt7615_init()-->
Use 2nd ePAeLNA default bin.
Use 1st /etc/wlan/mt7615e.eeprom.bin default bin.
<--mt7615_init()
<-- RTMPAllocTxRxRingMemory, Status=0
rdm_major = 255
xhci-mtk 1e1c0000.xhci: xHCI Host Controller
xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 1
xhci-mtk 1e1c0000.xhci: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000290010
xhci-mtk 1e1c0000.xhci: irq 22, io mem 0x1e1c0000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
xhci-mtk 1e1c0000.xhci: xHCI Host Controller
xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 2
xhci-mtk 1e1c0000.xhci: Host supports USB 3.0  SuperSpeed
usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usblp
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
rtc-pcf8563 0-0051: registered as rtc0
i2c /dev entries driver
Ralink APSoC Hardware Watchdog Timer
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
u32 classifier
    Performance counters on
    Actions configured
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (4096 buckets, 16384 max)
ctnetlink v0.93: registering with nfnetlink.
ipip: IPv4 and MPLS over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 10
Segment Routing with IPv6
NET: Registered protocol family 17
Bridge firewalling registered
NET4: DECnet for Linux: V.2.5.68s (C) 1995-2003 Linux DECnet Project Team
DECnet: Routing cache hash table of 1024 buckets, 8Kbytes
NET: Registered protocol family 12
8021q: 802.1Q VLAN Support v1.8
registered taskstats version 1
searching for nvram
nvram empty
nvram empty
auto-attach mtd6
ubi0: default fastmap pool size: 8
ubi0: default fastmap WL pool size: 4
ubi0: attaching mtd6
ubi0: scanning is finished
ubi0 error: vtbl_check: too large reserved_pebs 237, good PEBs 84
ubi0 error: vtbl_check: volume table check failed: record 1, error 9
Volume table record 1 dump:
        reserved_pebs   237
        alignment       1
        data_pad        0
        vol_type        1
        upd_marker      0
        name_len        11
        name            rootfs_data
        crc             0xdea7ad63
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd6, error -22
cannot attach mtd6
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
1f00             512 mtdblock0 
 (driver?)
1f01             512 mtdblock1 
 (driver?)
1f02             256 mtdblock2 
 (driver?)
1f03             256 mtdblock3 
 (driver?)
1f04           40960 mtdblock4 
 (driver?)
1f05           30208 mtdblock5 
 (driver?)
1f06           10752 mtdblock6 
 (driver?)
1f07           32768 mtdblock7 
 (driver?)
1f08           40960 mtdblock8 
 (driver?)
1f09            6144 mtdblock9 
 (driver?)
1f0a            8704 mtdblock10 
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Rebooting in 1 seconds..

getting closer, but i'm still missing something...

ubi0: attaching mtd4
ubi0: scanning is finished
ubi0: attached mtd4 (name "sysv", size 40 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 320, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/1, WL threshold: 4096, image sequence number: 1617612286
ubi0: available PEBs: 32, total reserved PEBs: 288, PEBs reserved for bad PEB handling: 20
rootfs: parsing partitions cmdlinepart
ubi0: background thread "ubi_bgt0d" started, PID 74
rootfs: got parser cmdlinepart
mtd: device 11 (rootfs) set to be root filesystem
rootfs_data: parsing partitions cmdlinepart
rootfs_data: got parser cmdlinepart
block ubiblock0_0: created from ubi0:0(rootfs)
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
UBIFS (ubi0:0): default file-system created
List of all partitions:
1f00             512 mtdblock0 
 (driver?)
1f01             512 mtdblock1 
 (driver?)
1f02             256 mtdblock2 
 (driver?)
1f03             256 mtdblock3 
 (driver?)
1f04           40960 mtdblock4 
 (driver?)
1f05           30208 mtdblock5 
 (driver?)
1f06           10752 mtdblock6 
 (driver?)
1f07           32768 mtdblock7 
 (driver?)
1f08           40960 mtdblock8 
 (driver?)
1f09            6144 mtdblock9 
 (driver?)
1f0a            8704 mtdblock10 
 (driver?)
1f0b            3348 mtdblock11 
 (driver?)
1f0c           29388 mtdblock12 
 (driver?)
fe00            3348 ubiblock0_0 
 (driver?)
No filesystem could mount root, tried: 
 ubifs
 squashfs

as far as i can tell, this looks correct except the failure to mount the partition after creating the ubifs, if i use the openwrt image as guide:

[    3.664472] ubi0: scanning is finished
[    3.712026] ubi0: volume 1 ("rootfs_data") re-sized from 9 to 237 LEBs
[    3.725925] ubi0: attached mtd6 (name "ubi", size 36 MiB)
[    3.736735] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.750436] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.763953] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.777818] ubi0: good PEBs: 288, bad PEBs: 0, corrupted PEBs: 0
[    3.789780] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    3.804162] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1617529885
[    3.822353] ubi0: available PEBs: 0, total reserved PEBs: 288, PEBs reserved for bad PEB handling: 20
[    3.840738] ubi0: background thread "ubi_bgt0d" started, PID 503
[    3.843959] block ubiblock0_0: created from ubi0:0(rootfs)

however it seems my build cannot detect the EOFs to automatically resize (hence why i have to manually specify ubi.mtd=4 to get as far as i have).

this shouldn't be so annoying!!

disclaimer: I'm far from an expert in what is actually being done at the lower level, I have mostly experience in configuring and working with the OpenWrt buildsystem. I have added support for some devices in Kirkwood target.

Afaik jffs2 has been more or less obsoleted in favor of UBI/UBIFS even for NOR in OpenWrt. A bunch of older devices still use jffs2 but pretty much all new additions use UBI/UBIFS even on NOR.

should not be required, the build system creates the two partitions with names that are automatically detected by the kernel. Just check any other device, for example kirkwood target.

(i am not appending the kernel, i don't see why i should?):

The main reason to put everything in a UBI volume is that this way it's wear-leveled and bad blocks are managed correctly. But in most devices the uboot bootloader is unable to read UBI volumes to get the kernel and boot it so it is kept outside and flashed raw in the kernel partition or just on flash.

GagansMacPro:router Gagan$ scripts/ubinize-image.sh mipsel/images/root.fs outtest -p 128KiB -m 1024 -E 5
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
image=mipsel/images/root.fs
vol_size=12149760
[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_size=1MiB
vol_flags=autoresize

Are you trying to generate the ubifs manually? The build system does this automatically and you should not need to care about this. You just need to specify pagesize subpagesize and blocksize (and the "-E 5" option if needed) in the device paragraph in the makefile in the images folder, for example see the one for kirkwood https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/image/Makefile

using the uimage mtdsplit, i now get the partitions created!

Ok, so you are using mtdsplit because you don't have a separate kernel partition? you seem to be using a single partition that is called "sysv" in the uboot partition table.

but now failing to get the partition to automatically attach, with the error "no valid UBI magic":

I see that others had similar issues on another mediatek device https://bugs.openwrt.org/index.php?do=details&task_id=2097&string=mtd&order=category&sort=desc&order2=severity&sort2=desc

and from their talk it seems that this is a driver bug in mediatek devices.

Now, if you are not in the mood to try to troubleshoot the flash driver, the guy said this in that bug report

By the way the (re-)read works correctly if the ubi partition is directly defined in the .dts, so it seems that the issue hits only when ubi is a slave of firmware.

This means you remove mtdsplit and then change the nand partition list in the device dts so you permanently create a kernel partition of a set size and a ubi partition of set size. The uboot obviously won't know (nor need to know) about this, but the OpenWrt kernel will follow it and this seems to be a workaround for this driver bug.

To see how big you can make the kernel partition see the uboot's bootcommand line and see how big is the area of flash that is actually read and loaded to RAM.

as an aside, i'll note i was a serious brat when i complained about the m25p80 being too small a few years ago. i knew spi-nor was 'the best' at the time, but i didn't know why. now i do, and i underst

I can personally say that when I added support for a bunch of kirkwood devices a few years ago everything went up smooth and without a problem even if they were all using NAND, I literally just copy-pasted a few lines in the Makefile and the image was generated correctly and worked fine. I would not blame the flash technology in use.

hey @bobafetthotmail

thanks for your insight. i actually backported the mediatek driver and the nand driver is fine. it just seems that there is an issue with the kernel not detecting the end bytes. however i will get back to you tomorrow when i have real (leaded) solder.

i bet i am going to learn just how disastrous this tree-hugging 96%3% solder is compared to the common 63/37 SnPb. looking back at when i started soldering on a DIR-882 (this same board) almost four years ago, it is a miracle i managed to make it work.

lol lead-free solder LICKS BALLS.
Sn63/Pb37 if you want to do it right the first time, and faster, kids.

regarding the offsets/vbtl issue: it turns out what i think happened was, after flashing openwrt the first time, my build was picking up that magic and doing something. i was under the wrong impression that the build was correctly detecting the right offset. it was not.

after doing
dd if=kernel.img of=output.img bs=4096K conv=sync

(i did not have the k before, my 882 build does not need it), the offset is now picked up correctly.

have to fix up the nvram map for the OODLES of space on Config+Config2 (on the 882 i can get 120 out of the 124k) and also accommodate this snazzy new button that's tripping resetbutton since it's not on the 882:

3: System Boot system code via Flash.
## Booting image at bc180000 ...
   Image Name:   DD-WRT v24 Linux Kernel Imag
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3864284 Bytes =  3.7 MB
   Load Address: 80001000
   Entry Point:  807b34b0
...........................................................   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 807b34b0) ...
## Giving linux memsize in MB, 256

Starting kernel ...

Linux version 4.14.229 (Gagan@GagansMacPro) (gcc version 10.2.0 (GCC)) #4231 SMP PREEMPT Mon Apr 12 18:26:28 MDT 2021
SoC Type: MediaTek MT7621 ver:1 eco:3
bootconsole [early0] enabled
CPU0 revision is: 0001992f (MIPS 1004Kc)
MIPS: machine is D-Link DIR-882 rev. A1
Determined physical RAM map:
 memory: 10000000 @ 00000000 (usable)
VPE topology {2,2} total 4
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
Zone ranges:
  DMA      [mem 0x0000000000000000-0x0000000000ffffff]
  Normal   [mem 0x0000000001000000-0x000000000fffffff]
  HighMem  empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000000fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
percpu: Embedded 15 pages/cpu s30640 r8192 d22608 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 65024
Kernel command line: console=ttyS0,57600n8
log_buf_len individual max cpu contribution: 4096 bytes
log_buf_len total cpu_extra contributions: 12288 bytes
log_buf_len min size: 16384 bytes
log_buf_len: 32768 bytes
early log buf free: 14232(86%)
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Writing ErrCtl register=00000020
Readback ErrCtl register=00000020
Memory: 247928K/262144K available (7918K kernel code, 877K rwdata, 1556K rodata, 256K init, 981K bss, 14216K reserved, 0K cma-reserved, 0K highmem)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Preemptible hierarchical RCU implementation.
        Tasks RCU enabled.
NR_IRQS: 256
CPU Clock: 880MHz
clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
Calibrating delay loop... 583.68 BogoMIPS (lpj=1167360)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU1 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 1: done.
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU2 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 2: done.
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
CPU3 revision is: 0001992f (MIPS 1004Kc)
Synchronize counters for CPU 3: done.
smp: Brought up 1 node, 4 CPUs
devtmpfs: initialized
random: get_random_u32 called from bucket_table_alloc+0x2b8/0x358 with crng_init=0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
futex hash table entries: 16 (order: -3, 512 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
cpuidle: using governor menu
pull PCIe RST: RALINK_RSTCTRL = 4000000
release PCIe RST: RALINK_RSTCTRL = 7000000
***** Xtal 40MHz *****
release PCIe RST: RALINK_RSTCTRL = 7000000
Port 0 N_FTS = 1b105000
Port 1 N_FTS = 1b105000
Port 2 N_FTS = 1b102800
PCIE2 no card, disable it(RST&CLK)
 -> 21007f2
PCIE0 enabled
PCIE1 enabled
PCI host bridge /pcie@1e140000 ranges:
 MEM 0x0000000060000000..0x000000006fffffff
  IO 0x000000001e160000..0x000000001e16ffff
PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621_gpio 1e000600.gpio: registering 32 gpios
mt7621_gpio 1e000600.gpio: registering 32 gpios
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-mt7621 1e000900.i2c: clock 100KHz, re-start not support
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
pci_bus 0000:00: root bus resource [io  0xffffffff]
pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
pci 0000:00:01.0: BAR 8: assigned [mem 0x60100000-0x601fffff]
pci 0000:00:00.0: BAR 1: assigned [mem 0x60200000-0x6020ffff]
pci 0000:00:01.0: BAR 1: assigned [mem 0x60210000-0x6021ffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
pci 0000:00:00.0: PCI bridge to [bus 01]
pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
pci 0000:02:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit]
pci 0000:00:01.0: PCI bridge to [bus 02]
pci 0000:00:01.0:   bridge window [mem 0x60100000-0x601fffff]
clocksource: Switched to clocksource GIC
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 128 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
NET: Registered protocol family 1
4 CPUs re-calibrate udelay(lpj = 1163264)
workingset: timestamp_bits=30 max_order=16 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
io scheduler noop registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
mtk_hsdma 1e007000.hsdma: Using 3 as missing dma-requests property
mtk_hsdma 1e007000.hsdma: MediaTek HSDMA driver registered
random: fast init done
serial8250_init
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
console [ttyS0] disabled
1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
console [ttyS0] enabled
console [ttyS0] enabled
bootconsole [early0] disabled
bootconsole [early0] disabled
Ralink gpio driver initialized:power_gpio[8]
mt7621-nand: NAND register bank at 0xbe003000
mt7621-nand: ECC register bank at 0xbe003800
mt7621-nand: using legacy BBT format
nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Winbond NAND 128MiB 3,3V 8-bit
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
mt7621-nand: ecc bit: 4, spare_per_sector: 16
MT7621-NAND: parsing partitions cmdlinepart
MT7621-NAND: got parser (null)
9 fixed-partitions partitions found on MTD device MT7621-NAND
Creating 9 MTD partitions on "MT7621-NAND":
0x000000000000-0x000000080000 : "Bootloader"
0x0000000c0000-0x000000100000 : "Config"
0x000000100000-0x000000140000 : "Factory"
0x000000140000-0x000000180000 : "Config2"
0x000000180000-0x000002980000 : "sysv"
2 uimage-fw partitions found on MTD device sysv
Creating 2 MTD partitions on "sysv":
0x000000000000-0x000000400000 : "kernel"
0x000000400000-0x000002800000 : "ubi"
0x000002980000-0x000004980000 : "private"
0x000004980000-0x000007180000 : "firmware2"
0x000007180000-0x000007780000 : "mydlink"
0x000007780000-0x000008000000 : "reserved"
mt7621-nand: BBT signature match, page=65472
mt7621-nand: loading BBT success (65472)
libphy: Fixed MDIO Bus: probed
tun: Universal TUN/TAP device driver, 1.6
CHIP_ID = MT7621
WAN at P4
GMAC1 support rgmii
GE1_RGMII_FORCE_1000
GMAC2 support rgmii
RGMII_AN (Internal GigaPhy)
STD_v0.1  1024 rx/2048 tx descriptors allocated, mtu = 1500!
set CLK_CFG_0 = 0x40a00020!!!!!!!!!!!!!!!!!!1
trgmii_set_7621 Completed!!
MT7530 Reset Completed!!
trgmii_set_7530 Completed!!
change HW-TRAP to 0x17c8f
set LAN/WAN LLLLW
eth3: ===> virtualif_open
== MT7530 MCM ==
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
register mt_drv
bus=0x1, slot = 0x0, irq=0x0

== pAd = c0181000, size = 4208320, Status=0 ==
pAd->PciHif.CSRBaseAddress =0xc0080000, csr_addr=0xc0080000!
RTMPInitPCIeDevice():device_id=0x7615
mt_pci_chip_cfg(): HWVer=0x8a10, FWVer=0x8a10, pAd->ChipID=0x7615
mt_pci_chip_cfg(): HIF_SYS_REV=0x76150001
AP Driver version-5.0.4.0
RtmpChipOpsHook(223): Not support for HIF_MT yet! MACVersion=0x0
mt7615_init()-->
Use 1st ePAeLNA default bin.
Use 0st /etc/wlan/MT7615E_EEPROM.bin default bin.
<--mt7615_init()
<-- RTMPAllocTxRxRingMemory, Status=0
bus=0x2, slot = 0x1, irq=0x0

== pAd = c0701000, size = 4208320, Status=0 ==
pAd->PciHif.CSRBaseAddress =0xc0600000, csr_addr=0xc0600000!
RTMPInitPCIeDevice():device_id=0x7615
mt_pci_chip_cfg(): HWVer=0x8a10, FWVer=0x8a10, pAd->ChipID=0x7615
mt_pci_chip_cfg(): HIF_SYS_REV=0x76150001
AP Driver version-5.0.4.0
RtmpChipOpsHook(223): Not support for HIF_MT yet! MACVersion=0x0
mt7615_init()-->
Use 2nd ePAeLNA default bin.
Use 1st /etc/wlan/mt7615e.eeprom.bin default bin.
<--mt7615_init()
<-- RTMPAllocTxRxRingMemory, Status=0
rdm_major = 255
xhci-mtk 1e1c0000.xhci: xHCI Host Controller
xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 1
xhci-mtk 1e1c0000.xhci: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000290010
xhci-mtk 1e1c0000.xhci: irq 22, io mem 0x1e1c0000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
xhci-mtk 1e1c0000.xhci: xHCI Host Controller
xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 2
xhci-mtk 1e1c0000.xhci: Host supports USB 3.0  SuperSpeed
usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usblp
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
rtc-pcf8563 0-0051: registered as rtc0
i2c /dev entries driver
Ralink APSoC Hardware Watchdog Timer
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
u32 classifier
    Performance counters on
    Actions configured
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (4096 buckets, 16384 max)
ctnetlink v0.93: registering with nfnetlink.
ipip: IPv4 and MPLS over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 10
Segment Routing with IPv6
NET: Registered protocol family 17
Bridge firewalling registered
NET4: DECnet for Linux: V.2.5.68s (C) 1995-2003 Linux DECnet Project Team
DECnet: Routing cache hash table of 1024 buckets, 8Kbytes
NET: Registered protocol family 12
8021q: 802.1Q VLAN Support v1.8
registered taskstats version 1
searching for nvram
nvram empty
nvram empty
auto-attach mtd6
ubi0: default fastmap pool size: 10
ubi0: default fastmap WL pool size: 5
ubi0: attaching mtd6
UBI: EOF marker found, PEBs from 98 will be erased
ubi0: scanning is finished
gluebi (pid 1): gluebi_resized: got update notification for unknown UBI device 0 volume 1
ubi0: volume 1 ("rootfs_data") re-sized from 9 to 166 LEBs
ubi0: attached mtd6 (name "ubi", size 36 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 288, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1668476296
ubi0: available PEBs: 0, total reserved PEBs: 288, PEBs reserved for bad PEB handling: 20
rootfs: parsing partitions cmdlinepart
ubi0: background thread "ubi_bgt0d" started, PID 76
rootfs: got parser (null)
mtd: device 11 (rootfs) set to be root filesystem
rootfs_data: parsing partitions cmdlinepart
rootfs_data: got parser (null)
block ubiblock0_0: created from ubi0:0(rootfs)
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
VFS: Mounted root (squashfs filesystem) readonly on device 31:11.
devtmpfs: mounted
Freeing unused kernel memory: 312K
This architecture does not have kernel memory protection.
cannot open /proc/sys/kernel/sysrq
init : starting devinit
cannot open /dev/nvram
cannot open /dev/nvram
cannot open /dev/nvram
cannot open /dev/nvram
cannot open /dev/nvram
starting hotplug
 random: crng init done
start MSTP Daemon
done
nvram_commit: read error ret = -22, len = 0/8192
init : no previous bootfails detected! (all ok)init : starting Architecture code for rt2880
Started WatchDog Timer.
configure mac address to ff:ff:ff:ff:ff:ff
mtk-eip93 1e004000.crypto: PRNG initialized
mtk-eip93 1e004000.crypto: EIP93 initialized succesfull
Failed to connect to the switch. Use the "list" command to see which switches are available.
Failed to connect to the switch. Use the "list" command to see which switches are available.
Failed to connect to the switch. Use the "list" command to see which switches are available.
Failed to connect to the switch. Use the "list" command to see which switches are available.
Failed to connect to the switch. Use the "list" command to see which switches are available.
switch reg write offset=2004, value=ff0003
switch reg write offset=2104, value=ff0003
switch reg write offset=2204, value=ff0003
switch reg write offset=2304, value=ff0003
switch reg write offset=2404, value=ff0003
switch reg write offset=2504, value=ff0003
switch reg write offset=2010, value=810000c0
switch reg write offset=2110, value=810000c0
switch reg write offset=2210, value=810000c0
switch reg write offset=2310, value=810000c0
switch reg write offset=2410, value=810000c0
switch reg write offset=2510, value=810000c0
switch reg write offset=2610, value=81000000
switch reg write offset=2710, value=81000000
switch reg write offset=2604, value=20ff0003
switch reg write offset=2704, value=20ff0003
switch reg write offset=2610, value=81000000
switch reg write offset=2014, value=10001
switch reg write offset=2114, value=10001
switch reg write offset=2214, value=10001
switch reg write offset=2314, value=10001
switch reg write offset=2414, value=10002
switch reg write offset=2514, value=10001
REG_ESW_WT_MAC_ATC is 0x7ff0002
done.
Raeth STD_v0.1 (
Tasklet
)

phy_qrx_ring = 0x0da09000, qrx_ring = 0xada09000
txd_pool=ac248000 phy_txd_pool=0c248000
ei_local->skb_free start address is 0x8ffa2000.
phy_free_head is 0x0d9c8000!!!
phy_free_tail_phy is 0x0d9c9ff0!!!
gmac1_txd_num:1024; gmac2_txd_num:1024; num_tx_desc:2048
Enable QDMA TX NDP coherence check and re-read mechanism
***********QDMA_GLO_CFG=80100465
device eth2 entered promiscuous mode
nvram_commit: write error (offset -8192, size 139264)
resetbutton : resetbutton daemon successfully started
Unknown server error
ifconfig: `--help' gives udevice br0 entered promiscuous mode
sage information.
bridge : bridge br0 successfully added
CTL_set_cist_bridge_config: Got return code 0, -1
Couldn't find bridge with index 10

Couldn't change bridge bridge_max_age
CTL_set_cist_bridge_config: Got return code 0, -1
Couldn't find bridge with index 10

Couldn't change bridge br0: port 1(vlan1) entered blocking state
bridge_forward_dbr0: port 1(vlan1) entered disabled state
elay
check vlandevice vlan1 entered promiscuous mode
1
name=[vlan1] lan_ifname=[br0]
bridge : interface vlan1 successfully added to bridge br0
check vlan2br0: port 1(vlan1) entered blocking state

br0: port 1(vlan1) entered forwarding state
device br0 left promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): br0: link is not ready
device br0 entered promiscuous mode
device br0 left promiscuous mode
ra1: ERROR while getting interface flags: No such device
ra2: ERROR while getting interface flags: No such device
ra3: ERROR while getting interface flags: No such device
ra4: ERROR while getting interface flags: No such device
ra5: ERROR while getting interface flags: No such device
ra6: ERROR while getting interface flags: No such device
ra7: ERROR while getting interface flags: No such device
ra8: ERROR while getting interface flags: No such device
ra9: ERROR while getting interface flags: No such device
wds0: ERROR while getting interface flags: No such device
wds1: ERROR while getting interface flags: No such device
wds2: ERROR while getting interface flags: No such device
wds3: ERROR while getting interface flags: No such device
wds4: ERROR while getting interface flags: No such device
wds5: ERROR while getting interface flags: No such device
wds6: ERROR while getting interface flags: No such device
wds7: ERROR while getting interface flags: No such device
wds8: ERROR while getting interface flags: No such device
wds9: ERROR while getting interface flags: No such device
apcli0: ERROR while getting interface flags: No such device
rai1: ERROR while getting interface flags: No such device
rai2: ERROR while getting interface flags: No such device
rai3: ERROR while getting interface flags: No such device
rai4: ERROR while getting interface flags: No such device
rai5: ERROR while getting interface flags: No such device
rai6: ERROR while getting interface flags: No such device
rai7: ERROR while getting interface flags: No such device
rai8: ERROR while getting interface flags: No such device
rai9: ERROR while getting interface flags: No such device
wdsi0: ERROR while getting interface flags: No such device
wdsi1: ERROR while getting interface flags: No such device
wdsi2: ERROR while getting interface flags: No such device
wdsi3: ERROR while getting interface flags: No such device
wdsi4: ERROR while getting interface flags: No such device
wdsi5: ERROR while getting interface flags: No such device
wdsi6: ERROR whiIPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
le getting interface flags: No such device
wdsi7: ERROR while getting interface flags: No such device
wdsi8: ERROR while getting interface flags: No such device
wdsi9: ERROR while getting interface flags: No such device
apclii0: ERROR while getting interface flags: No such device
ra0: ===> main_virtual_if_open
MT7615 found as INDEX0
[0]MT7615 found by chip
load l1profile succeed!
driver_own()::Try to Clear FW Own...
driver_own()::Success to clear FW Own
APWdsInitialize():WdsEntry Number=4
E2pAccessMode=2
SSID[0]=dd-wrt, EdcaIdx=0
BSS0 PhyMode=14
wmode_band_equal(): Band Equal!
[TxPower] BAND0: 100 
[PowerUpenable] BAND0: 1
FragThreshold[0]=2346
APWdsInitialize():WdsEntry Number=4
WDS-Enable mode=0
HT: WDEV[0] Ext Channel = BELOW
WtcSetMaxStaNum: BssidNum:1, MaxStaNum:125 (WdsNum:4, ApcliNum:1, MaxNumChipRept:32), MinMcastWcid:126
Top Init Done!
Use dev_alloc_skb
RX[0] DESC af02c000 size = 16384
RX[1] DESC af022000 size = 8192
cut_through_init(): ct sw token number = 4095
cut_through_token_list_init(): TokenList inited done!id_head/tail=0/4096
cut_through_token_list_init(): 8d8a0e88,8d8a0e88
cut_through_token_list_init(): TokenList inited done!id_head/tail=0/4096
cut_through_token_list_init(): 8d8a0e98,8d8a0e98
Hif Init Done!
ctl->txq = c057eed0
ctl->rxq = c057eedc
ctl->ackq = c057eee8
ctl->kickq = c057eef4
ctl->tx_doneq = c057ef00
ctl->rx_doneq = c057ef0c
Parsing patch header
        Built date: 
2
0
1
8
0
5
1
8
1
0
0
6
0
4
a


        Platform: 
A
L
P
S

        HW/SW version: 
0x
8a
10
8a
10

        Patch version: 
0x
00
00
00
10

        Target address: 0x80000, length: 11072
patch is not ready && get semaphore success
EventGenericEventHandler: CMD Success
MtCmdPatchFinishReq
EventGenericEventHandler: CMD Success
release patch semaphore
WfMcuHwInit: Before NICLoadFirmware, check ICapMode = 0
Parsing CPU 0 fw tailer
        Chip ID: 
0x
04

        Eco version: 
0x
00

        Region number: 
0x
00

        Format version: 
0x
00

        Ram version: 
_
r
e
s
e
r
v
e
d
_

        Built date: 
2
0
1
9
0
3
0
7
0
1
5
6
0
3


        Common crc: 0x0
Parsing tailer region 0
        Feature set: 
0x
01

        Target address: 0x84000, Download size: 409600
Parsing tailer region 1
        Feature set: 
0x
01

        Target address: 0x209c400, Download size: 43328
EventGenericEventHandler: CMD Success
EventGenericEventHandler: CMD Success
MtCmdFwStartReq: override = 0x1, address = 0x84000
EventGenericEventHandler: CMD Success
Parsing CPU 1 fw tailer
        Chip ID: 
0x
04

        Eco version: 
0x
00

        Region number: 
0x
00

        Format version: 
0x
00

        Ram version: 
_
r
e
s
e
r
v
e
d
_

        Built date: 
2
0
1
9
0
4
1
5
1
5
4
1
4
9


        Common crc: 0x0
Parsing tailer region 0
        Feature set: 
0x
01

        Target address: 0x90000000, Download size: 122608
EventGenericEventHandler: CMD Success
MtCmdFwStartReq: override = 0x4, address = 0x0
EventGenericEventHandler: CMD Success
MCU Init Done!
efuse_probe: efuse = 10000212
RtmpChipOpsEepromHook::e2p_type=2, inf_Type=5
RtmpEepromGetDefault::e2p_dafault=1
RtmpChipOpsEepromHook: E2P type(2), E2pAccessMode = 2, E2P default = 1
NVM is FLASH mode. dev_idx [0] FLASH OFFSET [0x0]
NICReadEEPROMParameters: EEPROM 0x52 b302
NICReadEEPROMParameters: EEPROM 0x52 b302
resetbutton : factory default.
nvram_commit: write error (offset -8192, size 139264)
init : Terminated....................................
lastlog: Failed to get the entry for UID 0
init : send dhcp lease release signal
init : Sending SIGTERM to all processes
init (1): drop_caches: 3
init : unmounting /
init : unmounting /dev
init : Sending SIGKILL to all prinit (1): drop_caches: 3
ocesses
init : unmounting /
init : unmounting /dev
nvram_commit: write error (offset -8192, size 139264)
cannot open /proStopped WatchDog Timer.
reboot: Restarting system

cues ominous music, preferably scored by howard shore