MT7603EN/MT7612EN Wifi Troubles on Netgear R6220

An English translation mainly.

so after trying your method on the breed bootload i still get the same problem
[ 14.754133] mt76x2e 0000:01:00.0: EEPROM data check failed: ffff
[ 14.767008] mt76x2e 0000:01:00.0: Invalid MAC address, using random address ae:e9:40:32:1f:83
I even set the mac address from the breed web interface.
I think my factory partition is corrupt. does anyone have an original backup?

is it possible for the devs of breed to reorder the flash layout so we can utilize all free space. my best guess is to make 4 partitions on the device bootloader eeprom kernel rootfs that would make it work if it could be done

@realopty
I have no idea, but I can tell you that you can rearrange the partitions when building openwrt.
As for the backup here you go: https://quickfileshare.org/SVy/mtd4.bak. Keep in mind that I am not sure if they are compatible. Also your MAC address will become my MAC address.
As for the Breed bootloader I gotta say, I'm not really a fan of this approach. What we're doing is essentially flashing the factory partition to a different spot than where it was earlier on top of using some closed source thing from the web. So if I understand correctly you won't be able to revert to stock firmware afterwards and you may overwrite something depending on whether the "unused" parts of flash are actually used for something. It looks to me like a hack more than a solution.

1 Like

Thanks for the help. I was the original person to build OpenWRT with a different partition mapping. I'll make sure to change your mac address too.

I agree with you on the breed bootloader. my thinking is that I have to patch every build why not get more space to do it with lol.

In the past i replaced this section of flash with an extended rootfs
partition@2200000 {
label = "ENG UI";
reg = <0x2200000 0x200000>;
read-only;
};

partition@2400000 {
	label = "ML1";
	reg = <0x2400000 0x200000>;
	read-only;
};

partition@2600000 {
	label = "ML2";
	reg = <0x2600000 0x200000>;
	read-only;
};

partition@2800000 {
	label = "ML3";
	reg = <0x2800000 0x200000>;
	read-only;
};

partition@2a00000 {
	label = "ML4";
	reg = <0x2a00000 0x200000>;
	read-only;
};

And was able to safely recover to stock

Sound logic. I'm curious if we can move the factory partition to just after kernel and resize ubi to fill the rest. It should still work, right? This way we could prepend the rootfs openwrt image with factory and there would be no need for separate dts files for each flash layout, you'd just have to make a backup of the original factory partition before flashing openwrt. That would still be less work than compiling from scratch and could be maybe pushed to git? Just an idea.
Of course it would complicate the installation and reverting to stock but that could just be explained on the wiki.
Or better yet, do the whole factory flashing while on stock, then flash rootfs with a 1MB offset.

EDIT: (For posterity) DO NOT move the factory partition. The moment you override the original factory partition header (hence why the current method of rewriting it elsewhere is so risky and discouraged by me), the U-boot crashes on boot. According to the serial output, in the header of factory partition there is an "upgrade flag", which when corrupted bricks the router. Furthermore, when the mac address in the factory partition gets corrupted, the u-boot also crashes. So again, do not move the factory partition. Instead, remove the "reserved" partition and increase the "ubi" partition size. You get a 100MB root this way.

Finally made a build for my own EEPROM location issues...

About 2 hours ago I bought the R6620, and have not yet flashed it. I'm no expert, but perhaps the following OEM information will help someone else in this thread. I have also dumped devices 0 to 20, download can be found here

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "Bootloader"
mtd1: 00100000 00020000 "SC PID"
mtd2: 00400000 00020000 "Kernel"
mtd3: 01c00000 00020000 "Rootfs"
mtd4: 00200000 00020000 "English UI"
mtd5: 00200000 00020000 "ML1"
mtd6: 00200000 00020000 "ML2"
mtd7: 00200000 00020000 "ML3"
mtd8: 00200000 00020000 "ML4"
mtd9: 00200000 00020000 "ML5"
mtd10: 00100000 00020000 "Factory"
mtd11: 00100000 00020000 "SC Private Data"
mtd12: 00200000 00020000 "POT"
mtd13: 00200000 00020000 "Traffic Meter"
mtd14: 00200000 00020000 "DPF"
mtd15: 00200000 00020000 "SC Nvram"
mtd16: 00200000 00020000 "Ralink Nvram"
mtd17: 00200000 00020000 "Ralink Reserved"
mtd18: 00200000 00020000 "ML6"
mtd19: 00200000 00020000 "Upgrade Flag"
mtd20: 00200000 00020000 "Reserved Block3"
mtd21: 03c00000 00020000 "Reserved Block4"

