Brian Stephenson schrieb:


> I dare say programming the chip would run into the problem as
> well as it uses same type of address programming, the following
> table gives a brief rundown:
> 
> sst39SF020  90nsec needs 1usec delay (out of asus SiS530 board)
> ae49F2008 120nsec needs 1usec delay (out of matsonic 630 board)
> am29F010B 90nsec no delay needed (border line)

Me too had some timing problems when accessing the BIOS-memory
directly, seems that there are some caching effects.
Then i went the unix way (hey, everyting is a file!) with
file synchronisation and that did it rather well.

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);
};
 
/* read data */
unsigned char MemRead(int a) {
  msync(base+a,1,MS_SYNC);
  return base[a];
};                                                                              

/* map memory */
void FlashOpen() {
  if ((fd = open("/dev/mem", O_RDWR)) < 0) {
    fprintf(stderr,"error: can´t open /dev/mem\n");
    exit(1);
  };
  if ((base = mmap(0, FLASHSIZE, PROT_READ|PROT_WRITE,
                   MAP_SHARED, fd, FLASHADDR)) == 0) {
    fprintf(stderr,"error: can´t remap bios address space\n");
    close(fd);
    exit(1);
  };
  iopl(3);
  BiosWriteEnable();
};

/* unmap memory */
void FlashClose() {
  BiosWriteDisable();
  iopl(0);
  munmap(base,FLASHSIZE);
  close(fd);
};

Reply via email to