help: bootloader for loading kernel from mtdblock device on flash........

Thomas Gleixner tglx at linutronix.de
Tue Feb 4 02:35:14 EST 2003


On Tuesday 04 February 2003 04:21, Vishal wrote:
> Its for an ARM7 core.
> I have the block driver for the JFFS on NAND Flash ready. I have the
> basic bootloader code. I was wondering whether i can do the proceed in
> the following way :
> 1. take the read/verify  code from the JFFS block driver for NAND flash,
> and put it in my bootloader code
> 2. The driver code that i copy will have a lot of kernel API calls...so
> i need to incorporate those also into my driver.
> 3. finally use this functionality achieved to read a kernel.bin file
> from the /dev/mtdblock device and load it.
>  or is there  any other workaroud?
Yep. copy your compressed kernel image in chunks of blocksize to your 
NAND-FLASH. Reserve enough spare in the case you have bad blocks. 
Provide a bad block aware read function and modify the decompressor in the 
kernel to read the image via this function from NAND. 
Then you don't need JFFS2 inside the bootloader. 
Then your NAND-CHIP has to have min. 2 Partitions 
1 for the kernel Image and 1 for the root-fs. You do not mount the partition, 
where your kernel image is stored.

Another way is to use YAFFS for your root-fs. YAFFS is NAND-aware too and 
provides bootloader code for booting the kernel from a YAFFS partition. Same 
procedure: 2 partitions (boot = YAFFS, root = JFFS2). You can mount your boot 
partition and update the kernel via normal fs access.

-- 
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx at linutronix.de





More information about the linux-mtd mailing list