# mtdinfo -a
Count of MTD devices:           22
Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8, mtd9, mtd10, mtd11, mtd12, mtd13, mtd14, mtd15, mtd16, mtd17, mtd18, mtd19, mtd20, mtd21
Sysfs interface supported:      yes

mtd0
Name:                           Bootloader
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:0
Bad blocks are allowed:         true
Device is writable:             true

mtd1
Name:                           SC PID
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:2
Bad blocks are allowed:         true
Device is writable:             true

mtd2
Name:                           Kernel
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          32 (4194304 bytes, 4.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:4
Bad blocks are allowed:         true
Device is writable:             true

mtd3
Name:                           Rootfs
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          224 (29360128 bytes, 28.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:6
Bad blocks are allowed:         true
Device is writable:             true

mtd4
Name:                           English UI
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:8
Bad blocks are allowed:         true
Device is writable:             true

mtd5
Name:                           ML1
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:10
Bad blocks are allowed:         true
Device is writable:             true

mtd6
Name:                           ML2
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:12
Bad blocks are allowed:         true
Device is writable:             true

mtd7
Name:                           ML3
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:14
Bad blocks are allowed:         true
Device is writable:             true

mtd8
Name:                           ML4
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:16
Bad blocks are allowed:         true
Device is writable:             true

mtd9
Name:                           ML5
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:18
Bad blocks are allowed:         true
Device is writable:             true

mtd10
Name:                           Factory
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:20
Bad blocks are allowed:         true
Device is writable:             true

mtd11
Name:                           SC Private Data
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:22
Bad blocks are allowed:         true
Device is writable:             true

mtd12
Name:                           POT
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:24
Bad blocks are allowed:         true
Device is writable:             true

mtd13
Name:                           Traffic Meter
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:26
Bad blocks are allowed:         true
Device is writable:             true

mtd14
Name:                           DPF
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:28
Bad blocks are allowed:         true
Device is writable:             true

mtd15
Name:                           SC Nvram
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:30
Bad blocks are allowed:         true
Device is writable:             true

mtd16
Name:                           Ralink Nvram
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:32
Bad blocks are allowed:         true
Device is writable:             true

mtd17
Name:                           Ralink Reserved
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:34
Bad blocks are allowed:         true
Device is writable:             true

mtd18
Name:                           ML6
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:36
Bad blocks are allowed:         true
Device is writable:             true

mtd19
Name:                           Upgrade Flag
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:38
Bad blocks are allowed:         true
Device is writable:             true

mtd20
Name:                           Reserved Block3
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:40
Bad blocks are allowed:         true
Device is writable:             true

mtd21
Name:                           Reserved Block4
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          480 (62914560 bytes, 60.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:42
Bad blocks are allowed:         true
Device is writable:             true

Update: After flashing 18.06.1, I seem to have been lucky. None of the above error around finding the mac address have appeared, as far as I can tell:

root@OpenWrt:/# dmesg -r
<5>[    0.000000] Linux version 4.14.63 (buildbot@builds-03.infra.lede-project.org) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7102-3f3a2c9)) #0 SMP Thu Aug 16 07:51:15 2018
<6>[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
<6>[    0.000000] bootconsole [early0] enabled
<6>[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
<6>[    0.000000] MIPS: machine is Netgear R6220
<6>[    0.000000] Determined physical RAM map:
<6>[    0.000000]  memory: 08000000 @ 00000000 (usable)
<6>[    0.000000] Initrd not found or empty - disabling initrd
<6>[    0.000000] VPE topology {2} total 2
<4>[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
<4>[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
<4>[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
<6>[    0.000000] Zone ranges:
<6>[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
<6>[    0.000000]   HighMem  empty
<6>[    0.000000] Movable zone start for each node
<6>[    0.000000] Early memory node ranges
<6>[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
<6>[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
<7>[    0.000000] On node 0 totalpages: 32768
<7>[    0.000000] free_area_init_node: node 0, pgdat 80545e80, node_mem_map 81003000
<7>[    0.000000]   Normal zone: 256 pages used for memmap
<7>[    0.000000]   Normal zone: 0 pages reserved
<7>[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
<5>[    0.000000] random: get_random_bytes called from 0x80549740 with crng_init=0
<6>[    0.000000] percpu: Embedded 14 pages/cpu @8110f000 s26256 r8192 d22896 u57344
<7>[    0.000000] pcpu-alloc: s26256 r8192 d22896 u57344 alloc=14*4096
<7>[    0.000000] pcpu-alloc: [0] 0 [0] 1
<6>[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
<5>[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
<6>[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
<6>[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
<6>[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
<6>[    0.000000] Writing ErrCtl register=0001a808
<6>[    0.000000] Readback ErrCtl register=0001a808
<6>[    0.000000] Memory: 123828K/131072K available (4596K kernel code, 239K rwdata, 564K rodata, 220K init, 270K bss, 7244K reserved, 0K cma-reserved, 0K highmem)
<6>[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
<6>[    0.000000] Hierarchical RCU implementation.
<6>[    0.000000] 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
<6>[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
<6>[    0.000000] NR_IRQS: 256
<6>[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
<6>[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
<6>[    0.000010] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
<6>[    0.015487] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
<6>[    0.087789] pid_max: default: 32768 minimum: 301
<6>[    0.097082] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
<6>[    0.110097] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
<6>[    0.125595] Hierarchical SRCU implementation.
<6>[    0.134824] smp: Bringing up secondary CPUs ...
<4>[    0.145656] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
<4>[    0.145667] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
<4>[    0.145682] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
<6>[    0.145813] CPU1 revision is: 0001992f (MIPS 1004Kc)
<6>[    0.204331] Synchronize counters for CPU 1: done.
<6>[    0.263992] smp: Brought up 1 node, 2 CPUs
<6>[    0.275491] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
<6>[    0.294953] futex hash table entries: 512 (order: 2, 16384 bytes)
<6>[    0.307172] pinctrl core: initialized pinctrl subsystem
<6>[    0.318094] NET: Registered protocol family 16
<4>[    0.333422] Can't analyze schedule() prologue at 80478bc4
<7>[    0.344107] FPU Affinity set after 11720 emulations
<4>[    0.344828] pull PCIe RST: RALINK_RSTCTRL = 0
<4>[    0.653763] release PCIe RST: RALINK_RSTCTRL = 7000000
<4>[    0.663831] ***** Xtal 40MHz *****
<4>[    0.670559] release PCIe RST: RALINK_RSTCTRL = 7000000
<4>[    0.680767] Port 0 N_FTS = 1b105000
<4>[    0.687664] Port 1 N_FTS = 1b102800
<4>[    0.694587] Port 2 N_FTS = 1b105000
<4>[    1.853050] PCIE1 no card, disable it(RST&CLK)
<4>[    1.861741]  -> 12007f2
<4>[    1.866558] PCIE0 enabled
<4>[    1.871755] PCIE2 enabled
<6>[    1.876939] PCI host bridge /pcie@1e140000 ranges:
<6>[    1.886465]  MEM 0x0000000060000000..0x000000006fffffff
<6>[    1.896822]   IO 0x000000001e160000..0x000000001e16ffff
<4>[    1.907192] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
<6>[    1.932424] mt7621_gpio 1e000600.gpio: registering 32 gpios
<6>[    1.943824] mt7621_gpio 1e000600.gpio: registering 32 gpios
<6>[    1.955131] mt7621_gpio 1e000600.gpio: registering 32 gpios
<6>[    1.967554] PCI host bridge to bus 0000:00
<6>[    1.975578] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
<6>[    1.989247] pci_bus 0000:00: root bus resource [io  0xffffffff]
<6>[    2.000970] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
<6>[    2.014454] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
<7>[    2.030219] pci 0000:00:00.0: [0e8d:0801] type 01 class 0x060400
<7>[    2.030259] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
<7>[    2.030271] pci 0000:00:00.0: reg 0x14: [mem 0x60300000-0x6030ffff]
<7>[    2.030336] pci 0000:00:00.0: supports D1
<7>[    2.030345] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
<7>[    2.030622] pci 0000:00:01.0: [0e8d:0801] type 01 class 0x060400
<7>[    2.030659] pci 0000:00:01.0: reg 0x10: [mem 0x00000000-0x7fffffff]
<7>[    2.030677] pci 0000:00:01.0: reg 0x14: [mem 0x60310000-0x6031ffff]
<7>[    2.030745] pci 0000:00:01.0: supports D1
<7>[    2.030757] pci 0000:00:01.0: PME# supported from D0 D1 D3hot
<7>[    2.031287] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
<7>[    2.031353] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
<7>[    2.031411] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
<7>[    2.031514] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
<7>[    2.031722] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
<7>[    2.031980] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000
<7>[    2.032036] pci 0000:02:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
<7>[    2.032195] pci 0000:02:00.0: PME# supported from D0 D3hot D3cold
<7>[    2.032436] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
<7>[    2.032458] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 02
<6>[    2.032531] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
<6>[    2.045569] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
<6>[    2.059375] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
<6>[    2.072506] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
<6>[    2.086332] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
<6>[    2.099817] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
<6>[    2.114152] pci 0000:00:01.0: BAR 8: assigned [mem 0x60200000-0x602fffff]
<6>[    2.127635] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
<6>[    2.141121] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
<6>[    2.154597] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
<6>[    2.169114] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
<6>[    2.183445] pci 0000:00:00.0: PCI bridge to [bus 01]
<6>[    2.193277] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
<6>[    2.206772] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
<6>[    2.221119] pci 0000:02:00.0: BAR 0: assigned [mem 0x60200000-0x602fffff]
<6>[    2.234596] pci 0000:00:01.0: PCI bridge to [bus 02]
<6>[    2.244424] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
<6>[    2.259722] clocksource: Switched to clocksource GIC
<6>[    2.270984] NET: Registered protocol family 2
<6>[    2.280527] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
<6>[    2.294278] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
<6>[    2.306878] TCP: Hash tables configured (established 1024 bind 1024)
<6>[    2.319592] UDP hash table entries: 256 (order: 1, 8192 bytes)
<6>[    2.331095] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
<6>[    2.343736] NET: Registered protocol family 1
<7>[    2.352329] PCI: CLS 80 bytes, default 32
<6>[    2.589673] 4 CPUs re-calibrate udelay(lpj = 2924544)
<4>[    2.600708] Crashlog allocated RAM at address 0x3f00000
<6>[    2.611171] workingset: timestamp_bits=30 max_order=15 bucket_order=0
<6>[    2.632214] squashfs: version 4.0 (2009/01/31) Phillip Lougher
<6>[    2.643742] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
<6>[    2.666782] io scheduler noop registered
<6>[    2.674579] io scheduler deadline registered (default)
<6>[    2.685234] gpio-export gpio_export: 1 gpio(s) exported
<6>[    2.696469] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
<6>[    2.712950] console [ttyS0] disabled
<6>[    2.720005] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 14, base_baud = 3125000) is a 16550A
<6>[    2.737937] console [ttyS0] enabled
<6>[    2.751727] bootconsole [early0] disabled
<3>[    2.768441] cacheinfo: Failed to find cpu0 device node
<4>[    2.778720] cacheinfo: Unable to detect cache hierarchy for CPU 0
<4>[    2.791782] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
<4>[    2.805833] Enable NFI Clock
<4>[    2.811569] # MTK NAND # : Use HW ECC
<6>[    2.818859] Device not found, ID: c2f1
<4>[    2.826314] Not Support this Device!
<4>[    2.833771] chip_mode=00000001
<4>[    2.839851] Support this Device in MTK table! c2f1
<4>[    2.849737] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
<6>[    2.862603] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
<6>[    2.875244] nand: Macronix NAND 128MiB 3,3V 8-bit
<6>[    2.884608] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
<6>[    2.899700] Scanning device for bad blocks
<4>[    3.082916] Bad eraseblock 743 at 0x000005ce0000
<5>[    3.158079] 6 fixed-partitions partitions found on MTD device MT7621-NAND
<5>[    3.171590] Creating 6 MTD partitions on "MT7621-NAND":
<5>[    3.181999] 0x000000000000-0x000000100000 : "u-boot"
<5>[    3.193027] 0x000000100000-0x000000200000 : "SC PID"
<5>[    3.203954] 0x000000200000-0x000000600000 : "kernel"
<5>[    3.214932] 0x000000600000-0x000002200000 : "ubi"
<5>[    3.225577] 0x000002e00000-0x000002f00000 : "factory"
<5>[    3.236711] 0x000004200000-0x000007e00000 : "reserved"
<4>[    3.248490] [mtk_nand] probe successfully!
<4>[    3.257346] Signature matched and data read!
<4>[    3.265843] load_fact_bbt success 1023
<6>[    3.274050] libphy: Fixed MDIO Bus: probed
<6>[    3.352288] libphy: mdio: probed
<6>[    4.758384] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
<6>[    4.770905] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 16
<6>[    4.790330] NET: Registered protocol family 10
<6>[    4.800775] Segment Routing with IPv6
<6>[    4.808150] NET: Registered protocol family 17
<6>[    4.817135] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
<6>[    4.842931] 8021q: 802.1Q VLAN Support v1.8
<5>[    4.854372] UBI: auto-attach mtd3
<5>[    4.861042] ubi0: attaching mtd3
<5>[    4.892832] UBI: EOF marker found, PEBs from 22 will be erased
<5>[    4.904704] ubi0: scanning is finished
<5>[    4.950481] ubi0: volume 1 ("rootfs_data") re-sized from 9 to 180 LEBs
<5>[    4.964381] ubi0: attached mtd3 (name "ubi", size 28 MiB)
<5>[    4.975160] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
<5>[    4.988848] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
<5>[    5.002366] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
<5>[    5.016228] ubi0: good PEBs: 224, bad PEBs: 0, corrupted PEBs: 0
<5>[    5.028184] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
<5>[    5.042568] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 856267455
<5>[    5.060592] ubi0: available PEBs: 0, total reserved PEBs: 224, PEBs reserved for bad PEB handling: 20
<5>[    5.078972] ubi0: background thread "ubi_bgt0d" started, PID 355
<6>[    5.080866] block ubiblock0_0: created from ubi0:0(rootfs)
<5>[    5.080878] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
<6>[    5.080896] hctosys: unable to open rtc device (rtc0)
<6>[    5.139674] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
<6>[    5.154610] Freeing unused kernel memory: 220K
<4>[    5.163506] This architecture does not have kernel memory protection.
<5>[    5.210271] random: fast init done
<14>[    5.713595] init: Console is alive
<14>[    5.720629] init: - watchdog -
<14>[    6.283835] kmodloader: loading kernel modules from /etc/modules-boot.d/*
<6>[    6.378426] usbcore: registered new interface driver usbfs
<6>[    6.389503] usbcore: registered new interface driver hub
<6>[    6.400236] usbcore: registered new device driver usb
<6>[    6.419235] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
<6>[    6.429902] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 1
<6>[    6.449863] xhci-mtk 1e1c0000.xhci: hcc params 0x01401198 hci version 0x96 quirks 0x00210010
<6>[    6.466745] xhci-mtk 1e1c0000.xhci: irq 15, io mem 0x1e1c0000
<6>[    6.479203] hub 1-0:1.0: USB hub found
<6>[    6.486798] hub 1-0:1.0: 2 ports detected
<6>[    6.495473] xhci-mtk 1e1c0000.xhci: xHCI Host Controller
<6>[    6.506137] xhci-mtk 1e1c0000.xhci: new USB bus registered, assigned bus number 2
<6>[    6.521060] xhci-mtk 1e1c0000.xhci: Host supports USB 3.0  SuperSpeed
<6>[    6.534078] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
<6>[    6.551110] hub 2-0:1.0: USB hub found
<6>[    6.558642] hub 2-0:1.0: 1 port detected
<14>[    6.569788] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
<14>[    6.600208] init: - preinit -
<6>[    7.109852] usb 1-2: new high-speed USB device number 2 using xhci-mtk
<6>[    7.334323] mtk_soc_eth 1e100000.ethernet: PPE started
<5>[    7.417415] random: procd: uninitialized urandom read (4 bytes read)
<6>[    7.574632] mtk_soc_eth 1e100000.ethernet eth0: port 0 link up
<5>[   11.606721] UBIFS (ubi0:1): default file-system created
<5>[   11.618588] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 452
<5>[   11.730641] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
<5>[   11.746253] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
<5>[   11.765998] UBIFS (ubi0:1): FS size: 21585920 bytes (20 MiB, 170 LEBs), journal size 1142784 bytes (1 MiB, 9 LEBs)
<5>[   11.786603] UBIFS (ubi0:1): reserved for root: 1019556 bytes (995 KiB)
<5>[   11.799607] UBIFS (ubi0:1): media format: w4/r0 (latest is w5/r0), UUID 67455288-9F1A-4482-B36C-B5D1402A3796, small LPT model
<14>[   11.825091] mount_root: overlay filesystem has not been fully initialized yet
<14>[   11.840011] mount_root: switching to ubifs overlay
<12>[   11.867976] urandom-seed: Seed file not found (/etc/urandom.seed)
<6>[   11.955577] mtk_soc_eth 1e100000.ethernet: 0x100 = 0x6060000c, 0x10c = 0x80818
<14>[   11.977301] procd: - early -
<14>[   11.983191] procd: - watchdog -
<14>[   12.659864] procd: - watchdog -
<14>[   12.666409] procd: - ubus -
<5>[   12.730689] random: ubusd: uninitialized urandom read (4 bytes read)
<5>[   12.850211] random: ubusd: uninitialized urandom read (4 bytes read)
<5>[   12.863357] random: ubusd: uninitialized urandom read (4 bytes read)
<14>[   12.876955] procd: - init -
<14>[   13.107294] kmodloader: loading kernel modules from /etc/modules.d/*
<6>[   13.123429] ip6_tables: (C) 2000-2006 Netfilter Core Team
<6>[   13.534582] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
<6>[   13.550571] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
<6>[   13.565679] ip_tables: (C) 2000-2006 Netfilter Core Team
<6>[   13.904203] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
<6>[   14.114172] xt_time: kernel timezone is -0000
<4>[   14.333360] bus=0x2, slot = 0x1, irq=0xff
<6>[   14.341583] mt7603e 0000:02:00.0: ASIC revision: 76030010
<6>[   14.355564] mt7603e 0000:02:00.0: Firmware Version: ap_pcie
<6>[   14.366710] mt7603e 0000:02:00.0: Build Time: 20160107100755
<4>[   14.409736] firmware init done
<7>[   14.582988] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
<4>[   14.592059] bus=0x1, slot = 0x0, irq=0xff
<6>[   14.600352] mt76x2e 0000:01:00.0: ASIC revision: 76120044
<6>[   14.630547] mt76x2e 0000:01:00.0: ROM patch build: 20141115060606a
<6>[   14.648331] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
<6>[   14.659316] mt76x2e 0000:01:00.0: Build: 1
<6>[   14.667526] mt76x2e 0000:01:00.0: Build Time: 201507311614____
<6>[   14.699789] mt76x2e 0000:01:00.0: Firmware running!
<7>[   14.710909] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
<6>[   14.721783] PPP generic driver version 2.4.2
<6>[   14.732736] NET: Registered protocol family 24
<14>[   14.745118] kmodloader: done loading kernel modules from /etc/modules.d/*
<4>[   15.969520] urandom_read: 5 callbacks suppressed
<5>[   15.969531] random: jshn: uninitialized urandom read (4 bytes read)
<6>[   24.901202] mtk_soc_eth 1e100000.ethernet: PPE started
<6>[   24.924380] device eth0 entered promiscuous mode
<6>[   24.936178] br-lan: port 1(eth0.1) entered blocking state
<6>[   24.947254] br-lan: port 1(eth0.1) entered disabled state
<6>[   24.958523] device eth0.1 entered promiscuous mode
<6>[   25.008893] br-lan: port 1(eth0.1) entered blocking state
<6>[   25.019741] br-lan: port 1(eth0.1) entered forwarding state
<6>[   25.031257] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
<6>[   25.940181] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
<5>[  156.820125] random: crng init done
root@OpenWrt:/#

There is an official bug report. Please vote. https://bugs.openwrt.org/index.php?do=details&task_id=1926

2 Likes

Thank you for linking the bug in this thread. I updated the device page to reflect the current findings.

1 Like

I am facing the similar Wifi troubles on my R6220. OpenWrt uses a random MAC address on every reboot.

[   13.477281] xt_time: kernel timezone is -0000
[   13.692335] bus=0x2, slot = 0x1, irq=0xff
[   13.700553] mt7603e 0000:02:00.0: ASIC revision: 76030010
[   13.713186] mt7603e 0000:02:00.0: Invalid MAC address, using random address 3a:2a:5d:8f:22:5e
[   13.731557] mt7603e 0000:02:00.0: Firmware Version: ap_pcie
[   13.742734] mt7603e 0000:02:00.0: Build Time: 20160107100755
[   13.788378] firmware init done
[   13.957701] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   13.964948] bus=0x1, slot = 0x0, irq=0xff
[   13.973286] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[   13.985589] mt76x2e 0000:01:00.0: EEPROM data check failed: ffff
[   13.998434] mt76x2e 0000:01:00.0: Invalid MAC address, using random address 9a:36:a2:e5:80:81
[   14.039205] mt76x2e 0000:01:00.0: ROM patch build: 20141115060606a
[   14.156120] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[   14.167294] mt76x2e 0000:01:00.0: Build: 1
[   14.175570] mt76x2e 0000:01:00.0: Build Time: 201507311614____
[   14.208461] mt76x2e 0000:01:00.0: Firmware running!

Unfortunately I don't have the skills to investigate this issue but I offer my device/help to generate logs and test fixes (with some small guidance).
I wasn't able to follow all points of above discussion. This is why I still have two questions:

  1. Is the MAC address and the wifi calibration data still available on the EEPROM?
  2. Do you recommend to do a backup as described by rsterz (Aug 11th) based on the stock firmware? (and wait for a fix?)

Actually the problem seems to be that OpenWrt looks for the factory partition (the one containing your MAC address and other info) in the wrong place. This partition is located at 0x2e00000, but OW will search for it at an address that depends on how many bad eraseblocks you have before the 0x2e00000 address. Every eraseblock is 128 KiB in size (0x20000 in hex), so, if you have N bad eraseblocks somewhere before 0x2e00000, OW will map the factory partition (mtd4) at 0x2e00000 + (N * 0x20000).

To see how many bad eraseblocks you have and where they are, you can look at the beginning of OW log for something like:

[    2.853468] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1         
[    2.866112] nand: Macronix NAND 128MiB 3,3V 8-bit                            
[    2.875473] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB si4
[    2.890555] Scanning device for bad blocks                                   
[    2.969549] Bad eraseblock 266 at 0x000002140000                             
[    3.096049] Bad eraseblock 708 at 0x000005880000                             
[    3.189001] 6 fixed-partitions partitions found on MTD device MT7621-NAND    
[    3.202518] Creating 6 MTD partitions on "MT7621-NAND":                      
[    3.212922] 0x000000000000-0x000000100000 : "u-boot"                         
[    3.223925] 0x000000100000-0x000000200000 : "SC PID"                         
[    3.234878] 0x000000200000-0x000000600000 : "kernel"                         
[    3.245854] 0x000000600000-0x000002200000 : "ubi"                            
[    3.256476] 0x000002e00000-0x000002f00000 : "factory"                        
[    3.267585] 0x000004200000-0x000007e00000 : "reserved"                       
[    3.279423] [mtk_nand] probe successfully!                                   

To see if this problem is affecting your device you can do one of the following:

  • [Not Applicable (*)]Solder a connector to the internal serial port, enter the uboot prompt and type sc_nand r 0x(address calculated as described before), copy the output to a text file and compare it with the output of dd if=/dev/mtd4 bs=1 count=2048 | hexdump -ve '16/1 "%02x " "\n"' from OW. If contents match then we found the guilty!
    (*) Factory partition and next one contains large blank areas so the comparison is likely to fall between two blank chunks.

  • (This, besides confirming the bug, can also be a possible workaround). You have to compile your own OW build after editing (path_to_openwrt_source)/openwrt/target/linux/ramips/dts/R6220.dts. In that file you should find:

	factory: partition@2e00000 {
		label = "factory";
		reg = <0x2e00000 0x100000>;
		read-only;
	};

and change both occurrencies of '2e00000' with the result of '0x2e00000 - (N * 0x20000)' (where N is the number of bad eraseblocks before 0x2e00000). If the Wifi works then, again, we found the guilty! (The Wifi will work until a new bad eraseblock pops up in the area before 0x2e00000)

  • (This, besides confirming the bug, can also be a possible (untested) workaround but will for sure overwrite your original factory partition! so you have been warned...) You simply do a backup of your factory partition from original Netgear firmware (where factory is /dev/mtd10) and write it on /dev/mtd4 in OW. I do not recommend this method since it will mess up your flash. Again if Wifi works... well, you know... (The Wifi will work until a new bad eraseblock pops up in the area before 0x2e00000)

All procedures are not risk free, so, as always, watch your steps!
If you find that this bug is affecting your device, please vote for the bug report here.

You should always do a backup of your flash before starting to play with your device, it's simple and will save you from many ugly situations. Anyway a dump of the original partitions is kindly offered in realopty's repository here. You have to modify the 10.bin file to insert your MAC address in place of realopty's one.

@dksl: thank you for the explanation. I voted for the bug report.
Booting OpenWrt 18.06.00 there is an eraseblock at 0x2d20000 on my device
...
[ 3.022504] Bad eraseblock 361 at 0x000002d20000
[ 3.186236] 6 fixed-partitions partitions found on MTD device MT7621-NAND
[ 3.199748] Creating 6 MTD partitions on "MT7621-NAND":
...

With the connection to the internal serial port (I will update the R6220 device page soon) I get the content of the address (0x2e00000 + 0x20000) by using
sc_nand r 0x2e20000
Output is ff for every entry. I get the same output for addresses above and below, which seems strange to me...

dd if=/dev/mtd4 bs=1 count=2048 | hexdump -ve '16/1 "%02x " "\n"'on ssh shows ff for every entry as well.

On 0x2f00000 was the first data that differs from ff. At this address i found a MAC address that is assigned to Netgear (9c:3d:cf:xx:xx:xx).

I will not mess up my flash but I try to do a backup of the flash the next days.

Well.. may bad... I didn't take into account that there are many blank areas ('ff' precisely) in partitions 10 and 11, so a comparison on a small chunk like I proposed is not really a proof of something. Since partition 11 begins with blank data, a comparison there would be difficult as well. Maybe the second method would be more suitable.
Obviously any suggestion is welcome.

I managed to compile openwrt 18.06.01 by myself and modified (path_to_openwrt_source)/openwrt/target/linux/ramips/dts/R6220.dts. I moved the adress of the factory partion by 0x20000 to (one erase block)

factory: partition@2de0000 {
		label = "factory";
		reg = <0x2de0000 0x100000>;
		read-only;
	};

So that openwrt is looking at 0x2e00000 for the factory partition. The error messages in the boot log are gone with this modification. The ethernet, wifi and wan interface have the expected MAC addresses (as well as after a reboot). Awesome!

1 Like

Many of us would like to give this a shot. Do you have the compiled version hosted somewhere?

I also ran into this build - https://github.com/jayanta525/openwrt-netgear-r6220-100ins

Has anyone given this a shot, and is the 100INS only specific to India? Wonder if I can tell which specific model we use (having thrown away the packaging)?

I uploaded my compilation of 18.06.01. I added the .config i used as a make file, so you can get an idea which packages are included (luci, relayd, ...). Use this firmware ON YOUR OWN RISK. According to the explanation of dksl, my firmware only works for r6220, which shows one erase block before 0x2e00000 address.

1 Like

I made a build a while back just for this use case

1 Like

I happened to try this and it worked for me. I can share the bootlog if anyone needs. badblock errors still exist but it's not messing with MAC IDs. My poor 5GHz performance improved tenfold too.

Good news, the patch posted by Jo-Philipp Wich in a comment of the bug report can solve the issue. I've tested it and worked for me.

5 Likes