Support for Xiaomi Wifi R3P Pro?

@ilyas, after flashing new build on r3p with bad's first boot was ok, but then it starts to reboot in cycles. Here's the log:

===================================================================
                MT7621   stage1 code 10:33:11 (ASIC)
                CPU=50000000 HZ BUS=16666666 HZ
==================================================================
Change MPLL source from XTAL to CR...
do MEMPLL setting..
MEMPLL Config : 0x11100000
3PLL mode + External loopback
=== XTAL-40Mhz === DDR-1200Mhz ===
PLL3 FB_DL: 0xd, 1/0 = 660/364 35000000
PLL4 FB_DL: 0xe, 1/0 = 681/343 39000000
PLL2 FB_DL: 0x16, 1/0 = 630/394 59000000
do DDR setting..[00320381]
Apply DDR3 Setting...(use customer AC)
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  11                                                                                                                                                                                                                                             2  120
      --------------------------------------------------------------------------                                                                                                                                                                                                                                             ------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 1    1
000E:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1                                                                                                                                                                                                                                                 1    1
000F:|    0    0    0    0    1    1    1    1    1    1    1    1    1    1                                                                                                                                                                                                                                                 0    0
0010:|    1    1    1    1    1    1    1    1    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0011:|    1    1    1    1    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0012:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0013:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0014:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0                                                                                                                                                                                                                                                 0    0
rank 0 coarse = 15
rank 0 fine = 72
B:|    0    0    0    0    0    0    0    1    1    1    0    0    0    0    0                                                                                                                                                                                                                                                 0
opt_dle value:8
DRAMC_R0DELDLY[018]=00001D1E
==================================================================
                RX      DQS perbit delay software calibration
==================================================================
1.0-15 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    9 8 8 10 8 8 6 6 6 6
10 |    8 8 8 8 5 8
--------------------------------------

==================================================================
2.dqs window
x=pass dqs delay value (min~max)center
y=0-7bit DQ of every group
input delay:DQS0 =30 DQS1 = 29
==================================================================
bit     DQS0     bit      DQS1
0  (1~58)29  8  (1~56)28
1  (1~57)29  9  (1~55)28
2  (1~56)28  10  (1~56)28
3  (1~58)29  11  (1~54)27
4  (1~58)29  12  (1~58)29
5  (1~59)30  13  (1~55)28
6  (1~55)28  14  (1~54)27
7  (1~58)29  15  (1~56)28
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    10 9 10 11 9 8 8 7 7 7
10 |    9 10 8 9 7 9
==================================================================
==================================================================
     TX  perbyte calibration
==================================================================
DQS loop = 15, cmp_err_1 = ffff0000
dqs_perbyte_dly.last_dqsdly_pass[0]=15,  finish count=1
dqs_perbyte_dly.last_dqsdly_pass[1]=15,  finish count=2
DQ loop=15, cmp_err_1 = ffff00a2
dqs_perbyte_dly.last_dqdly_pass[1]=15,  finish count=1
DQ loop=14, cmp_err_1 = ffff0000
dqs_perbyte_dly.last_dqdly_pass[0]=14,  finish count=2
byte:0, (DQS,DQ)=(8,8)
byte:1, (DQS,DQ)=(8,8)
20,data:88
[EMI] DRAMC calibration passed

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


U-Boot 1.1.3 (May 24 2018 - 02:20:54)

Board: Ralink APSoC DRAM:  256 MB
Power on memory test. Memory size= 256 MB...OK!
relocate_code Pointer at: 8ffac000

Config XHCI 40M PLL
******************************
Software System Reset Occurred
******************************
Allocate 16 byte aligned buffer: 8ffe10d0
Enable NFI Clock
# MTK NAND # : Use HW ECC
NAND ID [2C DA 90 95 06]
Device found in MTK table, ID: 2cda, EXT_ID: 909506
Support this Device in MTK table! 2cda
select_chip
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
Signature matched and data read!
load_fact_bbt success 2047
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: NAND Flash
Date:May 24 2018  Time:02:20:54
============================================
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 LLLLW

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.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.                     4
You choosed 3
                                                                              0
Booting System 2
..ranand_erase: start:40000, len:20000
..Done!
done

