Accessing flash directly from User Space [SOLVED]
Jonathan Haws
Jonathan.Haws at sdl.usu.edu
Fri Oct 30 04:02:45 EST 2009
> > > Anyway, to make a long story short, I inserted an msync() after
> each
> > > assignment to the flash. This resolved my problem and I can now
> program my flash.
> >
> > Ouch, this was news to me too. Calling msync() after every write
> kills performance.
> > We use mmap(/dev/mem) to access HW and havn't seen any issues yet.
> Is this
> > perhaps a new behaviour for mmap(/dev/mem) and is there a way
> > to avoid calling msync()?
>
> The address range should be outside the dram and thus uncached. Any
> write to any address in the range mmaped should go directly to the
> NOR
> flash. Any other behavior is a bug. It's not mapping an actual file
> here.
That is what I was thinking. But I have a working driver and the extra delay of writing to flash caused by the msync() calls I can deal with. I only ever write data to flash when I need to update one of my boot images.
Thanks,
Jonathan
More information about the Linuxppc-dev
mailing list