mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
dfu: mmc: Add support for exposing whole mmc device
Add support for exposing the whole mmc device by setting the 'size' parameter to 0. This can be useful in case it is not clear what the total device size is up front. Update the documentation accordingly. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Link: https://lore.kernel.org/r/20231029223740.284149-1-marex@denx.de Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
355aab94d1
commit
60d904a494
2 changed files with 15 additions and 0 deletions
|
@ -121,6 +121,11 @@ mmc
|
||||||
|
|
||||||
with
|
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
|
partid
|
||||||
being the GPT or DOS partition index,
|
being the GPT or DOS partition index,
|
||||||
num
|
num
|
||||||
|
|
|
@ -386,6 +386,16 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char **argv, int a
|
||||||
dfu->data.mmc.lba_size = third_arg;
|
dfu->data.mmc.lba_size = third_arg;
|
||||||
dfu->data.mmc.lba_blk_size = mmc->read_bl_len;
|
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
|
* Check for an extra entry at dfu_alt_info env variable
|
||||||
* specifying the mmc HW defined partition number
|
* specifying the mmc HW defined partition number
|
||||||
|
|
Loading…
Add table
Reference in a new issue