From patchwork Wed May 21 15:14:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 891525 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2177586wrm; Wed, 21 May 2025 08:16:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWk/KZhD6H79ReVjCqX4wh6tRL2/8GL2WndXl/SEddiwPBDkPnJpt9bga+nQS9gFh9lv0EfrA==@linaro.org X-Google-Smtp-Source: AGHT+IGgzP1I7KL9aYzU/8X8h1wwUWhw5+eB1qCmm/lj77zm7iGFC6UDb/sNH+q0Zt9wIK/eXTlc X-Received: by 2002:a05:6000:1889:b0:3a3:7e01:d2fa with SMTP id ffacd0b85a97d-3a37e01d307mr4470454f8f.28.1747840563374; Wed, 21 May 2025 08:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747840563; cv=none; d=google.com; s=arc-20240605; b=AgdmdFetyIVc1U8//IwFDid6ul0jiO28vC/PsRrV3cA6SJXcklzLdpLXdyFmc86Q6F z9C81l4oDqpyzJ9gFvecfZq31NgVz6ftTvfwkTn9858Qda343i8+GYNHqDr8ilEnnE7b bJ1fiS/RGMEG7kdH0hty7VwcyOw/LcCjDBY8vCA3zURx0lRsMptX2ObgIZ2tPi4A9pES GB0NqrZNHl0VQCa1gRzCV/RDPkePtfJ0wTit58XuOcACtVf8GXeoAhVdAK71fMKSjkQx 4h+nHBt7a8atT9bCjSBUbm3IwTBA1MlR2p8f091gfCOLxwtxra1fCo4m/h/wTim92S8B mjng== 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=Hk2c9/tSgoicmyHI7pE/MgajoOLTC2DBKjzOxz2/U5s=; fh=+TzJuMMnKDMsbGyXcXAynrdn4hYe+uVLmq5NLJkVciY=; b=BOUAvSfQBcrtCSXWKNULuHnewNYrxo9rJjVG1IjcGw289i9goRu16LWqkxYAf+fYP1 l841nX1zdEXZCYRUi4j1EhThR3GIhnGyxHAVrDYIGDpuGhdHBcDwL6W4Q8yQVCPkvdUV nfdaKMdjdUKFrJIHw1kq14JFK3/Tnr/6h3fE+bOFJIHwoYidzAcSbxrfc9Zywdt85JbF XPZAkWXJqHk0ogEzkQll3Wc81TuVQXdznqmh1hFb4oEHda2bRUE9hbZREbjaBwcPAQIj sEktHrXo2uDxeSfq+syZ1Ztc/hC6+/Taf95UqUjqg7R6mZ6eZjF0ukw478k+aZBU6kht ELfA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MG8gBWkI; 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 ffacd0b85a97d-3a35ca8bab1si9776607f8f.693.2025.05.21.08.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 08:16:03 -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=MG8gBWkI; 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 168C882F70; Wed, 21 May 2025 17:15: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="MG8gBWkI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D383B82E0A; Wed, 21 May 2025 17:15: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-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 D6C1E82E9A for ; Wed, 21 May 2025 17:15: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-x32a.google.com with SMTP id 5b1f17b1804b1-43d0618746bso56435665e9.2 for ; Wed, 21 May 2025 08:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747840551; x=1748445351; 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=Hk2c9/tSgoicmyHI7pE/MgajoOLTC2DBKjzOxz2/U5s=; b=MG8gBWkIUQYQvQpprOftEkXyo7hvzkG2d69eaDnzhPgIa3sVepuN58TGvPGihDKW+9 78iPZcdZVB+00wuL2ZVcMCOQAFduZ39u7HdqsahMGzNI9qTOT9fUyTMrm4ki6ncaVGfk JTYhvfMW8N1WYOrI9ATo54vte8IJ1NOJAOzuQ+EsvOzNkAPeuDQdXl+Jyn3PcsuC9M/a sySEMR49am8J3JX7eouvR+0g9bk8T7R4rW3RgX5NgYvdNUV3SF5ylFQcYGnOL6fHEexz OBD4FVBgAGH6emAIYNPMTdqxK05/IzL5KbXtpEHtOJDaag8/VGowOdBvoGnGxOKusssL 9cyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747840551; x=1748445351; 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=Hk2c9/tSgoicmyHI7pE/MgajoOLTC2DBKjzOxz2/U5s=; b=vOAvTTfpWjXCpuvvWwonNpnaCSD64EIpKwvDaaN3OInTRGVbi783pvOxjuy+HEocXi ycuhXfhkDyzp2pIB1XNmd6ScfwSXh4s2q50OAflMehG7ePk5um5FsyQcDuNaVY4ixogf qQ+m56+9oEFgqYHE4vQwOxP+3fT/R2b/IWbaGeR6rCH04Rc68ScQs4ce/egk4tgVwjq5 Pg5YwD4XE8cpbv3oZUkfr5mb+and8utUkEfW01TLlVcYfwHusP+/kFcpSnwNduyWZ2Pf PItdyGoH1cSOdpMTi3ZOW00Q39Ul2/4R35TCKIyVrehaBpxm4IP5wp8hcIGZ+K2XAP+g YAVw== X-Gm-Message-State: AOJu0Yz2WgYJsfbDhx3kFDhyJf6RSxpurRlBPWrOWUE8B1r+K/cHaMQL 4rNgDjkCd/rFTcnH4SUDtxAKCHFcQP2je1EmfEA6jFc4lafLm1ltXfLX0wOi8+6xqCM8tORADpB AitxtiWo= X-Gm-Gg: ASbGncuAK4qAbU+WaLE81ZtDqOAr9/8oOkkydXZA9ozVXsMZPgwF/So7GBbB9BbhXtZ J2EKAWove2ATPFFef3KrbZlYWGlUrNG7ZqsIDC6DXAenI4CGSgFu6q0W/lnNXDMki/WWEI5VoAU 7ZZZeA7ZHNuPN8wNMCTnu3D9y0tgxso+FW0A1xGIhDiEkUnxdsvHCPiCgzpXhRA5qZBVn3z+b7T GD0Bfnpj3TFaIp0Ya+Yk0DykiRiDmDYOuWE/jjmyKv8vZMPftscXJC/g3I1uqHCnT0UmjshSf/w GdantPa30pmE0U75xbQXcuK1sB76JfYkcHO9kM3CLSS/PoC7HilPDIpq4H4S X-Received: by 2002:a05:600c:1992:b0:43d:45a:8fca with SMTP id 5b1f17b1804b1-442ff039684mr195582365e9.30.1747840551026; Wed, 21 May 2025 08:15:51 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:f65b:56f4:360e:9fce]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3632a2bffsm18505226f8f.32.2025.05.21.08.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 08:15:50 -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 1/3] net: extract function net_sntp_set_rtc() from sntp_handler() Date: Wed, 21 May 2025 17:14:41 +0200 Message-ID: <20250521151516.16729-2-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250521151516.16729-1-jerome.forissier@linaro.org> References: <20250521151516.16729-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. Signed-off-by: Jerome Forissier --- include/net-common.h | 2 ++ net/net-common.c | 28 ++++++++++++++++++++++++++++ net/sntp.c | 23 +++-------------------- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/include/net-common.h b/include/net-common.h index e536968a92b..a021bf503ff 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -586,4 +586,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..30d04323d4a 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,27 @@ 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; +#ifdef CONFIG_DM_RTC + struct udevice *dev; + int ret; +#endif + + rtc_to_tm(seconds, &tm); + +#ifdef CONFIG_DM_RTC + 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); +} 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 Wed May 21 15:14:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 891527 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2177759wrm; Wed, 21 May 2025 08:16:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWimnf24Osf7jT0bDPU2Wp5AI71G3QAnT3bVRK4+36pznHySXezXcQqDk2jx0FdN2a3dCHQ1g==@linaro.org X-Google-Smtp-Source: AGHT+IHoyRIXAc+Jw7W+6XuxdMhvxiDrghlAehHvhrtNc7qDShm7lNh0+bN98XvtQPlpRjM6F/Ar X-Received: by 2002:a05:600c:1f82:b0:441:bbe5:f562 with SMTP id 5b1f17b1804b1-442f8534e53mr251650565e9.16.1747840580091; Wed, 21 May 2025 08:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747840580; cv=none; d=google.com; s=arc-20240605; b=ZRvXBw07YuqUNw5xCzb/PM2LUaWqHSD1qGdHTVywyRf5217OQRunYUc3tdki08GXOB qDybL1a7Yo0eaDq8BHjOL3fBZOpoBRTidVJj66I3UaySFnY/kusRWR6GdnS98UEiJlpn n2qYHVgMfE343DMWvoYE0G0EXAYx5m7lqFZOD7rzpuKwUcrwMvCnP2Qo01WBj7OQ8UZh l4WKqImlbzAcHUdG1kFC4hUqCuXBxV3j4ypHZMdcqbZD+xYMU+3mxh+WactrHP1SFZBg g3+ftKEnqUrA0hdntf8pMHI7nYoFV8hhwUQqTH4j41sztS4dBwNQF3egO6MrWn60MmGW uPEA== 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=gpTkdD3W+TlrBZwzq3MGkTyrJylZI6D54JapYuPoE0o=; fh=W0SKDPtoH6iwoJTtbvbm8yinNeDm5R98Ls2fv3eiZ7s=; b=iKOf0A2d00/qIiG0dGtwyb2SFRLwUR9WG+VSRC1z5AApbs/zZd2LA5wxSDscP5spHm sUAltPje6g6ELxTWnfS7b/afMWwVAHspkuBsGoedmsBwXYwWYH3hACSwtjLEgoPrGBbD QicZoJ8UWFu60LqU5VjfFRBSJHXk1yHCjAbVwFH91+ovByOMx64r3HVZZMJ3W3RjHFb+ N55yAQm2qOJF7e3dPDbxyJOhV5QN0jQDvaiEIa0oEHaCzLbfWeXMevilwqS/YMLiFAFC fTgmG1bq8y71rrE5+M7H9yAgA38CgnSD2MUNFNJN9BLBSMaUFMufuPktDg948//bxieg EOBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zCxZeSvg; 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 5b1f17b1804b1-447f56092a8si34656075e9.4.2025.05.21.08.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 08:16:20 -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=zCxZeSvg; 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 9FEE282F8A; Wed, 21 May 2025 17:15:57 +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="zCxZeSvg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A583582F40; Wed, 21 May 2025 17:15: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-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 B238E82F10 for ; Wed, 21 May 2025 17:15: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-x330.google.com with SMTP id 5b1f17b1804b1-43cfa7e7f54so53067375e9.1 for ; Wed, 21 May 2025 08:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747840552; x=1748445352; 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=gpTkdD3W+TlrBZwzq3MGkTyrJylZI6D54JapYuPoE0o=; b=zCxZeSvgUp5BVZZH+IPghR3npLVh6ZBwnofpt2BVMaHdlSabiHHKYGD+uoWv4Fo495 XwdYrIN5xb/YtKNZQl/QEkH6bQ+oONFImo6z4pfVkZw08cuc3dF/VPtaBQjddcrd5MUH Moyyk8rkT2vJW32EGKFHUaNb9UEiwBYEIxljJgWWEywzf72dFRDIqqS8w1rbSY/KvKNc t7dB7nQkVCRgfSXwbB2TOp+mQB4AdBw7uthoIO9ZVafxUTSZS8g9xoZd5Wuw/air88kj Z4cMfqc/LxLkxLZzhiAPMgupD3rdLbRYTbYniLJEm9AtXvojOrWiGfsYyb/WsOiJbuWE ne8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747840552; x=1748445352; 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=gpTkdD3W+TlrBZwzq3MGkTyrJylZI6D54JapYuPoE0o=; b=vn3rGxgC45BuNrHhStUJBt/uEOdRObRsTmGPdDqofzi578O6QGcz7Q4zFQfEMsl2RB tCihZkAhzMvGx1uNpipUuiQQ2OKXZr+/s8qibnd7jzj4D1n44b3Wr0MHI6ROTVNXWmj7 v7Yky/mCEmKUkwsc9V6dpPWC2Imk9gEnh+UCf8hiMiM1+W1KrrD0IUIcMZy4OsFT7RF6 HWIFrWOxUvQOkysY+CQiLq1g0LroJbDyg9ESLUYznzYeolQpj1KdVkMGviZzciSdbOdZ B1XZILuKm5CDpPZpaviJ+yHPYVXPrL10MKdwRF5P9SPA4iXHqRByJKnBOrHR0axXkhNY yYaA== X-Gm-Message-State: AOJu0YzP6RIHBMbYEBakgYfnN2ZNcYPQPMJAt0VAY5sA5W6NW4h5ggMk 6p5cJHb4bXIwzACwa9eKtYfvXQxeMfVXPUXBGpr5oichzt8flV2setEar6sZ84vLVdh0XMXcmY8 mHWZyRlk= X-Gm-Gg: ASbGnctLcAD71APd3GvU2Y2ELWcf0Q8RdmrMUH0BOnXL+Ps4p6uxX6XB8onhjusx2nX 8ApPcLTYqjaJMw8Bm2Zh5MauRsZPdP1fRoZZQoAEbSmRIPTN8xIhccjUZZwShWNehfk0igyFstL 6SpTXt3X1HMVfLEsZhtaqiPjkDRe1BxyUSxxHdmmxt/s23HCb6gqQ1tWrxFSJaafVhdwLd0xH7j uogAKIMZelWySP8+OvoFa5KhY7nIcpJKoA0okl7kbzppCglK2l2YKruMHzSIo5EQgw7i+mrqcF7 IfOJpf5avwlU2+s575bQCdTej04KKZOtWgDUjcjGPD3Zn4TQY1OntdvHRl1m X-Received: by 2002:a05:600c:3c99:b0:43b:4829:8067 with SMTP id 5b1f17b1804b1-442f84cb4famr229532425e9.6.1747840551803; Wed, 21 May 2025 08:15:51 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:f65b:56f4:360e:9fce]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3632a2bffsm18505226f8f.32.2025.05.21.08.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 08:15:51 -0700 (PDT) From: Jerome Forissier To: U-Boot mailing list Cc: Jerome Forissier , Adriano Cordova , Heinrich Schuchardt , Ibai Erkiaga , Ilias Apalodimas , Javier Tia , Joe Hershberger , Mattijs Korpershoek , Michael Walle , Michal Simek , Ramon Fried , Simon Glass , Tom Rini Subject: [PATCH 2/3] net: lwip: add sntp command Date: Wed, 21 May 2025 17:14:42 +0200 Message-ID: <20250521151516.16729-3-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250521151516.16729-1-jerome.forissier@linaro.org> References: <20250521151516.16729-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 --- cmd/Kconfig | 13 ++-- cmd/net-lwip.c | 5 ++ include/net-common.h | 11 ++++ lib/lwip/Makefile | 1 + lib/lwip/u-boot/arch/cc.h | 4 ++ lib/lwip/u-boot/lwipopts.h | 4 ++ net/lwip/Makefile | 1 + net/lwip/sntp.c | 128 +++++++++++++++++++++++++++++++++++++ 8 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 net/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/net-lwip.c b/cmd/net-lwip.c index cecf8d02555..2ffee64f97e 100644 --- a/cmd/net-lwip.c +++ b/cmd/net-lwip.c @@ -21,6 +21,11 @@ U_BOOT_CMD(tftpboot, 3, 0, do_tftpb, "[loadAddress] [[hostIPaddr:]bootfilename]"); #endif +#if defined(CONFIG_CMD_SNTP) +U_BOOT_CMD(sntp, 2, 1, do_sntp, "synchronize RTC via network", + "[NTP server IP]"); +#endif + #if defined(CONFIG_CMD_DNS) U_BOOT_CMD(dns, 3, 1, do_dns, "lookup the IP of a hostname", "hostname [envvar]"); diff --git a/include/net-common.h b/include/net-common.h index a021bf503ff..b06cafb497e 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 */ diff --git a/net/lwip/Makefile b/net/lwip/Makefile index 5df222589b8..5bb98dc4d98 100644 --- a/net/lwip/Makefile +++ b/net/lwip/Makefile @@ -4,6 +4,7 @@ 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_SNTP) += sntp.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o obj-$(CONFIG_WGET) += wget.o diff --git a/net/lwip/sntp.c b/net/lwip/sntp.c new file mode 100644 index 00000000000..3b2bc3c679d --- /dev/null +++ b/net/lwip/sntp.c @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2025 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include + +#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 = NULL; + char *server_ip = NULL; + ip_addr_t ipaddr; + + switch (argc) { + case 1: + server_ip = env_get("ntpserverip"); + break; + case 2: + server_ip = argv[1]; + break; + default: + return CMD_RET_USAGE; + } + + if (server_ip) { + if (!ipaddr_aton(server_ip, &ipaddr)) { + log_err("error: ipaddr_aton\n"); + return CMD_RET_FAILURE; + } + srvip = &ipaddr; + } + + 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; +} From patchwork Wed May 21 15:14:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 891526 Delivered-To: patch@linaro.org Received: by 2002:adf:e88a:0:b0:3a3:61c9:c5d4 with SMTP id d10csp2177668wrm; Wed, 21 May 2025 08:16:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpsVQRv29/LEddrkDwKpc8F858R5CoexG0WQpKhO1X3WJgqMTNB3fgW48ct6kZahRGrSt3Lg==@linaro.org X-Google-Smtp-Source: AGHT+IFNTvTI17hPmlrQQax6BMRldFr7OahoRfCgkpTap6rHiNGd/3KPZbrVuEPVD5R9WJhICGvo X-Received: by 2002:a05:600d:1c:b0:442:ffb1:b58 with SMTP id 5b1f17b1804b1-442ffb10be7mr174621645e9.12.1747840571663; Wed, 21 May 2025 08:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747840571; cv=none; d=google.com; s=arc-20240605; b=AymRkIIjE4PrwrAucbhh1b87Pj0PR6t5VTLk2UoVfRaM12sqMUmNb4EwjQ79zs94hp iNgPl78XvJxwPcCNMGx3B+LCP4UCaZY/ol9NCE8uNhS7TS7iruX4a8IyRMA2Y0MeYxtH Cf39PeNJSlPHQCoXSO1XS+zeqsAbZxcsqupnBcN7CSpPdIm6DjDhJWsAxXQ+1nnAVoks +hIi5Mh7jLSM0GtjSOVVqqNAQcHf3GHx0LN+3mA6gJPP81INibIK8cldYIHDKqaipmR9 2SkPgCnGbk5rXFCZUX9dJJfyZeJqJ9PN2bqTHr4G9cwm2id5tJxGExHCwo2xASBTLNZI ObsQ== 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=jMIvtD9k5poERnlo7FwHqHul/XfuSUbcYixvi5dD2uQ=; fh=Ul4q5/hzFLVUhZ4QLqdjjqDgc62TpfMU7EFHbvGmKV0=; b=L46cdF+qR3qRHTjYQWW5hjRhXyisCTaibNlAYB20zOdWgUctQ+6l1sKUdmcO7vMmNh 0I6/Edc12Somg8TkfzewSTEED3SJsgFq48emmUpK3xKxUhgMx/sSdz72jMxw1KkAFrEa Q1esDCM4sN/hUsVK1jeRPupP/fieddAD3C9pUNTnV21T7PV9R/ZPkFV1/FGasGQZpNLq 6gyIYWpPz9iHSO1d+gGqyZjxtNGr/nSi2J8R0naxKR1tVpOSCWc6D8Rax8GGV5n659WC XrQ4TSKWZobGQi/6PPuKYLDTpTq+fMidluKO44FVursD70ahqctATqxNp0qmzzWss72R Jngw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cAWrxbJ1; 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 5b1f17b1804b1-447f5ad904fsi34258385e9.75.2025.05.21.08.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 08:16:11 -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=cAWrxbJ1; 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 5C6A882F30; Wed, 21 May 2025 17:15:57 +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="cAWrxbJ1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 82F8D82F84; Wed, 21 May 2025 17:15: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 611ED82F40 for ; Wed, 21 May 2025 17:15: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-x32d.google.com with SMTP id 5b1f17b1804b1-43cfba466b2so75655685e9.3 for ; Wed, 21 May 2025 08:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1747840553; x=1748445353; 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=jMIvtD9k5poERnlo7FwHqHul/XfuSUbcYixvi5dD2uQ=; b=cAWrxbJ1YpfvOhnEA7BzbLFQMNupmV9FCtmM6hO4uDW0AahO2UYVFaMog8+18lTwQp /I3S+l6DxS/7wnKQospdvlL7pZWdpnFFe/n9OaAp8276o8UD1tLY2kzUAXpBbEKhlvAj Tonq9Z+Bx3bC33SorvAFHU1RAYKIVdoRNYdwnpS8UpGRV7AonkP2nHcEl8hODfw1GD+b U8n01tmVnWuYMDH04JsqE+nHcklf9lvozMBoOqJgnD8cJCvGolTlkoiqawJx/X+CC93N xGHXKZmRXkmH8MAw7SiTA8imgB/leQe9S3CWyqIE4O41d/sAno9+j1mPOCEi0zANeLhv twKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747840553; x=1748445353; 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=jMIvtD9k5poERnlo7FwHqHul/XfuSUbcYixvi5dD2uQ=; b=mfqTbHy4Z7LGEq14q/ShpBnYOtHxIqlWp7lb+oKhlHY2fORK5rX+ZosItwTGOjtKXT vIFaUR55bZxxFLbUdbYzWrA3m70mRXAh/YsLP5KffHr6N4WapL/mmOx2M44SjV75KTWe CrcAFdfxpBOcJgq5qD4lSZgXHGChJe/gJGXsZbkaKZoShuVS5YgBpJZITlSaSzYxILm1 VzvqLzY3GFtDthM207tu6g42mAIZ7sdPcqOWo+O0NQrjl/P/fjwlBuZk1u28C108PGUJ VcvWWLc3LB4ChWuIuwM7O6S+Ips2aPZkQe1Y35CNrnOnneV3hAkPVhTLgWP/9Fn5Cwn9 7m2A== X-Gm-Message-State: AOJu0YwDxGUpgsAD0wqv1YfTn+8/0dMkVEvZb979Pv1KYJ09QLSGo+MB Vf/THIdfkiCCcEfHPk+VPWp1Hd+NG/9nefFEPA2/VQWqPu2XmU9iNWe1rsKUQa++1AEajMFDpU1 jvf8HXy8= X-Gm-Gg: ASbGnctwsNQHHXFNXYRe7pL0FUsSRPXjuuanNwweXyPgTcHXJzWzoLyaVi526rYpuvr JU5glgSOmBn6FG+wEorwVwy+kwf5nXpARmlQwB1ldzP+HL6kSJIq7cW2yr4zM/jEZtr9G83nPRF vQPxCbB+18h0szunrApfW5TcdmWw5lCQJHDzCgWaU8pHWoAbxCrpDak6blSujfXYRGgQhUMM8fp qH5V/VBHTgs7wtF99mZNLqoE4k7UCoAzEEtU6+ianWyFJIPGnzNWrgtq8VcxNqpbyLbkj03z+yp 6vR1MvUlGME9IBEy1y3kZDrO8YXMyhafYDtRhOLgHNe7AtY3F13l10X1NKlJ X-Received: by 2002:a05:6000:250c:b0:3a3:7042:3ee4 with SMTP id ffacd0b85a97d-3a370424026mr10947326f8f.35.1747840552660; Wed, 21 May 2025 08:15:52 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:f65b:56f4:360e:9fce]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3632a2bffsm18505226f8f.32.2025.05.21.08.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 08:15:52 -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 3/3] configs: qemu_arm64_lwip_defconfig: enable CMD_SNTP Date: Wed, 21 May 2025 17:14:43 +0200 Message-ID: <20250521151516.16729-4-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250521151516.16729-1-jerome.forissier@linaro.org> References: <20250521151516.16729-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 --- 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