]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tftp: implement support for LED activity
authorChristian Marangi <ansuelsmth@gmail.com>
Tue, 1 Oct 2024 12:24:39 +0000 (14:24 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 10 Oct 2024 22:02:20 +0000 (16:02 -0600)
Implement support for LED activity. If the feature is enabled,
make the defined ACTIVITY LED to signal traffic.

Also turn the ACTIVITY LED OFF if a CTRL-C is detected in the main
net loop function.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
net/net.c
net/tftp.c

index 1e0b7c856244db09ebd45fe6305598fdcc134958..bc16f0d0cead16cf734fcb2d81566784279b81a9 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -87,6 +87,7 @@
 #include <env_internal.h>
 #include <errno.h>
 #include <image.h>
+#include <led.h>
 #include <log.h>
 #include <net.h>
 #include <net6.h>
@@ -664,6 +665,9 @@ restart:
                        /* Invalidate the last protocol */
                        eth_set_last_protocol(BOOTP);
 
+                       /* Turn off activity LED if triggered */
+                       led_activity_off();
+
                        puts("\nAbort\n");
                        /* include a debug print as well incase the debug
                           messages are directed to stderr */
index d6744bc24e227f6c127eef8f1e5ba1d9118b512d..704b20b4ff87d325017ee2a2994239c6b81f6991 100644 (file)
@@ -10,6 +10,7 @@
 #include <efi_loader.h>
 #include <env.h>
 #include <image.h>
+#include <led.h>
 #include <lmb.h>
 #include <log.h>
 #include <mapmem.h>
@@ -185,6 +186,7 @@ static void new_transfer(void)
 #ifdef CONFIG_CMD_TFTPPUT
        tftp_put_final_block_sent = 0;
 #endif
+       led_activity_blink();
 }
 
 #ifdef CONFIG_CMD_TFTPPUT
@@ -294,6 +296,9 @@ static void tftp_complete(void)
                        time_start * 1000, "/s");
        }
        puts("\ndone\n");
+
+       led_activity_off();
+
        if (!tftp_put_active)
                efi_set_bootdev("Net", "", tftp_filename,
                                map_sysmem(tftp_load_addr, 0),