[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-268-g507ac45
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2014-05-29 21:58:12
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 507ac454a6761f71bb4312facb1bfaae4f4098db (commit)
from 3809a7fa8a86e698225ab0c2cd3bd065b647d233 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 507ac454a6761f71bb4312facb1bfaae4f4098db
Author: Eric Jarrige <eri...@ar...>
Date: Thu May 29 23:57:55 2014 +0200
[UBOOT] 2014.04: Fix tftp direct download to NAND flash
-----------------------------------------------------------------------
Summary of changes:
.../2014.04/350-nand_large_file_download.patch | 36 ++++++++++++++++---
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/patches/u-boot/2014.04/350-nand_large_file_download.patch b/patches/u-boot/2014.04/350-nand_large_file_download.patch
index c6ed8e2..25c80f1 100644
--- a/patches/u-boot/2014.04/350-nand_large_file_download.patch
+++ b/patches/u-boot/2014.04/350-nand_large_file_download.patch
@@ -100,18 +100,40 @@ index 59a8ebb..727e746 100644
/*
* TFTP operations.
*/
-@@ -156,12 +166,96 @@ mcast_cleanup(void)
+@@ -156,12 +166,120 @@ mcast_cleanup(void)
#endif /* CONFIG_MCAST_TFTP */
+#if defined(CONFIG_CMD_NAND) && defined(CONFIG_SYS_DIRECT_FLASH_TFTP)
++static size_t drop_ffs(const nand_info_t *nand, const u_char *buf,
++ const size_t *len)
++{
++ size_t l = *len;
++ ssize_t i;
++
++ for (i = l - 1; i >= 0; i--)
++ if (buf[i] != 0xFF)
++ break;
++
++ /* The resulting length must be aligned to the minimum flash I/O size */
++ l = i + 1;
++ l = (l + nand->writesize - 1) / nand->writesize;
++ l *= nand->writesize;
++
++ /*
++ * since the input length may be unaligned, prevent access past the end
++ * of the buffer
++ */
++ return min(l, *len);
++}
++
+static int tftp_nand_write(nand_info_t *meminfo, uchar *src, unsigned long *offset, size_t *length )
+{
+/* size_t written ;*/
+ int ret = 0;
+ loff_t offs;
+ int blockstart = -1;
-+
++ size_t truncated_write_size;
+ /* find first non bad block */
+ do {
+ blockstart = (*offset) & (~meminfo->erasesize+1);
@@ -132,14 +154,16 @@ index 59a8ebb..727e746 100644
+ }
+ } while ((ret!=0) && (*offset < meminfo->size) );
+
-+ if (*offset < meminfo->size)
-+ /* write out the page data */
-+ ret = nand_write(meminfo, *offset, length, src);
-+/* ret = meminfo->write(meminfo,
++ if (*offset < meminfo->size) {
++ /* write out the page data */
++ truncated_write_size = drop_ffs(meminfo, src, length);
++ ret = nand_write(meminfo, *offset, &truncated_write_size, src);
++/* ret = meminfo->write(meminfo,
+ *offset,
+ meminfo->oobblock,
+ &written,
+ src);*/
++ }
+ if (ret != 0) {
+ printf("writing NAND page at offset 0x%lx failed\n",
+ *offset);
hooks/post-receive
--
armadeus
|