[flashrom] [PATCH] Fix sfdp_add_uniform_eraser and its usage.

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Tue Feb 21 14:51:38 CET 2012


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 at 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 */
> +		/* 8 double words from the start + 2 bytes for every eraser */
>  		tmp8 = buf[(4 * dw) + (2 * j)];

8 double words from the start is 32 bytes from the start. Last time I
checked, 7*4 was not 32.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list