
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

On Fri, 8 Oct 2010 23:54:00 +0100 David Collier from_denx_uboot@dexdyne.com wrote:
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.
It improves the odds, but there's never a guarantee...
4 in <target>.h
#undef CONFIG_NAND_LEGACY
What version of U-Boot are you using? There should be no references to CONFIG_NAND_LEGACY left.
CONFIG_MTD_NAND_VERIFY_WRITE CONFIG_MTD_PARTITIONS
- 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
There is no nand.c in the at91sam9261ek directory in current U-Boot. The NAND driver is in drivers/mtd/nand/atmel_nand.c.
Please try the latest code first, and use it as a base to build upon if it doesn't have what you need.
-Scott

On 09.10.2010 00:54, David Collier wrote:
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"
Posted in the AVR32 forum already...
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.
Sure. If everyone thought like that, nothing would exist...
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!!!
Blame it on the fact that no Atmel board for AVR32 uses NAND and that while the data sheet of the AP7k was still in "preliminary" state, the part went NRFND (not recommended for new designs).
I have found some stuff in support for other Atmel devices, which seems relevant. Plus of course the Linux sources.
Probably look at drivers/mtd/nand/atmel_nand.c. Compare datasheets of AT91SAM9 and AP7k. Probably there is little to do except at places where AT91 is referenced.
And as Scott just now mentioned: always use most recent u-boot as a base.
And if you succeed, make sure you send proper patches, so the next one can use work someone else did already...
Any and all advice welcome - especially if someone HAS got there first.
Unlikely that someone else is going to add NAND support for that chip. Maybe ditch not only the SD, but the AP7k as well ;)
Best Regards, Reinhard
participants (3)
-
David Collier
-
Reinhard Meyer
-
Scott Wood