On Mon, 16 May 2011 16:52:57 +0300 Urja Rannikko urjaman@gmail.com wrote:
opbuf/delay: what's the use of this in spi mode? i dont see why this is needed at all.
Well, programmer_delay can be used anywhere in flashrom, and I dont see a need to limit that. I could make it so that these commands are optional if the programmer only supports SPI, and if they are not supported serprog_delay would call internal_delay ?
if the opbuf stuff is mandatory the firmware of the external programmers would need to implement it although it is never used for spi programming. i would check for S_CMD_O_DELAY support at the start of serprog_delay. what to do if there is no support? calling internal_delay is probably the best option, maybe also issuing a warning or at least a debug message? just issuing a warning in returning would be ok with me too. it should not happen in the current code anyway. *shrug*
the other opbuf stuff should also be optional imho, but if this is done we probably would like to change the functions using it because they often bail out via exit if they read a NAK e.g. sp_flush_stream
maybe we can get a third opinion from someone else. i'll ask carldani when i see him.