The AAI code rewrite in r1052 introduced a bug: The writelen of AAI continuation is 3 bytes, but the code incorrectly had 6 bytes there. This causes all AAI writes (except the first two bytes of a chip) to fail. Thanks to den_m for reporting the bug and for testing the fix.
Functional change: Fix AAI continuation command write length (was 6, should be 3).
Cosmetic change: Change the whitespace of a few #defines in spi.h to have aligned values to improve readability (maybe someone would have spotted the AAI bug if the values had been aligned in the first place).
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
If this patch works for you, please reply-to-all with the following text: Acked-by: Your Name your@email
Index: flashrom-spi_aai_outsize_fix/spi.h =================================================================== --- flashrom-spi_aai_outsize_fix/spi.h (Revision 1058) +++ flashrom-spi_aai_outsize_fix/spi.h (Arbeitskopie) @@ -108,15 +108,15 @@ /* JEDEC_READ_INSIZE : any length */
/* Write memory byte */ -#define JEDEC_BYTE_PROGRAM 0x02 +#define JEDEC_BYTE_PROGRAM 0x02 #define JEDEC_BYTE_PROGRAM_OUTSIZE 0x05 #define JEDEC_BYTE_PROGRAM_INSIZE 0x00
/* Write AAI word (SST25VF080B) */ -#define JEDEC_AAI_WORD_PROGRAM 0xad -#define JEDEC_AAI_WORD_PROGRAM_OUTSIZE 0x06 -#define JEDEC_AAI_WORD_PROGRAM_CONT_OUTSIZE 0x06 -#define JEDEC_AAI_WORD_PROGRAM_INSIZE 0x00 +#define JEDEC_AAI_WORD_PROGRAM 0xad +#define JEDEC_AAI_WORD_PROGRAM_OUTSIZE 0x06 +#define JEDEC_AAI_WORD_PROGRAM_CONT_OUTSIZE 0x03 +#define JEDEC_AAI_WORD_PROGRAM_INSIZE 0x00
/* Error codes */ #define SPI_GENERIC_ERROR -1
On Thu, Jun 24, 2010 at 02:41:38AM +0200, Carl-Daniel Hailfinger wrote:
The AAI code rewrite in r1052 introduced a bug: The writelen of AAI continuation is 3 bytes, but the code incorrectly had 6 bytes there. This causes all AAI writes (except the first two bytes of a chip) to fail. Thanks to den_m for reporting the bug and for testing the fix.
Functional change: Fix AAI continuation command write length (was 6, should be 3).
Cosmetic change: Change the whitespace of a few #defines in spi.h to have aligned values to improve readability (maybe someone would have spotted the AAI bug if the values had been aligned in the first place).
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Uwe.
On 29.07.2010 18:18, Uwe Hermann wrote:
On Thu, Jun 24, 2010 at 02:41:38AM +0200, Carl-Daniel Hailfinger wrote:
The AAI code rewrite in r1052 introduced a bug: The writelen of AAI continuation is 3 bytes, but the code incorrectly had 6 bytes there. This causes all AAI writes (except the first two bytes of a chip) to fail. Thanks to den_m for reporting the bug and for testing the fix.
Functional change: Fix AAI continuation command write length (was 6, should be 3).
Cosmetic change: Change the whitespace of a few #defines in spi.h to have aligned values to improve readability (maybe someone would have spotted the AAI bug if the values had been aligned in the first place).
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Thanks, committed in r1121.
Regards, Carl-Daniel