From patchwork Tue Jun 17 10:03:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897350 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061048wrc; Tue, 17 Jun 2025 03:07:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXCqvZSBPWD0EjWyXFHyh/EybqDNMbqt67EJxxnpgv8Z3CwJBwsgbuhFU+VkY8B65Fift7mew==@linaro.org X-Google-Smtp-Source: AGHT+IHaBGJT6aJuY7/XMnbu6bdl/ozPKheywOVfFeUp3Zem+EASEaaIEketsOgaBo1kMkk/vDt4 X-Received: by 2002:ad4:5e87:0:b0:6fa:cb97:9722 with SMTP id 6a1803df08f44-6fb477ecd1emr183275986d6.34.1750154868708; Tue, 17 Jun 2025 03:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154868; cv=none; d=google.com; s=arc-20240605; b=lUhOqz9Q2CQIbxLyAAUJPY53miyI6xfrC8yjARh+tJMiEec4sbsa5MrNsalmIIf3hL 79kOHaGrMUWr+1Z8mn4YyKUO9zwGhjU7AuI+xr9HDnAOW/aaYJqpiCpEflhemb7T8SZS p63IvvKfpDIvJKOOg9Jq2J0f8ypmFQ5XXN59mvPq3guvfvwKZxEttm8Z6TlgfvzI9ksl I5DFPO0cNm8OeW3TxsiBuMl7No74RBoa0EgoKmTF/pYBqCBETi2Xm7q7B3B6wDBN07/o vOoROU+YEisByyvsO2IpZFXtAV60ZfLX5IuQkVStjkdmid/OOUro1E6L9krsZ819riuM qcvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B/ySdy1n6AgDC7NIfoWPUsAgLrYrc7+o/jJcNrR0Sb4=; fh=SaRt7jmIQ8IaazYOaoOXl1I3O1/3fElm3a6j0U4lRh4=; b=JY1lEZ4SdGSapIu/VWfYUqNn4DC08Qlyo/T/dK9XJhRMl/IJSmdWNf+px+laaxpLUG rJOTd+aLmI4XgpT7E1Vb8zKEx7GFck0bamXtkaxq8YzMBlpE029bLVQE6gQkFuRhXCe8 mb7yRM0MFt39ydDkurfzU4n7IC4julYGcK8NiyUqCvRfAUmfsFySR5wyHywklXcsaB26 0VGTENw/ob/UAomQAnIsRnN3akIa2xExWvGwjiPwF554+0KDD2zRTztvaNqXkHq6/wvY BIK0kbvHHVkuszA055t+ZewwpRd1gj361O9y590qFYBdQJ4qXxDqEmXIX3+cJYjY/MEz 8RvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TqkZvvie; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 6a1803df08f44-6fb35c008dbsi125062426d6.300.2025.06.17.03.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:48 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TqkZvvie; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B0BC682CBB; Tue, 17 Jun 2025 12:07:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="TqkZvvie"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E009680C83; Tue, 17 Jun 2025 12:07:45 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 EDD6C82B20 for ; Tue, 17 Jun 2025 12:07:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a375e72473so3057705f8f.0 for ; Tue, 17 Jun 2025 03:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154863; x=1750759663; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B/ySdy1n6AgDC7NIfoWPUsAgLrYrc7+o/jJcNrR0Sb4=; b=TqkZvviegCv6LQ0BVPAMmy337HLEsO6H3bVqGvhKzJ+ZVPvbtQ8419o5wy+0FL4f0R sKWW+2HvsyArrnMCjcOOaxlHWkgjMrdhB+W02ONxjRlczOjtVivieKSZlLZMDh8okESg 80SSjINEp4roO8Te8S/AZ5YQ+wp4uZMe4uJqP4A3dMGeCArpnAMNUnxPYyBeOiRHYTRX orZuUOn9teg0xV0tJeX8S8EHpwrXDfPQGTTaGcL95WyYNK4HZq4SFyj97nMQwTQPu4or bt2jzUv1ymSpbBERnfKGXHniEXzDcBcio1tO0FGksOHhzWI73+xU+FMb097BELkXIzed 18QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154863; x=1750759663; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B/ySdy1n6AgDC7NIfoWPUsAgLrYrc7+o/jJcNrR0Sb4=; b=qVMgbIhwTZRnpgHvbRQ5S/iafgy1chc5l7RM7M3ZZ4TXMFt3wBVf30zNiUk9RqKfEW sQGPRWa+Mu99Qqx/qFT0qLphx05bf/s0FZyyNAWcRuU/ejdbDkHmmNlmZswB4zWAsyE8 bzedK0W7elKihXVWPrrlP1J0Y649/GSOeelJlcamOIIJ0dxYv6sK2rgSfIK5ohwtNX8x TkTht/ze2MvdkLy8pHcMPWMZlwd4SJYe3vHl5M7YN8nsliL1YPn/mAW6KmbsgRXwutHg k320bow1aRDzMacxOA0Yl5rk3ICkqS6i6NQE3NLMAMNAkOUvZKiRBFGO+7pEQ8bTQ78u SAiQ== X-Gm-Message-State: AOJu0YxLX2rtn+ucYFB/iXeC62alAu4RsiW17rqca7jicuujWr3RlF70 pp5V81du2RjI0Bynw7MW1FagZX/pVUrIhyVGuINRhxpdylV3P7316jjzjQhxm46yz6kMB5SQJqD 3RvxT X-Gm-Gg: ASbGncvlBBQIXIBuZ7r31SDkHau4hcyWY7aMVHfxdiZ+4tbUU5p3SMS1d5ZAWcmMwuu 8b3lFPs7/7m7RGSe4Nn5whgLb3rYFk8ffvCFGB8rJtfQvll3GKsVhq8qTgHEJavVKL0Cx55Ju66 0/RWKABs5RRw6lUExga2Fzd/wzcWhqyxsR5/BGIXcxWLvAnfkqCdlFq70FbV5HZMlcpn4HmvYw7 aGKxfZUa8gMv5rWh/UKmEvsggVfamVcyf3JflSnuRC4xOSDJ5lqJRzEAbckZ9/0zAkMyvvXN/Db GN6ZOobSHjFYGlS3o6T7C9Mm316ygtD7MMiicIE2ZssZuDmJrytWVgHtI87RdgZ5WZPGbyc= X-Received: by 2002:a05:6000:1887:b0:3a4:e393:11e2 with SMTP id ffacd0b85a97d-3a5723a22d6mr10853294f8f.34.1750154863177; Tue, 17 Jun 2025 03:07:43 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:42 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Tom Rini Subject: [PATCH v3 01/13] lwip: remove net/lwip/eth_internal.h Date: Tue, 17 Jun 2025 12:03:51 +0200 Message-ID: <20250617100720.2544758-2-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 net/lwip/eth_internal.h is not used. Remove it. Signed-off-by: Jerome Forissier --- (no changes since v2) Changes in v2: - New patch net/lwip/eth_internal.h | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 net/lwip/eth_internal.h diff --git a/net/lwip/eth_internal.h b/net/lwip/eth_internal.h deleted file mode 100644 index 87561d5b214..00000000000 --- a/net/lwip/eth_internal.h +++ /dev/null @@ -1,35 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2001-2015 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * Joe Hershberger, National Instruments - */ - -#ifndef __ETH_INTERNAL_H -#define __ETH_INTERNAL_H - -/* Do init that is common to driver model and legacy networking */ -void eth_common_init(void); - -/** - * eth_env_set_enetaddr_by_index() - set the MAC address environment variable - * - * This sets up an environment variable with the given MAC address (@enetaddr). - * The environment variable to be set is defined by <@base_name><@index>addr. - * If @index is 0 it is omitted. For common Ethernet this means ethaddr, - * eth1addr, etc. - * - * @base_name: Base name for variable, typically "eth" - * @index: Index of interface being updated (>=0) - * @enetaddr: Pointer to MAC address to put into the variable - * Return: 0 if OK, other value on error - */ -int eth_env_set_enetaddr_by_index(const char *base_name, int index, - uchar *enetaddr); - -int eth_mac_skip(int index); -void eth_current_changed(void); -void eth_set_dev(struct udevice *dev); -void eth_set_current_to_next(void); - -#endif From patchwork Tue Jun 17 10:03:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897351 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061113wrc; Tue, 17 Jun 2025 03:07:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVP3yaXhF6uskq8EuEvkWtbKJveVPHDztFkmxOOVjta5YJbUOynPjH3vflIg4f4HOYEVt76Qw==@linaro.org X-Google-Smtp-Source: AGHT+IGuh4dTTn1/U2uy9LbUP8rh5U5iZ5GH8Tqmvpy8Kb7jdhR37CGRLV7FLudQymLyKza3eciI X-Received: by 2002:a05:622a:11c1:b0:476:7199:4da1 with SMTP id d75a77b69052e-4a73c5ed5bemr196559531cf.46.1750154878290; Tue, 17 Jun 2025 03:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154878; cv=none; d=google.com; s=arc-20240605; b=NrJbA5/O7m9012P7xHrj6WPJdUc9/G6cxEFPjP3LPwK0I3rv4yTnwdRRHoF0CgHUaR Z0c9IACD+2/MIcyTcLBpayqS8XvWDIq5laz7HwDy4Ba8EFXK42TWwaMAIwJ/OSH80wGa vWqhEWDb22xo/4gc5bXdar6bbJet4lkNZMXe48KclLjshJ21E3jzDR6m00U7LPS+2zeg r7hP87zVhxZyQpgP0GW74C+OBRzUs1YUw1926VCcPNZfErlxHnzr4m5r99ct+XSQnJ3v tGOBpp0pKp0wvc1bsvcjWVfkIMIgiFpvIURyqjzqqqGmvTOoIs0XYUvtRDjzBYfHkDUX J+HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/7B1jqkU0ZB9bfTKoSuygoKRovifI7TwPxghUo+wV9U=; fh=EB/+23iNNwSyOk/rskJHAeES32dKI5UPeid3pvl9t44=; b=C2pqDEoqF8QWYEnMptTqPSUh7I1TJyutnri/9wziu+p9xQXHIq+4/T/sjUecVS4pM/ SmSADIbmNpV8q+J5IencqUgNKKDoUOFH9rxDb7oskMroPUT++ympGuLzLkrkNQEtQ9Q7 d0tSypcv6PKRTai50jDpqhjWOEqN/GH6BmT00fEUUoG2Rkoo7jaeq9UBdRrj16NeL9wA suZGMN3fbc0MkP+djKb6lsaid7nZi/+hqbm4ANjE5zG7/WnstqS6QPomk3yjrFDRnYXn /gAHGyO+y648+RK6l5nixMVvX8so9u1xRemIb75xeOvHWhEC0eu4+XYJDYr4MhEF5yR+ PLuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FzWQYLRR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id d75a77b69052e-4a72a4f1988si114114671cf.463.2025.06.17.03.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FzWQYLRR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 28B4382CE7; Tue, 17 Jun 2025 12:07:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="FzWQYLRR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 686E182CCE; Tue, 17 Jun 2025 12:07:47 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 15E4D82C87 for ; Tue, 17 Jun 2025 12:07:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a5123c1533so3124404f8f.2 for ; Tue, 17 Jun 2025 03:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154864; x=1750759664; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/7B1jqkU0ZB9bfTKoSuygoKRovifI7TwPxghUo+wV9U=; b=FzWQYLRRMsmaVN7NfJ+YYzfDLxUoWL7a/tckqApxVFKBETJ+TcZuq/+ZYo2XxqtUes 31LMbGcy7IZZhxpbbvCbz1lF1HI+UZFL6xc59Xhhblh7pNZJTZIGYY9cBs7UT2dCbKEz idd7inb/quZAGwrqyFgLhUX+Y6cr9XJi/KYswyqe54i7DwRG1LoH/+7ibWpCjleh/MBT 1pZIuJuDfTMnqD4bJ6qK9k6vrQDO7TiT1XuVGr/TdZZRokjrRkJtyyOzl4P/f0IPZRvK e0H4wWicXPGySJU2UTYDTVhuDTfUly+sgKzLSN/9EcdsqOwCxJuyTDdYOjUoYpf/C87a x8qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154864; x=1750759664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/7B1jqkU0ZB9bfTKoSuygoKRovifI7TwPxghUo+wV9U=; b=WvArWyQvCTGZGzqBi+vtnYEmWE0P94lC0CAQCHTXqju7Hr3kAam2Jj+WTXhPOwSCNC diKV+gMOnZZlwMq03oI/99FeeBgws6jXOAfbQ1fkK9mg2DZ/C/cWiwlR4Nc8Vgx0Bqj1 9AaTWvFevikPitBYeS8FVh/Vt+g690nEVdJ65BNLrC7aGS74jfCutD6PO+WLnhq23E5K 6DuVM520HaeVmmlpcHmASQexgsHDPxQmrJmNfxqXvt33uJVdvaHMcLARUVqrISTC74me U0+gLSayWzle2AEsKISZlmqgvl7EGXIkaYAg91s/4A8kXpIcQHxnORbz1llh2z05/DXa QTBw== X-Gm-Message-State: AOJu0YxOYI5a+8EhyOLhlAaHHa0rEhCzGqqW7jpGH5BM2MwhaRFHQYIK 5NosJUVyEJtg0MuMj96ldbL61qYUKnC8aqLbFGzYOpQdRQwt7XCGf0tIuH5eNphjbYRYPesDflj U8wRK X-Gm-Gg: ASbGncuTKBrE7zzdS7TKZgSHGvXwb/zf16cSmXUSEhsBpvT9vggOAa94r2b1Ie/ylXb Gqg/B2MvEbIMJ0s5+tnKrV93dwazIYrQRwPMGlXZ6a+tLo10qMCsu20UeVb364Svoly/rXuKyaY elt1R54dyUb7PmLpAVFWa+Cb94rrOysPrbmNRq5bn0XC12c3O71KGABrDixBizAXxeVFA8M93cJ KrsyCtxyy+sEHm/fJYguHFme1WG8B3pwjC/glfCT+fwvAqpLdPMzbYa0fRNGNw7Z7CkdOhbQvGJ 3C90VB8FZc0WD2nXvDA27zF1bOqsJ5a9mpY58pPzMEMwnxnVTZzG4DZPDQwcd0rMdR5VY5U= X-Received: by 2002:a05:6000:144e:b0:3a4:eb92:b5eb with SMTP id ffacd0b85a97d-3a572e998a0mr8895325f8f.50.1750154864270; Tue, 17 Jun 2025 03:07:44 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:43 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Casey Connolly , Dmitry Rokosov , =?utf-8?q?Duje_Mihanovi=C4=87?= , Greg Malysa , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Mattijs Korpershoek , Nathan Barrett-Morrison , Oliver Gaskell , Patrice Chotard , Ramon Fried , Robert Marko , Sebastian Reichel , Simon Glass , Sumit Garg , Tom Rini Subject: [PATCH v3 02/13] lwip: move net/lwip/dns.c to cmd/lwip Date: Tue, 17 Jun 2025 12:03:52 +0200 Message-ID: <20250617100720.2544758-3-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Prepare to split the dns command from cmd/net-lwip.c by moving the implementation from net/lwip/dns.c to cmd/lwip. Signed-off-by: Jerome Forissier --- Changes in v3: - Move this patch before "lwip: split cmd/net-lwip.c into one file per command". Changes in v2: - New patch MAINTAINERS | 1 + cmd/Makefile | 2 +- cmd/lwip/Makefile | 1 + {net => cmd}/lwip/dns.c | 0 net/lwip/Makefile | 1 - 5 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 cmd/lwip/Makefile rename {net => cmd}/lwip/dns.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index d62dd35a385..e8f644fc75b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1409,6 +1409,7 @@ F: net/ NETWORK (LWIP) M: Jerome Forissier S: Maintained +F: cmd/lwip/ F: cmd/net-lwip.c F: configs/qemu_arm64_lwip_defconfig F: drivers/net/sandbox-lwip.c diff --git a/cmd/Makefile b/cmd/Makefile index 80cf70b7fe8..102422470c2 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -133,7 +133,7 @@ obj-$(CONFIG_CMD_NAND) += nand.o ifdef CONFIG_NET obj-$(CONFIG_CMD_NET) += net.o net-common.o else ifdef CONFIG_NET_LWIP -obj-$(CONFIG_CMD_NET) += net-lwip.o net-common.o +obj-$(CONFIG_CMD_NET) += net-lwip.o net-common.o lwip/ endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o diff --git a/cmd/lwip/Makefile b/cmd/lwip/Makefile new file mode 100644 index 00000000000..6c4ab58d06b --- /dev/null +++ b/cmd/lwip/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_CMD_DNS) += dns.o diff --git a/net/lwip/dns.c b/cmd/lwip/dns.c similarity index 100% rename from net/lwip/dns.c rename to cmd/lwip/dns.c diff --git a/net/lwip/Makefile b/net/lwip/Makefile index 5df222589b8..255c7d018b0 100644 --- a/net/lwip/Makefile +++ b/net/lwip/Makefile @@ -2,7 +2,6 @@ ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot obj-$(CONFIG_$(PHASE_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP) += dhcp.o -obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o obj-$(CONFIG_WGET) += wget.o From patchwork Tue Jun 17 10:03:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897352 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061197wrc; Tue, 17 Jun 2025 03:08:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVrSEx9DjbKUAq1BumFyKOdjSkXik0MdoztZa8QuZO2If/Re1OMM2z5jdNYi6leC/xy+NpM7w==@linaro.org X-Google-Smtp-Source: AGHT+IEk+/A4+gg0cNTJDYZCbOQxkYZ9R78/eQvy9XD8evys2aGv3wSIaLSjvFKptL/m9G1Nw9Au X-Received: by 2002:a05:620a:25ca:b0:7d3:8cc5:8a43 with SMTP id af79cd13be357-7d3c6cd8adfmr2825653585a.36.1750154888412; Tue, 17 Jun 2025 03:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154888; cv=none; d=google.com; s=arc-20240605; b=Ychlw6lsAmAcG5BJZK2sXKWMO7jSXrej+FzT4aDB9/LuFtcwIpKsYOR2oP9Lz/zwEv p7uJjR/S9dyHU415MxAwwqsmKj8voLkZfpT5eUY6AjDAViIpHHWCE058uq8a8kv6qA/x KOSbSJrY+pwa89d2R7nI2bqA9DN3WXedzpqyBX2QbUg01nbmNPzcgASmqWQpymHh2Tf1 cX4TasqiN/P6ooi9OAzHZJ83Tay24h3nkEAu+GR9Tq0kY6KXpejBZvul9Xo3de9O4KXe nndE9XwhpXCHaN5M2ffY3tjbrB80oblthxua8FbBmQ154vyanhGz6SWip8GeF2SJofJf KGww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gcXN/O0sngamvLKoUvDh3jJG0AbZo2sR4TdOddPYPg0=; fh=+TzJuMMnKDMsbGyXcXAynrdn4hYe+uVLmq5NLJkVciY=; b=YaDwgmHqueShzuH2G1AE/33AwEr4iPHtnAx0LWhLmfkk7qIVyl+XLpWxP6oKnhV41e +obkFdcO0mP35owSegIPD+nxiacEAF9KmUCHnPu2KyqUoGhVjOnYnntfA+dfnJyJ6NxM uhP5NGM1/gdmCcKOxBXzmCxsCRx+FLyH5rJkBcBqKb73CKIPwdmBt3Wgmp7xhmVOczbP 2ul/V9hB6uiGkxidmK0RWnI7rlEjTFa51qEpiIQoIQE7XJvu8Z8jJx/OVoyzOqkGlJbE 4l4Fo0x7gSe4a4gv3Rj4nUgipI8N+/FZDQKAT+rHH6Nh7Sc5KOGttBH7mI/UHpunI0mB hZ8w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PhiUrv9J; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8f48ca0si1158160685a.615.2025.06.17.03.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:08:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PhiUrv9J; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 71F6B82CF4; Tue, 17 Jun 2025 12:07:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="PhiUrv9J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 077E582C87; Tue, 17 Jun 2025 12:07:48 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 15F9580C83 for ; Tue, 17 Jun 2025 12:07:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3a50fc819f2so4642355f8f.2 for ; Tue, 17 Jun 2025 03:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154865; x=1750759665; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gcXN/O0sngamvLKoUvDh3jJG0AbZo2sR4TdOddPYPg0=; b=PhiUrv9JRZ9/ltrsR6GcTLc6sFcnnFUo+t/UkxYVMAC2dg243Acx/xRu6jhM78AIqr gA60fX/6AuiE2TXdpgB3QxQGZaleQoNGl63uYVgDD4tK1AqvcaV11RHIMXwLiajKDu+C 0RTmVuoRi5XLyZf1oMHciq5JyolcQfI/64ut+cHZOFiPfbPct1SoxtEbxwulCMnZxjeq DgjW1Xm16dfDZOyztkAJP9+w4mnyDi8jRJQY9XrmuhTP5KqafrNhnLz22lunppgCMNWq Z5qw1AWAyZM0fPF8b/uitF47K7M2PUXIMyxDN+ZTNGqLpS9NXIMfYm4ny6M8IjskEWez +ogQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154865; x=1750759665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gcXN/O0sngamvLKoUvDh3jJG0AbZo2sR4TdOddPYPg0=; b=qmmheS5hZjYb9vKlzMx/mwf/rQbqRnsYuEllxlMkO4EN9rvZnw9q8ILroKv+6QG6Cp S9HusV6B63xK0P1J9NZC5+vh92vCF4MmTtG0jlAFbebzdUTrMbM9fzS0Eh3b7AVWdFJs 79cTe/vBx8m7axJgjm3z3mebW1sH6ofJy4+v6vWK3j46pOxGSkEmnpj8Ej2H7v6glQ48 zU0uR9sbqF13lWpT6nE7nVXB5QeYkXsfHZEx4b2c2S0W0xdcEPF5vMVuoAQZPBJ/yWz8 vy6cfQPY+xtsvBozVhIsfMOEAgCDYVKJCsHJ+nUd/dY3o9sh23dJ7zcN25DJoI3qlVwz ni7w== X-Gm-Message-State: AOJu0YysllkVTqOqRNzxnzefws5KfHplRhdmwt1ZHyxo3TzqnnJ5J0rv fM2e2sJfbShyckRBnhNXl1zg01LnLlmk/F5X599uG/oSW61m6RHuF3aw0EqeAijNDn8PtNe6zs0 GGBEw X-Gm-Gg: ASbGnct/t0j0ZMtFk0jBRjnwPBXLrmVoyP83PbEDal9+k37SZrwbLduzUNzFisZemHh FIyQJvVbUo/RqkOhrdkh4PUx/nZFi9g8lEsd5RRld3149AGigf7tNJSFvDbBQZnJ2NTJSVTK2S2 A3Tq2GsX9WB2oIhq1uUOskD7aY8UD6EoNldeVF/tsAD4qV30eZyuCfhx+LpTiwAh1i5ZOCTV+mO Z6wbgU/8kM9+tb2oZILaMejCFhaRHWl9l4kcS/wzisMD2PSk3ijf1hcaWEOCrYCL6MxN560FVuK aULE8LHdj0WnwosU854OlyzTuggbSP9qEDGj+HESc6g1p3YHZzZ0TUIXBuS5wcuBQFilF5o= X-Received: by 2002:a5d:5f8f:0:b0:3a4:f439:e715 with SMTP id ffacd0b85a97d-3a572398eb0mr10700916f8f.9.1750154865176; Tue, 17 Jun 2025 03:07:45 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:44 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Simon Glass , Tom Rini Subject: [PATCH v3 03/13] lwip: move net/lwip/ping.c to cmd/lwip Date: Tue, 17 Jun 2025 12:03:53 +0200 Message-ID: <20250617100720.2544758-4-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Prepare to split the ping command from cmd/net-lwip.c by moving the implementation from net/lwip/dns.c to cmd/lwip. Signed-off-by: Jerome Forissier --- Changes in v3: - Move this patch before "lwip: split cmd/net-lwip.c into one file per command". Drop a change recommended by checkpatch (uint16_t -> u16) which would better be submitted separately, since the purpose if this patch is to move code around, not to modify it. Changes in v2: - New patch cmd/lwip/Makefile | 1 + {net => cmd}/lwip/ping.c | 0 net/lwip/Makefile | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename {net => cmd}/lwip/ping.c (100%) diff --git a/cmd/lwip/Makefile b/cmd/lwip/Makefile index 6c4ab58d06b..da79b64b5c2 100644 --- a/cmd/lwip/Makefile +++ b/cmd/lwip/Makefile @@ -1 +1,2 @@ obj-$(CONFIG_CMD_DNS) += dns.o +obj-$(CONFIG_CMD_PING) += ping.o diff --git a/net/lwip/ping.c b/cmd/lwip/ping.c similarity index 100% rename from net/lwip/ping.c rename to cmd/lwip/ping.c diff --git a/net/lwip/Makefile b/net/lwip/Makefile index 255c7d018b0..97299d9b542 100644 --- a/net/lwip/Makefile +++ b/net/lwip/Makefile @@ -2,7 +2,6 @@ ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot obj-$(CONFIG_$(PHASE_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP) += dhcp.o -obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o obj-$(CONFIG_WGET) += wget.o From patchwork Tue Jun 17 10:03:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897353 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061260wrc; Tue, 17 Jun 2025 03:08:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWoeDVd6ZlOMyjlHAdo0q8SzW2QqkRKg0JSIyxEoLb7M1nCk4Pcv72q+KGXD0yRhrzJE1gCOA==@linaro.org X-Google-Smtp-Source: AGHT+IEKDxg2axqvWnQJlu0o4ti176fBL2wYTnUPsudy/5hBwjO8rH0GwvEiEWaUqYZ+1//GcIus X-Received: by 2002:a05:6214:3291:b0:6fa:9ab7:3861 with SMTP id 6a1803df08f44-6fb47773e72mr195625786d6.3.1750154899562; Tue, 17 Jun 2025 03:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154899; cv=none; d=google.com; s=arc-20240605; b=XF4xbweP/wXlqANFd8YtskCXuTIt/xQFnIRJhn6/xW1xmJbbE9shE7lQqxJ/Z6yKkw +P34W1YEruB2e/EIPep+fs4jf7hnq2pqtPxGSjar2lTrloiXXchZd+mDsFe/Eaa9HX03 6cpRLWTX6WyRzg6j9cHg47lQRUM7y5UZAl2G4QeHvriRFnV8dMu/qGL+o1pTBFzQ8pZr RXlompTLFJ1egyZiv9oO9OBKgBV//TwinYb73u8UOsvlI/7+F0pNDqBUqkI+i9gT3Q6N CZxOtDq++MefhhuhteC0PPqOzIxRga34SXTUTIRU6x2z0FBjAflZvlzkRA684r4VUDFj PCkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SBus3lREdfBfRPlDnGauGCE503yX7PPRKy1v2APSgo8=; fh=GtwCMrG1XRYvzw9xVIcYO0bVzVVAVDmlU1CwQ83mqvw=; b=SZrjzKESavuS519ZbHcEMlQaO4N4PXILNEkkaGFIjD4i/BEjkavjiRPfBHqeDnlYmq ifphs0t/fi6YZaLgjmaCQWmIuNpnL87OwbxCTT+GGAklaugKwM8LDaGVjVUhtrPie0Q4 CjJTR0uwkmR42G4FjoCGIWy+uDKe5oJa09CXaJWGyD1P47a9SPoXogZRFrjRKYMP8osC z4PK2uBRN9XqWw9YeBqWn/VkgG9c7/joExTeid5HN6Wscm/3ark3u5PPnAINHefA4lei pcRoO7qLSHLle/Rvxhhc5dyj7V9NBK+9fhgDGbnPZamUXPf7GXu5n4FLUlbrTNh2AEYI PYFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oz0J6nmx; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 6a1803df08f44-6fb35bf27absi133450196d6.261.2025.06.17.03.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oz0J6nmx; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9AB182B20; Tue, 17 Jun 2025 12:07:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="oz0J6nmx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 512D382CF4; Tue, 17 Jun 2025 12:07:49 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 3758882CCF for ; Tue, 17 Jun 2025 12:07:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-450d668c2a1so43980555e9.0 for ; Tue, 17 Jun 2025 03:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154866; x=1750759666; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SBus3lREdfBfRPlDnGauGCE503yX7PPRKy1v2APSgo8=; b=oz0J6nmxasDC5LmfjqqgXd3WaRKUWM/K7UmavB1mgKSdaR1zpxj6Yc4ND/d6oxWoWm EKqo+qsu+GaG3bTce4KPjtSFaPT4uGM37ruhxRdf4/MIgMaTXElfuY0AaFiRLJkTAygW pTgGWXTXrTbHRglAnPEPnTDUeJoZmVBHkNflhqfrRJHIfA8grLSGeayVZM6DWn0JYGvu HgHzcqDKFra/ByghyEyta4tmZXz8B4fEpiffr/R6SVnySilUc39UTcV1IC2s9bVNlfxk +vchBQrQVgioEFWT9lYKZPzwjhQTDGx2Ugv1sJZTSDkWeupJylbyp4+WskPDs+p7rm0g vNJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154866; x=1750759666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SBus3lREdfBfRPlDnGauGCE503yX7PPRKy1v2APSgo8=; b=isuuk/Qe3zRnF0Qg0+oXRt2kUIOQvDwKv4B7QwW3rqv8ZtaSHY/CHDMqkKlqn49O3u AK+ZOijIk6HyCRsVKlT10gkAeRGOvLQxtbulyrwwqHFHbSaETlXWiJ7T+oQfMbXGrpWh gvBex9In1yILOi8sF4fVv2zwEK+ludx/0THiFlFSza8gMuiJgNXDaG3g8kADjJigwwAC ljL9aXJ2HMneVfaMQ3wbBGoHfyG/HJ8UskrnDVRkoReWdgO/LnFlFFC8yeaJRKqk4wtR fB+/M/Z6HDGZPtUCebgmaJOoXlT8qDEivXe/UkxU43YL0kiBXCLSQbX1s9IAQpAiYs/v cigA== X-Gm-Message-State: AOJu0Yz00h292H+aFO1yWD6VXM6hitrOK6+ynK7z/kuG7E3Vbv3N7jb1 zsyWVsR7Zmeh1mIBEE0PUUuEZTjP33gxVZ3E8wBwwRkv7u4aY0LeXeVhDRCAXjIjZmSMcIN6dNB YEK3N X-Gm-Gg: ASbGnctlGS85cLWhKbSEKaUBLj7j7U88VmO5Li6KV1eAiA6CCGdYoCkpkK9dJsGfC0z 99vPCmgrnia91Y2mGTzi8iesd1rma+MSxH0xqx01Z/gRD0O78u3kEeh02YphSW1zbq9Y8t21PYg Td7orH3p1xaF5/NAOurlGcY/px7GFn+oNAADFQzdD+gpQHb6gesUEDOulwusryybwN52TgrGLlh aWEHJnZIudG0Hsmssw+ZZXdNMqnsS+5C5B6Avs3N/2mB14PKThN5yg+mAl9/Fk3RE4TXqXG4Vyr ErUOYNJaGFdlA2fv91y7Pnad1hAhN4ejZfPW/lHDdZozQAqkNZrtzadHRqnZ7szW8iyx81M= X-Received: by 2002:a05:6000:2504:b0:3a4:f7ae:77c9 with SMTP id ffacd0b85a97d-3a5723840d3mr10139322f8f.5.1750154866223; Tue, 17 Jun 2025 03:07:46 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:45 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Heinrich Schuchardt , Dmitry Rokosov , Ilias Apalodimas , Mattijs Korpershoek , Michael Walle , Simon Glass , Tom Rini Subject: [PATCH v3 04/13] lwip: split cmd/net-lwip.c into one file per command Date: Tue, 17 Jun 2025 12:03:54 +0200 Message-ID: <20250617100720.2544758-5-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Move each command in cmd/net-lwip.c into its own file (cmd/lwip/${cmd}.c). Suggested-by: Heinrich Schuchardt Signed-off-by: Jerome Forissier - Patch moved after "lwip: move net/lwip/ping.c to cmd/lwip" and "lwip: move net/lwip/dns.c to cmd/lwip". --- (no changes since v2) Changes in v2: - New patch cmd/Makefile | 2 +- cmd/lwip/Makefile | 3 +++ cmd/lwip/dhcp.c | 9 +++++++++ cmd/lwip/dns.c | 3 +++ cmd/lwip/ping.c | 3 +++ cmd/lwip/tftp.c | 9 +++++++++ cmd/{net-lwip.c => lwip/wget.c} | 26 +------------------------- 7 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 cmd/lwip/dhcp.c create mode 100644 cmd/lwip/tftp.c rename cmd/{net-lwip.c => lwip/wget.c} (51%) diff --git a/cmd/Makefile b/cmd/Makefile index 102422470c2..d026ace6573 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -133,7 +133,7 @@ obj-$(CONFIG_CMD_NAND) += nand.o ifdef CONFIG_NET obj-$(CONFIG_CMD_NET) += net.o net-common.o else ifdef CONFIG_NET_LWIP -obj-$(CONFIG_CMD_NET) += net-lwip.o net-common.o lwip/ +obj-$(CONFIG_CMD_NET) += net-common.o lwip/ endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o diff --git a/cmd/lwip/Makefile b/cmd/lwip/Makefile index da79b64b5c2..4c28d2b28e5 100644 --- a/cmd/lwip/Makefile +++ b/cmd/lwip/Makefile @@ -1,2 +1,5 @@ +obj-$(CONFIG_CMD_DHCP) += dhcp.o obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_CMD_PING) += ping.o +obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o +obj-$(CONFIG_CMD_WGET) += wget.o diff --git a/cmd/lwip/dhcp.c b/cmd/lwip/dhcp.c new file mode 100644 index 00000000000..3894d71f654 --- /dev/null +++ b/cmd/lwip/dhcp.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024-2025 Linaro Ltd. */ + +#include +#include + +U_BOOT_CMD(dhcp, 3, 1, do_dhcp, + "boot image via network using DHCP/TFTP protocol", + "[loadAddress] [[hostIPaddr:]bootfilename]"); diff --git a/cmd/lwip/dns.c b/cmd/lwip/dns.c index 19172ac959a..13da52b59b9 100644 --- a/cmd/lwip/dns.c +++ b/cmd/lwip/dns.c @@ -8,6 +8,9 @@ #include #include +U_BOOT_CMD(dns, 3, 1, do_dns, "lookup the IP of a hostname", + "hostname [envvar]"); + #define DNS_RESEND_MS 1000 #define DNS_TIMEOUT_MS 10000 diff --git a/cmd/lwip/ping.c b/cmd/lwip/ping.c index d8042ceecf9..21a30228642 100644 --- a/cmd/lwip/ping.c +++ b/cmd/lwip/ping.c @@ -13,6 +13,9 @@ #include #include +U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host", + "pingAddress"); + #define PING_DELAY_MS 1000 #define PING_COUNT 5 /* Ping identifier - must fit on a u16_t */ diff --git a/cmd/lwip/tftp.c b/cmd/lwip/tftp.c new file mode 100644 index 00000000000..6bb7a3733a2 --- /dev/null +++ b/cmd/lwip/tftp.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024-2025 Linaro Ltd. */ + +#include +#include + +U_BOOT_CMD(tftpboot, 3, 0, do_tftpb, + "boot image via network using TFTP protocol", + "[loadAddress] [[hostIPaddr:]bootfilename]"); diff --git a/cmd/net-lwip.c b/cmd/lwip/wget.c similarity index 51% rename from cmd/net-lwip.c rename to cmd/lwip/wget.c index cecf8d02555..3f5b9952c93 100644 --- a/cmd/net-lwip.c +++ b/cmd/lwip/wget.c @@ -1,32 +1,9 @@ // SPDX-License-Identifier: GPL-2.0+ -/* Copyright (C) 2024 Linaro Ltd. */ +/* Copyright (C) 2024-2025 Linaro Ltd. */ #include #include -#if defined(CONFIG_CMD_DHCP) -U_BOOT_CMD(dhcp, 3, 1, do_dhcp, - "boot image via network using DHCP/TFTP protocol", - "[loadAddress] [[hostIPaddr:]bootfilename]"); -#endif - -#if defined(CONFIG_CMD_PING) -U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host", - "pingAddress"); -#endif - -#if defined(CONFIG_CMD_TFTPBOOT) -U_BOOT_CMD(tftpboot, 3, 0, do_tftpb, - "boot image via network using TFTP protocol", - "[loadAddress] [[hostIPaddr:]bootfilename]"); -#endif - -#if defined(CONFIG_CMD_DNS) -U_BOOT_CMD(dns, 3, 1, do_dns, "lookup the IP of a hostname", - "hostname [envvar]"); -#endif - -#if defined(CONFIG_CMD_WGET) U_BOOT_CMD(wget, 4, 1, do_wget, "boot image via network using HTTP/HTTPS protocol" #if defined(CONFIG_WGET_CACERT) @@ -47,4 +24,3 @@ U_BOOT_CMD(wget, 4, 1, do_wget, #endif #endif ); -#endif From patchwork Tue Jun 17 10:03:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897354 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061325wrc; Tue, 17 Jun 2025 03:08:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW4IiX66sXDJBAkFGLPAlGiczcIuUUOACFsEop+mBBYXawSedXy+bVhzHxm8uJK0244TFTn4Q==@linaro.org X-Google-Smtp-Source: AGHT+IE3lARW/2G8wXVe/U4sDYAGvJaH9SZNTfzg9HH9zpHmEt3SsikHurlAGvyGckIBkVEoOfFj X-Received: by 2002:a05:6214:5249:b0:6fa:c55e:86a with SMTP id 6a1803df08f44-6fb47759665mr224539236d6.28.1750154908010; Tue, 17 Jun 2025 03:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154907; cv=none; d=google.com; s=arc-20240605; b=OqtexI1bKPFBmumswcjxXkujKlH0WW3QpGUdfOWP8YtoCY0ozRfA1pVmbg8jN+TWLl LzWuHIj4G7oIJo0gxMJzCJ35XjQTz2JehDxdECh0hlD5x4PHkjXL7labUGeGC0/A7DSd 3whceWqlBqzY588WJPRIT855OAnh2sAj6aOYeMkCDEDOq6L6k+/nLV0veOCshNq7qIlw IqdCz+weDjTkW9Z+uOvE1Zzixb1omHcIYneEv2ebQ8T2KQ1o7joktKy09El2vYFWZjlV no0HTZGOjah7EPMHUj4YDXgUv+EJBQDD3oAI5E7HQ4EAaaWdxeACEAN4bA8YG0W7XKl0 CflQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BZjt3tuUKTV0I6VyE7x+99edvhzQIhE4xApstugg1Pk=; fh=cNlUmhrmVLZdtx7mxwbBkxH9DxScOKBYk8BJHHA/bw4=; b=SnNK/z4APYNNm9bjrh+Rjv2tMWBt2UR8cwdbxpT2xkhQp47WANqq6O6FELnUfBfeHg 6IoTaeHxyacjVJedEckVIEViK+Ii+4u7+VoO63T5yzP4CWSgMlbESgNki4DyIcfozY3v L8fGxlFeu1r6W+tRrCXjZX2yAPpzgPG7eLY8CNs2DL9P1pynwMWFtDN77Nj8renlM337 zB4XyMbyvmvWlMP7pTpL4bFBRryJFivVy8FanyPD9j1YdX2ui5YbYJ5lT52vEP5fRdXU QcbOgN9G6JYxhx03F562nxA/7pgEJiYviXoG2PLs2S+gTeZ0GiGJd8tqMPqSEnLs5FWv YVAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zZovawN1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 6a1803df08f44-6fb5a5a4da8si23938316d6.25.2025.06.17.03.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zZovawN1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 105F782CBC; Tue, 17 Jun 2025 12:07:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="zZovawN1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3FF9982D09; Tue, 17 Jun 2025 12:07:50 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 1482281760 for ; Tue, 17 Jun 2025 12:07:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3a5257748e1so3932024f8f.2 for ; Tue, 17 Jun 2025 03:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154867; x=1750759667; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BZjt3tuUKTV0I6VyE7x+99edvhzQIhE4xApstugg1Pk=; b=zZovawN1jVNrN3p+0rREseZCg76GbDuWNeYUnOXkFm4eSGwf7/zEmqrYhGJDE5mj9K xd+3pvJqbfyYF66iFsACpyb4xwWZCRP4y2MijG+PQr2woCw3yFaBsOfQwkUD+sndyjiq I+cZoBSY5q7ykSqvvInlZOG056ld12D+6VckqAiDrrV1whCrcj4wKsyt3feynwF2icwB jPQIPNJLt3Djyx1KSH1QuTVQMBQDJEMehehkWV95B0kW3+PO49BQ9k+5XoBzolPaQIlH A/6WffBbwpRkMw3+3MnPxVo8KJKGxjum/d8rDZKzzXAKUXWYLJBrimOXdXUhxDgjluy/ mODA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154867; x=1750759667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BZjt3tuUKTV0I6VyE7x+99edvhzQIhE4xApstugg1Pk=; b=raCnHveuuAoyoXF4sqHVEDRN/7j0dzA0QIF+/OX//AZP4Owgc6uBKmG9AfHsLY8Sxq evXgbZyyuG+dHQJvXEkyIKn5e896wA0jANSB+omqeQ3wWzhWK6YhFcJ5WUXNNspFAweM XlQmaDaaVg2j8yoo0FW/rBZZilVJF/jx1nrw7pppnFqY8RkqTJ4C9l7qFnf7JweqSA8q GtEAqb7Nh244yMS/KSP82mON25UXjq56EdVNeR6QaODU8JFC7gM/tqu+tfh6iwTn5eqs 1LN7G/sSv2XRVEtl8MVWDi7wlG/1hmTPMe1kHYfEzQ0jR6IBLhQ1ToJv7XyeCRST5onk /yGA== X-Gm-Message-State: AOJu0YwwADX+2ZYe7z2IptZ3+J/ZBx38TI27l4Lu/12I2vyMoO2j8Bn3 ouryPsmXs97WLyR8yHmMxga8IDFpiWjKFuPlwTCZNUekD6kr9u8+cFLiVnJL5CCryzZ0OpoghFj zZAlO X-Gm-Gg: ASbGncuTeXKx2pjiMfF+EKaajY3BJDGQg6gP0ZFMMWIFLSkgZ669Bm9TV866WUa0Arq neee3nNQl9LLGeU5yQwPObzk/w7cgCLBMbOIMCNOQGxOtZPzf3NU7CoKASIh8AuMGmbWliHTlVX AkahbuYdeSxhYMao7aiM6/WjYFJbgnSRvLuehO3LjSHrEiAj0xA0Dz44FJ5BKy3KAKdtLlQSFEN PMN74OTOx8lMBhkX3BJKwYiaW8/S754sg9mxw4hUgGVVQGn/zxxo57KH8YxzaVo+hWwnS38FtIS x6iW2HVOg5CXOdlW4UO3KnttwkmOYxO+5x6KMQ1i42zMbnDxtILQczaxBUfQle/AxuEoRGE= X-Received: by 2002:a5d:64c9:0:b0:3a4:f900:21c4 with SMTP id ffacd0b85a97d-3a57237dd6fmr11230554f8f.26.1750154867178; Tue, 17 Jun 2025 03:07:47 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:46 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Michael Walle , Ramon Fried , Simon Glass , Tom Rini Subject: [PATCH v3 05/13] lwip: split net/lwip/wget.c Date: Tue, 17 Jun 2025 12:03:55 +0200 Message-ID: <20250617100720.2544758-6-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Split net/lwip/wget.c in two: one part which implements CONFIG_WGET stays in net/ while the part that implements CONFIG_CMD_WGET is moved into cmd/. Signed-off-by: Jerome Forissier --- Changes in v3: - Remove WGET_CACERT guard around the auth_mode enum and the extern variables in include/net-lwip.h - Fix build with WGET_CACERT=n and WGET_CACERT_BUILTIN=y Changes in v2: - New patch cmd/lwip/wget.c | 195 +++++++++++++++++++++++++++++++++++++++++++ include/net-lwip.h | 14 ++++ net/lwip/wget.c | 202 +-------------------------------------------- 3 files changed, 211 insertions(+), 200 deletions(-) diff --git a/cmd/lwip/wget.c b/cmd/lwip/wget.c index 3f5b9952c93..902d155727b 100644 --- a/cmd/lwip/wget.c +++ b/cmd/lwip/wget.c @@ -2,7 +2,9 @@ /* Copyright (C) 2024-2025 Linaro Ltd. */ #include +#include #include +#include U_BOOT_CMD(wget, 4, 1, do_wget, "boot image via network using HTTP/HTTPS protocol" @@ -24,3 +26,196 @@ U_BOOT_CMD(wget, 4, 1, do_wget, #endif #endif ); + +#if CONFIG_IS_ENABLED(WGET_CACERT) || CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) +char *cacert; +size_t cacert_size; +enum auth_mode cacert_auth_mode = AUTH_OPTIONAL; + +#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) +extern const char builtin_cacert[]; +extern const size_t builtin_cacert_size; +bool cacert_initialized; +#endif + +static int _set_cacert(const void *addr, size_t sz) +{ + mbedtls_x509_crt crt; + void *p; + int ret; + + if (cacert) + free(cacert); + + if (!addr) { + cacert = NULL; + cacert_size = 0; + return CMD_RET_SUCCESS; + } + + p = malloc(sz); + if (!p) + return CMD_RET_FAILURE; + cacert = p; + cacert_size = sz; + + memcpy(cacert, (void *)addr, sz); + + mbedtls_x509_crt_init(&crt); + ret = mbedtls_x509_crt_parse(&crt, cacert, cacert_size); + if (ret) { + if (!wget_info->silent) + printf("Could not parse certificates (%d)\n", ret); + free(cacert); + cacert = NULL; + cacert_size = 0; + return CMD_RET_FAILURE; + } + +#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) + cacert_initialized = true; +#endif + return CMD_RET_SUCCESS; +} + +#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) +int set_cacert_builtin(void) +{ + cacert_auth_mode = AUTH_REQUIRED; + return _set_cacert(builtin_cacert, builtin_cacert_size); +} +#endif +#endif /* CONFIG_WGET_CACERT || CONFIG_WGET_BUILTIN_CACERT */ + +#if CONFIG_IS_ENABLED(WGET_CACERT) +static int set_auth(enum auth_mode auth) +{ + cacert_auth_mode = auth; + + return CMD_RET_SUCCESS; +} + +static int set_cacert(char * const saddr, char * const ssz) +{ + ulong addr, sz; + + addr = hextoul(saddr, NULL); + sz = hextoul(ssz, NULL); + + return _set_cacert((void *)addr, sz); +} +#endif + +/* + * Legacy syntax support + * Convert [:]filename into a URL if needed + */ +static int parse_legacy_arg(char *arg, char *nurl, size_t rem) +{ + char *p = nurl; + size_t n; + char *col = strchr(arg, ':'); + char *env; + char *server; + char *path; + + if (strstr(arg, "http") == arg) { + n = snprintf(nurl, rem, "%s", arg); + if (n < 0 || n > rem) + return -1; + return 0; + } + + n = snprintf(p, rem, "%s", "http://"); + if (n < 0 || n > rem) + return -1; + p += n; + rem -= n; + + if (col) { + n = col - arg; + server = arg; + path = col + 1; + } else { + env = env_get("httpserverip"); + if (!env) + env = env_get("serverip"); + if (!env) { + log_err("error: httpserver/serverip has to be set\n"); + return -1; + } + n = strlen(env); + server = env; + path = arg; + } + + if (rem < n) + return -1; + strncpy(p, server, n); + p += n; + rem -= n; + if (rem < 1) + return -1; + *p = '/'; + p++; + rem--; + n = strlen(path); + if (rem < n) + return -1; + strncpy(p, path, n); + p += n; + rem -= n; + if (rem < 1) + return -1; + *p = '\0'; + + return 0; +} + +int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) +{ + char *end; + char *url; + ulong dst_addr; + char nurl[1024]; + +#if CONFIG_IS_ENABLED(WGET_CACERT) + if (argc == 4 && !strncmp(argv[1], "cacert", strlen("cacert"))) + return set_cacert(argv[2], argv[3]); + if (argc == 3 && !strncmp(argv[1], "cacert", strlen("cacert"))) { +#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) + if (!strncmp(argv[2], "builtin", strlen("builtin"))) + return set_cacert_builtin(); +#endif + if (!strncmp(argv[2], "none", strlen("none"))) + return set_auth(AUTH_NONE); + if (!strncmp(argv[2], "optional", strlen("optional"))) + return set_auth(AUTH_OPTIONAL); + if (!strncmp(argv[2], "required", strlen("required"))) + return set_auth(AUTH_REQUIRED); + return CMD_RET_USAGE; + } +#endif + + if (argc < 2 || argc > 3) + return CMD_RET_USAGE; + + dst_addr = hextoul(argv[1], &end); + if (end == (argv[1] + strlen(argv[1]))) { + if (argc < 3) + return CMD_RET_USAGE; + url = argv[2]; + } else { + dst_addr = image_load_addr; + url = argv[1]; + } + + if (parse_legacy_arg(url, nurl, sizeof(nurl))) + return CMD_RET_FAILURE; + + wget_info = &default_wget_info; + if (wget_do_request(dst_addr, nurl)) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} diff --git a/include/net-lwip.h b/include/net-lwip.h index b762956e8fd..9c1167482e9 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -6,6 +6,20 @@ #include #include +/* HTTPS authentication mode */ +enum auth_mode { + AUTH_NONE, + AUTH_OPTIONAL, + AUTH_REQUIRED, +}; + +extern char *cacert; +extern size_t cacert_size; +extern enum auth_mode cacert_auth_mode; +extern bool cacert_initialized; + +int set_cacert_builtin(void); + enum proto_t { TFTPGET }; diff --git a/net/lwip/wget.c b/net/lwip/wget.c index ea1113e18b1..539812b68e9 100644 --- a/net/lwip/wget.c +++ b/net/lwip/wget.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include "lwip/altcp_tls.h" @@ -137,72 +136,6 @@ static int parse_url(char *url, char *host, u16 *port, char **path, return 0; } -/* - * Legacy syntax support - * Convert [:]filename into a URL if needed - */ -static int parse_legacy_arg(char *arg, char *nurl, size_t rem) -{ - char *p = nurl; - size_t n; - char *col = strchr(arg, ':'); - char *env; - char *server; - char *path; - - if (strstr(arg, "http") == arg) { - n = snprintf(nurl, rem, "%s", arg); - if (n < 0 || n > rem) - return -1; - return 0; - } - - n = snprintf(p, rem, "%s", "http://"); - if (n < 0 || n > rem) - return -1; - p += n; - rem -= n; - - if (col) { - n = col - arg; - server = arg; - path = col + 1; - } else { - env = env_get("httpserverip"); - if (!env) - env = env_get("serverip"); - if (!env) { - log_err("error: httpserver/serverip has to be set\n"); - return -1; - } - n = strlen(env); - server = env; - path = arg; - } - - if (rem < n) - return -1; - strncpy(p, server, n); - p += n; - rem -= n; - if (rem < 1) - return -1; - *p = '/'; - p++; - rem--; - n = strlen(path); - if (rem < n) - return -1; - strncpy(p, path, n); - p += n; - rem -= n; - if (rem < 1) - return -1; - *p = '\0'; - - return 0; -} - /** * store_block() - copy received data * @@ -337,93 +270,9 @@ static err_t httpc_headers_done_cb(httpc_state_t *connection, void *arg, struct return ERR_OK; } -#if CONFIG_IS_ENABLED(WGET_HTTPS) -enum auth_mode { - AUTH_NONE, - AUTH_OPTIONAL, - AUTH_REQUIRED, -}; - -static char *cacert; -static size_t cacert_size; -static enum auth_mode cacert_auth_mode = AUTH_OPTIONAL; -#endif - -#if CONFIG_IS_ENABLED(WGET_CACERT) -static int set_auth(enum auth_mode auth) -{ - cacert_auth_mode = auth; - - return CMD_RET_SUCCESS; -} -#endif - -#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) -extern const char builtin_cacert[]; -extern const size_t builtin_cacert_size; -static bool cacert_initialized; -#endif - -#if CONFIG_IS_ENABLED(WGET_CACERT) || CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) -static int _set_cacert(const void *addr, size_t sz) -{ - mbedtls_x509_crt crt; - void *p; - int ret; - - if (cacert) - free(cacert); - - if (!addr) { - cacert = NULL; - cacert_size = 0; - return CMD_RET_SUCCESS; - } - - p = malloc(sz); - if (!p) - return CMD_RET_FAILURE; - cacert = p; - cacert_size = sz; - - memcpy(cacert, (void *)addr, sz); - - mbedtls_x509_crt_init(&crt); - ret = mbedtls_x509_crt_parse(&crt, cacert, cacert_size); - if (ret) { - if (!wget_info->silent) - printf("Could not parse certificates (%d)\n", ret); - free(cacert); - cacert = NULL; - cacert_size = 0; - return CMD_RET_FAILURE; - } - -#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) - cacert_initialized = true; -#endif - return CMD_RET_SUCCESS; -} - -#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) -static int set_cacert_builtin(void) -{ - return _set_cacert(builtin_cacert, builtin_cacert_size); -} -#endif #if CONFIG_IS_ENABLED(WGET_CACERT) -static int set_cacert(char * const saddr, char * const ssz) -{ - ulong addr, sz; - - addr = hextoul(saddr, NULL); - sz = hextoul(ssz, NULL); - - return _set_cacert((void *)addr, sz); -} #endif -#endif /* CONFIG_WGET_CACERT || CONFIG_WGET_BUILTIN_CACERT */ int wget_do_request(ulong dst_addr, char *uri) { @@ -466,6 +315,7 @@ int wget_do_request(ulong dst_addr, char *uri) char *ca; size_t ca_sz; +#if CONFIG_IS_ENABLED(WGET_CACERT) || CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) #if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) if (!cacert_initialized) set_cacert_builtin(); @@ -492,7 +342,7 @@ int wget_do_request(ulong dst_addr, char *uri) * with no verification if not. */ } - +#endif if (!ca && !wget_info->silent) { printf("WARNING: no CA certificates, "); printf("HTTPS connections not authenticated\n"); @@ -541,54 +391,6 @@ int wget_do_request(ulong dst_addr, char *uri) return -1; } -int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) -{ - char *end; - char *url; - ulong dst_addr; - char nurl[1024]; - -#if CONFIG_IS_ENABLED(WGET_CACERT) - if (argc == 4 && !strncmp(argv[1], "cacert", strlen("cacert"))) - return set_cacert(argv[2], argv[3]); - if (argc == 3 && !strncmp(argv[1], "cacert", strlen("cacert"))) { -#if CONFIG_IS_ENABLED(WGET_BUILTIN_CACERT) - if (!strncmp(argv[2], "builtin", strlen("builtin"))) - return set_cacert_builtin(); -#endif - if (!strncmp(argv[2], "none", strlen("none"))) - return set_auth(AUTH_NONE); - if (!strncmp(argv[2], "optional", strlen("optional"))) - return set_auth(AUTH_OPTIONAL); - if (!strncmp(argv[2], "required", strlen("required"))) - return set_auth(AUTH_REQUIRED); - return CMD_RET_USAGE; - } -#endif - - if (argc < 2 || argc > 3) - return CMD_RET_USAGE; - - dst_addr = hextoul(argv[1], &end); - if (end == (argv[1] + strlen(argv[1]))) { - if (argc < 3) - return CMD_RET_USAGE; - url = argv[2]; - } else { - dst_addr = image_load_addr; - url = argv[1]; - } - - if (parse_legacy_arg(url, nurl, sizeof(nurl))) - return CMD_RET_FAILURE; - - wget_info = &default_wget_info; - if (wget_do_request(dst_addr, nurl)) - return CMD_RET_FAILURE; - - return CMD_RET_SUCCESS; -} - /** * wget_validate_uri() - validate the uri for wget * From patchwork Tue Jun 17 10:03:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897355 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061402wrc; Tue, 17 Jun 2025 03:08:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUtos9OlHNFuWFKc9U1/kFpPqBmED4EiJIVI+B+sryvXT+zIBAoXSXvnsAEIH8HYHIaVIC8zg==@linaro.org X-Google-Smtp-Source: AGHT+IHuACHvlaT8c5cSO2j657AdH4LOziDn5CxzwPtohEfye2cbjoU1LSCFo7AMNMvhoIByUFK9 X-Received: by 2002:a05:620a:4512:b0:7c5:49b7:237a with SMTP id af79cd13be357-7d3c6c209bbmr2094194085a.19.1750154918595; Tue, 17 Jun 2025 03:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154918; cv=none; d=google.com; s=arc-20240605; b=Ne/71TpUxygnotxp4ly5UOXwDwEmPxmROdqpHd+oE+N2M82k0AVBFSPJsjNL+n2/Ee D1oxBrlNxwro3tkt8V+IRHytTT7fEjVQLSaYoS+uMnv+2IuYuLyWdj3hy8snWixnViYv UcQTl2aRcRTKlmV+//jGYwhKQU14Gsf8Sx0tHqv8ub3FEzi7oWBWzLZDe0OgSEUtX46d cTYP37loRPH+nqlQZcNEbznUIFrOFmSnVj7zVtpXJS7QJtpxwYmsLpEuRBBoaBhAlRz1 Zz6RPq+IcFQjPA1eQQRDEKElyDYqdxTRKSPrehfjyIFfNv+lR/hvFk+jy6SIaVHyWCGL nIoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9zZ5v4Vpa7CEYpwxAITHXRuPqXdh/9/ctvBxOwqT1vo=; fh=UmjsKB3unp9m/Fk9s1BMSQpC/5itFxyvdTSgtmH1s3w=; b=Bw2HWkAeuOuoxZF0l+A7jIx7wHHoyQ/XXGfW2UzIHnknFoKTlGmT1iFWaDM+yFkmMP 2+4M/5TO4xN4+MmwSqBs3vmF0KPWhj8jhcz3Dj53CF+AGWmedpLWyh1HT1DOXNzcb5LZ O5+ddo5AFW5SFKd5Q6V0VOKG6TUUIDSz17/kUIQvKQBDuFn3CWIxsslpGy21BmgJsYaN YHO0pX3IY+i+3hXBoJlxQcx92HXvKtVjYi6xli2b6WfVZkMlZPR5hzoZxtBf6em4Utbg 86AgHPxrgeCp9gKX+T51gUv0n7iCGiGSM21jHkrHs3QQUPHiECxvYGufIGYs8X0x8Spj KeaA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TOTEGwTw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8ee4b74si1155076385a.389.2025.06.17.03.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TOTEGwTw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A33982D32; Tue, 17 Jun 2025 12:07:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="TOTEGwTw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD5D482C87; Tue, 17 Jun 2025 12:07:50 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 F1C3782C87 for ; Tue, 17 Jun 2025 12:07:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a4f72cba73so4483243f8f.1 for ; Tue, 17 Jun 2025 03:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154868; x=1750759668; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9zZ5v4Vpa7CEYpwxAITHXRuPqXdh/9/ctvBxOwqT1vo=; b=TOTEGwTwR/gVOHNjEyGkd5uoqtFDP3zmCO0ZjFOYU92p+VCrynuXCMOPQydKvGJhH3 gfjbAf64c9LjjvbDfaSwFzd2vJfP5q5ES1LckqGNzYsqvdsb/XpIEXwNXHkisgcvEkBN dnGqQ7EDW8G/edKsDYcAyLO8M/Ov4KNnK6W7UT9XPEbaCOyoZ3oXgsb/yxPRGwdaeWvU EYuZF9HTpyvMjHrYFTVlTIJ2EdOLhBdRaV+KU5owComgubVmHAugQDjs7U4MyIRyBkmZ hNsWLAwtLcW8P7tpEZfPOvyZ1sbK3LEPUQLewwLW9bXsSfXq03w5kp+v43eT3Euwyrig CqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154868; x=1750759668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9zZ5v4Vpa7CEYpwxAITHXRuPqXdh/9/ctvBxOwqT1vo=; b=HBvYlMVwCv3qqNzmsKUNe6a+qLDIJu2T/vtsEfLtw6x7aq75FO9Hsdmi3zqg9i1c12 xiATpUlne7qW4DqdVWx2paIRbwjk24aF3pRfnehJiB5x9OQm+9nmC+fpD07MUfX3Ml6i yjTKDcujDDj/WDqX/zVaBQs/URiO+0QRVy41AOvoajcZFyN+/Mk4lNkGKiIy9QK3r4o8 dI5pK3QkdebobB9feVwRQfEh7mCA6bBuo1NZ19H8vyypX/PzzpbOwRVTNGiz51CGQi83 erbfNlX38EsyUFWpJa+96tABG2iQYEuDw0HUE4Lb/09ue7MryIyLGJkP/3SYgh2HH4bl 46ZQ== X-Gm-Message-State: AOJu0YyU6hXO11QFxF5Hr2wrRGGR1O3p9NOCvnRPeuJ8Jj/oHOU2UV+S lXlSj+J5RHRjeQQFZdS5X/smMArp5PSZuT/dqyMkzUwBasVIxWibNK8YzUGpPrkNj9WbWBsbjfP iyvVr X-Gm-Gg: ASbGnct72rovMONiAoVwleWD2DGzP+E+CbjllsYeWW5wQz54jBRcBFOUkmSYsxetTeI xmRmu06ScaGncxmOYFF72UsZNM5yxH+79SD1OfmJ86hJXTZqEto3SmN29nhFSZ7+rn2hZbcNWrR 2WzackCHcgkgkx8EUGS6M/9Q/tAYh2uLS1usomeWIZ2wKthd4wXZq8tO9cqN7dNGp7P0F/0RV5R iayIPE2qJRTF0xy7h5NR7Sa9QIXBZ0e/Fia/YsvnF9PRzIj81dgZXIQTaljSRGslX8+5HJPT7Zv s7PdcGwX74GPTD4yZtKaq94ZvSGgwc6x70CV7h8PAtVPQrRyDbs6x/uzy7jaTDUi90hYv7M= X-Received: by 2002:a5d:588d:0:b0:3a4:f70e:bc25 with SMTP id ffacd0b85a97d-3a572e85b35mr11015526f8f.27.1750154868057; Tue, 17 Jun 2025 03:07:48 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:47 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Tom Rini Subject: [PATCH v3 06/13] lwip: dns: do not return CMD_RET_FAILURE on successful resolution Date: Tue, 17 Jun 2025 12:03:56 +0200 Message-ID: <20250617100720.2544758-7-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 The DNS loop checks for a non-zero IP address after DNS resolution, but the address is in fact never copied into the context. Fix that. Signed-off-by: Jerome Forissier --- (no changes since v2) Changes in v2: - New patch cmd/lwip/dns.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/lwip/dns.c b/cmd/lwip/dns.c index 13da52b59b9..4689ecce513 100644 --- a/cmd/lwip/dns.c +++ b/cmd/lwip/dns.c @@ -38,6 +38,8 @@ static void dns_cb(const char *name, const ip_addr_t *ipaddr, void *arg) return; } + dns_cb_arg->host_ipaddr.addr = ipaddr->addr; + if (dns_cb_arg->var) env_set(dns_cb_arg->var, ipstr); From patchwork Tue Jun 17 10:03:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897356 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061470wrc; Tue, 17 Jun 2025 03:08:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8G1oHHwtTVBKuOPGD2mC1hqkNKZeLPmB7ae7Ocb/p5GW8UL+1Qyu58ltAZzilyXLgll5tGA==@linaro.org X-Google-Smtp-Source: AGHT+IFuPx7fJBtWoW36Mf+Nv/UdsuPWUg0xvZ9nemGa8/u94YMtPl7WpRI/kNKe9o3c1gVt+KsO X-Received: by 2002:a05:620a:1997:b0:7d2:26f3:881a with SMTP id af79cd13be357-7d3c6cfefefmr2150605185a.56.1750154930058; Tue, 17 Jun 2025 03:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154930; cv=none; d=google.com; s=arc-20240605; b=jAKoFxX6bQgZ4sOh4RiiRutNbvmIm5BWx2DdToml6cHe1BKTx2l8eg0+m69ij5HkT6 7FWMtjG7V9RMKZjG66lyid52l4B1TI7wOHuqQz8tuBsOtUCkXyNsa53NYtRTtfvOzEGc ilw8e0ypCMzWYDMfLMiK//Z9XwmpYR5NJZ7Nw4GN7HMX2jG9n07cRLivxuEpuEKkNgyf BbPB0LejQUjOzvv5GFkf8VVLgwmUxc948vCpjpMiKoOrEj8pFRkXAjNY+rRAZ1h6btVZ POwPg/vlted7yxwuAjIFxNByXsm3yxyHsBee8Jb80C885lYTWLmeJf/ZU+OkHMeFphKm 36xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zw2o6MnolNwOFvuGvEw5Nc0YvBVz9NEXlG0S6QtGMrM=; fh=UmjsKB3unp9m/Fk9s1BMSQpC/5itFxyvdTSgtmH1s3w=; b=ANbNUYiN2QJBRYqKdTYF4RmuXjhR0XGqaKQCqiW3lMrari9ToW2Ah4GQDI3Q5/k3iG Fxs+G8Em4eLawSyToQ1g9nk5feL2onXgRStsS4d7hWhraIrxudZ7ZhBon10SQsYLxWIo OAM/E+iU1FhUtxjInvqG3mpPpsOU6EYr7HvyV2nKui7yFY+rQUCEgyXKQhQSdwgiG/TW FxmCzIilTVEM7xVXgcyAwZxC04mXtSzNDauH5GsCS7lZTdl+6TdWQm/OBImuBvOTBun0 YpR7g6i/s7Q9kU/FPtRnF54g8jWky6xpmSx5zuRQRFg6mGsWDpcLnDOD73VSxdapM5X8 puaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tbTzXsOk; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8dc342csi1289682785a.92.2025.06.17.03.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tbTzXsOk; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A63AB82D59; Tue, 17 Jun 2025 12:07:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="tbTzXsOk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C6E8E82CD5; Tue, 17 Jun 2025 12:07:51 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 E037A80C83 for ; Tue, 17 Jun 2025 12:07:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a4fb9c2436so3231660f8f.1 for ; Tue, 17 Jun 2025 03:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154869; x=1750759669; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zw2o6MnolNwOFvuGvEw5Nc0YvBVz9NEXlG0S6QtGMrM=; b=tbTzXsOkit8y3pSth/W4OMrs/e/QcaYEA58ERsufHCH+i0QBFe8XjXFC0NpXjflIze 2lB1Cthp4lUmtxet75gNYphgB27hLSZAxjvCCykmT3TjdFGNJaZcrQQN05dpjx0QHbCQ F9LJsROvY/hZkRT2atDj9l/n30LLVercc3MoOb3UHF1tw+7TjFrUs+UevrO1sTz+kYx2 PtHWNh13+BMmCnlK8GbrBB9LWDIl4xSJMPuxm+rDOE+p76BeOOZMyz6JBnDevBK7zhKn Du4vDyYHsCVFzZUZapUEkopuuXuAPFYEQMuvZNkBC1pdtuxWAhpfViRP7X9CP7e4Y4AV /f0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154869; x=1750759669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zw2o6MnolNwOFvuGvEw5Nc0YvBVz9NEXlG0S6QtGMrM=; b=sJuHUGCxvO2HfcYFEYv+imsNSxDc1wWyk0YQby7WryJkNnQZqf1BqwVTYz8JAzG4Fy j8xF/G0TK/2UgL7lRfWNDZ+U1IExv+jNRVpz7nvgMgpIU7rVinUaCBckhajr6z8A/Kib X2n4ogGfOJkJ55Hn7gb2wpRZhSK+9rxBGrWIJsRLVLGIIIijwHnnzvmHpVq65sCRQAvR e6GguFott7YG6/n5h0elvFemPSdzoJeraN4oi/I9PreQhyhTYLTRC6+YjHNHfB4hf0kK X+leLJr03Z6TfhArQ2dQX77WtXTSsMc9uM/5jO8Xhvury8l+XV4/FXfEZOVMPVAw2vPP h23Q== X-Gm-Message-State: AOJu0YzS/RHKBmpLQdE6u7Om8oyN9/uEVQZguCTEQV7PcF7c1jXRBF1/ b9fPO8o2qw03nMSJCOCwk8brttZ4UxyVusfyT3JKiQENOA2h/Zfmfn/75JI8F0J7xS+ISGV8Dih 27uAL X-Gm-Gg: ASbGnctCwnSnw2pDUbA3Xbl03qPNqErfB4L75pfoXmZyTwpo2eynt9ztN98W0V5LSpi JMG5CvKR0e/YJJA4Ui2ydImg8ph1PKE+/19tNODt3PlB04b+gMJRsT3Ki0uU7GvQrBlivbVt9ck F8YztWqQ2ebIFr7bH4djYWFf9zlFNqSSPrYDNeysiFI/V2ywKwMkTsjztgMnmIMpk/1yA4z/ebP iMWY99rKPhOoQ+PBqEEfwxYOSm7Ab+iVY8tT8L1+0gS9RTbRRpp7N/7pMkPpjl1vTDuZkrYPgD0 lOqBxzfPtZcevCHYl0ZKJqf9pUGA5tfSWlEbNAdIoUUCsimOlUNv23fg29RyRM6EhUcroOE= X-Received: by 2002:a05:6000:2184:b0:3a5:783f:5297 with SMTP id ffacd0b85a97d-3a5783f5770mr5786983f8f.35.1750154868966; Tue, 17 Jun 2025 03:07:48 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:48 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Tom Rini Subject: [PATCH v3 07/13] lwip: dns: do not print IP address when a variable is specified Date: Tue, 17 Jun 2025 12:03:57 +0200 Message-ID: <20250617100720.2544758-8-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 When calling "dns ", do not print out the IP address of onto the console. Print it only when no variable is passed. The reason is to be able to call do_dns() from another command in need of the DNS services without polluting the output. Signed-off-by: Jerome Forissier --- (no changes since v2) Changes in v2: - New patch cmd/lwip/dns.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/lwip/dns.c b/cmd/lwip/dns.c index 4689ecce513..344f9a68bb9 100644 --- a/cmd/lwip/dns.c +++ b/cmd/lwip/dns.c @@ -42,8 +42,6 @@ static void dns_cb(const char *name, const ip_addr_t *ipaddr, void *arg) if (dns_cb_arg->var) env_set(dns_cb_arg->var, ipstr); - - printf("%s\n", ipstr); } static int dns_loop(struct udevice *udev, const char *name, const char *var) @@ -107,8 +105,11 @@ static int dns_loop(struct udevice *udev, const char *name, const char *var) net_lwip_remove_netif(netif); - if (dns_cb_arg.done && dns_cb_arg.host_ipaddr.addr != 0) + if (dns_cb_arg.done && dns_cb_arg.host_ipaddr.addr != 0) { + if (!var) + printf("%s\n", ipaddr_ntoa(&ipaddr)); return CMD_RET_SUCCESS; + } return CMD_RET_FAILURE; } From patchwork Tue Jun 17 10:03:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897357 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061541wrc; Tue, 17 Jun 2025 03:09:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW9k1FtUnGZ/gdAG/N3cYwRUWBA6JSHXXKRDEpGLGCKFY6bfQOSUhUlMlqGIQ+sk3FjW0qEyQ==@linaro.org X-Google-Smtp-Source: AGHT+IFyrwdFCzcTrB9zIOz8B35fdfdyv7a4W7ZOw9dYG2ST5Ruj7D8kvPoVnaFb5ZCXQHenC1C+ X-Received: by 2002:a05:620a:46a0:b0:7ce:f094:3ec9 with SMTP id af79cd13be357-7d3e03b11f0mr283337385a.5.1750154941629; Tue, 17 Jun 2025 03:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154941; cv=none; d=google.com; s=arc-20240605; b=iTLdvXhYCW4qBAz+kj/gXeT51EwT887w9rS+DSpj2pFYD3xA3XaLT2lwB1vduP0A/J WbGYBUKoEzc4jzIkMVQDXnfW2HRKVkQI4KanuJ7dwLtg1Fp4xNspsVx1R7LpVDh8uIa/ dvQM7WmOovhvoB/Sm3anWhC9Mw/p5kTexEaJv4omUVj3J8roQeG1dant3xDmRGBGfHAO mHn4AcVt/U0AKmS2GVyPiVI8X/LQIchnN916RZZVHdorB/zduaxJfiE0LSCs0TZXDRoQ carfo8/IpVmn034F3k6Yww1rRlEsJGsgS+MM4EzWQUH38Z2x76tGeITcmmOjfiHjYcbC CqFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IJHk/OIQAK7p2slUDuw7khsvXEgoqUGdrCgMhts+zoA=; fh=ZbASfCYyCrerMZnlp3wxBtwpTsc6/VSitpKjs0aGt1c=; b=VOpEZThjJ421D0z8v3zeajPwrBBR4hA438XOYlaP4mVMVxY9yv3aQToFRitMK3y9HB 4PTRl6J6mFoCjvuITVpHTViiWkCNZpCEGlyL8Mdxzr1kziOeD1Y6N73in84j8XHr908+ 5MvysU13AyH7R8MlpAoSVqycY0hovWgIWemi5ZiUVKzZU2uEl6BYC0gLvzMQvwsNS/QI FmKnEgd1fnu4Z3kXWBWqbpI1Qemv1OSPsiOqGXr/8rnHiJBwVs2tV4cQnp/zVXcyzrEH 1yhCtxnEP3xDtmxGvo+wcnKnF7zzeGOlEyzLMIsut7kh/TzYYBRMZqZMnupO0AZKIH5g xAYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XOHkfnjj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8dc6617si1170523785a.38.2025.06.17.03.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:09:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XOHkfnjj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00ACF82D66; Tue, 17 Jun 2025 12:07:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="XOHkfnjj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C95DB82D06; Tue, 17 Jun 2025 12:07:52 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 D746382CBC for ; Tue, 17 Jun 2025 12:07:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3a5123c1533so3124470f8f.2 for ; Tue, 17 Jun 2025 03:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154870; x=1750759670; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IJHk/OIQAK7p2slUDuw7khsvXEgoqUGdrCgMhts+zoA=; b=XOHkfnjjH+9IFlNbTdqcLdkHcNsmD+F03MgOX8v4IdPJIBBzV4gbMntR1wWDjLd2XS 9epGbGHUHn8jbDj6WgNXophs29YUw0ROTJrqml9VALsu5KhGwYrZf95Sv0DL6OkQg77e F8J59wE3apd7TnAEUdMgSyyOtfht//X48DcJxIBd5WvrJ7RCWvZpUEhUMIxWxlstD+m6 xvbQtwaSDkdmagEs+sxb2mhbkCwN1CnGLalNAenTcPCItYic28S9uf/Gwvhuim9b5ftp qpWNgaudhDnH5lKpVzXQtCU4Bq9REroRzUMIP/4oRthagkpksKTdHTUORw6s4tA1x+fp 9Qdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154870; x=1750759670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IJHk/OIQAK7p2slUDuw7khsvXEgoqUGdrCgMhts+zoA=; b=MhQoMhjIgCG6uTuVKclxUx+CIxXRAN6nPKgyr4PXerEiUP18SO1abKSUP2Wy8WC3R4 vO9ltHxufclD6e/57g/S355vRoJop9UyKkPLxboFtQzPmiQI5Q0DRMhpwF7GNbT4jrSu n0ogN3YUe4HnQVb6bknWCV32jOUPR//TnU/DCRtgS+s8EBkFiY6ykg3PFldbg0OkxplI pHe3FjTSL3MZz6DrStIY/L9OhfgYpEVKa8x/+ralJD3F3rmCYqTG9Ng8AHuKUKCYC7YW 41TT8qbHLAZ71il8H5qWIDOmBKrynciF+tyigqnt+Rsm5LvDh9eZJ86xkog5gD+HXSmJ pwbg== X-Gm-Message-State: AOJu0Yzpk6DvW30hNAS0vgFr3PRFi3kEv3rY46EsT6y0gLGQl2AXMak1 iMYL+eE44P4ssT2oZ3uPxV5Uma20jG/EL9E/xe0B2PKgDCjxDhxoWbAyBUT2CRbSriw+0GAvEbr 3WSdA X-Gm-Gg: ASbGncsPjYXtgzpZuFCi/ZEt1waTqOL4AcICOJLwwmBeUc7HPinoW1o21avNbbZMoDA vefVtiUQUGh+lVotLVideRdGjDEprjhPj5Oz6aUHp4obRFAtrEFpKF7vLbkZEmBZc2nX8rxJ8Rz lf8sI3wZWDcfT8uhdvcVrYVV+Yw1+3zq5QjmLvReJgdRV0KkywfEAUJtPtZj8VzD2oSSrJ3zJuV dIdoCQm4SYd4TrZ1UenQ5tUI1IQ2iLoQLFyfn6z7F2xkIFoLtgqFZowpDNHTmJSAb2UZmI/Xdw4 Crf2Bbz708Sd9jDKZAY72yb1yfzLxEFn3ivyHHgsbIf+CzssXszH7HZ91TPpvPt5u6KC1aqaY86 QohU83A== X-Received: by 2002:a05:6000:230e:b0:3a4:ebc4:45a4 with SMTP id ffacd0b85a97d-3a572398fbbmr10465363f8f.5.1750154869911; Tue, 17 Jun 2025 03:07:49 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:49 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Simon Glass , Tom Rini Subject: [PATCH v3 08/13] lwip: add net_lwip_dns_resolve() Date: Tue, 17 Jun 2025 12:03:58 +0200 Message-ID: <20250617100720.2544758-9-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Add a helper fonction to convert an IP address (supplied as a text string) or a host name to an ip_addr_t. Signed-off-by: Jerome Forissier --- (no changes since v2) Changes in v2: - New patch include/net-lwip.h | 1 + net/lwip/net-lwip.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/include/net-lwip.h b/include/net-lwip.h index 9c1167482e9..299df29ace9 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -37,6 +37,7 @@ struct netif *net_lwip_new_netif_noip(struct udevice *udev); void net_lwip_remove_netif(struct netif *netif); struct netif *net_lwip_get_netif(void); int net_lwip_rx(struct udevice *udev, struct netif *netif); +int net_lwip_dns_resolve(char *name_or_ip, ip_addr_t *ip); /** * wget_validate_uri() - varidate the uri diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index f05c4cd3f64..c9a7114bbff 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -315,6 +316,44 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif) return len; } +/** + * net_lwip_dns_resolve() - find IP address from name or IP + * + * @name_or_ip: host name or IP address + * @ip: output IP address + * + * Return value: 0 on success, -1 on failure. + */ +int net_lwip_dns_resolve(char *name_or_ip, ip_addr_t *ip) +{ +#if defined(CONFIG_CMD_DNS) + char *var = "_dnsres"; + char *argv[] = { "dns", name_or_ip, var, NULL }; + int argc = ARRAY_SIZE(argv) - 1; +#endif + + if (ipaddr_aton(name_or_ip, ip)) + return 0; + +#if defined(CONFIG_CMD_DNS) + if (do_dns(NULL, 0, argc, argv) != CMD_RET_SUCCESS) + return -1; + + name_or_ip = env_get(var); + if (!name_or_ip) + return -1; + + if (!ipaddr_aton(name_or_ip, ip)) + return -1; + + env_set(var, NULL); + + return 0; +#else + return -1; +#endif +} + void net_process_received_packet(uchar *in_packet, int len) { #if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) From patchwork Tue Jun 17 10:03:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897358 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061599wrc; Tue, 17 Jun 2025 03:09:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUO77gRpOQs1eBTECshXPYq9I16RcIuyiGKj95ArSWUTZjUMsmMTEXZ2JmijZZs2zmWSRI3cw==@linaro.org X-Google-Smtp-Source: AGHT+IFcfnf6nGSj3Y1sSVyl2Co+j1+687fOSr1TvvvyUJ5GdUbekt5tNXq4Fpg8JoozQRo06tuv X-Received: by 2002:a05:620a:48c:b0:7d3:8b87:37cd with SMTP id af79cd13be357-7d3c6c08a9emr1649067485a.3.1750154952803; Tue, 17 Jun 2025 03:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154952; cv=none; d=google.com; s=arc-20240605; b=VMj5vQMhO11xJed1b6/Rt6USbZW7KngNnnEMtFX+JNPQ06yiqLR0bnsHQDZqAXeWjb LMoif2gQIUxGTZL2Sux5zOo6vVPcihFMLAY5gEfoZcC1+wTOMtm178bzH0Zn3lGGrVyU h+7y8xQ0XFqc4IkG0yNvOk7dZTXxtiwg8BfrQ47fyAfA/FkWIIQHmR7WE2tkjSMygAfw 1TWGfsNZywSWQ0Nq96DkNikl1uSrweRngKVY8IWMTi6Q3Zcx89OtO6kW7qdVjVm+0NY1 stl3DuuH6m8ItqcSEsSpXGtFKLbkBVjkdMLmG4aSlyXqzs7jwkkxMHHGnzbchqQ8x1T0 H/6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MkjgIbxAHU8Zj90b6X0L5ImxJYsM1pvo4wIHkeMkn8g=; fh=NhVI5B199TYN08tSLlofnXu2IV8l3rTSQ2Au7qwsF0c=; b=PTHdTm6pfZaYxD+jd38OHGSuKvpn5mEzImo+kDPShTWGeD0crHoiR5/nkgxNfA5n/J B0Qp61kOvgoePC9CxwmoRqJHQehDbP+KT+qKTbI5S1az6cUdTXesrxWMX7N5jpKJBc9+ oHGxRVqbah2dHpb7Rf7tDfWAou/dTlNo3XpzCV4Osuasu6NPBs0yLiDrOsIiV5ZOOoVF F3aYSvpGADcENLUHV1CzcyBKbSq9mpJzgzBI9fSUDTTV5XJh7Wb5nZ0S3yF9Ne05rfXe bS2JEauS8ReWLiZVFLxp72m2RlYGFiV2x2qojEoPCN/atlitVV728XNx1mseqMU6w6pv qJVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvtihFz8; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8dc3472si1261638085a.25.2025.06.17.03.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvtihFz8; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 55E6D82C87; Tue, 17 Jun 2025 12:07:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="fvtihFz8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C50682D3B; Tue, 17 Jun 2025 12:07:53 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 A5D0182C87 for ; Tue, 17 Jun 2025 12:07:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-441ab63a415so63436945e9.3 for ; Tue, 17 Jun 2025 03:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154871; x=1750759671; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MkjgIbxAHU8Zj90b6X0L5ImxJYsM1pvo4wIHkeMkn8g=; b=fvtihFz8daF/5kVSNiWiIKwOWZYNbT+4VcYAH09tvZ4MCtRQ2Mj3LgeDp59tWNIUJx LFNjXAHVNV+rGPLQJ7zsE6P4Kg/XBUjUM4fKv4HykHgnOZxMPgLGn4XONn7Mnlt+BXD1 y1lacwb4nebFl8fQej2NgUDVBWMyZsQfZWN+lGO+SK7oyC4INagfw3Vs6Q/cZ859P2wB k1ay2PcP3qy3cEj0l5BPuPWHjoYR2Y7e08YxcuDK4p5Kp/sXbca3/0S0KSSIknnjW6l6 vPwIr6U6yMDhZl4VB5bvzX/fqZ7+UjL8vcuOCcZZw+ACqUiHSk6e4piwQ7Hw0M19QUrl yA/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154871; x=1750759671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MkjgIbxAHU8Zj90b6X0L5ImxJYsM1pvo4wIHkeMkn8g=; b=b6aRzkP8qtbp3DAggBhqF4gUolQTFM1MxdSN73fnVbHBd0S9ElPy5ebTY7ffJwAK+g 7GaDKbeMwlWdouVBkAbKUecqeYl1wsMWvEN6G/2IDuAemBCiDr6CBJbrPMsZ+X0dRvCp jtlcVM+Xau/yiu3RCEqtk6/Rv77YADB+FJqCYXzKgyujEHFGQae8nUHqsU3/IYXxqj1g y8IJAXhBLTLnjvbKjzLVT4miuIZ9SiK+A06ntXi2IR1/97FTmbsVgpixoix9ydxTCz69 Xing3ehiy35xR6NDqn4AcD2Oi1Cn8REGoJtVe2Qb5TLf/WI7yEDqEI9DKPCAWq9kic6i OfTQ== X-Gm-Message-State: AOJu0YynUSDacpamdqKx2DayqTfRWpNRzL622FKykt7zS16EAAE1trcJ M0M+jrXeaNh5ehumRUNO+bzolo5tg1Apa2IkcvTAdftMVQsUWvxigZ45MOoG7K9vDaopLun4+7c JHni0 X-Gm-Gg: ASbGnctWsk3+YSYgMM9DxaE4A4wyjTAwri4GpOOagiKnOlyq3+J147bBXza+H7IOH6J LmTciZgEKfaS9RNlB3lRGo1IWLbrnpWDIX3BIgez9TL5LAZLa9oQLD/1UKwRmX+sLCTN/KVc1s9 sj+GPZaHoA6P6+2Nwbhy+Qa72a0eiYCE4X3svSmnPCzSsqw4h4H53IRTK0vgc7zj+bYMcmmXGuj MteoYPkg+onyui+ROizPD0ny96KNGpCkQM0fYc/WsIHWeC0dTMPL71WkskZtjCr1Zvry8KaqAcN 3M5U4lSn4oqP9p/qFKZL5FnqdS/hS3HHtuRg3tsbWyIhHthcHieXdzSy7A6aci2WyqU/eCY= X-Received: by 2002:a05:600c:698d:b0:439:9b2a:1b2f with SMTP id 5b1f17b1804b1-4533ca46737mr130972665e9.3.1750154870826; Tue, 17 Jun 2025 03:07:50 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:50 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Ilias Apalodimas , Simon Glass , Tom Rini Subject: [PATCH v3 09/13] lwip: ping: accept host name when CONFIG_CMD_DNS=y Date: Tue, 17 Jun 2025 12:03:59 +0200 Message-ID: <20250617100720.2544758-10-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Update the ping command so that a host name is accepted in addition to an IP address, provided DNS support is enabled. Signed-off-by: Jerome Forissier --- (no changes since v2) Changes in v2: - New patch cmd/lwip/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/lwip/ping.c b/cmd/lwip/ping.c index 21a30228642..51e37111ca9 100644 --- a/cmd/lwip/ping.c +++ b/cmd/lwip/ping.c @@ -14,7 +14,7 @@ #include U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host", - "pingAddress"); + "pingAddressOrHostName"); #define PING_DELAY_MS 1000 #define PING_COUNT 5 @@ -168,7 +168,7 @@ int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (argc < 2) return CMD_RET_USAGE; - if (!ipaddr_aton(argv[1], &addr)) + if (net_lwip_dns_resolve(argv[1], &addr)) return CMD_RET_USAGE; restart: From patchwork Tue Jun 17 10:04:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897359 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061675wrc; Tue, 17 Jun 2025 03:09:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX29Cje+BJKngEJRsxQdHR1P/YZWcMWNmmhza4+1XNmUEMvtvLlBT8vNp1JXx0Ld8RYYvaUWg==@linaro.org X-Google-Smtp-Source: AGHT+IGTgPJXchNNYSbTyuyAJdMos07qdjmP/w3Q0RzhG/3fWGTepriokJHLcSvotusGF9YQdRB/ X-Received: by 2002:a05:6214:27e4:b0:6fa:bedb:f61d with SMTP id 6a1803df08f44-6fb47725ccfmr194198956d6.14.1750154963330; Tue, 17 Jun 2025 03:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154963; cv=none; d=google.com; s=arc-20240605; b=IfnX+LKN7LkPSdckzdz5peTJAFodEXOhfZUNY0tzLMTG5RGIbUOY3ArG/e+IWcrVuQ SEIUouk6ghnoB+xSmK8woyTNcZ34BNE+vZFF1wPbQilOafuFP26mzcUsd3I7ASwggzCZ wa2hK2Mc/JTG3ENXgqBlPxd5BJQD5m4GugsLRcWZbMsx1fbiryiIZPfZUPfhDHk4s4Vu /z0E1inbMhuwJLhTUP5LkNaZuZ7QxmbTIpEmKZoy8cCDzzSFinVHVhPV8J6xXTK+57f3 I5Br7wUnbDjTn3+Krfr07GVbziJfCWi8XkWmwLNGYBHrXhX+YbPcUqZKGmCVZjewWhWs GpTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YYAng4b1PFv6aatTjr0TOnkP6IgSAMBiynf3klbsjUk=; fh=+TzJuMMnKDMsbGyXcXAynrdn4hYe+uVLmq5NLJkVciY=; b=Pf23YCoGnaToP7/AfUaLIdK3dTiKbbMh8xLkvqlBj0J6sj+GwVdMXnq+H82tHNQu5x sxmaLx8HK4r0tsvaLEA5aUbQc3CVGnXqcANrjSZInR76opO/EjvMKQCd3CM/sg//JjDP d9XAJz387myc6EYiul60MNaGfabP4tU02Zvyih0xyicoXcguRV96jROhqwY5HMX5T308 NUfhyqoA5/dmCgWeptHBloHyly6eQ3CZ/SFcJ9/wGBP8SexiF+4WWVyyPw8WmG6okZWm nRAbQSUIxnenIsLdHkCyd638dI/u/216YKZxOteW7GyRKevT1Jc7p78W8FS/Rc5qEao4 BceQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v3NHa6L1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 6a1803df08f44-6fb4b88aa2asi73599146d6.497.2025.06.17.03.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:09:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v3NHa6L1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E7C6A82D09; Tue, 17 Jun 2025 12:07:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="v3NHa6L1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B57F82D83; Tue, 17 Jun 2025 12:07:55 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 A930280C83 for ; Tue, 17 Jun 2025 12:07:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43edecbfb94so61366695e9.1 for ; Tue, 17 Jun 2025 03:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154872; x=1750759672; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YYAng4b1PFv6aatTjr0TOnkP6IgSAMBiynf3klbsjUk=; b=v3NHa6L15NTGJdnTyJIu+IcQrUDcNJWs61XIO8LjPZYyswYN1LSkK2hyDskztzy9z/ Gf744JegQj3q7IurnFAB6ysF7KjR3qvj/JPE4fT8B0BQgy3SiVb767t5m2hRmEJ3VpnK zysP6mzWCHUb7azV6PgGaMuh5uTx62AqNoTnm2h+M/uaA3P7DzpSUKkFd5QGtRoJpfLy TkrReNeb1nQrSuoHrbjWRAtQ8ijrpG80WD/sZqAoj3Ep5CTNUAW0+w2BeZnLRiG8nlo1 ij1Jx1HrUP0UDxITcve9V0RwyS3XMjZZvZjbkBk8q8qJsm0QKYAJppE2RErHGcW1MGBQ hwUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154872; x=1750759672; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YYAng4b1PFv6aatTjr0TOnkP6IgSAMBiynf3klbsjUk=; b=F/bKZfCSB7EELG9nGlDo7lmSs6SFtDfyJ7ByCCK5E2E10/5RMxmhGtvo/Y229J5S/w 0OGLKmA31QIU6lwLG75ZbYdU2VIISffH6M+YQCdP5dWDW1OmvnjCA0AC6myq7NWmrqie DGR6HfuXDV82S5mfEGDPEG0vWDeQvuykNtQxtgVjXseQvj+bdOex/qci9EBUA8XS0fN4 P+hDPpRgr2Hi7oPjElR+JGbSp8UU/XVkooRTO55JQCEc9J0jJMs+jkiRL/P43VI2c9O1 XgaTA66kqDssWDSRt3Hy6wA3gNQ91ClugXiLg4BUX5RRXbr9LsliK2JB0wOjdHst41OE BcvA== X-Gm-Message-State: AOJu0YzBMV4J3OE5/J/eZt/39tw90dS4ppNetHvt632BMdj/F8Qn3Fff BBMWmqoKP2eXDCM2orXx3v26BVlG+xMwWuWXhyxAv/Q7Ywv0bjn6Wo5SncxYdi56+uRDqSln/0n rKHPP X-Gm-Gg: ASbGncsojbCsqbdFb/2EErHuy1Ix4cjvBbckYeVH6Hok33D1QXS1+l++vqhwqYSyDV5 YYF9F4Ut1L/rhFy05t++ZyE3FAaV06x4DomAMYEPK53+9X1+mbn1230Usy/gDnndF3q5ZMUCazW cAJ3fM3/advSpqEvNNehDohvSQmhNYO0OTq5eafpbmgDGadBzh1apcV0qMSbfR31pOWCSQ0LviV IYwTiYzpGlUp5Ct4VErIgLoMlc4S+PYyx8C8sHhdonTrb1ZLm01auIzrHwzn7VUwgdiiR90W+fZ xjl5NBJ2yRQMa3qwZnJS6PaWRLP4zfTR75rs2eiqwxifWFwXmO62zb3E2/IHt0lFhKO1Du2KANx 0f4JLPQ== X-Received: by 2002:a05:6000:2c12:b0:3a4:ebc4:45a9 with SMTP id ffacd0b85a97d-3a57237478emr10566980f8f.19.1750154871815; Tue, 17 Jun 2025 03:07:51 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:51 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Heinrich Schuchardt , Ilias Apalodimas , Joe Hershberger , Ramon Fried , Simon Glass , Tom Rini Subject: [PATCH v3 10/13] net: extract function net_sntp_set_rtc() from sntp_handler() Date: Tue, 17 Jun 2025 12:04:00 +0200 Message-ID: <20250617100720.2544758-11-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Extract the code that sets the RTC clock from sntp_handler() in net/sntp.c and make it a new function net_sntp_set_rtc() in net/net-common.c. This will allow re-use with NET_LWIP. According to [1] it is safe to assume that all devices have been converted to DM_RTC so drop the useless code. [1] https://lists.denx.de/pipermail/u-boot/2025-June/591376.html Signed-off-by: Jerome Forissier --- (no changes since v2) Changes in v2: - Drop the non-RTC case include/net-common.h | 2 ++ net/net-common.c | 23 +++++++++++++++++++++++ net/sntp.c | 23 +++-------------------- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/include/net-common.h b/include/net-common.h index 7853612b237..c212d2f9b3b 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -588,4 +588,6 @@ extern struct wget_http_info default_wget_info; extern struct wget_http_info *wget_info; int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info); +void net_sntp_set_rtc(u32 seconds); + #endif /* __NET_COMMON_H__ */ diff --git a/net/net-common.c b/net/net-common.c index e01b0da7d7b..b064557d524 100644 --- a/net/net-common.c +++ b/net/net-common.c @@ -1,5 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 + +#include #include +#include +#include void copy_filename(char *dst, const char *src, int size) { @@ -25,3 +29,22 @@ int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info) wget_info = info ? info : &default_wget_info; return wget_do_request(dst_addr, uri); } + +void net_sntp_set_rtc(u32 seconds) +{ + struct rtc_time tm; + struct udevice *dev; + int ret; + + rtc_to_tm(seconds, &tm); + + ret = uclass_get_device(UCLASS_RTC, 0, &dev); + if (ret) + printf("SNTP: cannot find RTC: err=%d\n", ret); + else + dm_rtc_set(dev, &tm); + + printf("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n", + tm.tm_year, tm.tm_mon, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); +} diff --git a/net/sntp.c b/net/sntp.c index 73d1d87d38b..77cee0046bd 100644 --- a/net/sntp.c +++ b/net/sntp.c @@ -57,8 +57,7 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip, unsigned src, unsigned len) { struct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt; - struct rtc_time tm; - ulong seconds; + u32 seconds; debug("%s\n", __func__); @@ -69,24 +68,8 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip, * As the RTC's used in U-Boot support second resolution only * we simply ignore the sub-second field. */ - memcpy(&seconds, &rpktp->transmit_timestamp, sizeof(ulong)); - - rtc_to_tm(ntohl(seconds) - 2208988800UL + net_ntp_time_offset, &tm); -#ifdef CONFIG_DM_RTC - struct udevice *dev; - int ret; - - ret = uclass_get_device(UCLASS_RTC, 0, &dev); - if (ret) - printf("SNTP: cannot find RTC: err=%d\n", ret); - else - dm_rtc_set(dev, &tm); -#elif defined(CONFIG_CMD_DATE) - rtc_set(&tm); -#endif - printf("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n", - tm.tm_year, tm.tm_mon, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); + memcpy(&seconds, &rpktp->transmit_timestamp, sizeof(seconds)); + net_sntp_set_rtc(ntohl(seconds) - 2208988800UL + net_ntp_time_offset); net_set_state(NETLOOP_SUCCESS); } From patchwork Tue Jun 17 10:04:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897360 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061749wrc; Tue, 17 Jun 2025 03:09:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUm/QDsLGv/EjIt4x3ksf+DAJjJqfhMYBD2whthecbMij4NEgOi+v6wW+Tpl/o9eNrFQ3Q9Ng==@linaro.org X-Google-Smtp-Source: AGHT+IGmb8ShMCNaXgT6/zOOu51yGBczRlsODK75yOcMLAHL82J+livk44v4hpeYTUsSU305qGnn X-Received: by 2002:a05:6214:4b10:b0:6fb:1c3:f527 with SMTP id 6a1803df08f44-6fb47798242mr180662016d6.39.1750154973829; Tue, 17 Jun 2025 03:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154973; cv=none; d=google.com; s=arc-20240605; b=JT+I9GRCxBnvb9cajWe1oj9xcBJSBsbc8A60cjKr8MRg2vlciBFKvtY7cRqjTT04fk xKCeTV7Hod2DPURd4TX94EZN/Yf8kXBLWVFl1U6CpJ/vdvipxGyhLZ50ooFHkApUhtvz LwxfOalHrnVkpSW/jBDBFV7qH/QFRBKXI6BQ1paOSnS8Fz6SgpOqujl0x63+SXfEy0hS wL/MqJMZmf9h+xkbFucVpq5epDDAKQAQyk0k8SIF5VaA+8fzPSd8apFds0hiDOrpXrFf FPLQOTgnppQjbJvnD8n84YbtJO9MIWKFLFWCo1OVZruaisBlrNwKplvxq5eJocXenjm5 YyrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6FRdVmrBijhW1AWivYtwFjvoXrM75h+S+QcFgTAOkCA=; fh=TJSl+iGQrF9yEQ4WEdbNi7jdqpnzCA3AiPdCWlfwD0M=; b=ZZHrvcMGmcSJEPx+zeOU9RqzmKY/nYBvrwk4VQbFYccFCQQw5RLoQrVE3UJ4LesYyN R2NEdt6RtSDqqBcRsHpphd9+6cvvLe81zVkhSdI48Zo81XliizLvXqY6kyxtxu2D3xtN Ux2ihjOand+Z6DWHXu/M3gw1K8QandXoUimAACYAbMM2tLfHtrKN2XexmIVpcRBshNkC DEvklDYMlZaApapE2gOwOIoq6htexqmoMVvrOrAak/ZjQcT8den6KASx2kVND6u0gTOB poAYYX1iAC7t7LIXTe1E114B0JgoWvrcuQVRiPT4iMaz0hTqr76AHkcz0zJ3FIECcCL1 Hj4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qcSAWByy; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 6a1803df08f44-6fb35c414e9si127857686d6.509.2025.06.17.03.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:09:33 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qcSAWByy; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40AE282D60; Tue, 17 Jun 2025 12:07:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="qcSAWByy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 185EE82D83; Tue, 17 Jun 2025 12:07:56 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 954AA82C87 for ; Tue, 17 Jun 2025 12:07:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-450ce3a2dd5so51914705e9.3 for ; Tue, 17 Jun 2025 03:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154873; x=1750759673; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6FRdVmrBijhW1AWivYtwFjvoXrM75h+S+QcFgTAOkCA=; b=qcSAWByyhF4iRRDRasmqaSCAnVBUMtkTIi96foUFg+iF90mqO4NyxG6EEoMsX8pflA UldpuV3kUuHy++c07RKAxCQ/+7OeW2zrVL89CP65ZsABgnfLf0LHwLQxB62u0tJ29YMt 2o5gZQ+CGeWEoYcJWmyHC8QxX6J0QJK3gZNCxuO45t1mwg5CZtd7jf6tX0vOUR7DAPbA S01MqIcKueqTtwUrAsrdbCKtnUPLQI4rr+FsIqezwvM0i/mgv1xDf6l+qqAzBHZvPQ7T 8dQooamhlg8wK/2VtlIvk4s9O1Ot0EbqS4KIHNO/XOsZ7pikSUN9+XqmJu8pu+GBl3DB IhGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154873; x=1750759673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6FRdVmrBijhW1AWivYtwFjvoXrM75h+S+QcFgTAOkCA=; b=Nwz8jypGs2+uvfB5O+pYYXVaDDPrqFfabG6AD0DxrNyg0IKtYsW22KebBSe8FFNDiY zm3ji8iE50E9tNR9ehMBR2LXZ+HNAjZStNlxKdbh2HUvAUI2CR+x6B3ym9OMDG9YCOFh iaJdc+2yZPFaod31yY6LOFTI9UPvAzgFyUAQwWs8bZU0h692iagJ3TXIuruqPzCzWgLI lBN2fTG989UZVmEZ/rl89yxGPbpIvhyNZ8j0BS8tbpFFFc5Wkcb45bbTC/SZN4qksv5i LKJI0+IuSwNjuxTaIc1j++eMVUfkjTS6ePd9XB0U2Dbou0CwklYUhDRH7fWLqbpnPaXO 6d4Q== X-Gm-Message-State: AOJu0YywX9xIDOtV6+YX+mVd81VXKizgv7QbrLnPA7/bTkYEweGcjgld 0eLdKNF1YAmhVzgfL1DTIkvCOOZosvI0mu+5DCWVFZGaNmy1nnN83BMv8LrqJxkab9Lyr0sH2np V28fW X-Gm-Gg: ASbGncv4t7R3YaX/G8+2/Qsiuw/yIgvfeJ6Pxu6TTtRlZqv+gCHivhZ1A64pmnRruXW U5+NsZ4i/MRxAEbbOQlFdHyhtPvuYQD4/xJ72J0FPrNaGPLm6c665IniW3wwvArNJcLIdkyZxT+ +iwZbJfYFzx+OPkt2VELXfh1xQc9UQLE0JF/ME7pT6675bUOUN+vfh6DFr5rP1XrR0D09+0xAKU ZqmkBxarvBnYhW8IWc9AuGDR3MYfuOTrPoWw7p1eqpEnu/3vsuBmvkXQ1Zcu2bA2Gc/y8+E3qtq 5ueidb1T9YxxVCtCqaAZkWIWOhYqt8/Lw2k+ul1orQNuoeKXlJfKBzsjDM18nCXUHD3NeHU= X-Received: by 2002:a05:6000:650:b0:3a5:8c27:8644 with SMTP id ffacd0b85a97d-3a58c2786ffmr383576f8f.24.1750154872698; Tue, 17 Jun 2025 03:07:52 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:52 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Heinrich Schuchardt , Ibai Erkiaga , Ilias Apalodimas , Javier Tia , Mattijs Korpershoek , Michal Simek , Simon Glass , Tom Rini Subject: [PATCH v3 11/13] lwip: add sntp command Date: Tue, 17 Jun 2025 12:04:01 +0200 Message-ID: <20250617100720.2544758-12-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 the sntp command when NET_LWIP=y. Signed-off-by: Jerome Forissier --- (no changes since v1) cmd/Kconfig | 13 ++-- cmd/lwip/Makefile | 1 + cmd/lwip/sntp.c | 133 +++++++++++++++++++++++++++++++++++++ include/net-common.h | 11 +++ lib/lwip/Makefile | 1 + lib/lwip/u-boot/arch/cc.h | 4 ++ lib/lwip/u-boot/lwipopts.h | 4 ++ 7 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 cmd/lwip/sntp.c diff --git a/cmd/Kconfig b/cmd/Kconfig index f21d27cb27f..58f629e1c34 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2061,12 +2061,6 @@ config CMD_CDP and to retrieve configuration data including the VLAN id using the proprietary Cisco Discovery Protocol (CDP). -config CMD_SNTP - bool "sntp" - select PROT_UDP - help - Synchronize RTC via network - config CMD_LINK_LOCAL bool "linklocal" depends on (LIB_RAND || LIB_HW_RAND) @@ -2144,6 +2138,13 @@ config CMD_PING help Send ICMP ECHO_REQUEST to network host +config CMD_SNTP + bool "sntp" + select PROT_UDP if NET + select PROT_UDP_LWIP if NET_LWIP + help + Synchronize RTC via network + config CMD_TFTPBOOT bool "tftp" select PROT_UDP_LWIP if NET_LWIP diff --git a/cmd/lwip/Makefile b/cmd/lwip/Makefile index 4c28d2b28e5..a7f8976af3f 100644 --- a/cmd/lwip/Makefile +++ b/cmd/lwip/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_CMD_DHCP) += dhcp.o obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_CMD_PING) += ping.o +obj-$(CONFIG_CMD_SNTP) += sntp.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o obj-$(CONFIG_CMD_WGET) += wget.o diff --git a/cmd/lwip/sntp.c b/cmd/lwip/sntp.c new file mode 100644 index 00000000000..32cbdfbffdf --- /dev/null +++ b/cmd/lwip/sntp.c @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2025 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include + +U_BOOT_CMD(sntp, 2, 1, do_sntp, "synchronize RTC via network", + "[NTPServerNameOrIp]"); + +#define SNTP_TIMEOUT 10000 + +static enum done_state { + NOT_DONE = 0, + SUCCESS, + ABORTED, + TIMED_OUT +} sntp_state; + +static void no_response(void *arg) +{ + sntp_state = TIMED_OUT; +} + +/* Called by lwIP via the SNTP_SET_SYSTEM_TIME() macro */ +void sntp_set_system_time(uint32_t seconds) +{ + char *toff; + int net_ntp_time_offset = 0; + + toff = env_get("timeoffset"); + if (toff) + net_ntp_time_offset = simple_strtol(toff, NULL, 10); + + net_sntp_set_rtc(seconds + net_ntp_time_offset); + sntp_state = SUCCESS; +} + +static bool ntp_server_known(void) +{ + int i; + + for (i = 0; i < SNTP_MAX_SERVERS; i++) { + const ip_addr_t *ip = sntp_getserver(i); + + if (ip && ip->addr) + return true; + } + + return false; +} + +static int sntp_loop(struct udevice *udev, ip_addr_t *srvip) +{ + struct netif *netif; + + netif = net_lwip_new_netif(udev); + if (!netif) + return -1; + + sntp_state = NOT_DONE; + + sntp_setoperatingmode(SNTP_OPMODE_POLL); + sntp_servermode_dhcp(CONFIG_IS_ENABLED(CMD_DHCP)); + if (srvip) { + sntp_setserver(0, srvip); + } else { + if (!ntp_server_known()) { + log_err("error: ntpserverip not set\n"); + return -1; + } + } + sntp_init(); + + sys_timeout(SNTP_TIMEOUT, no_response, NULL); + while (sntp_state == NOT_DONE) { + net_lwip_rx(udev, netif); + sys_check_timeouts(); + if (ctrlc()) { + printf("\nAbort\n"); + sntp_state = ABORTED; + break; + } + } + sys_untimeout(no_response, NULL); + + sntp_stop(); + net_lwip_remove_netif(netif); + + if (sntp_state == SUCCESS) + return 0; + + return -1; +} + +int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + ip_addr_t *srvip; + char *server; + ip_addr_t ipaddr; + + switch (argc) { + case 1: + srvip = NULL; + server = env_get("ntpserverip"); + if (server) { + if (!ipaddr_aton(server, &ipaddr)) { + printf("ntpserverip is invalid\n"); + return CMD_RET_FAILURE; + } + srvip = &ipaddr; + } + break; + case 2: + if (net_lwip_dns_resolve(argv[1], &ipaddr)) + return CMD_RET_FAILURE; + srvip = &ipaddr; + break; + default: + return CMD_RET_USAGE; + } + + if (net_lwip_eth_start() < 0) + return CMD_RET_FAILURE; + + if (sntp_loop(eth_get_dev(), srvip) < 0) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} diff --git a/include/net-common.h b/include/net-common.h index c212d2f9b3b..885ba97fdf3 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -505,6 +505,17 @@ int dhcp_run(ulong addr, const char *fname, bool autoload); */ int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +/** + * do_sntp - Run the sntp command + * + * @cmdtp: Unused + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * Return: result (see enum command_ret_t) + */ +int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); + /** * do_tftpb - Run the tftpboot command * diff --git a/lib/lwip/Makefile b/lib/lwip/Makefile index e9e8caee93a..c3f0e916f66 100644 --- a/lib/lwip/Makefile +++ b/lib/lwip/Makefile @@ -13,6 +13,7 @@ obj-y += \ lwip/src/api/sockets.o \ lwip/src/api/tcpip.o \ lwip/src/apps/http/http_client.o \ + lwip/src/apps/sntp/sntp.o \ lwip/src/apps/tftp/tftp.o \ lwip/src/core/altcp_alloc.o \ lwip/src/core/altcp.o \ diff --git a/lib/lwip/u-boot/arch/cc.h b/lib/lwip/u-boot/arch/cc.h index 6104c296f6f..f91127ac565 100644 --- a/lib/lwip/u-boot/arch/cc.h +++ b/lib/lwip/u-boot/arch/cc.h @@ -43,4 +43,8 @@ #define BYTE_ORDER BIG_ENDIAN #endif +#define SNTP_STARTUP_DELAY 0 +void sntp_set_system_time(uint32_t sec); +#define SNTP_SET_SYSTEM_TIME(sec) sntp_set_system_time(sec) + #endif /* LWIP_ARCH_CC_H */ diff --git a/lib/lwip/u-boot/lwipopts.h b/lib/lwip/u-boot/lwipopts.h index edac74ff7a2..14ba7bd7ae2 100644 --- a/lib/lwip/u-boot/lwipopts.h +++ b/lib/lwip/u-boot/lwipopts.h @@ -162,4 +162,8 @@ #define LWIP_ALTCP_TLS_MBEDTLS 1 #endif +#if defined(CONFIG_CMD_SNTP) +#define LWIP_DHCP_GET_NTP_SRV 1 +#endif + #endif /* LWIP_UBOOT_LWIPOPTS_H */ From patchwork Tue Jun 17 10:04:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897361 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061824wrc; Tue, 17 Jun 2025 03:09:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVhNcKUGZkFCYlbDwyZHbUTJOvacd5iChzY5WQFCyKimvu+uFhxpieeoVsuZBmGk3m75a6atw==@linaro.org X-Google-Smtp-Source: AGHT+IGJIpcp89J5W/khp4X97n+3EtS5UQnwGrRfLvux+ft3Nhf5WxG+hMd5Kdoy+M3tqMFcm5fk X-Received: by 2002:a05:620a:1713:b0:7d2:1509:752e with SMTP id af79cd13be357-7d3c6d02558mr2171729785a.58.1750154985250; Tue, 17 Jun 2025 03:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154985; cv=none; d=google.com; s=arc-20240605; b=HKtuxB99tmAE1WAasI1O1loNOsqQyMFzzEB+pXHDxWBkmjtSv9AmNtU7Kxjtz+MUW8 OMtBWPaMignWTWJrTFsjIk0yAANfJhPXiPYv3+TDrCFgOIzgvzo0xwM96BpN+aJrJ9AN KWQ9WSRonWfcqYE5hgxd7OXtT1leeMzr8SbaNq7OXDgDs9LJqhxKSpjlWwAkOM36xeKD +q2BzjuKr2HLJVnhxzUaJVzgqS4Q5bo75uzx1MHGbR36FgktN8cZ1EvOGd7HL5zg4Umr kihZM3TqCT0QNkjeL8AMe/yAdaFt5nB6LVppORmBUE9Fs0aNEPeeRH1YJjmdQ1Dboxhb 35+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SB6HMXcM0M2J7NyexF5nDOWYI0PRjQ3rM6w3FJfgp74=; fh=c82MkoiW88nYU6nLGTHRjwpmV8ZNAJlHwhIYJkN9/2A=; b=XAJeTJPuJTKGXy+ytbIqWb8FF4M0eYrHZCf5Ed/wkYP+ybCkaOhQb/myWeXcntPGeQ jw+7ML7y9R4QssNWhGzKXglVKAFJm5poDg7UYw5myP6Zty+9Qzeyijys9FTLNsgl2qkG ZN5PET5uJbp3kN6yvcCzBjEiRFkhYtz5MGg6PAQjsQ4aIgo0h1GWGYsCc5gwwtVpXm0p rv/pTHmJG0UyBtVUS2VegKyP+08DvRHDuLyYZ4zONTuNjYYmcTEeY5oumI3xnjwe6+c/ at9KGnuJCksG7CNHH5RNcrou0X1OTvNUTi+q8OHo4a063jFRPnUJgOKhXo9XiWx2SNcd 9H7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e6gLQJbD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8f21a75si1193615085a.498.2025.06.17.03.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e6gLQJbD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 907E782DE7; Tue, 17 Jun 2025 12:07:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="e6gLQJbD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9DCEB82C87; Tue, 17 Jun 2025 12:07:56 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 8F9AA82D09 for ; Tue, 17 Jun 2025 12:07:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a57c8e247cso2095329f8f.1 for ; Tue, 17 Jun 2025 03:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154874; x=1750759674; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SB6HMXcM0M2J7NyexF5nDOWYI0PRjQ3rM6w3FJfgp74=; b=e6gLQJbDkrK9PwFYrq5Jz1BmZjR7kL2V+p6j5dNuWgNrO/GBg3dqnqs3ZuTngQuChn J1MNguIAOE5Bw9ZfuVWHuTa0Q3FKxZohPD5V6lihQGG8tDRyjFoPHgXxKS66SDRDCz97 2QpjkzieXzlLhGZebjwKd47zx4b4sZIwJ0eNiWOqnCyZQ0mXCgAgEUeQgQLiidRyzmmm X0cgfLzsLI743LyiCCPTkeTto6I+uJ7oS26M6u94FFp2KgdmTI6Rxj4PDprWXqMRvmbT /YptXnqYIGxVVjdr9fpQGpm3dGYiCiUVCwX+jlSRKTi2g+AdJUQUNz7RYm4X3tMSvqeR uT1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154874; x=1750759674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SB6HMXcM0M2J7NyexF5nDOWYI0PRjQ3rM6w3FJfgp74=; b=GB6wtHHc4mCuPhFgmSacS0tn4O9jOST0U9X/qiMglgQ5sxkKnWZvAr6Yv+V35gR+ON cA5+2t8ZkLNoEJvzMSweY2V6ItqX45Ynsvtpe5HZP1ImdbHyM+jhO4IF96kDyIaGaUTE F+f8k3SqS9ZjaWU+XPhMWoCLPnwWZ889E99go9f7NE62HPmqsqfjgISHrkrm1MjnUoH+ it6sypNWU9wQ0tZKHmBtqhjmuU5Ru+ZxDanrdELymG9yCf2SkW/B1t49HylSPUntM1I0 P0xHUkAEi0tqG4S8aPZ8G094yGjNz8DXlva6blHbLqpPSZM6ZUOefyP60wMm1gCJIT2v nA8A== X-Gm-Message-State: AOJu0YyB96WNZSzA/MbyVO4HyntwOifpw6sD2IyobM+MkUC3uQqD6n4X uY1x/gq6hyBUkK4Kq7fx2pbgtlcHwe+OTZfEZQ8JMMWtdfn2Y0xFlcWlsAEnoJi96Td5siv2aYe Zxa4r X-Gm-Gg: ASbGncujgK0hqLruqPl0it+1EFK3lyxNUoyYvuLmn0Ji5X5+9o8d2oKXFFGlvj7OEdT I6lAuCtn0M7FjVDWIIVdsazSfSdoxIbHQ3mC0VdPnC9EdARBvq3tao8QcTXKlz693ldaUfPh//Z h8HqrclPduhCwUr1F/WlM/4rp0y3+BfBuKWVZr8CjFu5vyhT66osYV1rJPe9Jo2ZbBRKn5DT9GD 5qnNGJNWnbyf6SaXwrOvFqGMbDDoSqZJ1IR7XzRy1p8tFB5oXZFUo7wp2BnjvASNqsJsMS18o5L mUSiNpyNnYBw+P7ZfRIv58iQ2ojHdGVs2VA984x+RQwEJ3Rd5QbPqwl+bg4lzBkt+2nyL0DTH4N UPm8Xpw== X-Received: by 2002:a05:6000:220f:b0:3a5:4b67:5a70 with SMTP id ffacd0b85a97d-3a5723977edmr10694069f8f.18.1750154873557; Tue, 17 Jun 2025 03:07:53 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:53 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Emil Kronborg , Harsha Vardhan V M , Heinrich Schuchardt , Hou Zhiqiang , Maxim Moskalets , Sebastian Reichel , Simon Glass , Tom Rini , Venkatesh Yadav Abbarapu , Wang Jie Subject: [PATCH v3 12/13] doc: add doc/cmd/sntp.rst and remove doc/README.SNTP Date: Tue, 17 Jun 2025 12:04:02 +0200 Message-ID: <20250617100720.2544758-13-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Add a proper documentation file for the cntp command in RST format and drop doc/README.SNTP. The documentation now includes the NET_LWIP specificities. Signed-off-by: Jerome Forissier - Create a new RST file and delete doc/README.SNTP --- (no changes since v2) Changes in v2: - New patch doc/README.SNTP | 17 ---------- doc/usage/cmd/sntp.rst | 72 ++++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 3 files changed, 73 insertions(+), 17 deletions(-) delete mode 100644 doc/README.SNTP create mode 100644 doc/usage/cmd/sntp.rst diff --git a/doc/README.SNTP b/doc/README.SNTP deleted file mode 100644 index da9ec459ad4..00000000000 --- a/doc/README.SNTP +++ /dev/null @@ -1,17 +0,0 @@ -To use SNTP support, add define CONFIG_CMD_SNTP to the -configuration file of the board. - -The "sntp" command gets network time from NTP time server and -syncronize RTC of the board. This command needs the command line -parameter of server's IP address or environment variable -"ntpserverip". The network time is sent as UTC. So if you want to -set local time to RTC, set the offset in second from UTC to the -environment variable "time offset". - -If the DHCP server provides time server's IP or time offset, you -don't need to set the above environment variables yourself. - -Current limitations of SNTP support: -1. The roundtrip time is ignored. -2. Only the 1st NTP server IP, in the option ntp-servers of DHCP, will - be used. diff --git a/doc/usage/cmd/sntp.rst b/doc/usage/cmd/sntp.rst new file mode 100644 index 00000000000..eab7c664728 --- /dev/null +++ b/doc/usage/cmd/sntp.rst @@ -0,0 +1,72 @@ +.. SPDX-License-Identifier: GPL-2.0+: + +.. index:: + single: wget (command) + +wget command +============ + +Synopsis +-------- + +:: + + sntp [serverip] + sntp [servername] # NET_LWIP=y && CMD_DNS=y only + + +Description +----------- + +The sntp command gets the current time from an NTP time server and +syncronizes the Real Time Clock (RTC) of the board. This command needs +the server's IP address to be given on the command line or via the +`ntpserverip` environment variable. + +The address of the NTP server does not need to be given if the DHCP server +provides one. The legacy network stack (`CONFIG_NET=y`) can only use the +first NTP server provided in the `ntp-servers` DHCP option. + +When the network stack is lwIP (`CONFIG_NET_LWIP=y`) and the dns command +is enabled (`CONFIG_CMD_DNS=y`), then the sntp command accepts a server +name as an argument. + +The network time is sent as UTC. So, if you want to set the RTC to any local +time different from UTC, you need to set the `timeoffset` environment variable. + +Round-trip delay compensation is not implemented/not enabled. In practice +this should not matter much given that the RTC API does not have sub-second +resolution, and round-trip times are typically 10 to 100 ms at most. + +Examples +-------- + +:: + + => setenv ntpserverip 109.190.177.205 + => date + Date: 2025-06-16 (Monday) Time: 15:19:35 + => date reset + Reset RTC... + Date: 2000-01-01 (Saturday) Time: 0:00:00 + => date + Date: 2000-01-01 (Saturday) Time: 0:00:03 + => sntp + Date: 2025-06-16 Time: 15:19:43 + => date + Date: 2025-06-16 (Monday) Time: 15:19:47 + => setenv timeoffset 7200 + => sntp + Date: 2025-06-16 Time: 17:19:55 + => date + Date: 2025-06-16 (Monday) Time: 17:19:57 + +With `CONFIG_NET_LWIP=y` and `CONFIG_CMD_DNS=y`: + +:: + + => date reset + Reset RTC... + Date: 2000-01-01 (Saturday) Time: 0:00:00 + => sntp 0.us.pool.ntp.org + Date: 2025-06-16 Time: 15:10:59 diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 372ef56c967..1f2de69b953 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -119,6 +119,7 @@ Shell commands cmd/sleep cmd/sm cmd/smbios + cmd/sntp cmd/sound cmd/source cmd/tcpm From patchwork Tue Jun 17 10:04:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 897362 Delivered-To: patch@linaro.org Received: by 2002:adf:9b99:0:b0:3a4:ee3f:8f15 with SMTP id d25csp2061901wrc; Tue, 17 Jun 2025 03:09:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqm0NDUU1+qFgeETmsHpRbx8nHDRTlol1cdEaiuRtq/C3pFWYiAZP9yCKMgX1EXRXEAMyBcg==@linaro.org X-Google-Smtp-Source: AGHT+IG5HZ6N1mUqp7YOkIbSFaAO+n7gdNJmPR6tYjzBPPqNkxUoObcfqG4HxU8WfNeXuywYPEtd X-Received: by 2002:a05:620a:2990:b0:7d3:9109:4472 with SMTP id af79cd13be357-7d3c6cda074mr2207410985a.37.1750154996837; Tue, 17 Jun 2025 03:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750154996; cv=none; d=google.com; s=arc-20240605; b=Z7VhEn3tT1qcC3Q3ytJ4SEEua83eU9rufDnTs0UlHCrmROVlLQt5Y9QTw1/8myiHjv pIl3IkCW8PA6kQVUoRqpynsMKjCvzYpFXBE/nNgtFgfehxmW3CC82HHG2pR3ssSm81o/ 9tKRwmkbRYDR7pZuD5HVVv96SuIsIGRAJA/m+PDUWie3CPsonR21434yXEaVagZNPRXj ZBGzdkaoZmXhOT1UPVGeJcc6wkOE/4EGaan8dqBKpXro2UGM6/ByIV87E8qCjjOBw83C xe1HHm4H+c2WzNv2MP6wFB9Q7SVApCVvgaScC/PlGm4enNYdypbMREgbcPpEBJwLvSNp Ez1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TLRcqehQyeudcAfUgQyUPGb8hXSikCjgmrSVEgvIiSM=; fh=Ul4q5/hzFLVUhZ4QLqdjjqDgc62TpfMU7EFHbvGmKV0=; b=HpGMfd4gbskYl2WMlHjtMrwgtDkgVQjilpB0KFCLcnQybsT8h9OoUofz5npAa2ZYnR cM7HGT7QKJy1Q03GVn9icv5Z/R0gwYBKH/CdYWU3V/RyPMtC6rJwbBPpPo9Ve8teSGwx 7LAG26OJUzJUz1BGdwv/XEqpdNI6l8trQq3efRldq2kJt5Fp/LuqNHE5oJsX1qcyWKCA mB33U2oYXQNCTqpuZ1lX3pzchKxWzZrXpa7EQzbCQ6afmNmZu0MGcnD5ikethVoFm+Fw AQGOJDvF7aIOM4dydZXX6k+mDzM8JloXLdIBowJ3qrAW7MEpFmh4iX3cFwHpAywekcna YjgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eKWyP7U7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id af79cd13be357-7d3b8efbcb9si1175952285a.432.2025.06.17.03.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:09:56 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eKWyP7U7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DDC1482E0A; Tue, 17 Jun 2025 12:07:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="eKWyP7U7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E25782C87; Tue, 17 Jun 2025 12:07:57 +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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 7333081760 for ; Tue, 17 Jun 2025 12:07:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-451dbe494d6so70380485e9.1 for ; Tue, 17 Jun 2025 03:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750154874; x=1750759674; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TLRcqehQyeudcAfUgQyUPGb8hXSikCjgmrSVEgvIiSM=; b=eKWyP7U7ZlDRIZpKAsRpLNFnerTlteYSdCofvMLrcAJzJbJlOweO6ukb7o0agzU71a iitx/p0z9yTgx8SXEOrm+djtWJWGsFVWHeYvVUq6Bjkc41SgVZQDnQFtNI007bmwYLnY T+/1wfYVCGeInGcSYU+a9ymDo7eCspV6TwU4+l/HkhGNDutdaGZFgktTMoFMz1ntuFXd OvxUqAroXm/wfkdtLgECTOxKSqHKMLvghgryUr+cHvV7FH3d0rodr1+KZI60vJ82NQPz XpsPikhVOddF6xxO3MxWstel9pZ2I11XXBA9uBPnY6XFKxagUq1CW0XrmiK1ETbrzraC Bf3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750154874; x=1750759674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TLRcqehQyeudcAfUgQyUPGb8hXSikCjgmrSVEgvIiSM=; b=w9xwTS1cdaAZ6b165e21zk7/3C4sFIzMS9q5+NGvRJO8/Biclw3IbtpThW2xRrzmAy Sol9mKkW/DROSHi4IwAlmvQ68Q4rMdb8NuvWpi5wF2rOcJh7F3FJYhgQ2LMX0rtrhFsh MduG1HbgeldVR92A3U2bPp+XKud2KIP4ifMck3bWqHsCMuR4iFhyVLUI5RoRVW86jR5a NjoTw5RQqYdZcg7MrmUWY1eSSgPqzV+hPu3Yd1l8Km91mr6ROAwPgWFfyNL/ECMFS6A7 41uLzwY4zG6nbpkEen2gPnKTITmJ1DuZ9JjFUI7at3F6PmPJZECBMJ84lR27V/naapE9 +e0g== X-Gm-Message-State: AOJu0Yxl69Fs2dMgoedNfPE4eBTgHwk5zdVnp+uyYKcA1lg4hc1DxGmO 9dxT8Ylp8hE+n+EpwFdMkXdHhFROyWHucie/+uqY0S5VHPlkrh3AttqT1GHGhVi8bouMtxEIceF rtFfB X-Gm-Gg: ASbGncvmNKSkiJrGn8UECXJI8qLX6g62w8gydyrsJJFgGN2LXKyouMz3hy2hbtDEegu MOckPGjHn2F+JGrjnqrTG4dasNEAasd+/V6kJm80CfTtDHTSuHRIV04PD1YsnCu0RcmpyQk1l1u vzWnrCFA37+b7xAeeAij5KLgiTC/PGBqXONf02dZitP2FVokb+7tiiZrE2i5LvG7dmXk70wg4Cq qEOwZrlvU7WFRXQDGw8BRjyTemz89sa4ihBukl+WYac9C97UJ/7rrB/83lH9y0na2qeTNjTVKE3 pxa0DnEUuu7/jRopRm/F0Zw2oYz1OB44kZRxqVAw9Ev7+6gTQ9jEeTSAUKGrJOixSITNpeOlKID txpbPbg== X-Received: by 2002:a05:600c:6989:b0:442:f4a3:9338 with SMTP id 5b1f17b1804b1-4533caf91a6mr110011995e9.21.1750154874420; Tue, 17 Jun 2025 03:07:54 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d4f5:465a:56e7:e545]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b61071sm13582412f8f.90.2025.06.17.03.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 03:07:54 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Ilias Apalodimas , Peter Robinson , Simon Glass , Tom Rini , Tuomas Tynkkynen Subject: [PATCH v3 13/13] configs: qemu_arm64_lwip_defconfig: enable CMD_SNTP Date: Tue, 17 Jun 2025 12:04:03 +0200 Message-ID: <20250617100720.2544758-14-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250617100720.2544758-1-jerome.forissier@linaro.org> References: <20250617100720.2544758-1-jerome.forissier@linaro.org> MIME-Version: 1.0 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 Enable the sntp command by default in the arm64 QEMU defconfig for lwIP since this config is meant to have all the features supported by lwIP. Signed-off-by: Jerome Forissier --- (no changes since v1) configs/qemu_arm64_lwip_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/qemu_arm64_lwip_defconfig b/configs/qemu_arm64_lwip_defconfig index 814e98729a3..e8f976efaf7 100644 --- a/configs/qemu_arm64_lwip_defconfig +++ b/configs/qemu_arm64_lwip_defconfig @@ -5,6 +5,7 @@ CONFIG_ARCH_QEMU=y CONFIG_NET_LWIP=y CONFIG_CMD_DNS=y +CONFIG_CMD_SNTP=y CONFIG_CMD_WGET=y CONFIG_EFI_HTTP_BOOT=y CONFIG_WGET_HTTPS=y