Re: TS-72xxx flash and NetBSD
Jesse Off <joff <at> embeddedARM.com>
2005-02-04 23:41:00 GMT
I'm Cc'ing this to the tech-kern <at> netbsd.org mailing list in order to
hopefully solicit a few other expert opinions on the subject.
I haven't implemented anything for the onboard TS72xx flash support because
the best course of action isn't yet perfectly clear (to me anyway). I know
what I'd like to see avoided in an implementation, but don't yet have a good
plan of action to offer that would avoid all the chaos thats currently in
Linux in the form of "MTD" drivers and special filesystems unique to each
type of flash chip (JFFS2, YAFFS, YAFFS2, FTL/EXT2, NFTL/EXT2, etc). There
are certain things unique about using direct mapped NAND/NOR flash (as
opposed to something like CF, or USB flash which has an onboard controller),
but a completely new filesystem (and one also for each type and variant of
chip) seems a bit overkill. Some ideas:
* Come up with some sort of "unreliable/quirky block device" layer that can
be used to implement the same sort of internal logic already present in
devices like CompactFlash and hard drives such that a regular FFS filesystem
could be placed on it. Devices (512B NAND, NOR, 2KB NAND) simply register
some generic block device access functions and their quirks with this layer,
and then a regular FFS filesystem could be placed on the "de-quirked" block
device. The de-quirking driver has all the intelligence of filesystem
agnostic wear-leveling, ECC generation/checking, and bad block management
(by reserving a driver-defined percentage of blocks)
* Perhaps 1) extend ffs's block allocation policy to be random within free
space, (with preference to a sector already erased or in an area already
marked for erase/rewrite) 2) force block rewrites to go through a block
reallocation instead of using the same block, 3) rate-limit/aggressively
buffer FS metadata (inode, block bitmap, etc) writes. This would still have
issue w/NAND for bad block management, and having to erase/rewrite an entire
(Continue reading)