linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* General question regarding multiple partitions on a single NOR device
@ 2013-06-06 19:18 Mark Jackson
  0 siblings, 0 replies; only message in thread
From: Mark Jackson @ 2013-06-06 19:18 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: lkml

On one of our products, we have 2 64Mbit NOR devices:- one to hold the
kernel, filesystem, etc, and the other to store "user" data.

The gotcha is that the "user" data is stored using our own wear
levelling code, with read / write / erase operations being carried out
on the raw flash device.

We are now designing a new CPU board with a single 1Gbit Spansion NOR
part on it, rather than the 2 separate devices.

I am planning to allocate 512Mbit to the "system" partitions (eg
bootloader, kernel, filesystem) and have the other 512Mbit as the "data"
partition.

Currently our wear levelling code uses mmap() to gain direct access to
the flash chip, which is not an issue, since all filesystem updates etc
are all carried out on the completely separate chip (via jffs2).

What I would like to know is, when the "system" and "user" partitions
reside on the *same" flash device, if I read/write directly to the
"user" partition, how do I maintain the jffs2 integrity on other
"system" partitions that may be doing their own read/write/erase
operations ?

If I can't read/write directly, can the same be achieved using the mtd
character device using something like:-

fd = open("/dev/mtd4", ..);
seek(fd, 1234);
write(fd, buff, ...);
...etc...

If I need to "manually" erase a sector on our custom data partition, how
can that be handled without disrupting any jffs2 flash access on the
other "system" partitions ?

Do the mtd ioctl() functions handle all the flash locking for me ?

Or is this a bit hole I'm digging for myself ?

Thanks for any help anyone can offer.

Regards
Mark J.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-06 19:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06 19:18 General question regarding multiple partitions on a single NOR device Mark Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).