On Wed, Apr 30, 2014 at 12:10:39AM +0200, Carl-Daniel Hailfinger wrote:
[snip]
Found the bug. TheMarvell 88SE94xx encoding of the number of bytes to send via SPI differs from the encoding of the number of bytes to receive via SPI. You actually have to subtract one from the number of bytes to send, but use the unmodified number of bytes to receive. This was an off-by-one for commands, especially affecting erase and write commands.
New version. Should even work for write+erase. WARNING! The controller may not like getting its flash erased, and may hang. Not sure. Just speculation on my part. The datasheet is silent about concurrent accesses to the flash chip.
This patch works. Tested erase and then tested a write with a new version of the firmware. All works as expected.
Thank you so much.