Xiaomi mi wifi 3 support

dont know if the information is valueable but here are some details on the partition layouts of padavan
/home/root # cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "Bootloader"
mtd1: 00080000 00020000 "BootEnv"
mtd2: 00540000 00020000 "Factory"
mtd3: 00140000 00020000 "Kernel"
mtd4: 00ec0000 00020000 "RootFS"
mtd5: 00080000 00020000 "Config"
mtd6: 00080000 00020000 "Storage"
mtd7: 06900000 00020000 "RWFS"
mtd8: 01000000 00020000 "Firmware_Stub"

partition tables of pandorabox

[ 1.484000] 0x000000000000-0x000000040000 : "u-boot"
[ 1.492000] 0x000000040000-0x000000080000 : "u-boot-env"
[ 1.500000] 0x000000080000-0x0000000c0000 : "Bdata"
[ 1.504000] 0x0000000c0000-0x000000100000 : "Factory"
[ 1.512000] 0x000000100000-0x000000140000 : "crash"
[ 1.520000] 0x000000140000-0x000000180000 : "crash_syslog"
[ 1.528000] 0x000000180000-0x000000200000 : "reserved0"
[ 1.536000] 0x000000200000-0x000007f00000 : "firmware"
[ 2.116000] 3 uimage-fw partitions found on MTD device firmware
[ 2.120000] 0x000000200000-0x000000400000 : "kernel"
[ 2.128000] 0x000000400000-0x000007ec0000 : "ubi"
[ 2.136000] 0x000007ec0000-0x000007f00000 : "panic_oops"
[ 2.160000] mtdoops: Attached to MTD device 10
[ 2.164000] 0x000007f00000-0x000008000000 : "factory_bbt"
[ 2.172000] 0x000000000000-0x000040000000 : "fullflash"

Not really helpfull

has someone taken a look at that xiaomi r3 pandorabox testing link.

if anything could help i believe its drawing parallels.

robimarko you said for example that PB had the same NAND issue.
however in this thread they manage to get it working by also flashing a bootloader as far as i could make sense of the translations.

there are 2 bootloaders one for nand and one for spi and a squashfs sysupgrade.

my guess is they must install it on a different method. maybe someone speaking chinese here could help us making a more accurate translation because it doesnt really make sense.

by the way you saved my router :slight_smile: thank u so much

Their way is not applicable.
First, they all use old 3.0, 3.1 or 3.4 kernels while LEDE is on 4.9 for RAMIPS.
The issue is that even with code source they are usually based on closed source Mediatek/Ralink sources and with their proprietary kernel patches.
While we have to do with the vanilla kernel.

No problem, glad that your router is alive.

What would you need to carry on development for this router? a new device?
thanks.

doesnt the r3 als have spi storage.
i read somewhere it has both nand and spi, is that incorrect?

if so nand seems to be the biggest issue for flashing it on this hardware? cant it be done on spi?

@robimarki you seem to be having the bootloop without being able to choose an option right? have you tried out another serial adapter,cables, checking the solder, another usb port and serial drivers also? maybe also a different client other than putty. ive been having these issues in the past often and after days ended up saving each device

No,it does not have SPI storage, only 128MB of NAND.

Yes,I have that bootloop.
I have tried another usb to serial(Altough they are the same model)
Solder,usb port and drivers are okay since it was working untill flashing LEDE.
Now it has NAND ECC errrors due to attempting to recover in the way that @dgiese managed to.
And still bootloops

Yes,a new device would be needed but since we are stuck on driver issues it would be useless since I do not have any knowledge on that field

I see.... crap... :frowning:

so for anyone curious despite of not being able to understand much
i tried the custom bootloader for pandorabox on the chinese forum i provided.
however it was weird because it didnt have a bootloader menu when i watched it bootup through serial it was immediately booting. i didnt proceed on trying to flash since i thought due to my limited knowledge it would become irreversible.

so i gained ssh and restored it straight through prometheus

heres also the link i posted prior on recovery through UART which wasnt working, now does, just in case it might be useful for someone:
https://4pda.ru/forum/index.php?showtopic=736801&st=1220#entry50915904
"We need to immediately reboot the field 4, then we move to the console.

Now we enter the commands:
setenv flag_try_sys1_failed 1
setenv flag_try_sys2_failed 1
saveenv
reset

After the reboot, the router will enter recovery mode and will wait for the flash drive to be connected with the firmware and pressing the Reset button."

Dear All!
Please Help!., I changed kernel1 and root0 then failed as follows:

U-Boot 1.1.3 (Apr 15 2016 - 17:46:32)

