Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
How To Guide
How to boot from ROM
Partitioning Flash
ST Logo
Previous   Contents   Next


Partitioning Flash

The Linux kernel manages on board Flash through the standard MTD subsystem (see Using the Memory Technology Device (MTD)). Regardless of the board type, by default, MTD divides the Flash into three partitions:

Device Size (Kbytes) Dedicated to
/dev/mtd0
256
Linux IPL program
/dev/mtd1
1024
Compressed kernel image
/dev/mtd2
Remaining
Root file system

However, this layout can be customized. This can be useful, for example, on multi processor platforms such as the Espresso to dedicate a Flash region for the ST20 application (see Dual-boot general overview in the Advanced Development Guide for more information).

Customized Flash partitioning can be achieved temporarily, at kernel boot time, by using the argument mtdparts in the command line. For example:

...mtdparts=Onboard_Flash:256k@0k,1024k@256k,2816k@1280k,-... 

results in the following Flash layout:

Device Size (Kbytes) Dedicated to
/dev/mtd0
256
Linux IPL program
/dev/mtd1
1024
Compressed kernel image
/dev/mtd2
2816
Root file system
/dev/mtd3
Remaining
ST20 CPU

Onboard_Flash is a keyword used by the MTD device driver to distinguish between Flash on the main board and any other Flash on an optional STEM card. This keyword must be entered exactly as displayed.

Note: This method is simple, but has some implications. When the kernel is launched from Flash the IPL program must provide a consistent command line; and when configuring the kernel CONFIG_MTD_CMDLINE_PARTS must be enabled in the section: Device Drivers ---> Memory Technology Devices (MTD) ---> Command line partition table parsing.

Customized Flash partitioning can also be achieved permanently, by modifying the default Flash partition defined by the structure onboard_partitions in the source file:
   .../drivers/mtd/maps/stboards.c
This method does not impact the IPL unless the kernel start region is modified.

Device nodes to cover up to 16 Flash slices are provided under /dev.

Previous   Contents   Next
Valid HTML 4.01! Last updated: 2005/09/30 14:14:42
© Copyright STMicroelectronics Limited, 2005
Printer