public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] dfu: make data buffer size configurable
@ 2013-06-04  9:22 Heiko Schocher
  2013-06-04 10:08 ` Pantelis Antoniou
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Heiko Schocher @ 2013-06-04  9:22 UTC (permalink / raw)
  To: u-boot

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 <hs@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Tom Rini <trini@ti.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-06-19 12:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04  9:22 [U-Boot] dfu: make data buffer size configurable Heiko Schocher
2013-06-04 10:08 ` Pantelis Antoniou
2013-06-04 10:31   ` Heiko Schocher
2013-06-04 10:31     ` Pantelis Antoniou
2013-06-09 20:01       ` Marek Vasut
2013-06-10  4:28         ` Heiko Schocher
2013-06-10  5:48           ` Lukasz Majewski
2013-06-10  7:05           ` Wolfgang Denk
2013-06-10 15:51             ` Tom Rini
2013-06-12  8:36               ` Marek Vasut
2013-06-12  8:49                 ` Heiko Schocher
2013-06-04 10:18 ` Lukasz Majewski
2013-06-04 20:04 ` Tom Rini
2013-06-05  4:53   ` Heiko Schocher
2013-06-05 12:43     ` Tom Rini
2013-06-05 14:04       ` Heiko Schocher
2013-06-06 15:55         ` Tom Rini
2013-06-07  6:05           ` Heiko Schocher
2013-06-07  7:28             ` Wolfgang Denk
2013-06-12  4:05 ` [U-Boot] [PATCH v2] " Heiko Schocher
2013-06-12 16:16   ` Tom Rini
2013-06-19 12:25   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox