On Tue, 07 Feb 2012 23:31:50 +0100 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net wrote:
Ahem. Once we do the per-region unlock dance, this will be extremely painful. We have three choices:
- Keep that part of the code as is. Not good.
- Spit out that message for every status register write. Not good.
- Fix all flash chip definitions. Good, but separate patch.
How do we proceed?
fixing the stuff that needs fixing, of course.
steve said he might look into it, so this is what has to be done: i have attached a file containing what seems to be the spi chips without correctly set feature_bits fields. we need to check the datasheets for the opcodes needed to enable writing to the status register. normally this is either WREN (write enable) or EWSR (enable write status register), or both. currently we are only interested in the non-volatile bits of the status register, but there are chips that require another write enable command for the volatile bits. if anyone creates a spreadsheet, he should probably note those too if feasible or maybe even add a comment in the patch.
the field should be added after page_size and either set to: .feature_bits = FEATURE_WRSR_EWSR or .feature_bits = FEATURE_WRSR_EITHER if EWSR and WREN are allowed (all other SPI chips are already set to FEATURE_WRSR_WREN). in the case we encounter a chip that does use something else a comment should suffice for the time being.
we could also split the work up, if it takes too long otherwise...