Hello Carl-Daniel,
I'll comment your questions and send a revised patch in a later email.
Am 14.06.2012 00:37, schrieb Carl-Daniel Hailfinger:
Hi Nico,
I have a few questions about AAI with the Dediprog SF100:
- Do you know how the completion of one AAI write command is detected?
The public SST25VF032B datasheet mentions three methods: "There are three methods to determine completion of a program cycle during AAI Word programming: hardware detection by reading the Serial Output, software detection by polling the BUSY bit in the Software Status Register or wait TBP (Byte Programming Time)."
- Is AAI programming done in 256 byte blocks (i.e. WRDI at the end of
each page) or in bigger blocks (i.e. WRDI only at the end of the to-be-programmed region)?
I'm sorry to admit that we have no further knowledge about what the SF100 does on the SPI bus. We just observed what the original dediprog driver wrote on the USB bus while writing to an SST25VF032B. It was just an assumption, that the SF100 uses AAI writing, as the flash chip doesn't support any other mode (besides single byte programming).
- const char count_and_chunk[] = {count & 0xff,
- const char count_and_cmd[] = {count & 0xff, (count >> 8) & 0xff,
chunksize & 0xff,
(chunksize >> 8) & 0xff};
(dedi_spi_cmd >> 8) & 0xff,
dedi_spi_cmd & 0xff};
Have you ever seen the field containing ((dedi_spi_cmd >> 8) & 0xff) at a nonzero value? Should we replace that field with 0 if we have no idea about it (and make dedi_spi_cmd an uint8_t)?
I'll set it to zero. I indeed haven't seen any other value.
-static int dediprog_spi_write_256(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len)
+static int dediprog_write_256(struct flashctx *flash, uint8_t *buf,
Not sure if dediprog_wite_256() still is an appropriate name for the function.
I'm not sure if it was an appropriate name before and I don't know why it was named like that. I'll rename it to dediprog_spi_write() as it's just dediprog's general write function.
Best Regards, Nico Huber