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 Enable the MTD subsystem CONFIG_MTD_PARTITIONS=y Support for multiple partitions CONFIG_MTD_GEN_PROBE=y Common routines for chip probing CONFIG_MTD_CFI=y Enable CFI chip driver CONFIG_MTD_PDA_MAP=y Option to enable the map driver CONFIG_JFFS2_FS=y 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.