5 Flash Partitioning
Linux Software Developers Kit (SDK) User Guide
36
}
#else /* CONFIG_MTD_RECOVER_PARAMS */
#ifdef CONFIG_MTD_BOOT_BANK
,
{
.name
= "UserExtra",
.size
= 0x40000,
.offset = 0x400000 // gets overwritten below
}
#endif /* CONFIG_MTD_BOOT_BANK */
#endif /* CONFIG_MTD_RECOVER_PARAMS */
};
ROMFS root + blank JFFS2
This is the easiest deployable configuration available. The build process creates a ROMFS from
the root file system and appends the Linux kernel to it. This layout is supported in two variations -
both are created in the images/ directory per default:
Uncompressed: image.bin (dBUG copies the image (a concatenation of kernel and ROMFS)
from flash to RAM)
Compressed: imagez.bin (dBUG uncompresses the compressed image (a concatenation of
kernel and ROMFS) from flash to RAM)
Both files contain a small header for dBUG with a checksum and the destination address for the
image in RAM.
The advantage of copying the ROMFS image into RAM is that the flash area where it resides on
can be easily overwritten during a firmware update without interrupting normal operation of the
device since the changes won't come into effect until after the next reboot.
The provided startup script (<install-dir>/linux/linux-2.6.x/drivers/mtd/maps/m520x.c) tries to
mount the JFFS2 file system (/dev/mtd5) under /mnt/flash. Modify the script accordingly if you
want to use this flash area for other purposes (e.g. splitting it up into multiple partitions).
To convert a unit from any other flash layout to this layout:
1. Boot into dBUG and issue these commands (assuming that the network settings are properly
configured, your TFTP server on your hosts is configured to serve files from /tftpboot and
make copied the images in that location:
dBUG> dnfl /tftpboot/image.bin
or
dBUG> dnfl /tftpboot/imagez.bin
Address: 0x4001FF80
Downloading Image 'imagez.bin' from 172.19.239.1
TFTP transfer completed
Read 1255499 bytes (2453 blocks)
Must erase complete sectors (0x00080000 to 0x001BFFFF)
Continue (yes | no)? yes
......................
Flash Erase complete. 0x140000 bytes erased
Program successfully flashed...