aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorƁukasz Majewski2013-06-28 18:41:50 +0200
committerTom Rini2013-07-03 08:41:23 -0400
commit9df49553a462f38341d2613f2635064f34f156a0 (patch)
tree7cc0ed86ef57d9163c5edb9f59081eaac69fb94d
parent051f9a3eedb13eb29151917e38231e37a4383fe5 (diff)
dfu:ext4:fix Fix DFU upload functionality
For the first eMMC read of data for upload, use the "large" dfu_buf (now configurable) instead of usb request buffer allocated at composite layer (which is 4KiB) [*]. For eMMC the whole file is read, which usually is larger than the buffer [*] provided with usb request. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Tom Rini <trini@ti.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Marek Vasut <marex@denx.de> Cc: Heiko Schocher <hs@denx.de>
-rw-r--r--drivers/dfu/dfu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index e429d7479fb..05217526bec 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -248,7 +248,11 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
__func__, dfu->name, buf, size, blk_seq_num, dfu->i_buf);
if (!dfu->inited) {
- ret = dfu->read_medium(dfu, 0, buf, &dfu->r_left);
+ dfu->i_buf_start = dfu_get_buf();
+ if (dfu->i_buf_start == NULL)
+ return -ENOMEM;
+
+ 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__);
return ret;
@@ -259,9 +263,6 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
dfu->i_blk_seq_num = 0;
dfu->crc = 0;
dfu->offset = 0;
- dfu->i_buf_start = dfu_get_buf();
- if (dfu->i_buf_start == NULL)
- return -ENOMEM;
dfu->i_buf_end = dfu_get_buf() + dfu_buf_size;
dfu->i_buf = dfu->i_buf_start;
dfu->b_left = 0;