u-boot on nadflash for at91sam9260ek
Hello all,
I'm working with u-boot for booting in nandflash with the evaluation board atmel at91sam9260ek. Nandflash reads ok, but performing and erase doesn`t work.
I get these messages trying to erase a block of the nand and writing the environment variables to nandflash.
Any help? I'm missing a configuration parameter in config or what may happens?
U-Boot> saveenv
Saving Environment to NAND...
Erasing redundant Nand...Timeout!U-Boot>
U-Boot>
U-Boot> nand erase 0x60000 0x20000
NAND erase: device 0 offset 0x60000, size 0x20000
Timeout!
SAM NAND 256MiB 3,3V 8-bit: MTD Erase failure: -5
OK
Victor Librado Sancho
Departamento I+D
------------------------------------------------------------------------
Victor Librado ha scritto:
Quoted 21 lines
Hello all,
I'm working with u-boot for booting in nandflash with the evaluation board atmel at91sam9260ek. Nandflash reads ok, but performing and erase doesn`t work.I get these messages trying to erase a block of the nand and writing the environment variables to nandflash.
Any help? I'm missing a configuration parameter in config or what may happens?
U-Boot> saveenv
Saving Environment to NAND...
Erasing redundant Nand...Timeout!U-Boot>
U-Boot>U-Boot> nand erase
0x600000x20000
Quoted 7 lines
NAND erase: device 0 offset
0x60000, size0x20000
Timeout!
SAM NAND 256MiB 3,3V 8-bit: MTD Erase failure: -5OK
Victor Librado Sancho
Departamento I+D
Victor,
you should check registers settings and timing into yourboard.h configuration file
Ciao
Signature · 4 lines
Marco Cavallini Koan s.a.s. - Bergamo - Italia Embedded and Real-Time Software Engineering http://www.KoanSoftware.com - http://www.KaeilOS.com
Quoted 44 lines
-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Victor Librado
Sent: Thursday, 7 June 2007 2:34 AM
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] u-boot on nadflash for at91sam9260ekHello all,
I'm working with u-boot for booting in nandflash with the evaluation board atmel at91sam9260ek. Nandflash reads ok, but performing and erase doesn`t work.I get these messages trying to erase a block of the nand and writing the environment variables to nandflash.
Any help? I'm missing a configuration parameter in config or what may happens?
U-Boot> saveenv
Saving Environment to NAND...
Erasing redundant Nand...Timeout!U-Boot>
U-Boot>U-Boot> nand erase
0x600000x20000NAND erase: device 0 offset
0x60000, size0x20000Timeout!
SAM NAND 256MiB 3,3V 8-bit: MTD Erase failure: -5OK
Quoted 4 lines
Victor Librado Sancho
Departamento I+D
--------------------------------------------------------------
----------
Hi Victor,
I also have this exact same problem on my at91sam9260ek. Nand works fine in linux but not in U-boot.
However when I use the patched u-boot from Atmel (based on an older version of u-boot) nand works.
Maybe there are some clues in there somewhere.
Regards
Chris
Thanks all,
By now I use u-boot-1.1.5 version with atmel 1.3 patch. Definitions of timing access for nandflash in my board.h as in linux board initialization.
The configuration nand parameters as follows:
#define NAND_MAX_CHIPS 1 /* Max number of NAND
devices */
#define CFG_MAX_NAND_DEVICE 1 /* Max number of NAND
devices */
#define SECTORSIZE 512
#define CFG_NAND_BASE 0x40000000
#define CONFIG_NEW_NAND_CODE
#define ADDR_COLUMN 1 #define ADDR_PAGE 2 #define ADDR_COLUMN_PAGE 3
#define NAND_ChipID_UNKNOWN 0
#define NAND_MAX_FLOORS 1
#undef CFG_NAND_WP
#define CFG_NO_FLASH 1
#undef CFG_ENV_IS_IN_FLASH
#undef CFG_ENV_IS_IN_DATAFLASH
#define CFG_ENV_IS_IN_NAND 1
/*#define CONFIG_MTD_DEBUG 1
#define CONFIG_MTD_DEBUG_VERBOSE MTD_DEBUG_LEVEL3
*/
#ifdef CFG_ENV_IS_IN_NAND
#define CFG_ENV_OFFSET 0x60000 /* environment starts here */ #define CFG_ENV_SIZE 0x20000 /* 1 sector = 128kB */
#endif
Now when I try to erase nand sector of environment variables or saveenv environment variables I get these messages:
U-Boot> nand erase 0x60000 0x20000
NAND erase: device 0 offset 0x60000, size 0x20000
Skipping bad block at 0x00060000
OK
U-Boot> saveenv
Saving Environment to NAND...
Erasing Nand...nand_erase: attempt to erase a bad block at page 0x000000c0 U-Boot>
I looked into source code and when saving environmet variables the erase functions exits if it finds a bad block, as in this case. environment variables are not saved.
Is it a problem of this sector of my nandflash that is kaputt (change my nandflash of my board?)? I read in nandflash datasheet that is normal the presence of bad blocks in a flash and that it should be created a table with the index of the bad blocks and skip them... U-boot can process in this way activiting some variables? (maybe i should use the old nand_legacy way ...?)
Or it must be configured u-boot in some way to skip bad block and continuing with the erasing and saving variables process ....
Or may be I am totally puzzled....
Victor Librado Sancho
Departamento I+D
------------------------------------------------------------------------
Chris Sharman escribi?:
Quoted 67 lines
Quoted 45 lines
-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Victor Librado
Sent: Thursday, 7 June 2007 2:34 AM
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] u-boot on nadflash for at91sam9260ekHello all,
I'm working with u-boot for booting in nandflash with the evaluation board atmel at91sam9260ek. Nandflash reads ok, but performing and erase doesn`t work.I get these messages trying to erase a block of the nand and writing the environment variables to nandflash.
Any help? I'm missing a configuration parameter in config or what may happens?
U-Boot> saveenv
Saving Environment to NAND...
Erasing redundant Nand...Timeout!U-Boot>
U-Boot>U-Boot> nand erase
0x600000x20000NAND erase: device 0 offset
0x60000, size0x20000Timeout!
SAM NAND 256MiB 3,3V 8-bit: MTD Erase failure: -5OK
Quoted 5 lines
Victor Librado Sancho
Departamento I+D
--------------------------------------------------------------
----------Hi Victor,
I also have this exact same problem on my at91sam9260ek. Nand works fine in linux but not in U-boot.
However when I use the patched u-boot from Atmel (based on an older version of u-boot) nand works.
Maybe there are some clues in there somewhere.
Regards
Chris