Flash Memory Map

9 posts / 0 new
Last post
bzing2
bzing2's picture
Flash Memory Map

One thing that is decidly missing is a Flash memory map of the WGR614L. As we can see by these patches there is a gap between the rootfs_data and nvram.

0x00220000-0x00380000 : "rootfs_data"
0x00380000-0x003f0000 : "dead_spot"  <--- Added for illistration
0x003f0000-0x00400000 : "nvram"

Now having a little look at the bootloader drops out some usefull constants, which we clearly dont want to accedently overwrite.

0x003afff8 KERNEL_LEN_ADDR
0x003afffc KERNEL_CHKSUM_ADDR
0x003e0000 BOARD_DATA_ADDR

Now that occupies a total of 86 bytes as far as I can tell. What else is in this 448k of flash (or looking another way 10%). Its my understanding that there is some board data, whats in that? Any why is the bootloader info not in the board data?

Fmay
Fmay's picture
At the follow link you can

At the follow link you can find one improvement of the data partition:

http://www.myopenrouter.com/article/10721/How-to-Increase-the-Data-Parti...

So that, you have to wait to be reviewed by the moderator.

Fmay
Fmay's picture
Article delayed to be

Article delayed to be published:

If you wish to increase the available free space of the data partition (rootfs_data), you have to following these simple tips:

1) Add the following lines to the file drivers/mtd/maps/bcm947xx-flash.c (See DD-WRT source) to the mtd_partition struct :

static struct mtd_partition bcm947xx_parts[] = {
{ name: "cfe", offset: 0, size: 0, mask_flags: MTD_WRITEABLE, },
{ name: "linux", offset: 0, size: 0, },
{ name: "rootfs", offset: 0, size: 0, mask_flags: MTD_WRITEABLE, },
{ name: "nvram", offset: 0, size: 0, },
{ name: "rootfs_data", offset: 0, size: 0, },
{ name: "fwcfg", offset: 0, size: 0, },
{ name: "new_fwcfg", offset: 0, size: 0, },
{ name: NULL, },
};

2) At the same file, in the init_mtd_partitions function, add the following lines (you have to see where):

//NetGear Data Config
bcm947xx_parts[5].offset = bcm947xx_parts[4].offset + bcm947xx_parts[4].size;
bcm947xx_parts[5].size = 2*0x10000;
//Free Space
bcm947xx_parts[6].offset = bcm947xx_parts[5].offset + bcm947xx_parts[5].size;
bcm947xx_parts[6].size = 2*0x10000;

3) Compile, install the firmware and init linux. You have to apply the following commands:

rock@fmay: #/ mtd write /dev/mtd/5 new_fwcfg

rock@fmay: #/ nvram set boardrev=0x10

rock@fmay: #/ nvram commit

4) Undo all modifications of the file drivers/mtd/maps/bcm947xx-flash.c.

5) You have to add the following lines at the init_mtd_partitions function (you have to see where) :

if ( nvram_match("boardrev", "0x10") ) {
/* A correction for North American version of WGR614v8, cfe version 1.3 */
board_data_size = 1 * 0x10000;
jffs_exclude_size = 0x10000;
}

6) Compile, reinstall and good luck.

WARNING!!!! The WGR614v8 boardrev 0x10 doesn't need it.

bzing2
bzing2's picture
Could you post the kernel

Could you post the kernel messages that show the MTD partition layout please? The following should be sufficient...

dmesg | grep -A 8 "MTD partitions"
Fmay
Fmay's picture
Follow this file:http://svn

Follow this file:
http://svn.dd-wrt.com:8000/dd-wrt/changeset/10773?format=zip&new=10773

Initially it would looks like as follow:

Creating 7 MTD partitions on "sflash":
0x00000000-0x00020000 : "cfe"
0x00020000-0x003b0000 : "linux"
0x0009a800-0x00320000 : "rootfs"
0x003f0000-0x00400000 : "nvram"
0x00320000-0x003a0000 : "rootfs_data"
0x003a0000-0x003c0000 : "fwcfg"
0x003c0000-0x003e0000 : "new_fwcfg"

After apply it.. It will looks as follow:

Creating 5 MTD partitions on "sflash":
0x00000000-0x00020000 : "cfe"
0x00020000-0x003e0000 : "linux"
0x0009a800-0x00320000 : "rootfs"
0x003f0000-0x00400000 : "nvram"
0x00320000-0x003d0000 : "rootfs_data"

bzing2
bzing2's picture
You have expanded the rootfs

You have expanded the rootfs_data partition to end at 0x003d0000. This means that it is possible for the addresses 0x003afff8 and 0x003afffc to be written over. When that happens the board will not boot due to a checksum error and will drop into tftp mode.

Fmay
Fmay's picture
Do you think that it could

Do you think that it could happen even if the board config. was moved?

Good, It hasn't happened yet with me. It seems work like a WGR614v8 boardrev 0x10.

bzing2
bzing2's picture
Irrespective of how you

Irrespective of how you configure Linux the bootloader (CFE) has those locations hard coded; so yes it could happen even if you move the board config.

What you should say is "it hasn't happened, yet!".

Fmay
Fmay's picture
Not at all, it already

Not at all, it already happened before to move the board config. Now, with it moved all seems normal, however, it is an experiment that is in observation.