which driver for mmap-able battery-backed SRAM ?

Philippe De Muyter phdm at macq.eu
Thu Feb 20 03:34:40 EST 2014


Hi Markus,

On Thu, Feb 20, 2014 at 09:17:52AM +0100, Markus Niebel wrote:
> Hi,
> 
> Am 11.02.2014 20:29, wrote Philippe De Muyter:
> > Hi mtd experts,
> > 
> 
> not an expert, but this should be done as a simple char device driver?

Actually, I am surprised that this does not exist yet, (or did I
not search enough ?)

At the moment, the only solution I have found is using /dev/mem, and
mmap-ing the part of it starting at the physical address of my sram
into my user program.

But my user program must know the physical address of the sram, and run as root;
I cannot give individual access rights to my sram.

> 
> BTW. if you intend to try mainlining such a driver I can send you a piece of raw code
> offlist.

I would gladly look at it.  Thanks for the proposal.

Philippe

> 
> > I try to find the right driver for a memory-mapped battery-backed SRAM chip.
> > I have tried two drivers : 
> > 	"mmio-sram"	drivers/misc/sram.c
> > and
> > 	"mtd-ram"	drivers/mtd/chips/map_ram.c
> > but none of them provides me the expected interface : being able to mmap
> > it in a user program, and ensure that every write access to it happens
> > at the moment it is executed in the user program.
> > 
> > Is there already a driver that has those functionalities, or which one should
> > I enhance ?
> > 
> > TIA
> > 
> Markus

-- 
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles



More information about the linux-mtd mailing list