Board: Ralink APSoC DRAM:  128 MB
Power on memory test. Memory size= 128 MB...OK!
relocate_code Pointer at: 87fb8000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
******************************
Software System Reset Occurred
******************************
!!! nand page size = 2048, addr len=4
..============================================
Ralink UBoot Version: 4.2.S.1
--------------------------------------------
ASIC 7620_MP (Port5<->None)
DRAM_CONF_FROM: Auto-detection
DRAM_TYPE: DDR2
DRAM component: 1024 Mbits
DRAM bus: 16 bit
Total memory: 128 MBytes
Flash component: NAND Flash
Date:Apr 15 2016  Time:17:46:32
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 580 MHZ ####
 estimate memory size =128 Mbytes

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.
   9: Load Boot Loader code then write to Flash via TFTP.


3: System Boot system code via Flash.
Booting System 2
..ranand_erase_write: offs:40000, count:20000
.Done!
done
## Booting image at bc600000 ...
   Image Name:   MIPS LEDE Linux-4.9.49
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1352342 Bytes =  1.3 MB
   Load Address: 80000000
   Entry Point:  80000000
.....................   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
commandline uart_en=0 factory_mode=0 mem=128m
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 128

Starting kernel ...

[    0.000000] Linux version 4.9.49 (robimarko@Builder-temp2) (gcc version 5.4.0 (LEDE GCC 5.4.0 r4851-4072846) ) #0 Mon Sep 11 08:31:23 2017
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:6
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Xiaomi Mi Router R3
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=0007fef0
[    0.000000] Readback ErrCtl register=0007fef0
[    0.000000] Memory: 125404K/131072K available (3141K kernel code, 155K rwdata, 752K rodata, 168K init, 216K bss, 5668K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007580] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.070075] pid_max: default: 32768 minimum: 301
[    0.074689] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.081062] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.094785] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.104338] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.110290] pinctrl core: initialized pinctrl subsystem
[    0.115985] NET: Registered protocol family 16
[    0.381714] PCI host bridge /pcie@10140000 ranges:
[    0.386327]  MEM 0x0000000020000000..0x000000002fffffff
[    0.391379]   IO 0x0000000010160000..0x000000001016ffff
[    0.410196] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.415591] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.421996] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.427375] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.433710] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.439087] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.445933] PCI host bridge to bus 0000:00
[    0.449862] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.456578] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.462277] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.468882] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.477042] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.485582] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.491948] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.498758] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.505304] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.512329] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.518921] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.526043] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.533027] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.537857] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.544437] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.551481] pci 0000:00:00.0: card - bus=0x0, slot = 0x0 irq=0
[    0.557123] pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[    0.566519] clocksource: Switched to clocksource systick
[    0.572976] NET: Registered protocol family 2
[    0.578066] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.584793] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.591015] TCP: Hash tables configured (established 1024 bind 1024)
[    0.597245] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.602868] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.609257] NET: Registered protocol family 1
[    0.615809] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.622492] Crashlog allocated RAM at address 0x3f00000
[    0.628887] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.643446] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.649094] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.667508] io scheduler noop registered
[    0.671253] io scheduler deadline registered (default)
[    0.676459] ralink-usb-phy usbphy: invalid resource
[    0.681817] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.689087] console [ttyS0] disabled
[    0.692539] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.702218] console [ttyS0] enabled
[    0.702218] console [ttyS0] enabled
[    0.709250] bootconsole [early0] disabled
[    0.709250] bootconsole [early0] disabled
[    0.719196] libphy: Fixed MDIO Bus: probed
[    0.729264] gsw: setting port4 to ephy mode
[    0.733584] mtk_soc_eth 10100000.ethernet eth0 (uninitialized): port 0 link up (100Mbps/Full duplex)
[    0.742986] mtk_soc_eth 10100000.ethernet: generated random MAC address 36:7f:82:1e:9f:06
[    0.751426] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    0.758344] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.767391] rt2880_wdt 10000120.watchdog: Initialized
[    0.773676] NET: Registered protocol family 10
[    0.781387] NET: Registered protocol family 17
[    0.785985] 8021q: 802.1Q VLAN Support v1.8
[    0.793043] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.800755] Please append a correct "root=" boot option; here are the available partitions:
[    0.809291] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.818940] Rebooting in 1 seconds..

Thanks a lot!

Again,read the thread.
You will see that LEDE does not currently work due to NAND driver.

2 Likes

Thank you so muchs!

Also, you can see at least 3-4 different recovery methods

1 Like

Yep, I am new member;
Can you help me by teamview remote to repair?

Nope.
You can read the thread like everybody else and you will figure out everything.

1 Like

Thank you so much!.
i have try an other methods!

I tried with this kernel and my drive had brick on yesterday!
i hope you can repair in future.

I really dont understand what you meant to say?