mmc-utils: ffu: Allow ffu of large images

ffu is done using a single multi-ioctl to carry the entire firmware
image. This is limiting the fw image size to be at most 512KB, as the
mmc driver restricts each single ioc data to be at most
MMC_IOC_MAX_BYTES.

the spec however, allows the fw image to be written using multiple write
commands.

To overcome this limitation, if the fw image is larger than 512KB,
split it into a series of 512KB chunks.

fixes: 1b8b13beb424 (mmc-utils: let FFU mode use CMD23 and CMD25)
Reported-by: Lund Austin <Austin.Lund@garmin.com>
Tested-by: Lund Austin <Austin.Lund@garmin.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230625103814.105-6-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 file changed