[OpenWrt-Devel] Netgear WNR1000v3 / WGR614v10 flash issue

Rafał Miłecki zajec5 at gmail.com
Thu Sep 18 17:31:50 EDT 2014


We recently got report from /quickbooks/ that OpenWrt didn't boot
successfully on his WNR1000v3. He is still waiting for the serial
console, but I've noticed something weird in the original firmware
boot log (found on the Internet) meanwhile.

Take a look at partition offsets original firmware uses:
Creating 10 MTD partitions on "sflash":
0x00000000-0x00020000 : "boot"
0x00020000-0x003c8000 : "linux"
0x000b0ae0-0x003c8000 : "rootfs"
0x003c8000-0x003d8000 : "ML1"
0x003d8000-0x003e8000 : "ML2"
0x003e8000-0x003f0000 : "T_Meter1"
0x003f0000-0x003f8000 : "T_Meter2"
0x003f8000-0x003f9000 : "POT"
0x003f9000-0x003fa000 : "board_data"
0x003fa000-0x00400000 : "nvram"

It's 4K (0x1000) alignment! I re-checked Broadcom's SDK code but it
still didn't make much sense to me. Their are clearly using 64K
alignment and only number of blocks varies:
case 0x14:
        /* ST M25P16 16 Mbit Serial Flash */
        sflash.numblocks = 32;
        break;
case 0x15:
        /* ST M25P32 32 Mbit Serial Flash */
        sflash.numblocks = 64;
        break;
case 0x16:
        /* ST M25P64 64 Mbit Serial Flash */
        sflash.numblocks = 128;
        break;

So I decided to download GPL packages from Netgeat site. It appeared
that both use 5.10.56.62 but then I found something unusual in their
sflash.c fles:

case 0x14:
        /* ST M25P16 16 Mbit Serial Flash */
#ifndef CONFIG_SHRINKSIZE
        sflash.blocksize = 64 * 1024;
        sflash.numblocks = 32;
#else
        sflash.blocksize = 4 * 1024;
        sflash.numblocks = 32*16;
#endif
        break;
case 0x15:
        /* ST M25P32 32 Mbit Serial Flash */
        /*
            sflash.blocksize = 64 * 1024;
        sflash.numblocks = 64       ;
        */
        sflash.blocksize = 4 * 1024;
        sflash.numblocks = 32*32;
        break;
case 0x16:
        /* ST M25P64 64 Mbit Serial Flash */
        sflash.blocksize = 64 * 1024;
        sflash.numblocks = 128;
        break;

Interesting, huh? My guess is that Netgear decided to hack Broadcom's
code and use smaller blocks.

According to the wikidevi:
https://wikidevi.com/wiki/Netgear_WNR1000v3
the flash model is Macronix MX25L3205DM2I-12G

I've downloaded datasheet and it says:
1024 Equal Sectors with 4K byte each (32Mb)
64 Equal Blocks with 64K byte each (32Mb)

Well, so at least it makes some minimal sense.

I guess we will need to add some hacks to the serial flash detection
code. We can't simply keep using 64K alignment as there are some
important partitions aligned differently (board_data, nvram).

I'm not sure if that was what happened the original problem with
booting on this device, but it's definitely something to look at.
For now I'm leaving this problem until getting a boot log from OpenWrt.

-- 
Rafał
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list