Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: NAND, bad blocks, ecc, u-boot and linux
PostPosted: Tue May 29, 2007 2:17 am 
Offline

Joined: Wed Jan 10, 2007 8:13 am
Posts: 18
Hi,

I have been trying to sort out the nand bad block issues using the at91sam9260ek board.

My ultimate goal is to be able to alter the U-boot environment from linux using the fw_setenv/fw_printenv tools.

Any data I write with SAM-BA is considered a bad block under linux at boot up. I think this is because SAM-BA is writing the bad block information in the wrong location, or writing the ECC information where the bad block information should be (first byte of spare area on large page)

I am also trying to get U-boot to operate on the nand flash, but it always gets a timeout for erase and write operations. Read operations seems to work ok.

Quote:
nand erase 0x60000 0x20000




NAND erase: device 0 offset 0x60000, size 0x20000

nand_isbad_bbt(): bbt info for offs 0x00060000: (block 0) 0x03

nand_erase: start = 0x00060000, len = 131072

nand_isbad_bbt(): bbt info for offs 0x00060000: (block 0) 0x03

Timeout!nand_erase: Failed erase, page 0x000000c0



NAND 256MiB 3,3V 8-bit: MTD Erase failure: -5



OK


I'm using u-boot-1.2, linux 2.6.21.1

Has anyone managed to get nand working correctly under u-boot and linux?

U-boot defines the bad block offset as 5, which i think is incorrect for a large page device, I have changed this to 0. This then conflicts with soemthing SAM-BA writes.

Maybe the tming is incorrect for the erase operations. However it seems the same as mtd under linux which erases/reads/writes fine (on areas not written by SAM-BA)

Any suggestions?

Thanks
Chris


Top
 Profile  
 
 Post subject: Re: NAND, bad blocks, ecc, u-boot and linux
PostPosted: Sat Jun 16, 2007 5:27 pm 
Offline

Joined: Thu May 31, 2007 3:30 pm
Posts: 1
Location: Germany
[quote="csharman"]Hi,

I have been trying to sort out the nand bad block issues using the at91sam9260ek board.

My ultimate goal is to be able to alter the U-boot environment from linux using the fw_setenv/fw_printenv tools.

Any data I write with SAM-BA is considered a bad block under linux at boot up. I think this is because SAM-BA is writing the bad block information in the wrong location, or writing the ECC information where the bad block information should be (first byte of spare area on large page)

The at91sam926x write the ECC to the first 4 Bytes of spare area. U-boot and linux interpret the ECC as bad block information if there is no bbt.

Has anyone managed to get nand working correctly under u-boot and linux?

U-boot defines the bad block offset as 5, which i think is incorrect for a large page device, I have changed this to 0. This then conflicts with soemthing SAM-BA writes.

You have to use a bbt (bad block table), because at91sam916x is writing the ECC in the first 4 bytes of spare area. The u-boot must be configured to write the bbt, if they don't exists. Linux only have to use the bbt.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 20, 2007 7:18 am 
Offline

Joined: Wed Jan 10, 2007 8:13 am
Posts: 18
Ok, thanks for the reply.

Do you know what i have to do to enable bbt for at91sam926x?

I guess i need to get U-boot to create the bbt and tell linux to use it. Once linux is using the bbt I guess the factory OOB markers don't matter so much.

I have noticed that the openmoko project has done a lot of work with u-boot and nand. They have set dynamically allocated environment to avoid bad block, and the same for the partition table. I hoping to use some of their patches.

thanks for your help
Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 12:23 am 
Offline

Joined: Wed Jan 10, 2007 8:13 am
Posts: 18
I'm still struggling with this problem.

Does anyone know how to make u-boot create a bbt on the nand???

I'm starting with the atmel patched u-boot .


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 10:25 am 
Offline

Joined: Wed Feb 14, 2007 11:17 am
Posts: 67
use these tools :
u-boot 1.1.5_atmel_1.4 (available on this web site : u-boot project)
SAM-BA 2.6 (isp 1.10)

They all use software ecc and preserve manufacturer bad block information in large page nand flash.

They behave well with linux kernel.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: