JFFS2 Problem

Russ Dill Russ.Dill at asu.edu
Thu Jul 11 15:32:35 EDT 2002


On Thu, 2002-07-11 at 12:18, Snehaprabha wrote:
> Thanks for the response.
> I am running 2.4.17 Kernel. I have a limitation on the flash size (AMD flash 
> 2MB with 64K erase block size). I am running our own bootloader which takes 
> up 3 erase blocks. Then I have the linux kernel that takes around 12 erase 
> blocks, leaving 17 erase blocks for the JFFS2 image. I have managed to fit in 
> most of the required pieces for the file system, which makes it 17 blocks. 
> Now the question is about the spare erase block required for GC.
> I am confused with the #defines in fs/jffs2/nodelist.h

I don't know your requirements, but there are probably better ways of
doing whatever you are doing. On my 2M board, my flash layout looks like
this:

dev:    size   erasesize  name
mtd0: 00008000 00008000 "BLOB boot loader"
mtd1: 00008000 00004000 "NESA journaled config"
mtd2: 00010000 00010000 "NESA static config"
mtd3: 00060000 00020000 "NESA cramfs saveme"
mtd4: 00180000 00020000 "NESA cramfs root"

(note that 0x8000 is 32k, 0x10000 is 64k, etc)
768k is pretty big for a kernel, but if your need that many drivers,
that is the way it goes. A bootloader should be able to fit in one
block, by using bottom boot block flash, I can make even more efficient
use of the first block by subdividing it. I don't see where a 2M system
would need jffs2, my /proc/mounts looks like this:

/dev/root / cramfs rw 0 0
ramfs /etc ramfs rw 0 0
ramfs /var ramfs rw 0 0
ramfs /tmp ramfs rw 0 0
proc /proc proc rw 0 0

/etc is created by copying /init-etc from the cramfs partition at boot.
Any files that need to be saved across boots are tar.gz'd and saved to
the journalled config sectors by writing to that flash raw and including
a revision and crc.

I'm not saying that you should do it exactly this way, but hopefully it
will give you some ideas beyond what you are currently doing.





More information about the linux-mtd mailing list