On Sun, 7 Jan 2001, Bernhard Kuhn wrote:
> Me too had some timing problems when accessing the BIOS-memory
> directly, seems that there are some caching effects.
I'm not sure I believe this. Flash is in PCI address space, and PCI isn't
cached (that's controlled by MTRR, and the MTRR only covers memory, not
PCI -- "cat /proc/mtrr")
> At least, i flashed an AM29F040 a 100 times with different
> data and that did it quite well. Here is an excerpt of
> the relevant code in the flashtool:
>
>
> /* write data */
> void MemWrite(int a,unsigned char d) {
> base[a]=d;
> msync(base+a,1,MS_SYNC);
I think the beneficial effect of the msync was probably that it gave you a
timing delay (i.e. long cost of the syscall). A quick scan of the kernel
source for the mem driver and other bits doesn't show anything that would
be 'flush cache to memory'. In fact there is no sync fop for the mem
devices at all. I think this is timing.
ron