[U-Boot] [PATCH 4/7] dfu: MMC specific routines for DFU operation
Marek Vasut
marex at denx.de
Tue Jul 3 23:29:31 CEST 2012
Dear Lukasz Majewski,
> Support for MMC storage devices to work with DFU framework.
>
> Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> Cc: Marek Vasut <marex at denx.de>
> ---
[...]
> +
> +#include <common.h>
> +#include <malloc.h>
> +#include <dfu.h>
> +
> +int dfu_write_medium_mmc(struct dfu_entity *dfu, void *buf, long *len)
> +{
> + ALLOC_CACHE_ALIGN_BUFFER(char, cmd_buf, DFU_CMD_BUF_SIZE);
> +
> + memset(cmd_buf, '\0', sizeof(cmd_buf));
> +
> + switch (dfu->layout) {
> + case RAW_ADDR:
> + sprintf(cmd_buf, "mmc write 0x%x %x %x", (unsigned int) buf,
> + dfu->data.mmc.lba_start, dfu->data.mmc.lba_size);
> + break;
> + case FAT:
> + sprintf(cmd_buf, "fatwrite mmc %d:%d 0x%x %s %lx",
> + dfu->data.mmc.dev, dfu->data.mmc.part,
> + (unsigned int) buf, dfu->name, *len);
> + break;
> + default:
> + printf("%s: Wrong layout!\n", __func__);
> + }
> +
> + debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
> + run_command(cmd_buf, 0);
Holy Moly ... can we not make this into simple calls to those subsystems ?
Instead invoking command is crazy ;-)
[...]
Best regards,
Marek Vasut
More information about the U-Boot
mailing list