From patchwork Tue Jun 4 09:22:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 248514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 140D42C008A for ; Tue, 4 Jun 2013 19:23:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C80434A11C; Tue, 4 Jun 2013 11:23:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 81MZrR4x9tua; Tue, 4 Jun 2013 11:23:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E7E34A03C; Tue, 4 Jun 2013 11:23:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B0B34A107 for ; Tue, 4 Jun 2013 11:23:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5RVe68XlJJYs for ; Tue, 4 Jun 2013 11:22:55 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from pollux.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by theia.denx.de (Postfix) with ESMTP id 8D1074A100 for ; Tue, 4 Jun 2013 11:22:55 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 2E8C17F7E; Tue, 4 Jun 2013 11:22:55 +0200 (CEST) From: Heiko Schocher To: u-boot@lists.denx.de Date: Tue, 4 Jun 2013 11:22:54 +0200 Message-Id: <1370337774-16768-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.7.11.7 MIME-Version: 1.0 Cc: Marek Vasut , Pantelis Antoniou , Kyungmin Park , Tom Rini , Heiko Schocher Subject: [U-Boot] =?utf-8?q?dfu=3A_make_data_buffer_size_configurable?= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Cc: Pantelis Antoniou Cc: Tom Rini Cc: Lukasz Majewski Cc: Kyungmin Park Cc: Marek Vasut Acked-by: Lukasz Majewski --- 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