[U-Boot-Users] NAND support [was: Port U-Boot to SBC-2410X]

Ladislav Michl
2005-08-31T21:21:22Z

On Wed, Aug 31, 2005 at 05:19:11PM +0200, Wolfgang Denk wrote:
> Please note that a complete rewrite of the NAND code has been
> discussed several times before. There is some work in progress
> (performed by Ladislav Michl <ladis@linux-mips.org>) whic is
> available in the "testing-NAND" branch of the git repository at
> source.denx.net.

Wolfgang,

I promised you to send update over a weekend, but didn't tell you which
one ;-). Although normaly I do not have problems explaining my boss why
I'm working on something we do not necessarily need (nice clean code :)),
he has not so good understanding when I'm doing it when I should hunt
more important bugs elsewhere. My apologies to everyone...

> It makes IMHO littel sense to add patches to the old code. Please
> help improving / fixing the rewqrite instead.

Patch against "testing-NAND" branch can be found here:
ftp://ftp.linux-mips.org/pub/linux/mips/people/ladis/u-boot/u-boot-nand.diff
It also contains support for new board NetStar (it is not meant to be
included - I want to maintain it outside U-Boot, but I'd agree to put it
into "testing-NAND" branch for reference), which shows sample
implementation. Note that you have to define CONFIG_NEW_NAND_CODE to
actually compile and use new code. Original <linux/mtd/nand.h> was moved
to <linux/mtd/nand_old.h> and so has to be fixed all unconverted boards
includes (I do not have energy to do it now and test if they still compiles).
Ideally old and new code should be able to coexist. Please let me know if you
experience any problems or if you want me to split patch into smaller
chunks.

File list:
drivers/nand/* - Linux MTD
include/linux/mtd/* - MTD headers
include/nand.h - compat stuff
common/cmd_nand_new.c - user command interface to Linux MTD (*)
fs/jffs2/jffs2_nand_1pass.c
fs/jffs2/jffs2_nand_private.h - somewhat faster jffs2 file loader (*)

(*) - needs discussion and improvements, it's not finished.

Best regards,
ladis