FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How do I get filesystem on the dataflash (AT91SAM9261-EK ) ?
PostPosted: Sun Oct 05, 2008 7:04 pm 
Offline

Joined: Sun Oct 05, 2008 6:57 pm
Posts: 2
Hi

Working on a project based on the AT9SAM9261-EK board and it all works, but on the production boards we do not have a nandflash, we want all parts of linux to be in the dataflash (in our case 8Meg).

So I have successfully compiled the kernel and created a filesystem, bootloader etc.
On the at91sam9261ek board the filesystem that the kernel boots to is located in nand flash.
The ffs2 filsystem needed to run our project is so small it will fit without any problem in the flashdata chip.
So I have tried for a very long time now to make the kernal boot to a ffs2 file system located in the dataflash (DataFlash:AT45DB642 8Mb) and not to the default nandflash (Samsung NAND 256MiB).

By changing the kernel Kconfig in
/linux-2.6.26/drivers/mtd/devices/Kconfig
line 57: commenting out the dependency
the at45 dataflash option becoms available for the at91sam9261ek board

I followed the atmel pdf for using data flash at:
http://www.atmel.com/dyn/resources/prod ... c32055.pdf
and successfully compiled the kernel and booted it up using a ffs2 filesystem located in nand.
Here is a part of the successful boot output and you can see the dataflash driver seems to be loaded and working.

(from the debug consol connected to the serialport on the dev board)
---------------------------------------------------------------------------------------------
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)
mtd_dataflash spi0.0: AT45DB642x (8448 KBytes)
---------------------------------------------------------------------------------------------

after the bootup, I login with root(no password) and
when I do a partitions check I get this:
---------------------------------------------------------------------------------------------
root@at91sam9261ek:/$ cat /proc/partitions
major minor #blocks name

31 0 256 mtdblock0
31 1 261888 mtdblock1
31 2 8448 mtdblock2
root@at91sam9261ek:/$
---------------------------------------------------------------------------------------------

so I got the dataflash partition, and here is where my problem is

I create a directory so I can mount the dataflash to it.
mkdir test
I check that test is created and it is.
So now I try to mount it to the dataflash
mount -t jffs2 /dev/mtdblock2 test

and all I get is a massiv amount of this:
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c00: 0xe04d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c04: 0xae02 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c08: 0x36e0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c0c: 0xb5dd instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c10: 0x74a5 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c14: 0x1e89 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c18: 0x3d40 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00162c1c: 0x9719 instead

and it goes on for a while, so here is where I am stuck, I have tried to find any answers on the net and many people have the same problems,

Conclusion:
I simply want the at91sam9261-ek to run everything from dataflash and not include the nand flash, is that not possible ?

A first step would be to be able to mount the data flash the linux that I already have working, but as already shown, that gives me the Magic bitmask 0x1985 not found error.
I have read on the net that others have tried to do the same thing but no answers has been found for it.

Any clues, no matter how small will be greatly appreciated.

Jorgen


Top
 Profile  
 
 Post subject: Re: How do I get filesystem on the dataflash (AT91SAM9261-EK ) ?
PostPosted: Wed Oct 08, 2008 8:49 am 
Offline

Joined: Thu Jun 26, 2008 5:25 pm
Posts: 20
Hi Jorgen,


We are also interested in doing this. I have looked at the Atmel document and noticed that the AVR2 is big-endian. This may be your problem. The SAM926 series can be built as either. We use buildroot and the kernel is Little Endian, not big. We have already had other problems with this sort of thing. It would be worth a try building a little endian jffs2 and trying it.

Cheers,

Dirk.

_________________
Dirk Vermaak
Design Engineer
Diarre Audio Systems


Top
 Profile  
 
 Post subject: Re: How do I get filesystem on the dataflash (AT91SAM9261-EK ) ?
PostPosted: Thu Oct 09, 2008 1:14 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 649
Location: USA
jorgen wrote:
So I have tried for a very long time now to make the kernal boot to a ffs2 file system located in the dataflash (DataFlash:AT45DB642 8Mb)

