From patchwork Wed Jun 5 19:21:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1944137 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GSKI8RGu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvd9d1cczz20WK for ; Thu, 6 Jun 2024 05:40:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 131A6884CA; Wed, 5 Jun 2024 21:37:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GSKI8RGu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8916A8831D; Wed, 5 Jun 2024 21:22:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 106C788369 for ; Wed, 5 Jun 2024 21:22:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ansuelsmth@gmail.com Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4210aa012e5so2699255e9.0 for ; Wed, 05 Jun 2024 12:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717615324; x=1718220124; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=DMtQynVUynIygMJG+HZoR5ODD0Kxq9UV2wpCO2Dk7eU=; b=GSKI8RGuBlaPWcKrxTwOz6Ut/nhcDxRUY23r9iDj51M3qxyiqDTM1ey37+SpYqF8uD PsrSLx3BwfDNUFZ8l+MlJRwhBj4JNro86VzkOMZn/rz7g4SmBrDo6LHrYL2ZIkx1IUXq RGevFXMdFVJv0iOeXU6r3PK2fT8/zT3sWFuRzZtClGar1WqtnYc3TkHx96MbBjyiceEl 5JxbBnG8aT3aCTwmTayRch1cPvHev1kckGbjmfrUHls5bGu8PfnECFVBFRGDkfnIxyc2 h6L34ZlFiZUauBPUZVipRY0E+dsMO/bD3M3IzV1WkCO01c45jveUayHVAQkcHnKGWczV WzxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717615324; x=1718220124; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DMtQynVUynIygMJG+HZoR5ODD0Kxq9UV2wpCO2Dk7eU=; b=vbZvHL3UbvCuAbVptFvI9lNtgACmYYI5mFEY93glRvyLHepinWC4AyuqjzIg3euRKp 5u0HyOpcWoQ5pRijkVIdQsyAgWxVLhMZJg9g9ikmm+5o+Ym9xO+XOHMVQ9Fe9s1ahnid smpS54Twbj05xAsybmOQ3ReK0r4VAPYhdyQnIeIS0IWRIKfGKZQSOl0p42+MiWUg7kXo 8XR/KW/rKOCEHs3QVW9pzuTyIWfPSnwJxKYphaqnkCL0F557FW7vVPoaa0y7dimdUXzN sT7oFHjjdKjNI0te0pSLiNgaZE4emcOgpd/WLHXlY3pLRsFinBdXh6Z/F9rlCe1m/yIw kXPQ== X-Forwarded-Encrypted: i=1; AJvYcCUuF/dy5q+F6pqJsvlyScUaQYrA+ai7je5Ey8Fg3p80RSr4CLLeDL2QLRS7zWNOc68UPa5FPDtnvNvDOgjH8Mv9+I5Fsg== X-Gm-Message-State: AOJu0YwDiRsQc0hWw4Jmyoo6fHMkoCHQ9+Nm+UrqbA5YPlqRH+3M1gJo 3HYIiZ948Wj6hfVYOdKbfg81nVpmQRJBq5t3Jlr8CkJ0Zz3ZUS4b X-Google-Smtp-Source: AGHT+IF/DLKpxiFUV75gz22btwZA5UcxYrHoZb3JmMGS3S6+dahFuKAktbgTaShNUPBrB/VsohhVog== X-Received: by 2002:a05:600c:4ed1:b0:421:54f7:c294 with SMTP id 5b1f17b1804b1-4215632d74fmr29771825e9.29.1717615324462; Wed, 05 Jun 2024 12:22:04 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4214bf5994csm36079625e9.1.2024.06.05.12.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 12:22:04 -0700 (PDT) From: Christian Marangi To: Tom Rini , Dario Binacchi , Michael Trimarchi , Frieder Schrempf , Jagan Teki , Vignesh R , Joe Hershberger , Ramon Fried , Christian Marangi , Arseniy Krasnov , Miquel Raynal , Simon Glass , Heinrich Schuchardt , Dmitry Dunaev , Devarsh Thakkar , Bin Meng , Eugene Uriev , Nikhil M Jain , Shiji Yang , Raymond Mao , Rasmus Villemoes , Doug Zobel , William Zhang , Mikhail Kshevetskiy , Igor Prusov , Bruce Suen , Takahiro Kuwano , Pratyush Yadav , Venkatesh Yadav Abbarapu , Vaishnav Achath , AKASHI Takahiro , u-boot@lists.denx.de Subject: [PATCH 5/7] tftp: implement support for LED status activity Date: Wed, 5 Jun 2024 21:21:37 +0200 Message-ID: <20240605192146.19052-6-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605192146.19052-1-ansuelsmth@gmail.com> References: <20240605192146.19052-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 05 Jun 2024 21:37:35 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Implement support for LED status activity. If the feature is enabled, make the defined ACTIVITY LED to signal traffic. Signed-off-by: Christian Marangi --- net/tftp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/net/tftp.c b/net/tftp.c index 2e335413492..07dea321bb4 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -19,6 +19,7 @@ #include #include #include "bootp.h" +#include DECLARE_GLOBAL_DATA_PTR; @@ -193,6 +194,10 @@ static void new_transfer(void) #ifdef CONFIG_CMD_TFTPPUT tftp_put_final_block_sent = 0; #endif +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_set(CONFIG_LED_STATUS_ACTIVITY, + CONFIG_LED_STATUS_BLINKING); +#endif } #ifdef CONFIG_CMD_TFTPPUT @@ -228,6 +233,10 @@ static void show_block_marker(void) { ulong pos; +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_activity(CONFIG_LED_STATUS_ACTIVITY); +#endif + #ifdef CONFIG_TFTP_TSIZE if (tftp_tsize) { pos = tftp_cur_block * tftp_block_size + @@ -290,6 +299,9 @@ static void tftp_complete(void) /* Print hash marks for the last packet received */ while (tftp_tsize && tftp_tsize_num_hash < 49) { putc('#'); +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_activity(CONFIG_LED_STATUS_ACTIVITY); +#endif tftp_tsize_num_hash++; } puts(" "); @@ -302,6 +314,10 @@ static void tftp_complete(void) time_start * 1000, "/s"); } puts("\ndone\n"); +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_set(CONFIG_LED_STATUS_ACTIVITY, + CONFIG_LED_STATUS_OFF); +#endif if (!tftp_put_active) efi_set_bootdev("Net", "", tftp_filename, map_sysmem(tftp_load_addr, 0),