aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-11-03 09:52:37 -0400
committerTom Rini <trini@konsulko.com>2023-11-03 09:52:37 -0400
commit563142350fee5bdd483a0cf00169d8272b60022f (patch)
tree0eadcce9faf66a2366757444afe86f5458c4e31b
parent1e044a9bd68220af562cc2d895936ec7cc3e3d6d (diff)
parent60d904a494c6e89c323bc13fa9348869e07e86d3 (diff)
downloadu-boot-563142350fee5bdd483a0cf00169d8272b60022f.zip
u-boot-563142350fee5bdd483a0cf00169d8272b60022f.tar.gz
u-boot-563142350fee5bdd483a0cf00169d8272b60022f.tar.bz2
Merge tag 'u-boot-dfu-20231103' of https://source.denx.de/u-boot/custodians/u-boot-dfu
u-boot-dfu-20231103 - Fix CRC chunk size in fastboot - Make size optional for dfu on mmc
-rw-r--r--doc/usage/dfu.rst5
-rw-r--r--drivers/dfu/dfu_mmc.c10
-rw-r--r--lib/image-sparse.c4
3 files changed, 17 insertions, 2 deletions
diff --git a/doc/usage/dfu.rst b/doc/usage/dfu.rst
index 68cacbb..8845a71 100644
--- a/doc/usage/dfu.rst
+++ b/doc/usage/dfu.rst
@@ -121,6 +121,11 @@ mmc
with
+ offset
+ is the offset in the device (hexadecimal without "0x")
+ size
+ is the size of the access area (hexadecimal without "0x")
+ or 0 which means whole device
partid
being the GPT or DOS partition index,
num
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index cdb3c18..12c54e9 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -387,6 +387,16 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char **argv, int a
dfu->data.mmc.lba_blk_size = mmc->read_bl_len;
/*
+ * In case the size is zero (i.e. mmc raw 0x10 0),
+ * assume the user intends to use whole device.
+ */
+ if (third_arg == 0) {
+ struct blk_desc *blk_dev = mmc_get_blk_desc(mmc);
+
+ dfu->data.mmc.lba_size = blk_dev->lba;
+ }
+
+ /*
* Check for an extra entry at dfu_alt_info env variable
* specifying the mmc HW defined partition number
*/
diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index 8f8a67e..323aad9 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -289,8 +289,8 @@ int write_sparse_image(struct sparse_storage *info,
case CHUNK_TYPE_CRC32:
if (chunk_header->total_sz !=
- sparse_header->chunk_hdr_sz) {
- info->mssg("Bogus chunk size for chunk type Dont Care",
+ sparse_header->chunk_hdr_sz + sizeof(uint32_t)) {
+ info->mssg("Bogus chunk size for chunk type CRC32",
response);
return -1;
}