Hi Heiko,

Just thinking out loud here. Can we have an extra option that
allocates the buffer dynamically based on an env variable?

Regards

-- Pantelis

On Jun 4, 2013, at 12:22 PM, Heiko Schocher wrote:

> Dfu transfer uses a buffer before writing data to the
> raw storage device. Make the size (in bytes) of this buffer
> configurable.
> 
> Signed-off-by: Heiko Schocher <h...@denx.de>
> Cc: Pantelis Antoniou <pa...@antoniou-consulting.com>
> Cc: Tom Rini <tr...@ti.com>
> Cc: Lukasz Majewski <l.majew...@samsung.com>
> Cc: Kyungmin Park <kyungmin.p...@samsung.com>
> Cc: Marek Vasut <ma...@denx.de>
> ---
> README            | 5 +++++
> drivers/dfu/dfu.c | 2 +-
> include/dfu.h     | 4 +++-
> 3 Dateien geändert, 9 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
> 
> diff --git a/README b/README
> index b1b3e17..8550f34 100644
> --- a/README
> +++ b/README
> @@ -1360,6 +1360,11 @@ The following options need to be configured:
>               CONFIG_DFU_NAND
>               This enables support for exposing NAND devices via DFU.
> 
> +             CONFIG_SYS_DFU_DATA_BUF_SIZE
> +             Dfu transfer uses a buffer before writing data to the
> +             raw storage device. Make the size (in bytes) of this buffer
> +             configurable.
> +
>               CONFIG_SYS_DFU_MAX_FILE_SIZE
>               When updating files rather than the raw storage device,
>               we use a static buffer to copy the file into and then write
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 6af6890..fe3a36e 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -42,7 +42,7 @@ static int dfu_find_alt_num(const char *s)
> }
> 
> static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)
> -                                  dfu_buf[DFU_DATA_BUF_SIZE];
> +                                  dfu_buf[CONFIG_SYS_DFU_DATA_BUF_SIZE];
> 
> static int dfu_write_buffer_drain(struct dfu_entity *dfu)
> {
> diff --git a/include/dfu.h b/include/dfu.h
> index a107f4b..124653c 100644
> --- a/include/dfu.h
> +++ b/include/dfu.h
> @@ -68,7 +68,9 @@ static inline unsigned int get_mmc_blk_size(int dev)
> 
> #define DFU_NAME_SIZE                 32
> #define DFU_CMD_BUF_SIZE              128
> -#define DFU_DATA_BUF_SIZE            (1024*1024*8)   /* 8 MiB */
> +#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
> +#define CONFIG_SYS_DFU_DATA_BUF_SIZE         (1024*1024*8)   /* 8 MiB */
> +#endif
> #ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE
> #define CONFIG_SYS_DFU_MAX_FILE_SIZE  (4 << 20)       /* 4 MiB */
> #endif
> -- 
> 1.7.11.7
> 

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to