Writing Linux kernel to MTD

Ricard Wanderlof ricard.wanderlof at axis.com
Mon Feb 9 04:10:24 EST 2009


On Mon, 9 Feb 2009, Michal Ludvig wrote:

> I've got some problems writing a linux kernel image to /dev/mtd1 both
> using 'dd of=/dev/mtd1' or using nandwrite. In either case the kernel is
> not bootable after such a write.
> ...
> When I write the kernel image directly from u-boot using 'nandw' command
> it works fine and can be booted. However all attempts to write the image
> from a running Linux to /dev/mtd1 failed so far. I always ended up with
> an unbootable system:
> ...
> Interestingly even when I dump /dev/mtd1 using 'dd if=/dev/mtd1' or
> 'nanddump -o' I get something very close to the originally written
> kernel but not exactly the same. A number of bits here and there are
> slightly different:
> ---

My instinctive reaction is that there may be a difference in the way the 
Linux and u-boot drivers access the NAND device in terms of bus timing 
etc, so that the Linux driver breaks the timing causing bad communication 
with the device. I.e., the timing setup of the Linux driver is at fault 
here.

Another similar condition I have experienced is that due to a 
misconfiguration one of the control bits to the NAND flash was 
inadvertently mapped to a network indicator LED, causing NAND read/write 
to fail if network traffic occurred at the same time.

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list