Please use "Fix SFDP probing" as commit message headline and commit the whole batch of SFDP bugfixes in one commit once the patch is fixed.
Am 20.02.2012 22:29 schrieb Stefan Tauner:
sfdp_add_uniform_eraser checks for existing erasers. Due to a bug it looked for eraser slots that have no erase functions set instead of those that have one set.
Postpone adding an erase function for the special 4k block erase opcode until we know the flash chip size. Check for zero chip size in sfdp_add_uniform_eraser.
Fix the output of the parameter table contents.
This patch fixes the index used to retrieve the eraser types, which was off one double word.
For me it looks like this part of the patch introduced a new bug.
Refine some messages and add a few further debugging prints.
has been tested with the new emulator to be able to write successfully and also handle some error cases as expected.
Signed-off-by: Stefan Tauner stefan.tauner@student.tuwien.ac.at
sfdp.c | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/sfdp.c b/sfdp.c index 75dfb5f..e1897c7 100644 --- a/sfdp.c +++ b/sfdp.c @@ -213,22 +223,25 @@ static int sfdp_fill_flash(struct flashctx *flash, uint8_t *buf, uint16_t len) goto done; }
- dw = 8;
- /* 8. double word */
- dw = 7; for (j = 0; j < 4; j++) {
/* 8 double words from the start + 2 words for every eraser */
tmp8 = buf[(4 * dw) + (2 * j)];/* 8 double words from the start + 2 bytes for every eraser */
8 double words from the start is 32 bytes from the start. Last time I checked, 7*4 was not 32.
Regards, Carl-Daniel