From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] dfu:ext4:fix Fix DFU upload functionality
Date: Fri, 28 Jun 2013 18:41:50 +0200 [thread overview]
Message-ID: <1372437710-6361-2-git-send-email-l.majewski@samsung.com> (raw)
In-Reply-To: <1372437710-6361-1-git-send-email-l.majewski@samsung.com>
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>
---
drivers/dfu/dfu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index e429d74..0521752 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;
--
1.7.10.4
next prev parent reply other threads:[~2013-06-28 16:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 16:41 [U-Boot] [PATCH 1/2] dfu:ext4:fix Fix ext4{read|write} command formatting Lukasz Majewski
2013-06-28 16:41 ` Lukasz Majewski [this message]
2013-07-03 19:33 ` [U-Boot] [U-Boot, 2/2] dfu:ext4:fix Fix DFU upload functionality Tom Rini
2013-07-03 21:49 ` Marek Vasut
2013-07-05 12:48 ` Tom Rini
2013-07-05 13:55 ` Marek Vasut
2013-07-05 14:09 ` Tom Rini
2013-07-05 14:32 ` Marek Vasut
2013-07-05 15:25 ` Lukasz Majewski
2013-07-07 6:43 ` Sumit Gemini
2013-07-08 6:22 ` Lukasz Majewski
2013-07-08 8:59 ` Sumit Gemini
2013-07-08 14:16 ` Tom Rini
2013-07-03 19:33 ` [U-Boot] [U-Boot, 1/2] dfu:ext4:fix Fix ext4{read|write} command formatting Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372437710-6361-2-git-send-email-l.majewski@samsung.com \
--to=l.majewski@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.