Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

This chapter is from the book

This chapter is from the book

Configuring MTD

To MTD-enable your kernel, you have to choose the appropriate configuration options. For the flash chip shown in Figure 17.2, the required options are as follows:

CONFIG_MTD=y                u2192.gif Enable the MTD subsystem
CONFIG_MTD_PARTITIONS=y     u2192.gif Support for multiple partitions
CONFIG_MTD_GEN_PROBE=y      u2192.gif Common routines for chip probing
CONFIG_MTD_CFI=y            u2192.gif Enable CFI chip driver
CONFIG_MTD_PDA_MAP=y        u2192.gif Option to enable the map driver
CONFIG_JFFS2_FS=y           u2192.gif Enable JFFS2

CONFIG_MTD_PDA_MAP is assumed to be a new option added to enable the map driver we previously wrote. Each of these features can also be built as a kernel module unless you have an MTD-resident root filesystem. To mount the filesystem partition in Figure 17.2 as the root device during boot, ask your bootloader to append root=/dev/mtdblock/2 to the command-line string that it passes to the kernel.

You may reduce kernel footprint by eliminating redundant probing. Because our example handheld has two parallel 16-bit banks sitting on a 32-bit physical bus (thus resulting in a two-way interleave and a 2-byte bank width), you can optimize using these additional options:

CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_GEOMETRY=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_CFI_I2=y

CONFIG_MTD_MAP_BANK_WIDTH_2 enables a CFI bus width of 2, and CONFIG_MTD_CFI_I2 sets an interleave of 2.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.