Feature #364
closed
Feature #353: Release v1.3
Investigate whether clear_spi_id_cache() needs to be called before probing
Added by Anastasia Klimchuk over 2 years ago.
Updated almost 2 years ago.
Description
Currently clear_spi_id_cache()
is only called in tests. Should it be also called for real, before probing?
- Assignee set to Edward .
- Related links updated (diff)
- Status changed from New to Response Needed
- Target version changed from 1.3 to main
Hey David, could you look into this and explain what you wanted to do? That would be great :)
Felix Singer wrote in #note-2:
Hey David, could you look into this and explain what you wanted to do? That would be great :)
The original patch has some context in the commit message: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/313752/. Also, this patch is where the cache was introduced: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/35376
Wayyyy long ago, flashrom would call RDID/REMS for each chip in flashchips[] until a match was found. This resulted in significant time spent probing, especially for chips far down the list such as Windbond chips. Thus the cache was added so we only need to do RDID/REMS once.
The reason for clearing the cache is if you intend to do something that may change the value returned by RDID/REMS. The follow-up to chromium:313752 had to do with auto-detecting voltage when using an external programmer that can supply different voltages such as Dediprog SF100/SF600. The idea was to probe 1.8V chips first, then 3.3V chips. The steps went like this:
- Set external programmer voltage to 1.8V
- Do RDID/REMS. If a valid ID is returned, then we're done.
- Clear ID cache
- Set external programmer voltage to 3.3V
- Do RDID/REMS again and hope we get a valid ID this time.
I'm not sure how this sort of thing is handled nowadays. If there's a better probing algorithm now then please feel free to get rid of clear_spi_id_cache().
David, thanks so much for the information!
Auto-detect voltage feature has been removed from chromium's dediprog programmer. The reason: there are some chips that allow probing at one voltage (lower) but expect a different voltage (higher) for reads/writes. For such cases, auto-detect feature would not work and even could maybe damage the chip.
Specifically, auto-detection was based on successful probing, and the same voltage would then be attempted for reads/writes.
If auto-detection in dediprog is the only feature that matters, then the answer to initial question seems to be "clear_spi_id_cache() is only needed for tests, and not for real". Which means, nothing to do for this ticket.
- Status changed from Response Needed to Resolved
- % Done changed from 0 to 100
Also available in: Atom
PDF