[U-Boot] [RFC PATCH 2/2] usb: dfu: correct dfu buffer inited value

Lukasz Majewski l.majewski at samsung.com
Mon Nov 4 11:17:04 CET 2013


Hi Bo,

> After dfu buffer is initialized, the buffer should be all available,
> while not 0. Initialize its value to min(dfu_buf_size, dfu->r_left).
> 
> Signed-off-by: Bo Shen <voice.shen at atmel.com>
> 
> ---
>  drivers/dfu/dfu.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 65c6984..b8c8aa4 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -288,7 +288,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf,
> int size, int blk_seq_num) dfu->offset = 0;
>  		dfu->i_buf_end = dfu_get_buf() + dfu_buf_size;
>  		dfu->i_buf = dfu->i_buf_start;
> -		dfu->b_left = 0;
> +		dfu->b_left = min(dfu_buf_size, dfu->r_left);
>  

I've testd in on Trats. It causes dfu read to be performed two times.

Could you write a more verbose message to explain the problem that you
are trying to solve? I can _only_ suppose that you want to read/write
data from/to NAND memory.

So, I'm curious why dfu-util breaks with your setup but works at am335x.
Both chips are supposed to use dfu_nand.c for performing NAND
read/write.


>  		dfu->bad_skip = 0;
>  



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group


More information about the U-Boot mailing list