3: System Boot system code via Flash.
## Booting image at bc600000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.93
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1901124 Bytes =  1.8 MB
   Load Address: 80001000
   Entry Point:  80001000
..............ranand_read: skip reading a fact bad block 6e0000 -> 700000
...............   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
commandline uart_en=0 factory_mode=0 usb_u3=0
No initrd
## Transferring control to Linux (at address 80001000) ...
## Giving linux memsize in MB, 256

Starting kernel ...

[    0.000000] Linux version 4.14.93 (ilyas@fish) (gcc version 7.4.0 (OpenWrt GC                                                                                                                                                                                                                                             C 7.4.0 r9393+1-d0b45962ef)) #0 SMP Wed Feb 20 06:56:38 2019
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is Xiaomi Mi Router 3 Pro
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 1c000000 @ 00000000 (usable)
[    0.000000]  memory: 04000000 @ 20000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2,2} total 4
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 byt                                                                                                                                                                                                                                             es
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000]   HighMem  [mem 0x0000000010000000-0x0000000023ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000]   node   0: [mem 0x0000000020000000-0x0000000023ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000023ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x4a4 with                                                                                                                                                                                                                                              crng_init=0
[    0.000000] percpu: Embedded 14 pages/cpu @81491000 s26192 r8192 d22960 u5734                                                                                                                                                                                                                                             4
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 130560
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,j                                                                                                                                                                                                                                             ffs2
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Writing ErrCtl register=000180cc
[    0.000000] Readback ErrCtl register=000180cc
[    0.000000] Memory: 512944K/524288K available (4480K kernel code, 231K rwdata                                                                                                                                                                                                                                             , 1000K rodata, 228K init, 248K bss, 11344K reserved, 0K cma-reserved, 262144K h                                                                                                                                                                                                                                             ighmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 880MHz
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478ab                                                                                                                                                                                                                                             b4, max_idle_ns: 440795247997 ns
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_i                                                                                                                                                                                                                                             dle_ns: 4343773742 ns

Continuation:

[    0.000010] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 48806                                                                                                                                                                                                                                             45118ns
[    0.007808] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.073967] pid_max: default: 32768 minimum: 301
[    0.078727] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.085236] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.093971] Hierarchical SRCU implementation.
[    0.099072] smp: Bringing up secondary CPUs ...
[    0.116555] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.116564] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 byt                                                                                                                                                                                                                                             es
[    0.116575] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.116708] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.163785] Synchronize counters for CPU 1: done.
[    0.209992] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.210000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 byt                                                                                                                                                                                                                                             es
[    0.210008] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.210076] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.254729] Synchronize counters for CPU 2: done.
[    0.297496] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.297504] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 byt                                                                                                                                                                                                                                             es
[    0.297512] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.297592] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.339905] Synchronize counters for CPU 3: done.
[    0.369769] smp: Brought up 1 node, 4 CPUs
[    0.377643] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma                                                                                                                                                                                                                                             x_idle_ns: 19112604462750000 ns
[    0.387437] futex hash table entries: 1024 (order: 3, 32768 bytes)
[    0.393734] pinctrl core: initialized pinctrl subsystem
[    0.400227] NET: Registered protocol family 16
[    0.414997] pull PCIe RST: RALINK_RSTCTRL = 4000000
[    0.720218] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.725267] ***** Xtal 40MHz *****
[    0.728622] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.733720] Port 0 N_FTS = 1b105000
[    0.737194] Port 1 N_FTS = 1b105000
[    0.740633] Port 2 N_FTS = 1b102800
[    1.895900] PCIE2 no card, disable it(RST&CLK)
[    1.900261]  -> 21007f2
[    1.902665] PCIE0 enabled
[    1.905254] PCIE1 enabled
[    1.907858] PCI host bridge /pcie@1e140000 ranges:
[    1.912636]  MEM 0x0000000060000000..0x000000006fffffff
[    1.917787]   IO 0x000000001e160000..0x000000001e16ffff
[    1.922991] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
[    1.938596] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.944449] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.950192] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.957798] PCI host bridge to bus 0000:00
[    1.961826] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.968690] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    1.974517] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.981274] pci_bus 0000:00: No busn resource found for root bus, will use [b                                                                                                                                                                                                                                             us 00-ff]
[    1.990929] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    1.997479] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.004353] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[    2.010942] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.017838] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    2.024589] pci 0000:00:01.0: BAR 8: assigned [mem 0x60100000-0x601fffff]
[    2.031307] pci 0000:00:00.0: BAR 1: assigned [mem 0x60200000-0x6020ffff]
[    2.038073] pci 0000:00:01.0: BAR 1: assigned [mem 0x60210000-0x6021ffff]
[    2.044802] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bi                                                                                                                                                                                                                                             t]
[    2.052078] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.056973] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.063741] pci 0000:02:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bi                                                                                                                                                                                                                                             t]
[    2.070980] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.075909] pci 0000:00:01.0:   bridge window [mem 0x60100000-0x601fffff]
[    2.083847] clocksource: Switched to clocksource GIC
[    2.090340] NET: Registered protocol family 2
[    2.095287] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    2.102170] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[    2.108621] TCP: Hash tables configured (established 2048 bind 2048)
[    2.115029] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.120791] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.127259] NET: Registered protocol family 1
[    2.363818] 4 CPUs re-calibrate udelay(lpj = 2924544)
[    2.370272] Crashlog allocated RAM at address 0x3f00000
[    2.375873] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    2.389523] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.395326] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORIT                                                                                                                                                                                                                                             Y) (c) 2001-2006 Red Hat, Inc.
[    2.406925] random: fast init done
[    2.411949] bounce: pool size: 64 pages
[    2.415793] io scheduler noop registered
[    2.419619] io scheduler deadline registered (default)
[    2.425793] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.433392] console [ttyS0] disabled
[    2.436984] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 18, base_baud                                                                                                                                                                                                                                              = 3125000) is a 16550A
[    2.446012] console [ttyS0] enabled
[    2.446012] console [ttyS0] enabled
[    2.452864] bootconsole [early0] disabled
[    2.452864] bootconsole [early0] disabled
[    2.461612] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.468537] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[    2.475689] Enable NFI Clock
[    2.478562] # MTK NAND # : Use HW ECC
[    2.482221] Device found in MTK table, ID: 2cda, EXT_ID: 909506
[    2.488137] Support this Device in MTK table! 2cda
[    2.493085] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
[    2.499559] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[    2.505892] nand: Micron NAND 256MiB 3,3V 8-bit
[    2.510402] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB siz                                                                                                                                                                                                                                             e: 64
[    2.517967] Scanning device for bad blocks
[    2.536125] Bad eraseblock 55 at 0x0000006e0000
[    2.574448] Bad eraseblock 189 at 0x0000017a0000
[    2.640666] Bad eraseblock 433 at 0x000003620000
[    2.662595] Bad eraseblock 502 at 0x000003ec0000
[    3.058339] 10 fixed-partitions partitions found on MTD device MT7621-NAND
[    3.065194] Creating 10 MTD partitions on "MT7621-NAND":
[    3.070489] 0x000000000000-0x000000040000 : "Bootloader"
[    3.076736] 0x000000040000-0x000000080000 : "Config"
[    3.082544] 0x000000080000-0x0000000c0000 : "Bdata"
[    3.088284] 0x0000000c0000-0x000000100000 : "Factory"
[    3.094262] 0x000000100000-0x000000140000 : "crash"
[    3.099953] 0x000000140000-0x0000001c0000 : "crash_syslog"
[    3.106328] 0x0000001c0000-0x000000200000 : "reserved0"
[    3.112422] 0x000000200000-0x000000600000 : "kernel_stock"
[    3.118869] 0x000000600000-0x000000a00000 : "kernel"
[    3.124762] 0x000000a00000-0x00000ff80000 : "ubi"
[    3.132143] [mtk_nand] probe successfully!
[    3.136959] Signature matched and data read!
[    3.141208] load_fact_bbt success 2047
[    3.145620] libphy: Fixed MDIO Bus: probed
[    3.216396] libphy: mdio: probed
[    4.620060] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    4.626750] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe                                                                                                                                                                                                                                             100000, irq 20
[    4.637455] NET: Registered protocol family 10
[    4.643256] Segment Routing with IPv6
[    4.647082] NET: Registered protocol family 17
[    4.651550] 8021q: 802.1Q VLAN Support v1.8
[    4.658681] UBI: auto-attach mtd9
[    4.662014] ubi0: attaching mtd9
[    7.003388] ubi0: scanning is finished
[    7.007363] ubi0 error: ubi_read_volume_table: the layout volume was not foun                                                                                                                                                                                                                                             d
[    7.015151] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd9, error -22
[    7.022196] UBI error: cannot attach mtd9
[    7.026229] hctosys: unable to open rtc device (rtc0)
[    7.031514] usb_vbus: disabling
[    7.035242] VFS: Cannot open root device "(null)" or unknown-block(0,0): erro                                                                                                                                                                                                                                             r -6
[    7.042693] Please append a correct "root=" boot option; here are the availab                                                                                                                                                                                                                                             le partitions:
[    7.051066] 1f00             256 mtdblock0
[    7.051075]  (driver?)
[    7.057607] 1f01             256 mtdblock1
[    7.057612]  (driver?)
[    7.064131] 1f02             256 mtdblock2
[    7.064136]  (driver?)
[    7.070637] 1f03             256 mtdblock3
[    7.070641]  (driver?)
[    7.077156] 1f04             256 mtdblock4
[    7.077161]  (driver?)
[    7.083660] 1f05             512 mtdblock5
[    7.083663]  (driver?)
[    7.090184] 1f06             256 mtdblock6
[    7.090189]  (driver?)
[    7.096705] 1f07            4096 mtdblock7
[    7.096709]  (driver?)
[    7.103208] 1f08            4096 mtdblock8
[    7.103212]  (driver?)
[    7.109732] 1f09          251392 mtdblock9
[    7.109738]  (driver?)
[    7.116267] Kernel panic - not syncing: VFS: Unable to mount root fs on unkno                                                                                                                                                                                                                                             wn-block(0,0)
[    7.126418] Rebooting in 1 seconds..

