From: Lukasz Majewski Date: Tue, 04 Jun 2013 12:18:14 +0200 Subject: [U-Boot] dfu: make data buffer size configurable In-Reply-To: <1370337774-16768-1-git-send-email-hs@denx.de> References: <1370337774-16768-1-git-send-email-hs@denx.de> Message-ID: <20130604121814.551b9355@amdc308.digital.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Heiko, > Dfu transfer uses a buffer before writing data to the > raw storage device. Make the size (in bytes) of this buffer > configurable. > Acked-by: Lukasz Majewski > Signed-off-by: Heiko Schocher > Cc: Pantelis Antoniou > Cc: Tom Rini > Cc: Lukasz Majewski > Cc: Kyungmin Park > Cc: Marek Vasut > --- > 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 -- Best regards, Lukasz Majewski Samsung R&D Poland Institute (SRPOL) | Linux Platform Group