mtd char and block both on same nand flash

Charles Manning manningc2 at actrix.gen.nz
Mon Jan 5 20:07:51 EST 2004


On Saturday 03 January 2004 17:57, Amit Mistry wrote:
> I have to write the MTD NAND driver for K9x1208 FLASH chip. Now, the
> requirement is some of the blocks of FLASH need to be accessed like raw
> block access as they contains bootloader and rest of the blocks will be
> accessed through YAFFS file system. How can I access the some of the blocks
> with raw FLASH access method and rest with some file system? May be the
> correct question is: How can I distribute the whole NAND flash in a char
> device for few blocks and block device for rest of the blocks?  In MTD
> directory of linux kernel source, there are mtdchar.c and mtdblock.c they
> provide the functionality of char and block driver. Can I use the mtdchar.c
> and mtdblock.c of MTD layer or they are samples?  I would appreciate if you
> can help me out. Thanks in advance.

The mtdchar laye gices you the ability to read/write data to flash from user 
space.

The mtdblock stuff is only as a way to pass a name into JFFS2 or YAFFS for 
mounting the file system.

Probably he best way to achieve what you want is to partition the device into 
two partitions, one for the bootloader and one for YAFFS.

-- Charles



More information about the linux-mtd mailing list