From: Angelo Dureghello <angelo70@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: SST flash issues
Date: Wed, 27 Apr 2011 21:12:22 +0200 [thread overview]
Message-ID: <4DB86A96.6080607@gmail.com> (raw)
Hi all,
my name is angelo, i am new to this list to ask for some help to mtd experts.
I installed uClinux in a custom board i developed, the kernel is stored inside a parallel flash, SST 29VF3201B (4MB, 16bit bus, word-readable) and loaded into RAM from the bootloader.
I prepared 3 partitions from my board.c, "bootloader", "kernel+romfs", and a final small "jffs2" data partition.
My idea is to use this small third partition (1024Kb) to store some non-volatile data.
The partitions seems to be detected correctly from the dmesg:
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash":
0x000000000000-0x000000010000 : "Colilo (64K)"
mtd: Giving out device 0 to Colilo (64K)
0x000000010000-0x000000300000 : "Kernel+ROMfs (3008K)"
mtd: Giving out device 1 to Kernel+ROMfs (3008K)
0x000000300000-0x000000400000 : "JFFS2 (1024K)"
mtd: Giving out device 2 to JFFS2 (1024K)
uclinux[mtd]: RAM probe address=0x1ab704 size=0xa7000
Creating 1 MTD partitions on "RAM":
0x000000000000-0x0000000a7000 : "ROMfs"
mtd: Giving out device 3 to ROMfs
Generic platform RAM MTD, (c) 2004 Simtec Electronics
The first thing i don't understand is why the erasesize is for all 3 partitions as the same flash size, 0x400000:
/ # cd proc
/proc # cat mtd
dev: size erasesize name
mtd0: 00010000 00400000 "Colilo (64K)"
mtd1: 002f0000 00400000 "Kernel+ROMfs (3008K)"
mtd2: 00100000 00400000 "JFFS2 (1024K)"
mtd3: 000a7000 00001000 "ROMfs"
/proc #
I was supposing that the erasesize was different for every partition. This is probably the first fact that don't allow to access for writing the 3rd partition (mtd2).
Then, as a first step, i try to read the mtdblock2 (cat), and i read exactly what i written inside, the data bytes of a little jffs2 fs i programmed in from the bootloader.
Then as a second step i would try to unlock/erase, to see if the flash has been detected correctly.
If i try to unlock the partition i get:
/proc # unlock /dev/mtdblock2
mtdblock_open
ok
Comtdblock_release
uok
ld not get MTD device info from /dev/mtdblock2
/proc #
If i try to erase:/proc # erase /dev/mtdblock2
mtdblock_open
ok
Ermtdblock_release
aok
se Total 1 Units
/proc #
But now, if i cat /dev/mtdblock2, original data are still there.
It is obvious now that also trying to mount the jffs2 fs nothing will work;:
/var # mount -t jffs2 /dev/mtdblock2 jffs2
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 2 ("JFFS2 (1024K)")
jffs2: Flash size not aligned to erasesize, reducing to 0KiB
jffs2: Too few erase blocks (0)
mount: mounting /dev/mtdblock2 on jffs2 failed: Invalid argument
/var #
So i guess i am wrong in more than one assumption,
every help is very appreciated,
many thanks,
angelo
reply other threads:[~2011-04-27 19:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DB86A96.6080607@gmail.com \
--to=angelo70@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.