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 issue on linux 3.0.4 (SAM9G45)
PostPosted: Thu Sep 15, 2011 11:15 am 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Hi,

I'm working on a custom board design based on AT91SAM9G45-EKES and using Linux 3.0.4.

I'm creating a user space utility for working with the nand flash. When I try to read a partition of the nand flash as a character device, then I'm receiving alternate bytes.

For example, if Nand partition contains:
0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08....
I'm getting
0x01 0x03 0x05 0x07....

Did anyone have similar issues? Can anyone point out what may be going wrong?

-PJ


Top
 Profile  
 
 Post subject: Re: Nand issue on linux 3.0.4 (SAM9G45)
PostPosted: Thu Sep 15, 2011 1:34 pm 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Hi,

I probed into the nand driver and found out that it is being configured for 8 bit and not 16 bits (as it should be). I set the variable in ek_nand_data.bus_width_16 as 1, even then the probe function in the atmel_nand.c configures it for 8 bits.

Any idea what else has to be set, to make the nand driver realize that it is 16 bit NAND.

-PJ


Top
 Profile  
 
 Post subject: Solved: Re: Nand issue on linux 3.0.4 (SAM9G45)
PostPosted: Fri Sep 16, 2011 10:01 am 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
This was a really stupid one. I dont know how I missed it.

in arch/arm/mach-at91/board-sam9m10g45ek.c
in function ek_add_device_nand()
change
ek_nand_data.bus_width_16=board_have_nand_16bit(); to
ek_nand_data.bus_width_16=1;

-PJ


Top
 Profile  
 
 Post subject: Re: Nand issue on linux 3.0.4 (SAM9G45)
PostPosted: Fri Sep 16, 2011 10:19 am 
Offline

Joined: Wed Feb 14, 2007 11:17 am
Posts: 67
Hi,

In fact, if you are using a custom board, it is maybe better to create another board file...
So, in board-sam9m10g45ek.c file, it has been decided to use an indication from the "system_rev" variable that is passed to the Linux kernel by the bootloader through the ATAG mechanism. It replaces the old Kconfig value.
If you use this board file and place a "1" at bit 31 of the system_rev, your system should understand that your NAND is connected in 16bits mode.

But for sure, your modification will work for your custom board.

Best regards,


Top
 Profile  
 
 Post subject: Re: Nand issue on linux 3.0.4 (SAM9G45)
PostPosted: Fri Sep 16, 2011 11:25 am 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Thanks nferre.

I would try that in my spare time and will report back the results.

-PJ


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 5 guests


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: