summaryrefslogtreecommitdiff
path: root/drivers/dfu/dfu_mmc.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2017-07-19 14:39:23 (GMT)
committerMarek Vasut <marex@denx.de>2017-07-28 21:34:39 (GMT)
commit15970d871c299c8a4218911ee68edb0495a69cd4 (patch)
treef8f31f420ca9e3f4f1ec4be3cc568303c59f833d /drivers/dfu/dfu_mmc.c
parent4de512018ba7d57f1672be21c7459281f7c97514 (diff)
downloadu-boot-15970d871c299c8a4218911ee68edb0495a69cd4.tar.xz
dfu: remove limitation on partition size
Change long (32 bits on arm) to u64 (same type than offset) for size and read offset r_left So partition and device used for DFU can be greater than 4GB Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/dfu/dfu_mmc.c')
-rw-r--r--drivers/dfu/dfu_mmc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index d918f95..bb23e7f 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -17,7 +17,7 @@
#include <mmc.h>
static unsigned char *dfu_file_buf;
-static long dfu_file_buf_len;
+static u64 dfu_file_buf_len;
static long dfu_file_buf_filled;
static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
@@ -107,7 +107,7 @@ static int mmc_file_buffer(struct dfu_entity *dfu, void *buf, long *len)
}
static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
- void *buf, long *len)
+ void *buf, u64 *len)
{
const char *fsname, *opname;
char cmd_buf[DFU_CMD_BUF_SIZE];
@@ -150,7 +150,7 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
sprintf(cmd_buf + strlen(cmd_buf), " %s", dfu->name);
if (op == DFU_OP_WRITE)
- sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len);
+ sprintf(cmd_buf + strlen(cmd_buf), " %llx", *len);
debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
@@ -209,7 +209,7 @@ int dfu_flush_medium_mmc(struct dfu_entity *dfu)
return ret;
}
-int dfu_get_medium_size_mmc(struct dfu_entity *dfu, long *size)
+int dfu_get_medium_size_mmc(struct dfu_entity *dfu, u64 *size)
{
int ret;
@@ -237,7 +237,7 @@ static int mmc_file_unbuffer(struct dfu_entity *dfu, u64 offset, void *buf,
long *len)
{
int ret;
- long file_len;
+ u64 file_len;
if (dfu_file_buf_filled == -1) {
ret = mmc_file_op(DFU_OP_READ, dfu, dfu_file_buf, &file_len);