Discussion:
XIP support
Anna Fischer (novero/Bochum)
2013-07-03 11:51:59 UTC
Permalink
Hi everyone,

I'm looking for help on Linux XIP support on MTD devices.

I'd like to create a system where I can use a single NOR as XIP device and at the same time as data storage device. E.g. I can imagine that on my NOR flash device I create two partitions: one as ROMFS supporting XIP which holds kernel and application code, and one as standard data storage, for example holding a read-write YAFFS2 file system which my applications can use to store data.

Can anyone clarify if this is supported with the current kernel infrastructure, and if yes then what support do I need on the NOR flash device itself? I assume that the device itself will need to support reading from one segment in NOR (e.g. XIP partition) whilst writing to another one (data partition). Many flash vendors call this read-while-erase support. On the other hand I assume that if the software is capable, then it should also be sufficient that the NOR flash support partial erase functions, and suspend/resume for those operations. Can anyone confirm that this can be handled in Linux MTD drivers?

Many thanks for any pointers.

Anna
Nicolas Pitre
2013-07-03 18:31:55 UTC
Permalink
Post by Anna Fischer (novero/Bochum)
Hi everyone,
I'm looking for help on Linux XIP support on MTD devices.
I'd like to create a system where I can use a single NOR as XIP device
and at the same time as data storage device. E.g. I can imagine that
on my NOR flash device I create two partitions: one as ROMFS
supporting XIP which holds kernel and application code, and one as
standard data storage, for example holding a read-write YAFFS2 file
system which my applications can use to store data.
Can anyone clarify if this is supported with the current kernel
infrastructure, and if yes then what support do I need on the NOR
flash device itself? I assume that the device itself will need to
support reading from one segment in NOR (e.g. XIP partition) whilst
writing to another one (data partition). Many flash vendors call this
read-while-erase support.
Yes. And in that case you don't need very much in terms of software
support, besides making sure that your MTD partitions are defined to
match the NOR flash partition boundaries.
Post by Anna Fischer (novero/Bochum)
On the other hand I assume that if the software is capable, then it
should also be sufficient that the NOR flash support partial erase
functions, and suspend/resume for those operations. Can anyone confirm
that this can be handled in Linux MTD drivers?
There is support for doing that with Intel NOR flash parts. I don't
know if the other NOR flash drivers have that capability though. See
code related to CONFIG_MTD_XIP in drivers/mtd/chips/cfi_cmdset_0001.c.

Some platform specific helpers such as those found in the following
files are needed:

arch/arm/mach-omap1/include/mach/mtd-xip.h
arch/arm/mach-pxa/include/mach/mtd-xip.h
arch/arm/mach-sa1100/include/mach/mtd-xip.h

This feature, however, is not used much by contemporary platforms. So
it might not be as well tested as it used to.


Nicolas

Continue reading on narkive:
Loading...