[U-Boot] NAND on AVR32
David Collier
from_denx_uboot at dexdyne.com
Sat Oct 9 00:54:00 CEST 2010
Apologies if this is a double -post - I didn't get it back in my feed
from the mailing list.... maybe it is awaiting approval or something.
But I'm off on holiday, and I'd really like it to be "out there"
-----------------------------------------------------------------
I thought the whole point of using this linux and u-boot stuff was that
whatever you did, someone else had done it first and you just had to copy
them.
Well I've been caught out Smile
I want to ditch using the uSD card at all on our AVR32 board , and use
NAND where we have been using uSD.
I have a Linux disk working out of NAND - quite easy as Linux pretty much
knew how, once you told it you had a chip.
But the u-boot seems to have no clue about NAND on the AVR32 - it doesn't
set up the hardware to get to it at all, and there's no code set up in
the target board header and code files for any AVR32-based board, as far
as I can see!!!
I have found some stuff in support for other Atmel devices, which seems
relevant. Plus of course the Linux sources.
I'm totally in the dark about what u-boot can or should do with ecc .....
------------
So far I've worked out that I've got to
1. in cpu.c add set up MODE3, CYCLE3, SETUP3, PULSE3 registers for cs3
timing.
2. in <target>.c/board_early_init_f
add hmatrix_slave_write call to enable nand in ebi
3. in <target>.c/board_early_init_f
set up chip select(s) and busy(s) in the GPIO setup to point the right
way, and initially turn everything off
4 in <target>.h
#undef CONFIG_NAND_LEGACY
#define CONFIG_CMD_NAND
#define CONFIG_JFFS2_NAND
#define CFG_MAX_NAND_DEVICE
#define NAND_MAX_CHIPS
#define CFG_NAND_BASE 0x0c000000
I'm still pretty woolly about these though
CONFIG_MTD_NAND_VERIFY_WRITE
CONFIG_MTD_PARTITIONS
5. create a file called nand.c in the same directory as my <target>.c -
I've based mine on the one for the at91sam9261ek. This needs to implement
board_nand_init
which must set up service routines
cmd_ctrl to alter ALE,CLE etc
dev_ready to read the "chip ready" status
chip_delay - no idea!
so far I've no clue how this file gets included in the make of u-boot.
Any and all advice welcome - especially if someone HAS got there first.
TVM
David
More information about the U-Boot
mailing list