summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-07-11 16:40:04 -0500
committerJohn Klug <john.klug@multitech.com>2017-07-11 16:40:04 -0500
commit87fdfe064f88bbc6941384027ee827d035fa10ff (patch)
treee5639270321734f421c465760d90add17f3d609a /recipes-bsp/u-boot
parente455c420711d189fa2d0b9e987fbe0e386e32202 (diff)
downloadmeta-multitech-atmel-87fdfe064f88bbc6941384027ee827d035fa10ff.tar.gz
meta-multitech-atmel-87fdfe064f88bbc6941384027ee827d035fa10ff.tar.bz2
meta-multitech-atmel-87fdfe064f88bbc6941384027ee827d035fa10ff.zip
Fix tftpput in u-boot so it works with large files
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch28
-rw-r--r--recipes-bsp/u-boot/u-boot_2016.09.01.bb3
2 files changed, 30 insertions, 1 deletions
diff --git a/recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch b/recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch
new file mode 100644
index 0000000..b5e419f
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-2016.09.01/tftpput.patch
@@ -0,0 +1,28 @@
+/*
+ * tftpput in u-boot has two issues. It never resets the timeout, so
+ * tftpput must complete within the timeout perious (by defaut 5 seconds)
+ * and it does not properly handle the block wrap at 65535 back to zero,
+ * so it will transmit data forever, or at least a very long time, if
+ * the timeout is set long enough, or the timeout issue is patched by
+ * itself.
+ */
+diff -Naru old/net/tftp.c new/net/tftp.c
+--- old/net/tftp.c 2017-07-05 15:52:28.865818329 -0500
++++ new/net/tftp.c 2017-07-11 16:15:27.870430395 -0500
+@@ -499,10 +499,15 @@
+ int block = ntohs(*s);
+ int ack_ok = (tftp_cur_block == block);
+
++ /* update_block_number needs tftp_prev_block */
++ tftp_prev_block = tftp_cur_block;
+ tftp_cur_block = (unsigned short)(block + 1);
+ update_block_number();
+- if (ack_ok)
++ if (ack_ok) {
++ /* We got the ACK, so reset the timeout */
++ net_set_timeout_handler(timeout_ms, tftp_timeout_handler);
+ tftp_send(); /* Send next data block */
++ }
+ }
+ }
+ #endif
diff --git a/recipes-bsp/u-boot/u-boot_2016.09.01.bb b/recipes-bsp/u-boot/u-boot_2016.09.01.bb
index 3d0f4a1..a7281a4 100644
--- a/recipes-bsp/u-boot/u-boot_2016.09.01.bb
+++ b/recipes-bsp/u-boot/u-boot_2016.09.01.bb
@@ -8,7 +8,8 @@ SRC_URI = "ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
file://i2c.patch \
file://macb.patch \
file://printeepromcrc.patch \
- file://mtpwd.patch"
+ file://mtpwd.patch \
+ file://tftpput.patch"
SRC_URI_append_mtcdt = " \
file://mtcdt.patch"