ffs2?
Is this a typo you keep on making, or some new filesystem or are you renaming JFFS2?


Quote:
By changing the kernel Kconfig in
/linux-2.6.26/drivers/mtd/devices/Kconfig
line 57: commenting out the dependency
the at45 dataflash option becoms available for the at91sam9261ek board

There is rarely a good reason to modify the Kconfig files for existing boards or unless you're adding a driver. (BTW, why isn't this post in the Linux forum?)
Instead of modifying the Kconfig, you probably should have enabled the "dependency".


Quote:
Conclusion:
I simply want the at91sam9261-ek to run everything from dataflash and not include the nand flash, is that not possible ?

How can a "conclusion" be a question?

Before you can use the DataFlash partition as a filesystem, you need to initialize the filesystem in that partition. For JFFS2, the documentation states that erasing the partition is sufficient to initialize it. (For an ext2 filesystem, there is the utility mkext2fs.) The MTD utility eraseall will work. The alternative to to write a complete JFFS2 image to the DataFlash partition (which is the method that the Atmel app note mentions). But you made no mention of writing the image to DataFlash before you tried to mount the partition.

FYI, you can write the filesystem image to the MTD char device.
Then you can mount the MTD block device that contains the filesystem.

BTW have you added DataFlash support into U-Boot, and defined "areas" to match the Linux partitions? Note that U-Boot soft-maps the DataFlash to a "special" memory space, and no explicit "erase" is needed when copying to DataFlash locations.

Regards


Top
 Profile  
 
 Post subject: Re: How do I get filesystem on the dataflash (AT91SAM9261-EK ) ?
PostPosted: Thu Oct 09, 2008 7:14 am 
Offline

Joined: Sun Oct 05, 2008 6:57 pm
Posts: 2
Quote:
ffs2?
Is this a typo you keep on making, or some new filesystem or are you renaming JFFS2?

yepp ffs2 is a typo should of course be jffs2

Quote:
There is rarely a good reason to modify the Kconfig files for existing boards or unless you're adding a driver. (BTW, why isn't this post in the Linux forum?)
Instead of modifying the Kconfig, you probably should have enabled the "dependency".

true, I'm no linux expert, and tweaking the kernel is for me a learning experience, my area is audio dsp stuff, and was just trying to get something going by simply hacking away, I will look at the dependency now that I actually got more stuff working.
I put the question here, since I was hoping some other AT91SAM9261-EK board user (hardware) was trying or had already done the same thing that I wanted to do, so in that, its AT91SAM9261-EK related, but we could split hairs over it I guess.



Quote:
How can a "conclusion" be a question?

nope, it can't, me copy and pasting from a bigger text mass, it was more detailed in its first version, so F in English for me :?


Quote:
Before you can use the DataFlash partition as a filesystem, you need to initialize the filesystem in that partition. For JFFS2, the documentation states that erasing the partition is sufficient to initialize it. (For an ext2 filesystem, there is the utility mkext2fs.) The MTD utility eraseall will work. The alternative to to write a complete JFFS2 image to the DataFlash partition (which is the method that the Atmel app note mentions). But you made no mention of writing the image to DataFlash before you tried to mount the partition.

FYI, you can write the filesystem image to the MTD char device.
Then you can mount the MTD block device that contains the filesystem.

BTW have you added DataFlash support into U-Boot, and defined "areas" to match the Linux partitions? Note that U-Boot soft-maps the DataFlash to a "special" memory space, and no explicit "erase" is needed when copying to DataFlash locations.


this link describes pretty much what I want:
viewtopic.php?f=12&t=4279&view=next
and have successfully got the partitions working so I think this might be a step to the solution.
I have tested it by mounting a partition and created a file and it all worked.
What I got left to do now, is to make a jffs2 image of the rootfs and put it in the correct partition and have the kernel boot to it with the u-boot environment variables set to match the new partitions.


Thanks for the info


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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: