Error free RO mtdblock device for NAND chips
PATCH 1/1 Error free RO mtdblock device for NAND chips
Hi there
Following the discussion in the list the previous day here is a patch that implements a very simple read-only error free block device interface in order to allow NAND chips to use filesystems like CRAMFS.
The theory of operation is very simple.
There is a mapping array for every block in the device which provides the number of the physical NAND block which it resides.
This is not the final driver. It's only a base for discussion for the list.
I haven't done any serious tests really, but I was able to mount a CRAMFS filesystem over it and read files OK.
Comments and/or flames welcome.
Regards
Pantelis
mtd/Config.in +1 -0
@@ -30,6 +30,7 @@ if [ "$CONFIG_NFTL" = "y" -o "$CONFIG_NFTL" = "m" ]; then bool ' Write support for NFTL (BETA)' CONFIG_NFTL_RW fi + dep_tristate ' Read-only block device access to NAND MTD devices' CONFIG_MTD_BLOCKN $CONFIG_MTD source drivers/mtd/chips/Config.in
mtd/Makefile +1 -0
@@ -48,6 +48,7 @@ obj-$(CONFIG_MTD_BLOCK_RO) += mtdblock_ro.o $(mtd_blkdevs) obj-$(CONFIG_FTL) += ftl.o $(mtd_blkdevs) obj-$(CONFIG_NFTL) += nftl.o $(mtd_blkdevs) +obj-$(CONFIG_MTD_BLOCKN) += mtdblock_nro.o $(mtd_blkdevs) ifeq ($(BELOW25),y) obj-y += chips/chipslink.o maps/mapslink.o \
mtd/mtdblock_nro.c +272 -0
272 lines not on this page · raw message
Well, obviously this thing will not work since I mistakenly use a block size of 512, instead of the erase size of the device as supported by the nandwrite utility.
My device had no bad blocks, so everything worked by chance.
Reading the NAND documentation for the JFFS2 OOB usage it states the the valid block marker is used for the first page in a block.
I thought that it meant a block device block, but it appears that it is the erase block.
So a new patch will be produced shortly.
Regards
Pantelis