hi @pellmen... yeah i saw his message on 4pda ...
it's strange that he says it booted fine the first time and then started to bootloop... there's no real reason for it to do that.
can you verify that he installed the new bits properly? (or... ask him to reinstall them). if he tried to use sysupgrade (and misunderstood my installation message) that would make a mess... (sysupgrade will work after upgrading to the latest bits)

since he's in a bootloop anyhow, he might as well tftpboot (use initramfs file... and make sure you rename it or you'll have to type all that garbage in)... there are tutorials out there, but it's pretty straightforward (and i can help if he has a hard time... i'm using tftpboot/initramfs all the time now... i was getting scared of burning my nand)

once he boots with initramfs i'd be curious to see what's up with /dev/mtd9 (the ubi partition). can he verify that it starts with "UBI"?

dd if=/dev/mtd9 bs=1 count=3

should result in

UBI3+0 records in
3+0 records out

to reinstall (from tftp/initramfs boot of the latest bits):

dd if=factory.bin bs=1M count=4 | mtd write - kernel
dd if=factory.bin bs=1M skip=4 | mtd write - ubi

If that doesn't do the trick, I'm going to start to have a horrible suspicion that maybe there's something important i'm missing in the DTS file...

@ilyas, can you, please, explain about initramfs-kernel.bin, factory.bin, sysupgrade.bin files? Or give a link to any faq?
As I understand, sysupgrade.bin is for upgrading firmware from web-interface of openwrt (it's not working in beta 4?); factory.bin we can use for updating from stock, and for updating existing openwrt through

mtd write factory.bin firmware

About initramfs I know nothing(

@pellmen: I'll try my best. I hope I don't botch this because I'm just figuring it out myself...

initramfs-kernel.bin is useful for tftpboot ... it's got all you need in a neat package. you just boot into it and don't worry about touching your nand. it's not what you're going to give to mtd write.

factory.bin is your friendly "write this file to mtd and reboot" file. obviously if something goes wrong you won't be able to boot (and then back to tftpboot).

sysupgrade.bin has the kernel and all your other files together, but you're not going to 'mtd write' that, but you're going to feed it to sysupgrade (the command... i suppose luci also can do it). sysupgrade is nice because it installs the new (upgrade) system but keeps your configuration files (etc) around.

IIRC sysupgrade was broken in 'beta 4'. trying to use it resulted in something very similar to what you reported (similar bootloop failing to find root filesystem). I've come to the conclusion that that was because of the partition layout I was using (ie, if the kernel grew the UBI partition would get clobbered).

sysupgrade works now (I've used it many times).

mtd write factory.bin firmware is what you want to use if you're running (the infamous) 'beta 4'. If you're coming from stock you need to split factory.bin so it spans two partitions (kernel1 and rootfs0):

dd if=factory.bin bs=1M count=4 | mtd write - kernel1
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0

(come to think of it, it wouldn't hurt to blow away the other (remaining) partitions either:

mtd erase rootfs1
mtd erase overlay

If for reason (like our friend with the bootloop problem) you've already installed my latest (rc1) and just want to re-flash it (and don't want to use sysupgrade for whatever reason) you'll need to do

dd if=factory.bin bs=1M count=4 | mtd write - kernel
dd if=factory.bin bs=1M skip=4 | mtd write - ubi

(since "firmware" as a partition no longer exists in rc1). Or (if you're not bootlooping) you can just do

sysupgrade sysupgrade.bin

I don't know if this helped...

1 Like

EDIT: also ask him to verify that the files are being written properly (using 'mtd verify')

@pellmen one more thought about your friend with the bootloop... depending on how courageous he's feeling, I would suggest he could blow away kernel0 (aka "kernel_stock") and put openwrt there. Advise him to backup kernel0 (so he can re-flash it later if he needs to... I think it's helpful to have).

I haven't tried this myself, but since he has his bad block in "kernel" (ie, formerly kernel1, after 0x600000) I think we might be able to narrow down the problem (ie, is it really because of bad blocks?) if (just in his case) we put the first part of factory.bin in "kernel_stock" (formerly kernel0) and the rest of it in ubi.

In other words (from stock):

nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=1
nvram set flag_boot_success=0
nvram commit
dd if=factory.bin bs=1M count=4 | mtd write - kernel0
mtd erase kernel1
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0
mtd erase rootfs1
mtd erase overlay
reboot

There was something I read about uboot looking for a xiaomi-signed kernel file so I'm not sure this will work. Make sure he backs up rootfs0 first and knows how to use tftpboot (because he might need it ;))

Only for the adventurous... (no, I don't think you can hard-brick your router unless you screw up the uboot partition, but we're not touching that. So you should be able to recover with tftpboot).

BTW, for those who are planning on putting my bits into "production": I can get it to panic by concurrently copying a bunch of very large files over wifi (both 2.4ghz and 5ghz)... the same over ethernet is fine. I seriously hope MTK fixed that in later versions of their drivers...

1 Like

Guys, thanks for the great work!

From all the conversations above, does it mean that all brands and models using MT7621 will crash/hang/corrupt large files after transfer?

https://wikidevi.com/wiki/MediaTek_MT7621

This Xiaomi router is out in 2017, do you guys think something else using a newer chipset is more ideal?

I've already get panic for large file download.

Can someone confirm OpenWRT on R3P work with VHT160Mhz? Stock Firmware cannot change bandwidth.

@kevinracer ... there's an easy way to find out :wink:

1 Like

@Charleslcso i'm fairly sure the problem isn't with mt7621 (which is the SoC)... most likely it isn't with the mt7615 (the wifi chip) either... it might be the driver or it might be the driver configuration (most likely the latter). we're doing something rather unorthodox with the wifi driver (that is, using binary modules compiled with unknown settings, most likely for DBDC mode) and trying to hack it to get it to work... so the short answer is 'i don't think (at all) that it's a hardware problem'...

@pelllmen how did it go compiling the wifi driver from source? i tried over the weekend but the instructions (on the page you linked to) don't seem to make sense or fit the code i've downloaded (for example, no "patches", but it talks about patches).... also the convoluted way he describes to get it to compile (at least, configure) makes me think that that can't really be the proper way of doing things... with the earlier (2016) sdk, mt7615 is a "package" which makes sense... except that uses an older driver (4.4.0.2 or something), so the patches don't all fit (and the newer driver might need other patches).

btw, did you notice (from @lukasz92 's answer on the mt7615 thread) that mt76 apparently already has some kind of support for mt7615?! incredible!

btw2, messing with the driver source, i'm pretty sure @nossiac's binary modules are compiled for DBDC mode (one chip with two frequencies) like the K2P has... I'm hoping recompiling without DBDC mode will result in something saner.

@ilyas, my friend is trying to repair the system of compiling - he said it's broken. He said, that getting working driver can take a week or more becase he can watch it only a few hours in evening.

@pellmen tell your friend not to spend too much time on it.. it's annoying. i got the source for version 5.0.2.0 to compile ... @nossiac uses 4.4.1.2 (iinm)... the "latest" may be a good or a bad thing (honestly I was just playing around and tried to compile every version i could find... this is the first I could compile)... I'll try with 4.4.1.2 (etc) later.

BTW, i get the impression that this code hasn't really been tested for non-DBDC mode (as in... it was missing some #ifdef's to guard for non-DBDC mode)... once I get it into a "package" format I'll post it in case anyone wants to play around (and yes I'll post the build instructions and patches too... of course...)

EDIT: OK, mt7615e (closed-source) version 5.0.2.0 compiles... could connect via 5G at first try (ssh). 2.4ghz seems like it needs some configuration options changed. source/patches will be posted as soon as it's looking sane (and a little more polished)

EDIT2: OK, it was just a silly configuration file slip that was causing wierdness with 2.4ghz. I can connect to the router (and get an IP address, etc) over both 5ghz and 2.4ghz...

EDIT3: @pellmen i've had the new kernel modules running all night doing simultaneous iperf3 and large file (~2GB) copy over ssh.... no kernel panics. can't say i'm much impressed by the speed, though (~70-80mbps for 5ghz; 40-50 for 2.4ghz)... although i honestly haven't compared it with @nossiac's binaries. want to try?

3 Likes

Yes, of course)

1 Like

Give it a try Kev, if you don't like it roll back

Amazing work !. Installed R3P RC1 from github yesterday and it works pretty well!
I'm up for testing if you guys need me to. Its very liberating to get rid of the eavesdropping MI router firmware.

@ilyas can you share your firmware

EDIT : Is there any way to make samba share work at the moment?

Thanks for RC1. It works, but tell me please how install l2tp vpn server on it? I try to install packet and its says The installed version of package kernel is not compatible, require 4.14.103-1-eb8ed4b9… while 4.14.93-1-1c5c2146… is installed.
Help please!

@pjgowtham i'm not sure what you mean when you say "can you share your firmware".... i posted all of the source (same place where you downloaded the binaries from... or scroll up in this forum).

as for samba share and l2tp (@splash)... at the moment we're stuck at kernel build 93 (which is the latest that we have prebuilt mt7615 modules for). as i've posted earlier, i now have compiled and (what appears to be) working kernel modules of my own (so we're no longer stuck with the prebuilt modules, and we can sync to the latest openwrt/kernel). i suppose there are two options (and related sub-options):

  • for people who prefer to stick with the tried-and-true prebuilt modules (that is, mt7615 version 4.4.1.2), i suppose the easiest way would be to download the openwrt source and build it themselves (choosing whatever packages they want) and then add in the kernel modules. i do realize it's a hassle for windows-users (presumably need to install vmware, etc etc... and if you're not familiar with linux/unix at all, it might be daunting). so i don't mind building/posting packages, although i would rather not build every single possible package and upload all of them.... maybe if people give me a list of packages they want, i'll build and post them.

  • for people who would like to use bleeding-edge latest (possibly better, maybe worse... unknown) mt7615 version 5.0.2.0 modules that i've managed to compile, once i've posted the new binaries, you should just be able to use the regular openwrt packages (ie, kernel 103 or whatever the latest and greatest linux version is).

perhaps i'll take a moment for a personal rant: i really don't see why the patches needed to compile the mt7615 (or other "leaked") sources aren't (currently) publicly available... the "the source isn't free to distribute" argument is weak: you're not posting copyrighted source, you're posting a patch... there's no intellectual property involved. it's almost as if people are trying to create personal dependencies and carve out little niches of "i can do something you can't" for themselves to make themselves special...

anyway, i'll be posting the patches and build instructions... the world has too many private niches. and i'm already special :wink:

1 Like