[CC flashrom because this is a flashrom topic. Please don't drop it from CC.]
On 27.11.2009 01:04, Peter Stuge wrote:
ron minnich wrote:
Serialice could have the capability to flash the "normal".
Yes, but I say forget about using flashrom as-is for this. The code is still pretty much a mess.
Really? The code has changed a lot in the last 6 months. I won't debate that main() is ugly, but the rest of the code is abstracted well enough to support SerialICE as external flasher right now with ~21 LOC (given a fast enough serial line, but timing constraints are not the fault of flashrom).
Detailed size estimate for a SerialICE external programmer driver (supporting Parallel/LPC/FWH) in flashrom: Functions for programming are exactly 13 LOC (including function headers, unless SerialICE requires more than 1 write overhead for each read/write). Function for init is ~4 LOC (1 line function header, 1 line opening serial port, 1 line setting buses_supported, 1 line return). Adding required functions to flash.h is 0 LOC (pure cut-n-paste of 3 lines from the new driver). Hooking up the new driver is 4 LOC (copy-n-paste programmer_table it87spi entry, change name/init/writeb/readb). We can even use dummyflasher.c as basis and run s/dummy/serialice/ on 3 functions which saves us 3 LOC and a similar search/replace in programmer_table which saves us writing another 4 LOC, reducing the total to 14 LOC.
Writing 14 LOC can't be that hard.
Regards, Carl-Daniel
P.S. The makefile one-liner and the man page entry are not included in above calculations.