public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH] usb: dfu: make nand upload working
@ 2013-10-12  7:47 Bo Shen
  2013-10-12 21:19 ` Lukasz Majewski
  0 siblings, 1 reply; 6+ messages in thread
From: Bo Shen @ 2013-10-12  7:47 UTC (permalink / raw)
  To: u-boot

If won't pass value to dfu->r_left, it always 0, make no transfer,
the dfu-util on host side report failed. So, before starting transfer,
pass the value, then nand uploading can work.

Signed-off-by: Bo Shen <voice.shen@atmel.com>

---
 drivers/dfu/dfu.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 56b21c7..3c3ad1b 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -274,6 +274,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
 		if (dfu->i_buf_start == NULL)
 			return -ENOMEM;
 
+		dfu->r_left = dfu->data.nand.size;
 		ret = dfu->read_medium(dfu, 0, dfu->i_buf_start, &dfu->r_left);
 		if (ret != 0) {
 			debug("%s: failed to get r_left\n", __func__);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-01  1:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-12  7:47 [U-Boot] [RFC PATCH] usb: dfu: make nand upload working Bo Shen
2013-10-12 21:19 ` Lukasz Majewski
2013-10-13 20:50   ` Marek Vasut
2013-10-14  7:25   ` Bo Shen
2013-10-16  9:00     ` Bo Shen
2013-11-01  1:20       ` Bo Shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox