Writing JFFS2 to Samsung K9F1208U0B NAND on AMCC PPC405EX/r Kilauea/Haleakala

Grant Erickson gerickson at nuovations.com
Fri Feb 29 13:55:34 EST 2008


On 2/29/08 12:50 AM, Manfred jun. Schlägl wrote:
> Am Donnerstag, den 28.02.2008, 16:30 -0800 schrieb Grant Erickson:
>> I am attempting to create and write a JFFS2 file system to the Samsung
>> K9F1208U0B NAND part on an AMCC PPC405EXr "Haleakala" board and seem to be
>> running into a hurdle or two.
>> 
>> Given the Samsung K9F1208U0B's 16 KiB erase block and 512 B page sizes, I
>> invoked mkfs.jffs2 with:
>> 
>> % mkfs.jffs2 -n -b -s 512 -e 16 KiB -d /export/haleakala -o haleakala.img
> 
>> I then erase the device with 'flash_eraseall' using the '-j' option:
>> 
>> # flash_eraseall -j /dev/mtd9
>> Erasing 16 Kibyte @ 3f94000 -- 99 % complete. Cleanmarker written at
>> 3f94000.
>> 
>> However, when I attempt to lay down the file system image with nandwrite
>> (again, using the '-j' option), I get a driver error:
>> 
>> # nandwrite -j /dev/mtd9 haleakala.img
>> MEMSETOOBSEL: Inappropriate ioctl for device
>> 
>> Eliding the '-j' option, I get errors about page alignment:
>> 
>> # nandwrite /dev/mtd9 haleakala.img
>> Input file is not page aligned
>> Data was only partially written due to error: Success

> You have to pad(-p) your image, so that it's size is a multiple of page
> size
> % mkfs.jffs2 -n -b -s 512 -p 512 -e 16 KiB -d /export/haleakala -o
> haleakala.img
> 
> Then you should be able to write it with:
> % nandwrite /dev/mtd9 haleakala.img
> 
> greetings
> manfred

Manfred:

Danke schön. Your suggestion of adding padding ('-p 512') along with
Andrey's suggestion to remove the deprecated '-j' options to flash_eraseall
and nandwrite did the trick:

# mount -t jffs2 /dev/mtdblock9 /import/
# df -h
Filesystem                Size      Used Available Use% Mounted on
...
/dev/mtdblock9           63.6M     14.4M     49.2M  23% /import

Regards,

Grant





More information about the linux-mtd mailing list