[flashrom] [PATCH] [1/n] SPI FAST READ infrastructure

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Sun Aug 14 10:38:47 CEST 2011


> SPI FAST READ infrastructure.
> Add feature bits to allow annotation of SPI flash chips with possible
> read methods.
> This includes the not-yet-supported Dual and Quad I/O read operations
> just in case we ever encounter programmer hardware which can use that
> feature.
> 
> An alternative design would be to create a separate spi_chip_fast_read
> function and have a per-chip array of allowable read functions similar
> to what we have for erase functions. A similar design problem exists for
> chips supporting multiple write functions (e.g. classic SPI write and
> SPI AAI write).
> 
> Thorough design review appreciated.

i think the alternative is much better, because it is generic.
the only drawback i see is that it uses more space. apart from that it
is clearly superior imo.
- the scheme is know from the erasers
- adding new functions is easy (there will be chips that do it slightly
  different... wanna bet? :)
- generic implementations (such as the example function in dediprog)
  can easily be supported with wrappers that call the generic function
  with an additional parameter. that's better than forcing the
  implementations to be generic functions (that have to check the
  flags).

i would start with adding support for multiple write functions. we have
a use case there already and if we encounter problems there, they are
probably similar to those we would have with read functions.

one thing i have not considered yet (did you?) is how the programmers
are involved. it is clear that they have to control the usage of
commands that need different i/o settings. getting the programmers
involved is already ugly, even without changing pin directions... i
am too tired atm to think that entirely through now.

dual and quad read/write operations should be possible to implement on
the serprog programmers for testing purposes. it would be very slow on
AVRs (bit banging instead of hw spi at f_cpu/2), but for testing
flashrom it would suffice. dunno if there are any (cheap)
microcontrollers supporting fast read/writes. afaics the small ARMs do
not support it either.

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner




More information about the flashrom mailing list