From patchwork Thu Oct 3 15:22:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832400 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp342962wra; Thu, 3 Oct 2024 08:23:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlEnIxyzXKJC3GO1A4rpmMaxdwM8G1n6Ta7Gphyl2tj3pX0lDF67YxHy8iqQrPA1rBZh8NnA==@linaro.org X-Google-Smtp-Source: AGHT+IHzLWNrVHC5GLyuOy65pF9CLzUkxvzkhE9x0Ef+ICqztXrzP2UqxNy9iEYtOPP3G9//V1vj X-Received: by 2002:a05:6e02:1d19:b0:3a3:3e17:993f with SMTP id e9e14a558f8ab-3a36593a386mr64062635ab.8.1727969035053; Thu, 03 Oct 2024 08:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969035; cv=none; d=google.com; s=arc-20240605; b=PxD/uAClpRJbQS7kqpsA/59KFeLZIAfdS2H5THNDO+5Nl7KW6cw8agFNYfbsHQnLOB kOoBLj3QO7/9xOonSyse4i/Xgljdy0FMXBqH0ZkRU8g0dEmy5PGTzGYKr+0/3idBZ7Oc 96leaqqROp4StntDkTsZfP84Jqa+gs5zDCbX/g4cAeBcAI5H1fl5IYkyq/uYbvatlgYD pIHnjZuU0OvaEyR/Qe3e9N2gQnkoe3zFN1GkdSBHY5/4EHwBxs5zNee3xfPsv5bZEgdK HweoFiVXRJDOVQFn6JDFuvn7B4Jx5jU1phtqBaEY0NNlsN25SHj/eiSy94t6ARCLDrn5 dPaA== 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=IPYJafKN3Kt/xHB/DNZ6P2xS+0mBigy9jMHqZFqQF8Q=; fh=MFsJz/6NgpQprpwvNv8CqsrWK6sST7rgnGXBPmh9Hfs=; b=Vk8VAtuqJSNzuc+H+U3jluCzkgzol+A/JdahS+RejR5ZrODKXzVW8D6lK6WHAkWQc0 vpAnwOoCX0hXTVfwbScY47hnO1eg0ZKgd7CFeX5aFVQv9QljqmMT1iSbEDgBMDMdwWUF a4BowF5n4iQxtFhoeR1bciX/dgawfs7d67eQsmU7Mx1JL1FX+Xzw9Z+o5464fgpQ8LbF aqGGpPZHRAxEea+W0GMnMuDRbaiVTLSiD2G6NlEyusXVKOumRdJURqBYp6HJa6Kd1FrN J4/emhioJ9QGLMvzDAu5t+upI7UoBgNkcocFfWIpUVgUpb+zVJ6fQe35lJvSwnz85XDF vd8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BMyXso8I; 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 e9e14a558f8ab-3a3713ac016si6345015ab.91.2024.10.03.08.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:55 -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=BMyXso8I; 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 B582188E4A; Thu, 3 Oct 2024 17:23:42 +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="BMyXso8I"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C189988D9F; Thu, 3 Oct 2024 17:23:41 +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-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 67C1B88DE9 for ; Thu, 3 Oct 2024 17:23:39 +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-x431.google.com with SMTP id ffacd0b85a97d-37cfa129074so864104f8f.1 for ; Thu, 03 Oct 2024 08:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969019; x=1728573819; 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=IPYJafKN3Kt/xHB/DNZ6P2xS+0mBigy9jMHqZFqQF8Q=; b=BMyXso8IT/TFgVYeck/qsxasL8CapTw405LOxdkZYIBB+sUSdbfMk+s+7ZrH1udXJ0 bwIGxcxRZUBcPUPlUqn35m6ccCc392oa1REJp1rCMh5DI+yD8saGlma/PXV6XxoXcTV4 R9hdYBPlmINHiMweGnAsfQnJzvLa7TM74C7mYpz/NkKiAlDwx+AFtVN6YfL88NvwdlIS sxxZhZiAzwwKgt59dACpvE/mns4/NJTpDHatj5legbEJ1JGP+bQkw2Y6dckwDRtRGmOl ljQx6d6bvZyVdvvh7+vkU46lqBzCcGrjq3TAnE3ANJnNl6LNAutzXp9hxN6W1OnhoB1Z icVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969019; x=1728573819; 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=IPYJafKN3Kt/xHB/DNZ6P2xS+0mBigy9jMHqZFqQF8Q=; b=iJU925H9kQfT40irShDkJTZgMZTKyCp9s+LCf54UngQp2tACSvIImUlT1rQcwvPYks 6VwACq8x+PzjX8I1MfUB3GmuhtZoF8wh12edZcYKUJC+mHKr2mjyLVsdgfFRe2e+Zf0H mslNXnh0lofZ1tUB6GkYDR/2rnrr7zJfAItN7UF3PyqPpq9+nIZpTv/lH8ELmayhOHI/ OOqLoL1CsufoMsElHNrlVWi8i7DKgEiR4HGuFiKywOBKSg8ssZzM4zfonsmsi8eDdgg1 9LvFRsYV0hxQV60DLfYFmYgxbXBNm+WOuxJc0hH/slYr7CAVXlB104VZewHRhZkuszXW x7rw== X-Gm-Message-State: AOJu0YzfwqVr9BMpCO7EkkZoK7yDC3kJ3pQjoyJrJ3FSHFK9sAjWQAqb x26PhfZZXkkwTKMDpHSc65CsGGmAg5VbgDbi6zBjvS/bASP9b1en/CBtY7jl82v8ijLQiKMeJrz 1bAT0Rg== X-Received: by 2002:a05:6000:10c7:b0:37c:d512:d427 with SMTP id ffacd0b85a97d-37cfb9ddfc2mr4654329f8f.35.1727969018667; Thu, 03 Oct 2024 08:23:38 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:38 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Maxim Uvarov , Simon Glass Subject: [PATCH v11 01/29] net: recv(): return -EAGAIN instead of 0 when no cleanup is expected Date: Thu, 3 Oct 2024 17:22:47 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Note: patch posted separately [0]. [0] http://patchwork.ozlabs.org/project/uboot/patch/20240927142038.879037-1-jerome.forissier@linaro.org/ Some drivers do not behave properly when free_pkt() is called with a length of zero. It is an issue I observed when developing the lwIP series [1] (see "QEMU CI tests for r2dplus_i82557c, r2dplus_rtl8139" in the change log) and which I fixed incorrectly by not calling free_pkt() when recv() returns 0. That turned out to be wrong for two reasons: 1. The DM documentation [2] clearly requires it: "The **recv** function polls for availability of a new packet. [...] If there is an error [...], return 0 if you require the packet to be cleaned up normally, or a negative error code otherwise (cleanup not necessary or already done). If **free_pkt** is defined, U-Boot will call it after a received packet has been processed [...]. free_pkt() will be called after recv(), for the same packet [...]" 2. The imx8mp_evk platform will fail with OOM errors if free_pkt() is not called after recv() returns 0: u-boot=> tftp 192.168.0.16:50M Using ethernet@30be0000 device TFTP from server 192.168.0.16; our IP address is 192.168.0.48 Filename '50M'. Load address: 0x40480000 Loading: #######################fecmxc_recv: error allocating packetp fecmxc_recv: error allocating packetp fecmxc_recv: error allocating packetp ... Therefore, make recv() return -EINVAL instead of 0 when no packet is available and the driver doesn't expect free_pkt() to be called subsequently. [1] https://lists.denx.de/pipermail/u-boot/2024-August/562861.html [2] doc/develop/driver-model/ethernet.rst Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- drivers/net/eepro100.c | 2 +- drivers/net/rtl8139.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index d18a8d577ca..f64dbb7d6a1 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -678,7 +678,7 @@ static int eepro100_recv_common(struct eepro100_priv *priv, uchar **packetp) status = le16_to_cpu(desc->status); if (!(status & RFD_STATUS_C)) - return 0; + return -EAGAIN; /* Valid frame status. */ if (status & RFD_STATUS_OK) { diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index 2e0afad089f..5f4b1e2d3a0 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -433,7 +433,7 @@ static int rtl8139_recv_common(struct rtl8139_priv *priv, unsigned char *rxdata, int length = 0; if (inb(priv->ioaddr + RTL_REG_CHIPCMD) & RTL_REG_CHIPCMD_RXBUFEMPTY) - return 0; + return -EAGAIN; priv->rxstatus = inw(priv->ioaddr + RTL_REG_INTRSTATUS); /* See below for the rest of the interrupt acknowledges. */ From patchwork Thu Oct 3 15:22:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832401 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343094wra; Thu, 3 Oct 2024 08:24:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWeSLHl2bEMX2TeiG6IvVdymCUYIBGl+2tXTpcvsZDXvdkXYm3MaFJhpI1Wu+8v1yygJpBhmw==@linaro.org X-Google-Smtp-Source: AGHT+IHbKxvsjwHvm2x96dJzOkAEhxq7K9TUTa8JypnknN8nOiDpcb2JT/yHqxb0veyIbfnfXqRd X-Received: by 2002:a05:6602:2b85:b0:834:d4a3:85f2 with SMTP id ca18e2360f4ac-834d84a48e0mr804876039f.15.1727969045335; Thu, 03 Oct 2024 08:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969045; cv=none; d=google.com; s=arc-20240605; b=KpraWnWz+rDTMtFtLHRV0ec1FE6r/E42atWruvXoQ33StgsEMGKMIt2DJlC196at4s wSX7oEBRpkJVgTyZ7lqzRlf27L38iqm4PHM0Sa4jv3fK91WlEy/71KGGBE5qYuHiAF28 RLN1LsZtCSurkQw7kEIVVPISJp12gKyhmhSBoWhDUg92+p5QXQuMKDZucZybp03hD9eW uXyHaD4a+NoU9QbdjQlSM4iHG1N8Xo9Kjitxb4QtYS6zZ3tTxQ7LBiwC4+PVg0y7PXb7 6Mtura0m9xQLfdZCRs6x+944ZncEorSpulAwidv/EEfk/G5tNGwoUqRz+ZzdKcaTb08/ TZYg== 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=fY1rvb4AY8EPfNwxN7zX2XLR8+jm9ePz4QdrCggMvHw=; fh=6qwGabeJRBrpmO2yr117eyV0fdnUj6Qb42ZlAUAwlRQ=; b=g1DGOeOlUU2uka5wWEGScKrnNHAx9UvU5dqwHztfi7Y7xQV7eEta9Eng+qA0YfFInx LDJDuqjAroW0vaxb5AutsUX5xHSSLC6AtJ7kWIxT5Xqqa/ZAtfZB8SVF7ibombOtAinf D++RMfWVpjxkB5tMmrAF+PWrnJJmVPl7L0y0cqTQz2Lc+ClkUwURKgRlchKTN7Od56O4 QNFqUdVFPYc9KmcjyLFlQjzaytB0enIhyJTYjRMGKEpX3nW9Mj4OjIpQgp980tOtd805 19jRrObwoCSEIzP5NeXA9K25w7TmiUtb3bjyHtPg+dx4cAk8Az97l6SwSAtzVjvNoq6o L0Fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xuXRS77j; 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 ca18e2360f4ac-834efde7d9asi67333739f.73.2024.10.03.08.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:05 -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=xuXRS77j; 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 2876388E65; Thu, 3 Oct 2024 17:23: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=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="xuXRS77j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D25E988E84; Thu, 3 Oct 2024 17:23:43 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 83B1588E19 for ; Thu, 3 Oct 2024 17:23:40 +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-x42f.google.com with SMTP id ffacd0b85a97d-37d00322446so1112782f8f.2 for ; Thu, 03 Oct 2024 08:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969020; x=1728573820; 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=fY1rvb4AY8EPfNwxN7zX2XLR8+jm9ePz4QdrCggMvHw=; b=xuXRS77jLfjxgRFwrIkfpYFdwrzzO2NdRQ1RpMKF+xxIa+l0qmWEdtvBdqTkdASMAm J5erIaKnk6V5Rywpk20pQo7fhIlz8HqEp5HaJsHriIOrQlBK6kmNqp/y8PXtMwBOWzkt F7w7V/MNUd7KAWYJJK4eydjcLkP4fv3ID3L6TZgrReTCktlgYvA4TwFDpBip6FvkoA8O LKStCQB5k18W1fOCbo1noZ41PBPg+U2sQH9cq4/3gdNBOwgKe+iBoeIjCgWunh4PX2d3 tl9liT9psFKyNGJUh+KRPGMwnQqDYmCUfWTTNz9+dstXvpVfo5YHrwr1vnwMcteJlQv6 FR7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969020; x=1728573820; 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=fY1rvb4AY8EPfNwxN7zX2XLR8+jm9ePz4QdrCggMvHw=; b=du0D17myfdos3t0jNF7wZ6nQgc7IkdIabPrTiJcqBBDXs4sWnIMrJpsGblnyiuAiBB KcDFQn+KI12irSOH4pBoI0bUPRnsZoj8vWDw0XUPkfbIbFRom3wddfrsXZ20ZNEUrSFl 14r5dGYLwJ/BzNPao8ao4zKz8lIAdmpVOsiQe3zW1TKEhzVGsLg3sYnm0LgNuawwdVUa SJMiGOgyHCMKs7WO2zZXbaZETOxFLwrrHZwoPIwcArY5Ddxp8bGB9r3sAxJ62nBMMPya mPpNs8X0HzldRsypZvLzF8S3gvjLTr7N6xTDNRb+yMBtWKznLMF1U2wazjMPuXMm+eRH fVEQ== X-Gm-Message-State: AOJu0YxxbsuLUBPPTJ9uzhPZyoiD0T7yH8kqAp+meH/kJ74JnyJby6Pd KiLXQerKIle8Z0jBuWzHAa7/48Xj/c3aCI30FWV891J8I0R9BysKcR2p7BFeZZT7ADIxXM1THzp z93Gr/w== X-Received: by 2002:a5d:424b:0:b0:37c:cbd8:66cf with SMTP id ffacd0b85a97d-37cfba18401mr4339499f8f.48.1727969019691; Thu, 03 Oct 2024 08:23:39 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:39 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Mattijs Korpershoek , Stefan Roese , Joshua Watt , Marek Vasut , Rasmus Villemoes , Jagan Teki Subject: [PATCH v11 02/29] Make AVB_VERIFY depend on FASTBOOT Date: Thu, 3 Oct 2024 17:22:48 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Note: Patch posted separately [0]. [0] http://patchwork.ozlabs.org/project/uboot/patch/20241002144845.1439316-1-jerome.forissier@linaro.org/ AVB_BUF_ADDR, which is under "if AVB_VERIFY", defaults to FASTBOOT_BUF_ADDR. Therefore AVB_VERIFY should depend on FASTBOOT. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- common/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/common/Kconfig b/common/Kconfig index 957de0c5c02..c011ab6e820 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -850,6 +850,7 @@ config AVB_VERIFY depends on LIBAVB depends on MMC depends on PARTITION_UUIDS + depends on FASTBOOT help This option enables compilation of bootloader-dependent operations, used by Android Verified Boot 2.0 library (libavb). Includes: From patchwork Thu Oct 3 15:22:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832402 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343129wra; Thu, 3 Oct 2024 08:24:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWYp50zAXNXSu6z6zD8QjbSqnqVPa+yGv+8mEw7JNpnEqAbwrW1ww/XEBySFGoFU+WYgwpw8w==@linaro.org X-Google-Smtp-Source: AGHT+IHgb5odTXmyOQQHOlFNX+t6a0kLsbxzeQ05I3llHmR7enB6ERfu+j+pu6YD2MOs5C7V6FhN X-Received: by 2002:a05:6602:2cce:b0:82c:db6a:366 with SMTP id ca18e2360f4ac-834d829d0dfmr688792639f.0.1727969056000; Thu, 03 Oct 2024 08:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969055; cv=none; d=google.com; s=arc-20240605; b=U+fsPYRvz3teoPVrJCDe1ClHVIirLBJAz4l1ej6xsrtvcfNQf/T0V3WiVbh4LiEvjM KAYAoL6WxFdmmVrRI3NMbUNXQAjXYVE5zsodfUf8CK4FtWXeay25DoE3w5LU/NcdmizY DpQQKTDGkdRtdQI6Se18KcwPB6NH7vV+gj3Gm3wt26tVuOSjmMu0aEqpPmjHcsdjDUyk UpLyCROhIC8SEOlVrjT1BNBlHlFw0Hsk+Orgit4sSoOPgx+daDo7vDry3xjeDoaiDCtu UzZnFnaqh/fJIutiJcjrw+f8PYQrjUYLPo7dG41L745PXmN74AzuRCyIZXGDcgk4heh5 UGlw== 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=cqiyAoroPIcERV5UdiZ9NbI4bh3DuJ6aBo7wOO8WXf4=; fh=sSpIskISIohG8bsYLL8XhVgyCtIjzEE9bI5TcJmdmT8=; b=K7FS3RNFUmocUuqKb1AjC+R/Y74aGCMX89sKMbEhQjqQAvm6HC5MQqiAFpcOm5ozbF dbubvSIHv3h6DXzTAfFMj3A5r+CCDnMNaKuTsypXcRT/qUz5h0A6YtGB69dUGZrvDmoX 1Pp92xWvn0tTWwrBfo9PcPEi5yzE5Y+JWzZfxEfIG4vlv3ZnnthswDzF8l+HoLwOZtf1 +U1jj4TF9wsiHT/MEhkxfE0zUtAXWXEcZWUE6A5wczqyBTB98hQCpen1wH+4U3vKJi00 wt93UHVETKf1wb9CHIIg6B93SbQ5NMSrYm+ogWXxDww1XxqvECmtjNmKFC5cMnCOt8l2 u+ew==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iPr6Pqzu; 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 8926c6da1cb9f-4db55a639f3si878710173.126.2024.10.03.08.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:15 -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=iPr6Pqzu; 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 8CD3488E6C; Thu, 3 Oct 2024 17:23: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=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="iPr6Pqzu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D629B88E19; Thu, 3 Oct 2024 17:23:43 +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 73B2888E3A for ; Thu, 3 Oct 2024 17:23:41 +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-37cc60c9838so682839f8f.1 for ; Thu, 03 Oct 2024 08:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969021; x=1728573821; 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=cqiyAoroPIcERV5UdiZ9NbI4bh3DuJ6aBo7wOO8WXf4=; b=iPr6PqzuS91pThZrZNVmymkjff8ENeEmZlWdvU4lQKdc+GUX8aZXXaTMJGmrjQd8x/ PMxNT8z4OWV7PbLIByNt7NGTyx4Ghu2jazLzPupazMIJ3HaxFk1XbMEgnObISjuLY7bc EXA5ZqIk1zIyqKGynZmmPyJWtYCVQqHiSanbfPctjix7NQVh0v4XNX8XDA3M+dGHm8k2 7XKQXdAWTT+DMZ/OK+CaiQK3X2LLEt3KR9Wo/PtwUMW92akg5tu/5QM2XrkcsGDqmS5i xTeTb7e68oDOG0X9GygavRKVLG6G8ldjRRbWd7U6ZTDFcPGoYb4r3154SFLw6VPToUx1 QwDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969021; x=1728573821; 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=cqiyAoroPIcERV5UdiZ9NbI4bh3DuJ6aBo7wOO8WXf4=; b=QTVbb9f8ku1AovjQX2Ja3jEMql7jGJyqqAMN3STRQ7H6Cr70HqgUycl87hzsNN4MZA lDMnGCcz8AtSSEF2vfMv9/ik2+DxFJ/PyQraxMhR0QsV7mPxscwkcs05SSeLCfajM6e4 GEk0V1SfJRL7IqiQIay5HN3W3KsxIV6vriCcT73AZMnaSytMlGiH+6m+mGQ4soAlBrp+ QbYhbLUD2kKNet/B5wyG44iTXkSTr/zxJb0ojldqQ+lnqm+R9/ozod3i2E4bOtyhDSyp HmUPlfnhE79EUGmJ28b8hKdtJvRWDqlismv7SrFC780whYNiQARd7gwkzrYNZzY496/f o3eA== X-Gm-Message-State: AOJu0YwwjurnZqdKAgGD+f/1Byhon8bdfLQqkAGghO49tPXLZhYxJL9F 9OofcNpeDONPE06ydAmEhSSRhzDQl9flo6Mya6IbPIAxRsHAagjqWkOQ2NJulpQ2xIppSpWSEOh D4swGTA== X-Received: by 2002:adf:f2cf:0:b0:374:bd00:d1e with SMTP id ffacd0b85a97d-37d049b7650mr2155164f8f.3.1727969020741; Thu, 03 Oct 2024 08:23:40 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:40 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Jiaxun Yang , Heinrich Schuchardt , Dan Carpenter , Alexander Gendin Subject: [PATCH v11 03/29] linker_lists: set LINKER_LIST_ALIGN to 8 for CPU_MIPS64 Date: Thu, 3 Oct 2024 17:22:49 +0200 Message-Id: <1699de5384a71c0d0ad535cdc48cc2b95087719d.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Note: Patch posted separately [0]. [0] https://patchwork.ozlabs.org/project/uboot/patch/20241003142030.1610222-1-jerome.forissier@linaro.org/ CPU_MIPS64 needs 8-byte alignment on the linker lists, otherwise an exception may occur. Fixes an issue found on malta64 with QEMU: Breakpoint 1, lists_driver_lookup_name (name=0xffffffffbe043578 "root_driver") at /home/uboot/u-boot/drivers/core/lists.c:31 31 if (!strcmp(name, entry->name)) [...] ld a1,0(s0) (gdb) p/x &entry->name 0xffffffffbe04b0d4 (gdb) p/x $s0 0xffffffffbe04b0d4 $ grep __u_boot_list /tmp/malta64/u-boot.objdump 4 __u_boot_list 000018e0 ffffffffbe04a4d4 ffffffffbe04a4d4 0004a584 2**2 Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 8f1f4667012..8f4df849801 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -45,7 +45,7 @@ config SYS_CACHELINE_SIZE config LINKER_LIST_ALIGN int default 32 if SANDBOX - default 8 if ARM64 || X86 + default 8 if ARM64 || X86 || CPU_MIPS64 default 4 help Force the each linker list to be aligned to this boundary. This From patchwork Thu Oct 3 15:22:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832403 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343202wra; Thu, 3 Oct 2024 08:24:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbaH3YCy++lKA8Cq2NsqY1tDpKKo449lC1xA/ZV9TvFsyqfIvjyhKY/kLjZHnEvRD0T6yzuQ==@linaro.org X-Google-Smtp-Source: AGHT+IF98ezU/LPW+vGsaO5P81wXlq4muNnEqKL/4w+3W3++QVEAE7X/+TF8cPo+zchPQ37liaDE X-Received: by 2002:a05:6602:601b:b0:82c:967b:6f96 with SMTP id ca18e2360f4ac-834d8411337mr828161339f.8.1727969066167; Thu, 03 Oct 2024 08:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969066; cv=none; d=google.com; s=arc-20240605; b=PryKhFjicGWdV1Aps5cH3JvHT8mOqHxGskLe6dC3RqiYyNBnJrh8rDwwS+vaCXu5jC xd34kmJZcwIFEtqTdFdxbP9T1l5S0wKd4CjQqVRDPfiiO+dI69ECsCQZ6u4hqLtnzMM7 XJOY3R4u78tStV4k9Bb9iZy6tduEjeu3jrB3P1p9a3ahGfRiZgEleiBF6SuCfe9tsdZD +ionjJK3GVBsv+BVEN/F50FfWpnWwCHHXncLp95cjR046mVnrapGYR0CHh92JigWnY3q CiokAJXH1FpXHLkSjKkD2oKR5BeSEoiuaGskZa3TVo3TvXU7KwVlyVpYDfmsP8eW6pGN dXZg== 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=RWG739LNLScuPnPoHoy8J4VInoN+jJ0v7ivgGIJsYr0=; fh=uRolVTu7QzpRsIoSTIuQegbQJQ0dDjCyKZ95MjrEInQ=; b=WvFDl/souYYFM9f2RETm87X3+RY/aXx8tIlRZjlubr2aXrHP3wjWAmJvIRO/ei65oS 96w9A+FbNY6tfjWHflrh8qLptqUFgLQUNE/ghK00U17RpM/S/RaVlwUOlCU7eBrwB+db z2bEB1IogHvimVmCD+5QzHyMVGHdV+VhiBbMdBTtVs+/lf4HYRQ6Q8kcO3/tSgysIXcU dSaoJhq7OD+Xd3rz+oRp5fCZuI1iOxxSCYrk9gWJw4G6MtsNZf2PpSvZVhD1EiPMSLjj RM6mItWdURpFr/xkCn7DQ7qrhENjubu9hW9NP6Voknk3wH4sT51cbLmsnQgUxZonZ1jz if+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yUVasMrQ; 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 8926c6da1cb9f-4db55aa484asi819535173.138.2024.10.03.08.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:26 -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=yUVasMrQ; 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 E632B88E31; Thu, 3 Oct 2024 17:23: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="yUVasMrQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CC28888EAB; Thu, 3 Oct 2024 17:23: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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 1F00B88E7A for ; Thu, 3 Oct 2024 17:23: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-x432.google.com with SMTP id ffacd0b85a97d-37cea34cb57so792643f8f.0 for ; Thu, 03 Oct 2024 08:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969022; x=1728573822; 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=RWG739LNLScuPnPoHoy8J4VInoN+jJ0v7ivgGIJsYr0=; b=yUVasMrQhymjrhewABv0WkgaShZueB+KfKq9vcUCDlPt7ZpySIDi/jhArolfEAMUuy UL/D61rnTSJ1VBqfLy78mBGSRoAhfDTxjIKDqxVve2NLDb3crQwUy7jUlAunmOP1JI3j K5GPmigIW7LNhkmANFDmPosHxTynYGXc9C4z9oTv3uytLMA2YGJRJIPQG73xo+V7jcr2 LINzjQB/k4duKSTmcILmm1MQFOw53dlH9gDjCXajNFe87SBpVTtSIm90Z+IC2u0OMk4A HQ6tBRd8CB3XSubZNekCf275WAOK2LWgkMfaaQcFjfwfAwpccKewuHVPxusbKxNSioHT +baw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969022; x=1728573822; 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=RWG739LNLScuPnPoHoy8J4VInoN+jJ0v7ivgGIJsYr0=; b=gmB0tnS6Gu4TO4IqEuHj4r47UfU94CFmA1gYdF/IRV5DZUBWzXqf8YVU4ycaQiXZoP pnOKpVGXHxuad1sK0LBM4BumBf38X8f+EoDBoZUrwlGf++Zxkuy3FxyV3Bjtt8lW+1bF SJgeSgrWa/oV2MFCfI76ngSsHEYBGMKvrdCgjAolD+RBPazpjrKYifNHiDeyQvRb40f3 LEyZtj0nzrPDbRxmfXtW7zFfHY7OctMSVGZi5LsnpxU+kVVWpkxz7LLQ5qGit37oNB6d 5J4T38bXGccZsuXX86V4Z4npe17lBJ7AX4O9Y1wyhSu7O+KpF3Tf37ygoao27u5tbNqf Hfug== X-Gm-Message-State: AOJu0YyprysB2SkbKaJBlPkXKLc28X48CP1PXDg3Fd6BsnHao/8cyANa 9bB8OwKs+ZWEzoOYUqE2qOXc0gVa3717X9ozkqx9blmkFFhkATQj1mEA5pcjcYN4o0J7cycxCfH JIztJ4A== X-Received: by 2002:a5d:4fca:0:b0:37c:cbd0:8d94 with SMTP id ffacd0b85a97d-37cfba20777mr3953005f8f.57.1727969022358; Thu, 03 Oct 2024 08:23:42 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:42 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Yang Xiwen , Kever Yang , Philip Oberfichtner , Boon Khai Ng , Robert Marko , Jonas Karlman , Neil Armstrong , Patrice Chotard , Marek Vasut Subject: [PATCH v11 04/29] sandbox: add dummy driver ETH_SANDBOX_LWIP Date: Thu, 3 Oct 2024 17:22:50 +0200 Message-Id: <1cc1dda87239c68cfa30430f08911b78cf4c69fd.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Introduce ETH_SANDBOX_LWIP which enables a mock driver similar to ETH_SANDOX but without the dependencies on the legacy network stack (NET) so that it may be enabled when the lwIP stack (NET_LWIP) is introduced. The driver does nothing at this stage but its presence will allow dm_test_iommu_noiommu [1] to pass. [1] ./u-boot -T -c "ut dm dm_test_iommu_noiommu" Signed-off-by: Jerome Forissier Acked-by: Ilias Apalodimas Reviewed-by: Simon Glass --- drivers/net/Kconfig | 11 +++++ drivers/net/Makefile | 1 + drivers/net/sandbox-lwip.c | 85 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 drivers/net/sandbox-lwip.c diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e7d0ddfe25a..2f39ec05ac7 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -350,6 +350,17 @@ config ETH_SANDBOX This driver is particularly useful in the test/dm/eth.c tests +config ETH_SANDBOX_LWIP + depends on SANDBOX + depends on NET_LWIP + default y + bool "Sandbox: Mocked Ethernet driver (for NET_LWIP)" + help + This driver is meant as a replacement for ETH_SANDBOX when + the network stack is NET_LWIP rather than NET. It currently + does nothing, i.e. it drops the sent packets and never receives + data. + config ETH_SANDBOX_RAW depends on SANDBOX default y diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 4946a63f80f..f5ab1f5dedf 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -39,6 +39,7 @@ obj-$(CONFIG_ETH_DESIGNWARE_SOCFPGA) += dwmac_socfpga.o obj-$(CONFIG_ETH_SANDBOX) += sandbox.o obj-$(CONFIG_ETH_SANDBOX_RAW) += sandbox-raw-bus.o obj-$(CONFIG_ETH_SANDBOX_RAW) += sandbox-raw.o +obj-$(CONFIG_ETH_SANDBOX_LWIP) += sandbox-lwip.o obj-$(CONFIG_FEC_MXC) += fec_mxc.o obj-$(CONFIG_FMAN_ENET) += fm/ obj-$(CONFIG_FMAN_ENET) += fsl_mdio.o diff --git a/drivers/net/sandbox-lwip.c b/drivers/net/sandbox-lwip.c new file mode 100644 index 00000000000..3721033c310 --- /dev/null +++ b/drivers/net/sandbox-lwip.c @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2015 National Instruments + * + * (C) Copyright 2015 + * Joe Hershberger + */ + +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +static int sb_lwip_eth_start(struct udevice *dev) +{ + debug("eth_sandbox_lwip: Start\n"); + + return 0; +} + +static int sb_lwip_eth_send(struct udevice *dev, void *packet, int length) +{ + debug("eth_sandbox_lwip: Send packet %d\n", length); + + return -ENOTSUPP; +} + +static int sb_lwip_eth_recv(struct udevice *dev, int flags, uchar **packetp) +{ + return -EAGAIN; +} + +static int sb_lwip_eth_free_pkt(struct udevice *dev, uchar *packet, int length) +{ + return 0; +} + +static void sb_lwip_eth_stop(struct udevice *dev) +{ +} + +static int sb_lwip_eth_write_hwaddr(struct udevice *dev) +{ + return 0; +} + +static const struct eth_ops sb_eth_ops = { + .start = sb_lwip_eth_start, + .send = sb_lwip_eth_send, + .recv = sb_lwip_eth_recv, + .free_pkt = sb_lwip_eth_free_pkt, + .stop = sb_lwip_eth_stop, + .write_hwaddr = sb_lwip_eth_write_hwaddr, +}; + +static int sb_lwip_eth_remove(struct udevice *dev) +{ + return 0; +} + +static int sb_lwip_eth_of_to_plat(struct udevice *dev) +{ + return 0; +} + +static const struct udevice_id sb_eth_ids[] = { + { .compatible = "sandbox,eth" }, + { } +}; + +U_BOOT_DRIVER(eth_sandbox) = { + .name = "eth_lwip_sandbox", + .id = UCLASS_ETH, + .of_match = sb_eth_ids, + .of_to_plat = sb_lwip_eth_of_to_plat, + .remove = sb_lwip_eth_remove, + .ops = &sb_eth_ops, + .priv_auto = 0, + .plat_auto = sizeof(struct eth_pdata), +}; From patchwork Thu Oct 3 15:22:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832404 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343258wra; Thu, 3 Oct 2024 08:24:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXpNRxf+lgXA16MBuInDlMsUykFhx1nKC8xqwBrtqEf5LkKf8xlxD+7fBtBZ/OCicg4jEfFHg==@linaro.org X-Google-Smtp-Source: AGHT+IFG7/24WY+s9l1kZU2/CdzeinJV3sEZIdPE6Yy5OHAsd0E7YL2kma5fX2DwSDglFbMcXdVb X-Received: by 2002:a05:6602:6d0e:b0:82d:2a45:79f5 with SMTP id ca18e2360f4ac-834d84d4e78mr612682839f.13.1727969075613; Thu, 03 Oct 2024 08:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969075; cv=none; d=google.com; s=arc-20240605; b=UAi53kTpAMhtDNQbdfiEP5p/WU2oLNGDd6jt90VN/m2OGCk83FEc5N3vlGSueSHMZP pNlpMfATF7ZFten+oQZPO7T2KUJTaw3QlkNKEdGOoIvS7ppcxvinidZnO5bn4PjaiDWg ZhLTVKsgqgSANbhSP7c5jHx3uL24yEfubWeVnX+a9+J9wddsDP73PPGmLnALMKsZ3ojg K1MHqjCyc2NniHcVNyEYs/6HREsQfvoWFyh6rWUOWD+XAhVPtfdCnOQKjbK2lHvViePj YT7l37KIDvFp3y900xqJ0fWouaMAY6bw7kYe77Tv0DCf57MQBgGKJaGQJdCJD7NQVrpx 5/Ew== 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=9X4um2R6dVMJH/vlbJbwmbiVPamSmz2YnJf/D866L60=; fh=nej+w6m9gbRnK6RkZbbY3buI7TuJ7nR0LerABlBlevs=; b=OHjxBKxLhEr3AeyHSN89iuSUHJfDych2VJpuU3cXamSkFCb+WQBhINfqBiZNs7LH72 xLG0acGva+S2G40Sgu7eEDXQm8/I+X1uOXoH5WF96Ltnou3aMecgyScBPVgXTYOguJ0W JM9ftkcVS1Ye92P19k8xRfp+L3MFy1KtIg2OrOr88mPJn2h2acAWqSiDR88OHz73rR5a jSiB3OETRtF/fbeN4fYF6KchWukuDAhtHSrWWlkCoVraPal8DEjoyZPLS9BwuFf2Atwr I6WVtb2QVJSnvoQNYPY0pstOQgNu+HOci0FPm1XShoxsrSAlmAWowdlOo6szjFxWRj0R lksA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yDyV6C7r; 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 8926c6da1cb9f-4db559690e4si769110173.47.2024.10.03.08.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:35 -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=yDyV6C7r; 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 50CBE88EAB; Thu, 3 Oct 2024 17:23: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=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="yDyV6C7r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E953588E7A; Thu, 3 Oct 2024 17:23: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-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 00CD888E19 for ; Thu, 3 Oct 2024 17:23:44 +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-x331.google.com with SMTP id 5b1f17b1804b1-42cba6cdf32so11162155e9.1 for ; Thu, 03 Oct 2024 08:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969023; x=1728573823; 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=9X4um2R6dVMJH/vlbJbwmbiVPamSmz2YnJf/D866L60=; b=yDyV6C7rqT1uGptv+2PvH64Zo+/qmtJu5GA2WuN9Y7jW20rQRYCjgnrbuPEGFxEMUx qoV3eWDe+xVBuXDyeThtWoBaOIHlZG9zZ2gZLRvIqzNOnGPnuwy4drfcTGji2yS6gsSs a0CamMG86/aezPH9S2b0XKgxLLaF3RA6Egiq1JnVp2mO2ojyUALMdzb8eYS/qopuWCPf XsgcRjGvd4AyXN5PFVHbWsrKygG9QeE1zyCuV8tkudEk6/7gJ1bIIHZQSS63tkMMNLGM kH5me5FUxHYeXe0wbilefJL/csm4XWqbqfS/D1odc7Ik6vblmh58bvoMBsamY711ezcL SZHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969023; x=1728573823; 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=9X4um2R6dVMJH/vlbJbwmbiVPamSmz2YnJf/D866L60=; b=DbhKABvpzFMgCdNJJs5pp+0MwFwN0FWZ5GaknwMrWbjF3aJ64orFelZQ9FVHuIhEqz LIrtThhKqGQLDrIuRFkK8ZoN2MrDw+Tenvd/pLVuJdZreXmDBwZ8TF5OofGm7FuRKCu8 LehDuFRrLf9E/U6lYWk6UmkuRWZhK3ddq2fBU9R2fRE1KktbYGHBGZzFb+/3ud8S0Dp+ 09EOeEU2mWgR6w4XV/yT4hU+JvAroHknrXhjvsDZV9GLJK3SRqXF/ZA0Ug+el4dKDier ymgS+1A9fGysOOBjSbsWi96olS3p7emPGrGK9xnPQAvjqzv/lt11kDdFFwDx/1W8hhsE royg== X-Gm-Message-State: AOJu0YxZPTr+LTcmX0krJ60P/G4YmKo21YQ4gANY/NQXw8pNlu8JADKT oz9v5QQchcZnzqYteR8qTffLbDxTJx444Q6wp7EXtiQa81bb8+zSAZeLXlgkKlNwcSz8Df+/VVr 7uGyAHQ== X-Received: by 2002:a05:600c:230c:b0:42c:bdb0:c61e with SMTP id 5b1f17b1804b1-42f7a12bb01mr50224415e9.13.1727969023230; Thu, 03 Oct 2024 08:23:43 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:43 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Simon Glass , Tom Rini , Marek Vasut , Mattijs Korpershoek Subject: [PATCH v11 05/29] test: boot: fix bootdev_test_any for when DSA_SANDBOX is disabled Date: Thu, 3 Oct 2024 17:22:51 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 DSA_SANDBOX is not set, the sandbox tests fail as follows: $ ./test/py/test.py --build-dir=$(pwd) -k bootdev_test_any [...] Test: bootdev_test_any: bootdev.c test/boot/bootdev.c:156, bootdev_test_any(): "mmc2" = media->name: Expected "mmc2", got "mmc0" [...] This is due to the device list containing two less entries than expected. Therefore, adjust the expected index to be two less when DSA_SANDBOX is disabled. The actual use case is NET_LWIP=y (to be introduced in later patches) which implies DSA_SANDBOX=n for the time being. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- test/boot/bootdev.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index c635d06ec25..369105ca4cf 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -128,6 +128,7 @@ BOOTSTD_TEST(bootdev_test_labels, UTF_DM | UTF_SCAN_FDT | UTF_ETH_BOOTDEV); static int bootdev_test_any(struct unit_test_state *uts) { struct udevice *dev, *media; + char *seq; int mflags; /* @@ -147,8 +148,16 @@ static int bootdev_test_any(struct unit_test_state *uts) * 8 [ ] OK mmc mmc2.bootdev * 9 [ + ] OK mmc mmc1.bootdev * a [ ] OK mmc mmc0.bootdev + * + * However if DSA_SANDBOX is disabled the dsa-test@{0,1} devices + * are not there. */ - ut_assertok(bootdev_find_by_any("8", &dev, &mflags)); + if (CONFIG_IS_ENABLED(DSA_SANDBOX)) + seq = "8"; + else + seq = "6"; + + ut_assertok(bootdev_find_by_any(seq, &dev, &mflags)); ut_asserteq(UCLASS_BOOTDEV, device_get_uclass_id(dev)); ut_asserteq(BOOTFLOW_METHF_SINGLE_DEV, mflags); media = dev_get_parent(dev); From patchwork Thu Oct 3 15:22:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832405 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343331wra; Thu, 3 Oct 2024 08:24:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDRRtpMTNRMXtirUrwT4CW5hlTwMnnAAlK+bu30ESKb9Mmu9aVb4s76tDK+aeiAJiHICwatw==@linaro.org X-Google-Smtp-Source: AGHT+IGvkUM4rbFCdPKO+sBIkbZfSFzD3aA0wOKJgKVHeWkb0MzqyETcHXB2lGYYjSf/Egdh9w3h X-Received: by 2002:a05:6e02:1c03:b0:3a0:9d62:3b65 with SMTP id e9e14a558f8ab-3a365918290mr66578965ab.3.1727969085425; Thu, 03 Oct 2024 08:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969085; cv=none; d=google.com; s=arc-20240605; b=kMjBq+satzCFYTkRZrVcwfM5NLV1PmWd/j2HyAOm51iq/crgEZ3j314KRl9O/D1VLh W7zaQMZV2kqPJhDb9lG9AmOULTpZJs2T/K7Ey5b/Yt0ZVMeU+bXEQeeNvOhOwzqprhZc imHTNK5R4AP/ilEg/IHlvEYqFqlJ2/ydmOdkJL5NhXgaQhpy1+mRegfxxYXtq9Z/L9Zv UdJ3pRIMXssWLRB+iP9FGkUHtvHTLE9o29akHuDaB1ANA+r0d/pDGaW7rlP5sDD01507 CnTCLGmg/UjyQ35KN1V4OfWFCF3wxRdsxmvaYuHze2lAXrVuDTmSQe/WgCDxVEn4TDLc Dx7w== 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=0Jltn/X1Y1l7bLIIzXvV51M2plK+/RLLaLwiXUPWAo8=; fh=MVi58pieQiK5+fPNjqZOASQjEAM8Iutfp98Ij2EPMok=; b=cbOPUhL1FiPAfOoDR74ekVDPb1Gljo2z8AazsORGyeUANQTwxAIYznYP8L22qPfItb rZLTWutZAaA8qTJBHHvvUKEXTV9CefVjBF78LD+f8HXZ/+gQdeoyEm7HlzlYwEsjgJTL OwmUiUGYJwzoNzl/X/fPT9059mXVQq4m6cRhZEaChevkwb6W4pEOVo12evkpjxROHe3K F8tEDPQmqFg064yvJb8uvTDJtuuOPMD0bDGNZcbaOEPeTkeM989Vxr6NDpELORDEVJH+ 04qBiDgpRt8dWuo2C14dcQpHavt6UrsfdjQs/TfFyxCiYN9Pgoafkk/c003q+nmuJes0 Qf4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KM4EyZ17; 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 e9e14a558f8ab-3a371639024si6010425ab.205.2024.10.03.08.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24: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=KM4EyZ17; 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 AD70B88EBB; Thu, 3 Oct 2024 17:23: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=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="KM4EyZ17"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE5E588418; Thu, 3 Oct 2024 17:23:46 +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 EF29A88418 for ; Thu, 3 Oct 2024 17:23:44 +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-42e82f7f36aso9846695e9.0 for ; Thu, 03 Oct 2024 08:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969024; x=1728573824; 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=0Jltn/X1Y1l7bLIIzXvV51M2plK+/RLLaLwiXUPWAo8=; b=KM4EyZ17CLwK5YKm0ZmBRxismDvm0DPGaERNxKQIC2bhBloMmWfk0gaN+CVZZvoUx3 ho5i5zVBKhxE30dGK+CA1D9wj1Ex6SQXLX//g0uJ/cJzzQLWa1JwwK/dGxMJyk9JT7d7 SHi5VN7z76Gnw3iD1OgytamufOTTLwZpiNgt9VNy99I2IGcNjAChykkUQLOK6ihwsW0m h/1U5nf9tYe7u8gMpPXKVJjlwZQlleoDNlqHatYODP6VV3nIxpoaR7dQ/ua92ElbU5w6 BPf9wuuZj7hfGvAbFvXxyHKR+8xjcdfyN+SCzhBtgYfoqiTgv41semcqcKBGUZY0Jig6 XMrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969024; x=1728573824; 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=0Jltn/X1Y1l7bLIIzXvV51M2plK+/RLLaLwiXUPWAo8=; b=ER8v840aQtbxb3OokHOFrMa8Pgd4JFmzcL3Ht36GBTT2XTP4QDVW1gpnZXzui5x/wj 1wlkLyo1OgeAFKKTAOumxIy4/NbeT1R7ZUEsek0du741sLjMHp2jeenf1AeUXSlEukZl q9tN8GlbBF5fmL4f7JwchNbcXRdhm0Pxq3EUtHPL3FSY+0BOLDrlKUYwSP4YoZVfDHoX l1xW26Y0MXuql23P6VMc6zxByZA1UphVzu/9254VEej5HyC6R3p6fEKOlng0nXKTkgUw wSmexmKJ3vo8aQG9zrCTHevaVxMFO0kK/BzciY5p7s340Lbz0CMcAUlqk80I9s35wNo4 UTAQ== X-Gm-Message-State: AOJu0YyYrzrzf0LEmrZkbPSfd1OCNQSerqbF3Mfr6XTJlEuZIk3Uv7Jb pGlgrkJkJwVLawyvThL1XGInWaSNKkfNucizK/fXvrlwSMro6wF3lWSeAIbdWazE2O9hekPI4PM +txqFHw== X-Received: by 2002:a05:600c:4f4d:b0:42f:80a7:84e0 with SMTP id 5b1f17b1804b1-42f80a787c0mr16786935e9.32.1727969024153; Thu, 03 Oct 2024 08:23:44 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:43 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Simon Glass , Tom Rini , Mattijs Korpershoek , AKASHI Takahiro , Heinrich Schuchardt , Francis Laniel Subject: [PATCH v11 06/29] test: boot: fix bootflow_cmd_label for when DSA_SANDBOX is disabled Date: Thu, 3 Oct 2024 17:22:52 +0200 Message-Id: <2e8206d8bbd7d3140cf2734ca9b3fcd12ced4f14.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 DSA_SANDBOX is not set, the sandbox tests fail as follows: $ ./test/py/test.py --build-dir=$(pwd) -k bootdev_test_any [...] Scanning for bootflows with label '9' [...] Cannot find '9' (err=-19) This is due to the device list containing two less entries than expected. Therefore, look for label '7' when DSA_SANDBOX is disabled. The actual use case is NET_LWIP=y (to be introduced in later patches) which implies DSA_SANDBOX=n for the time being. Signed-off-by: Jerome Forissier Reviewed-by: Simon Glass --- test/boot/bootflow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 6ad63afe90a..c440b8eb778 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -109,9 +109,12 @@ static int bootflow_cmd_label(struct unit_test_state *uts) * 8 [ ] OK mmc mmc2.bootdev * 9 [ + ] OK mmc mmc1.bootdev * a [ ] OK mmc mmc0.bootdev + * + * However with CONFIG_DSA_SANDBOX=n we have two less (dsa-test@0 and + * dsa-test@1). */ - ut_assertok(run_command("bootflow scan -lH 9", 0)); - ut_assert_nextline("Scanning for bootflows with label '9'"); + ut_assertok(run_command("bootflow scan -lH 7", 0)); + ut_assert_nextline("Scanning for bootflows with label '7'"); ut_assert_skip_to_line("(1 bootflow, 1 valid)"); ut_assertok(run_command("bootflow scan -lH 0", 0)); From patchwork Thu Oct 3 15:22:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832409 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343785wra; Thu, 3 Oct 2024 08:25:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXd0xGUai9Dfutl9YlJ8hS8IQ84GLBl4Fw0KtqOU3Zi4ILgaC8tWt7UzgQVQBfPvSVpD0TvfQ==@linaro.org X-Google-Smtp-Source: AGHT+IEHg780zvYjcOPCeyboaCrkrmmMBdORVTkmFnOfx4u9aADgLz3XzJcQj5+7nOTjIyiVW3bg X-Received: by 2002:a05:6e02:17ce:b0:39f:5d96:1fde with SMTP id e9e14a558f8ab-3a365913dafmr66292065ab.3.1727969142979; Thu, 03 Oct 2024 08:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969142; cv=none; d=google.com; s=arc-20240605; b=hTjXE6m2x+rsWCxnOJaGtczX6zgI39vc/krSnHgSfQ4tHxMPDWleOjbRr96OH/GFBm oIxHpDAORjHf2hwKrXQIzmGit2uyZWIvx08RGs8Oaapfb+i6W2GddZfDJJe+UGAf9hdk q+YpiGUUwAMAgnHi0rTOqQ61gwuzhaphzoWA4Bau4NwtYDwYq/petvV8Nv6uTr0H+AtO 8+Vy6LrI5aACMZSRMxMBlQvtTr/JdXSHn/0d2ACR+o1IR2LsVPf/N8f7PDCrRcaFSvZi pYbk9v92jGE7qnh4oK/SQYRhlHvUja0kj46eXy/IXh9QJJVLU0bf9NzDfAlcF5rTMMu0 Kaaw== 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=vh2vaLsiYaGYXwGCPW80jK2jyrroW3+gmHVk0ybo56E=; fh=ro60/SyldB0OgZsilxgeyuYx79anBB2fwBy1jzzE00w=; b=BO5HKPRr/syA6uII1sqi+k6rpGwTWBN9jlRVFrNCFOYFy8RAmb1dmYgkSNUZipeOY5 oeaKJKzkZ0As7b7KIZjigprDJNGyG3/QeSzok7es2ltqdMvQ8JCWpBLxVgIcxtOE1k+D XE6WaIbc7tApGtJ/wVAvCdG+bN0Ka4XFycObk2371KJOkJo7qgrtFk2GwhMTuqvyYetV REf647jSExns+nbW3JM1s6EkkdlQeNXcPE8nyAnmqedsSQcNQx9ECg9t79x/y3plXcfj fzzu3OT8h7+4fNpMhQAzgKb7q76vLYIFRpik8kwQ/rt4FbR8wMAsZl/g2+/O5+2SR+Q/ dUMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NJKH63Rg; 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 e9e14a558f8ab-3a37162d725si6194965ab.149.2024.10.03.08.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:25:42 -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=NJKH63Rg; 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 8DFE588DFA; Thu, 3 Oct 2024 17:25:41 +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="NJKH63Rg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 47F3088E3F; Thu, 3 Oct 2024 17:23: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=unavailable 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 7815588EFA for ; Thu, 3 Oct 2024 17:23: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-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso11096015e9.2 for ; Thu, 03 Oct 2024 08:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969028; x=1728573828; 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=vh2vaLsiYaGYXwGCPW80jK2jyrroW3+gmHVk0ybo56E=; b=NJKH63RgwIRNvqbKTzlB+W2wtXJ8k6AueEKBQ+pioRSSIZLj26spJxCgj+usVvc8kK YFxZzivPiPQAFR6bAtp4w9LnAx1Vb6+kvGkDYQtp3yOVpV6e8FbeyTM4iPBMG8wbN8Yr H4AcNaybjj2HtHYPPQAn72Ia6zKZzkBtE3FQ6DrG/1hTjGKYT/lse1ZbI78OkFWCACau HPAFrGLa7PR2JL2IVW+dL+UUlZADIwyYTLxBn1uYGRAf8u5HTjEj8ZS1ZCNoBJ9Lzjgv yGdLXmTEpef7NadgS7MjM8un77EXxp7EkCwwnrKmQ3uJarBMsCdQa9sQs0OMZfXQUuDx z4uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969028; x=1728573828; 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=vh2vaLsiYaGYXwGCPW80jK2jyrroW3+gmHVk0ybo56E=; b=ERlqQpE5sXW6aShBDfAPiLxqaE9MwZi4m5c/A9cjU+O2Dr6clR/1iDTvP77eUcA8tt mKUQfhnhFsg9zLMhvDvrl2yoyCGBLkMFCanhz4x7i2XxWdqnm+0BQJkEGvyiq0SQUiXv cAA3XnOFW7N9ledOj84nnhFPm0vSF0PBAeyPDuYYSdU9/enuhEzg8dwp3yeoZpBSmD05 i+FNKRjbM/zJGbA2YzlkNHZwDPFf2qn/NrK4n8w7cixdsq6dJ19yuq6PM9dH8BAA7g04 eqQZ0PsFwoMSnB5KIpIjsU6Z7J50KGmsEUZRg3/Wo/VcSHzT8zZRa6Xe8Y2/I62LDetU uw7g== X-Gm-Message-State: AOJu0YyrhWhBp+PN5i6ORimNrGNJQ/7Ca+V3W7JEAqCx6Sezf+pIUrZf bBqMTUSMABDM/6YdHPFTJk16s0eY13qc0UvZ/TMexC9XK7bzq7FZxwq41+jW7B2i4KVbf/IOYSt GQDB+5iWO X-Received: by 2002:a05:600c:3108:b0:42c:ae30:fc4d with SMTP id 5b1f17b1804b1-42f777b64c9mr55711985e9.7.1727969027538; Thu, 03 Oct 2024 08:23:47 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:23:47 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Lukasz Majewski , Mattijs Korpershoek , Joe Hershberger , Ramon Fried , Marek Vasut , Simon Glass , Paul Kocialkowski , Hiago De Franco , Sean Anderson , Jonas Karlman , John Keeping , Greg Malysa , Heinrich Schuchardt , Sumit Garg , Andrew Davis , Rasmus Villemoes , Bryan Brattlof , "Leon M. Busch-George" , AKASHI Takahiro , Eddie James , Quentin Schulz , Stefan Roese , Joshua Watt , Jiaxun Yang , Andre Przywara , Samuel Holland , Lukas Funke , Jaehoon Chung , Alexey Romanov , Ion Agorria , Svyatoslav Ryhel , Yang Xiwen , Robert Marko , Peter Robinson , Neil Armstrong , Boon Khai Ng , Miquel Raynal , Baruch Siach , Anand Moon , Alexander Gendin , Johan Jonker Subject: [PATCH v11 07/29] net: introduce alternative implementation as net-lwip/ Date: Thu, 3 Oct 2024 17:22:53 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 03 Oct 2024 17:25:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net/lwip/ directory and the NET_LWIP symbol. Network support is either NO_NET, NET (legacy stack) or NET_LWIP. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP. SPL_NET cannot be enabled when NET_LWIP=y. SPL_NET pulls some symbols that are part of NET (such as arp_init(), arp_timeout_check(), arp_receive(), net_arp_wait_packet_ip()). lwIP support in SPL may be added later. Similarly, DFU_TFTP and FASTBOOT are not compatible with NET_LWIP because of dependencies on net_loop(), tftp_timeout_ms, tftp_timeout_count_max and other NET things. Let's add a dependency on !NET_LWIP for now. SANDBOX can select NET_LWIP but doing so will currently disable the eth dm tests as well as the wget tests which have strong dependencies on the NET code. Other adjustments to Kconfig files are made to fix "unmet direct dependencies detected" for USB_FUNCTION_SDP and CMD_FASTBOOT when the default networking stack is set to NET_LWIP ("default NET_LWIP" instead of "default NET" in Kconfig). Signed-off-by: Jerome Forissier --- Kconfig | 29 ++++++++++++++++++ Makefile | 2 +- boot/Kconfig | 4 ++- cmd/Kconfig | 1 + common/Kconfig | 2 +- common/spl/Kconfig | 1 + drivers/dfu/Kconfig | 1 + drivers/fastboot/Kconfig | 1 + drivers/net/Kconfig | 3 ++ drivers/net/phy/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 2 +- net/Kconfig | 61 +++++++++++++++++++------------------- net/Makefile | 4 +++ net/lwip/Kconfig | 49 ++++++++++++++++++++++++++++++ test/cmd/Makefile | 2 ++ test/dm/Makefile | 2 ++ 16 files changed, 131 insertions(+), 35 deletions(-) create mode 100644 net/lwip/Kconfig diff --git a/Kconfig b/Kconfig index ab46b27999c..9e3a55798f9 100644 --- a/Kconfig +++ b/Kconfig @@ -752,8 +752,37 @@ source "dts/Kconfig" source "env/Kconfig" +menu Networking + +choice + prompt "Networking stack" + default NET + +config NO_NET + bool "No networking support" + +config NET + bool "Legacy U-Boot networking stack" + imply NETDEVICES + +config NET_LWIP + bool "Use lwIP for networking stack" + imply NETDEVICES + help + Include networking support based on the lwIP (lightweight IP) + TCP/IP stack (https://nongnu.org/lwip). This is a replacement for + the default U-Boot network stack and applications located in net/ + and enabled via CONFIG_NET as well as other pieces of code that + depend on CONFIG_NET (such as cmd/net.c enabled via CONFIG_CMD_NET). + Therefore the two symbols CONFIG_NET and CONFIG_NET_LWIP are mutually + exclusive. + +endchoice + source "net/Kconfig" +endmenu + source "drivers/Kconfig" source "fs/Kconfig" diff --git a/Makefile b/Makefile index 8711831767d..96211738b2f 100644 --- a/Makefile +++ b/Makefile @@ -859,7 +859,7 @@ libs-$(CONFIG_OF_EMBED) += dts/ libs-y += env/ libs-y += lib/ libs-y += fs/ -libs-y += net/ +libs-$(filter y,$(CONFIG_NET) $(CONFIG_NET_LWIP)) += net/ libs-y += disk/ libs-y += drivers/ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/ diff --git a/boot/Kconfig b/boot/Kconfig index 925afe06a19..1d50a83a2d2 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -503,7 +503,8 @@ config BOOTMETH_ANDROID select ANDROID_AB select ANDROID_BOOT_IMAGE select CMD_BCB - select CMD_FASTBOOT + imply CMD_FASTBOOT + imply FASTBOOT if !NET_LWIP select PARTITION_TYPE_GUID select PARTITION_UUIDS help @@ -559,6 +560,7 @@ config BOOTMETH_EXTLINUX_PXE config BOOTMETH_EFILOADER bool "Bootdev support for EFI boot" depends on EFI_BINARY_EXEC + imply CMD_TFTPBOOT if CMD_NET default y help Enables support for EFI boot using bootdevs. This makes the diff --git a/cmd/Kconfig b/cmd/Kconfig index 5ef3c8a8748..3beddd72583 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1661,6 +1661,7 @@ config CMD_USB config CMD_USB_SDP bool "sdp" + depends on USB_GADGET_DOWNLOAD select USB_FUNCTION_SDP help Enables the command "sdp" which is used to have U-Boot emulating the diff --git a/common/Kconfig b/common/Kconfig index c011ab6e820..90cee19d413 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -424,7 +424,7 @@ config LOGF_FUNC_PAD config LOG_SYSLOG bool "Log output to syslog server" - depends on NET + depends on NET || NET_LWIP help Enables a log driver which broadcasts log records via UDP port 514 to syslog servers. diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 137f94a1681..97bafa50c9e 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1073,6 +1073,7 @@ config SPL_DM_SPI_FLASH config SPL_NET bool "Support networking" + depends on !NET_LWIP help Enable support for network devices (such as Ethernet) in SPL. This permits SPL to load U-Boot over a network link rather than diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index aadd7e8cf7f..604386bb734 100644 --- a/drivers/dfu/Kconfig +++ b/drivers/dfu/Kconfig @@ -20,6 +20,7 @@ config DFU_WRITE_ALT config DFU_TFTP bool "DFU via TFTP" depends on NETDEVICES + depends on !NET_LWIP select UPDATE_COMMON select DFU_OVER_TFTP help diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index 70207573de2..1eb460f5a02 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -1,5 +1,6 @@ menu "Fastboot support" depends on CMDLINE + depends on !NET_LWIP config FASTBOOT bool diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 2f39ec05ac7..9c042808b44 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -48,6 +48,7 @@ config DM_DSA bool "Enable Driver Model for DSA switches" depends on DM_MDIO depends on PHY_FIXED + depends on !NET_LWIP help Enable driver model for DSA switches @@ -342,6 +343,7 @@ config ESSEDMA config ETH_SANDBOX depends on SANDBOX + depends on NET default y bool "Sandbox: Mocked Ethernet driver" help @@ -363,6 +365,7 @@ config ETH_SANDBOX_LWIP config ETH_SANDBOX_RAW depends on SANDBOX + depends on NET default y bool "Sandbox: Bridge to Linux Raw Sockets" help diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index a9efc509814..13e73810ad6 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -11,7 +11,7 @@ config MV88E6352_SWITCH menuconfig PHYLIB bool "Ethernet PHY (physical media interface) support" - depends on NET + depends on NET || NET_LWIP help Enable Ethernet PHY (physical media interface) support. diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index f20a16e3e7d..96ed3a2def0 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -224,7 +224,7 @@ endif # USB_GADGET_DOWNLOAD config USB_ETHER bool "USB Ethernet Gadget" - depends on NET + depends on NET || NET_LWIP default y if ARCH_SUNXI && USB_MUSB_GADGET help Creates an Ethernet network device through a USB peripheral diff --git a/net/Kconfig b/net/Kconfig index 7cb80b880a9..16a9de47e94 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -2,11 +2,6 @@ # Network configuration # -menuconfig NET - bool "Networking support" - default y - imply NETDEVICES - if NET config ARP_TIMEOUT @@ -26,15 +21,6 @@ config PROT_UDP Enable a generic udp framework that allows defining a custom handler for udp protocol. -config BOOTDEV_ETH - bool "Enable bootdev for ethernet" - depends on BOOTSTD - default y - help - Provide a bootdev for ethernet so that is it possible to boot - an operationg system over the network, using the PXE (Preboot - Execution Environment) protocol. - config BOOTP_SEND_HOSTNAME bool "Send hostname to DNS server" help @@ -45,15 +31,6 @@ config BOOTP_SEND_HOSTNAME of the "hostname" environment variable is passed as option 12 to the DHCP server. -config NET_RANDOM_ETHADDR - bool "Random ethaddr if unset" - help - Selecting this will allow the Ethernet interface to function even - when the ethaddr variable for that interface is unset. In this case, - a random MAC address in the locally administered address space is - generated. It will be saved to the appropriate environment variable, - too. - config NETCONSOLE bool "NetConsole support" help @@ -255,11 +232,35 @@ config IPV6 endif # if NET +source "net/lwip/Kconfig" + +if NET || NET_LWIP + +config BOOTDEV_ETH + bool "Enable bootdev for ethernet" + depends on BOOTSTD + default y + help + Provide a bootdev for ethernet so that is it possible to boot + an operating system over the network, using the PXE (Preboot + Execution Environment) protocol. + +config NET_RANDOM_ETHADDR + bool "Random ethaddr if unset" + help + Selecting this will allow the Ethernet interface to function even + when the ethaddr variable for that interface is unset. In this case, + a random MAC address in the locally administered address space is + generated. It will be saved to the appropriate environment variable, + too. + +endif # if NET || NET_LWIP + config SYS_RX_ETH_BUFFER - int "Number of receive packet buffers" - default 4 - help - Defines the number of Ethernet receive buffers. On some Ethernet - controllers it is recommended to set this value to 8 or even higher, - since all buffers can be full shortly after enabling the interface on - high Ethernet traffic. + int "Number of receive packet buffers" + default 4 + help + Defines the number of Ethernet receive buffers. On some Ethernet + controllers it is recommended to set this value to 8 or even higher, + since all buffers can be full shortly after enabling the interface on + high Ethernet traffic. diff --git a/net/Makefile b/net/Makefile index 64ab7ec740a..70eec8caf0d 100644 --- a/net/Makefile +++ b/net/Makefile @@ -5,6 +5,8 @@ #ccflags-y += -DDEBUG +ifeq ($(CONFIG_NET),y) + obj-$(CONFIG_NET) += arp.o obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o @@ -38,3 +40,5 @@ obj-$(CONFIG_CMD_WGET) += wget.o # sprintf(buf, index ? "foo%d" : "foo", index) # and this is intentional usage. CFLAGS_eth_common.o += -Wno-format-extra-args + +endif diff --git a/net/lwip/Kconfig b/net/lwip/Kconfig new file mode 100644 index 00000000000..8a67de4cf33 --- /dev/null +++ b/net/lwip/Kconfig @@ -0,0 +1,49 @@ +# +# Network configuration (with lwIP stack) +# + +if NET_LWIP + +config LWIP_DEBUG + bool "Enable debug traces in the lwIP library" + +config LWIP_ASSERT + bool "Enable assertions in the lwIP library" + +config PROT_DHCP_LWIP + bool + select PROT_UDP_LWIP + +config PROT_DNS_LWIP + bool + select PROT_UDP_LWIP + +config PROT_RAW_LWIP + bool + +config PROT_TCP_LWIP + bool + +config PROT_TCP_SACK_LWIP + bool "TCP SACK support" + depends on PROT_TCP_LWIP + default y + help + TCP protocol with selective acknowledgements. Improves + file transfer speed in wget. + +config PROT_UDP_LWIP + bool + +config LWIP_TCP_WND + int "Value of TCP_WND" + default 8000 if ARCH_QEMU + default 3000000 + help + Default value for TCP_WND in the lwIP configuration + Lower values result in slower wget transfer speeds in + general, especially when the latency on the network is high, + but QEMU with "-net user" needs no more than a few KB or the + transfer will stall and eventually time out. + +endif # NET_LWIP diff --git a/test/cmd/Makefile b/test/cmd/Makefile index 8f2134998ad..dbee9b26405 100644 --- a/test/cmd/Makefile +++ b/test/cmd/Makefile @@ -30,7 +30,9 @@ ifdef CONFIG_SANDBOX obj-$(CONFIG_CMD_MBR) += mbr.o obj-$(CONFIG_CMD_READ) += rw.o obj-$(CONFIG_CMD_SETEXPR) += setexpr.o +ifdef CONFIG_NET obj-$(CONFIG_CMD_WGET) += wget.o +endif obj-$(CONFIG_ARM_FFA_TRANSPORT) += armffa.o endif obj-$(CONFIG_CMD_TEMPERATURE) += temperature.o diff --git a/test/dm/Makefile b/test/dm/Makefile index c12589d487c..03952441278 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -48,7 +48,9 @@ obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi_host.o obj-$(CONFIG_DM_DSA) += dsa.o obj-$(CONFIG_ECDSA_VERIFY) += ecdsa.o obj-$(CONFIG_EFI_MEDIA_SANDBOX) += efi_media.o +ifdef CONFIG_NET obj-$(CONFIG_DM_ETH) += eth.o +endif obj-$(CONFIG_EXTCON) += extcon.o ifneq ($(CONFIG_EFI_PARTITION),) obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fastboot.o From patchwork Thu Oct 3 15:22:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832410 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343839wra; Thu, 3 Oct 2024 08:25:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWeuSVQhriJ7H+kbQrpy5D6xywgZgXXg+cTdJpO6bUNsO+BxR8Xcitfnua1aKudYvn1yyx3wg==@linaro.org X-Google-Smtp-Source: AGHT+IHu2KnpCcDec9Eb9s7D7b1TXrnK2Yx7TFVbMPrG9ocfXElxaCDEVq0/7wWLtilgUnd3dz1W X-Received: by 2002:a05:6602:6409:b0:82c:f8fb:2c23 with SMTP id ca18e2360f4ac-834d852fb60mr784158339f.15.1727969151797; Thu, 03 Oct 2024 08:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969151; cv=none; d=google.com; s=arc-20240605; b=kM8RyT41288ssVQw+jFY18wskYBI1t8xM9YKasn72YSmRJHqFcbqoUkJriU1oiz0eJ toBkG0oPDerPC8zjlsjgK1Q0HDIc0GN6Nmq1AN1rKaVIaX7RuDHvV7JaIsv91Gpbj/nX ZaCrhCTcBpVJ2IGpeybxzu6aQb/FTZy1d+NRIlHi8RgRP6xfwa6Us6YGc8I4Pz5MySuP qPITWW5ANDvU6BcNKSiTUm/fbBCz3bvvnXjyWytlML7wi6di95UzQM/1Y+tITIUCDJRX KtXKeuh3WsPqMQp1LyGDs4JXfG3Hf7r7+PmDMbjggKhj/s/SbyoToVcZY526PqfPjBbX 3kXQ== 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=GosR7VMpkoVByMXOpu4LiNAj/1DQy5mnx904UmnIiPg=; fh=tys5SHaK2cCgqBVs9vbEqylHm/cNm9U82z13hPSbRYg=; b=RY/FedW654V2tJUx/gMfzNJn7XbjqQ6AwAAnPwPKbbJ6WBRnHeeHSEO5ve1GrqQa+u mv3lKWFzUxfAAxsg7xfuvKoAT3CAjFsutc5kXNnPVhzxWVpD2Cr/mHhq70MVXMieZ/2o He3vQSYbUBxnZtvhvAGaWKCfzL3tue9hn7w3pi0aQAoiP6bmR5J8UZBHU2Q6ZzLuGE0x bFFONFiBFWmY5O+SB+GmuSRCMUQGzhfZc4pIr/cEH2+IIy0cOKr4tsQGFqFlseLfWdwh 7luFwyP9XGjpuRSYP0G73Mu1iArZmF6PhkJNYCdAPcXQcsAFHSZ91KPe0pNdTPq+mB2M IL6A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WPOzdfhH; 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 8926c6da1cb9f-4db5586159asi757079173.1.2024.10.03.08.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:25:51 -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=WPOzdfhH; 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 0101488E84; Thu, 3 Oct 2024 17:25:42 +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="WPOzdfhH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C09CA88EE0; Thu, 3 Oct 2024 17:24:17 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 53FB388E19 for ; Thu, 3 Oct 2024 17:24:13 +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-x430.google.com with SMTP id ffacd0b85a97d-37cc846fbc4so904144f8f.2 for ; Thu, 03 Oct 2024 08:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969052; x=1728573852; 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=GosR7VMpkoVByMXOpu4LiNAj/1DQy5mnx904UmnIiPg=; b=WPOzdfhHJvAwQfiKSQGxwcmih9MXqaQAdekuRb0MOpwR6uKoRIGw7qQ8c/XsuiTV5K crDT+5ITwlOhgrFK4Og97QanFgd79SaZX/KZMnJhhqpfcIzRIU14VsgDVvF9ruVGZ2PU 6FLV561qYR2WnSMUg1sBscDJBAWr+HmdI27i6CdGse2fKOcnngvLRuulgirBtZuNRkSm T8HCbhiglSJW1AWR1LvtZK/14CYvcoS0+4H1wCWYq8Y6Xay1OfF7omOkKmaJd6FWdIvD zMs7DQU+cIzpy++n6ZzIQvRBRNjAQykQ+jqvimjwIKyHn9b22NDETqhZF/D1GcH0zkbA w2zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969052; x=1728573852; 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=GosR7VMpkoVByMXOpu4LiNAj/1DQy5mnx904UmnIiPg=; b=gbeyd59k+lxCiZMAPsjGOUZ/GI9O1QkJTjaKP4DT7NLKpsiZHpGve69wFH/dPniqNg t77/eQ3a+v7jua7Y73Z50WZMSlCTjOAknGx1seCu7PKSxs9aVmbWBXE+9Ww39Hr1Jfgn 0hgjs89TeCVoMuE+HztTQ36P45VxMn6rQGqkb4hMr7jEbRc6Vzpv19hj8fVE+INtDtaW wVW2S3iDjmSNTw5hlMc0WPvrTV2yLtmIg9k0dZ/yA/3giT4PBJxqiZOSZ6shxZZyIunP N0KmagJD95xYHkp4pITHujU73um/8XVNbQznfgAzkmLmguHLl5pXyY3LKdtuVwLuAl2g 1Mvw== X-Gm-Message-State: AOJu0Yx3Rdc7ZZ6/beaiy0k0gbOPvStLTN+s/uVHZJxf4ss9eBHH+pV3 PYB1GeKPk5bida3racp57jAVdINZvZO5V6kKHFj1VMyPrvjRBTKrs4gZSiLCtAINoZ1b0622PY9 T9XY1Waan X-Received: by 2002:adf:ffc2:0:b0:37c:cc96:d1cd with SMTP id ffacd0b85a97d-37cfb9d3364mr4432158f8f.34.1727969051543; Thu, 03 Oct 2024 08:24:11 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:09 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Felix Brack , Icenowy Zheng , Tom Rini , Angelo Dureghello , Vignesh Raghavendra , Bryan Brattlof , Nishanth Menon , Robert Nelson , Michal Simek , Chris Morgan , Wills Wang , Rosy Song , Mark Kettenis , Wolfgang Wegner , Stelian Pop , Thomas Fitzsimmons , Philippe Reynes , Linus Walleij , Simon Glass , Alex Nemirovsky , liuhao , shuyiqi , Sam Protsenko , Trevor Woerner , Heinrich Schuchardt , Alexey Brodkin , Andy Yan , Jonas Karlman , Yang Xiwen , Enric Balletbo i Serra , Matthias Winker , Philip Oberfichtner , Michael Trimarchi , Vaishnav Achath , Jayesh Choudhary , David Lechner , Johan Jonker , Fabio Estevam , Otavio Salvador , Eric Nelson , Peng Fan , =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Tianrui Wei , Minkyu Kang , lixinde , weichangzheng , Ilko Iliev , Stefan Bosch , Jaehoon Chung , Greg Gallagher , Mihai Sain , Sean Anderson , Stephan Gerhold , Kamil Lulko , Patrick Delaunay , Patrice Chotard , Dillon Min , Wei Fu , Yixun Lan , Sergey Temerkhanov , Mike Looijmans , Usama Arif , Anastasiia Lukianenko , Oleksandr Andrushchenko , Paul Kocialkowski , Martyn Welch , Quentin Schulz , Marcel Ziswiler , Svyatoslav Ryhel , Andrew Davis , Wadim Egorov , Venkatesh Yadav Abbarapu , Kever Yang , Dragan Simic , Janne Grunau , Neal Gompa , Sughosh Ganu , Hector Martin , Sumit Garg , Javier Martinez Canillas , Patrick Barsanti , Francesco Dolcini , Marek Vasut , Heiko Schocher , TracyMg_Li , Dario Binacchi , Andrii Chepurnyi Subject: [PATCH v11 08/29] configs: replace '# CONFIG_NET is not set' with CONFIG_NO_NET=y Date: Thu, 3 Oct 2024 17:22:54 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 03 Oct 2024 17:25:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The parent patch has made the networking stack a choice between NO_NET, NET and NET_LWIP. Therefore '# CONFIG_NET is not set' is now 'CONFIG_NO_NET=y'. Adjust the defconfigs accordingly. Note that this patch is intended to be folded in but is kept separate separate for now to make review easier. Signed-off-by: Jerome Forissier Tested-by: Felix Brack --- configs/LicheePi_Zero_defconfig | 2 +- configs/M5249EVB_defconfig | 2 +- configs/am335x_pdu001_defconfig | 2 +- configs/am62ax_evm_r5_defconfig | 2 +- configs/am62px_evm_r5_defconfig | 2 +- configs/am62x_beagleplay_r5_defconfig | 2 +- configs/amcore_defconfig | 2 +- configs/amd_versal2_mini_defconfig | 2 +- configs/amd_versal2_mini_emmc_defconfig | 2 +- configs/amd_versal2_mini_ospi_defconfig | 2 +- configs/amd_versal2_mini_qspi_defconfig | 2 +- configs/anbernic-rgxx3-rk3566_defconfig | 2 +- configs/ap143_defconfig | 2 +- configs/ap152_defconfig | 2 +- configs/apple_m1_defconfig | 2 +- configs/astro_mcf5373l_defconfig | 2 +- configs/at91sam9rlek_dataflash_defconfig | 2 +- configs/at91sam9rlek_mmc_defconfig | 2 +- configs/at91sam9rlek_nandflash_defconfig | 2 +- configs/bcm7260_defconfig | 2 +- configs/bcm7445_defconfig | 2 +- configs/bcm968380gerg_ram_defconfig | 2 +- configs/bcmns_defconfig | 2 +- configs/chromebook_samus_tpl_defconfig | 2 +- configs/cortina_presidio-asic-base_defconfig | 2 +- configs/cortina_presidio-asic-pnand_defconfig | 2 +- configs/durian_defconfig | 2 +- configs/e850-96_defconfig | 2 +- configs/ea-lpc3250devkitv2_defconfig | 2 +- configs/efi-x86_app32_defconfig | 2 +- configs/efi-x86_app64_defconfig | 2 +- configs/emsdp_defconfig | 2 +- configs/evb-px5_defconfig | 2 +- configs/generic-rk3568_defconfig | 2 +- configs/generic-rk3588_defconfig | 2 +- configs/hc2910_2aghd05_defconfig | 2 +- configs/igep00x0_defconfig | 2 +- configs/imx6q_bosch_acc_defconfig | 2 +- configs/imx6ulz_smm_m2_defconfig | 2 +- configs/iot_devkit_defconfig | 2 +- configs/j722s_evm_r5_defconfig | 2 +- configs/legoev3_defconfig | 2 +- configs/mk808_defconfig | 2 +- configs/mx23evk_defconfig | 2 +- configs/mx28evk_defconfig | 2 +- configs/mx6memcal_defconfig | 2 +- configs/mx6ulz_14x14_evk_defconfig | 2 +- configs/mx7ulp_com_defconfig | 2 +- configs/mx7ulp_evk_defconfig | 2 +- configs/mx7ulp_evk_plugin_defconfig | 2 +- configs/netgear_cg3100d_ram_defconfig | 2 +- configs/nsim_700_defconfig | 2 +- configs/nsim_700be_defconfig | 2 +- configs/nsim_hs38be_defconfig | 2 +- configs/openpiton_riscv64_defconfig | 2 +- configs/openpiton_riscv64_spl_defconfig | 2 +- configs/origen_defconfig | 2 +- configs/pe2201_defconfig | 2 +- configs/pinecube_defconfig | 2 +- configs/pm9261_defconfig | 2 +- configs/s5p4418_nanopi2_defconfig | 2 +- configs/s5p_goni_defconfig | 2 +- configs/s5pc210_universal_defconfig | 2 +- configs/sama5d27_giantboard_defconfig | 2 +- configs/sama5d29_curiosity_mmc1_defconfig | 2 +- configs/sama5d29_curiosity_mmc_defconfig | 2 +- configs/sama5d29_curiosity_qspiflash_defconfig | 2 +- configs/sama7g54_curiosity_mmc_defconfig | 2 +- configs/sama7g54_curiosity_nandflash_defconfig | 2 +- configs/sama7g54_curiosity_qspiflash_defconfig | 2 +- configs/sipeed_maix_bitm_defconfig | 2 +- configs/sipeed_maix_smode_defconfig | 2 +- configs/stemmy_defconfig | 2 +- configs/stm32f429-discovery_defconfig | 2 +- configs/stm32f429-evaluation_defconfig | 2 +- configs/stm32f469-discovery_defconfig | 2 +- configs/stm32h743-disco_defconfig | 2 +- configs/stm32h743-eval_defconfig | 2 +- configs/stm32h750-art-pi_defconfig | 2 +- configs/stm32mp25_defconfig | 2 +- configs/stmark2_defconfig | 2 +- configs/th1520_lpi4a_defconfig | 2 +- configs/thunderx_88xx_defconfig | 2 +- configs/tools-only_defconfig | 2 +- configs/topic_miami_defconfig | 2 +- configs/topic_miamilite_defconfig | 2 +- configs/topic_miamiplus_defconfig | 2 +- configs/total_compute_defconfig | 2 +- configs/trats2_defconfig | 2 +- configs/trats_defconfig | 2 +- configs/xenguest_arm64_defconfig | 2 +- configs/xenguest_arm64_virtio_defconfig | 2 +- configs/xilinx_versal_mini_defconfig | 2 +- configs/xilinx_versal_mini_emmc0_defconfig | 2 +- configs/xilinx_versal_mini_emmc1_defconfig | 2 +- configs/xilinx_versal_mini_ospi_defconfig | 2 +- configs/xilinx_versal_mini_qspi_defconfig | 2 +- configs/xilinx_versal_net_mini_defconfig | 2 +- configs/xilinx_versal_net_mini_emmc_defconfig | 2 +- configs/xilinx_versal_net_mini_ospi_defconfig | 2 +- configs/xilinx_versal_net_mini_qspi_defconfig | 2 +- configs/xilinx_zynqmp_mini_defconfig | 2 +- configs/xilinx_zynqmp_mini_emmc0_defconfig | 2 +- configs/xilinx_zynqmp_mini_emmc1_defconfig | 2 +- configs/xilinx_zynqmp_mini_nand_defconfig | 2 +- configs/xilinx_zynqmp_mini_nand_single_defconfig | 2 +- configs/xilinx_zynqmp_mini_qspi_defconfig | 2 +- configs/zynq_cse_nand_defconfig | 2 +- configs/zynq_cse_nor_defconfig | 2 +- configs/zynq_cse_qspi_defconfig | 2 +- 110 files changed, 110 insertions(+), 110 deletions(-) diff --git a/configs/LicheePi_Zero_defconfig b/configs/LicheePi_Zero_defconfig index 009384eaf1b..c37c49ccbb1 100644 --- a/configs/LicheePi_Zero_defconfig +++ b/configs/LicheePi_Zero_defconfig @@ -5,4 +5,4 @@ CONFIG_SPL=y CONFIG_MACH_SUN8I_V3S=y CONFIG_DRAM_CLK=360 # CONFIG_HAS_ARMV7_SECURE_BASE is not set -# CONFIG_NET is not set +CONFIG_NO_NET=y diff --git a/configs/M5249EVB_defconfig b/configs/M5249EVB_defconfig index eac85b9c2d5..ed1446d81cb 100644 --- a/configs/M5249EVB_defconfig +++ b/configs/M5249EVB_defconfig @@ -22,7 +22,7 @@ CONFIG_CMD_MX_CYCLIC=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_CACHE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_FLASH_CFI_DRIVER=y diff --git a/configs/am335x_pdu001_defconfig b/configs/am335x_pdu001_defconfig index d9acc81e9d3..a8e901b40f9 100644 --- a/configs/am335x_pdu001_defconfig +++ b/configs/am335x_pdu001_defconfig @@ -41,7 +41,7 @@ CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_OF_TRANSLATE=y diff --git a/configs/am62ax_evm_r5_defconfig b/configs/am62ax_evm_r5_defconfig index 092d0830623..6b926f47507 100644 --- a/configs/am62ax_evm_r5_defconfig +++ b/configs/am62ax_evm_r5_defconfig @@ -68,7 +68,7 @@ CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_PART=1 -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_REGMAP=y diff --git a/configs/am62px_evm_r5_defconfig b/configs/am62px_evm_r5_defconfig index 4f7be44cfba..11a00dbfc04 100644 --- a/configs/am62px_evm_r5_defconfig +++ b/configs/am62px_evm_r5_defconfig @@ -72,7 +72,7 @@ CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_PART=1 -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_SPL_DM_DEVICE_REMOVE=y CONFIG_SPL_DM_SEQ_ALIAS=y diff --git a/configs/am62x_beagleplay_r5_defconfig b/configs/am62x_beagleplay_r5_defconfig index ee4c43ff97f..e32ec42111c 100644 --- a/configs/am62x_beagleplay_r5_defconfig +++ b/configs/am62x_beagleplay_r5_defconfig @@ -69,7 +69,7 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_SPL_MULTI_DTB_FIT=y CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_REGMAP=y diff --git a/configs/amcore_defconfig b/configs/amcore_defconfig index f1f5201b30a..94c5379590d 100644 --- a/configs/amcore_defconfig +++ b/configs/amcore_defconfig @@ -33,7 +33,7 @@ CONFIG_CMD_DIAG=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="AMCORE" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_FLASH_CFI_DRIVER=y diff --git a/configs/amd_versal2_mini_defconfig b/configs/amd_versal2_mini_defconfig index 0dd2305bfb2..684205d25a3 100644 --- a/configs/amd_versal2_mini_defconfig +++ b/configs/amd_versal2_mini_defconfig @@ -62,7 +62,7 @@ CONFIG_CMD_CACHE=y # CONFIG_CMD_SLEEP is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/amd_versal2_mini_emmc_defconfig b/configs/amd_versal2_mini_emmc_defconfig index 7ad44386a6d..8484f182b93 100644 --- a/configs/amd_versal2_mini_emmc_defconfig +++ b/configs/amd_versal2_mini_emmc_defconfig @@ -53,7 +53,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_MMC_HS200_SUPPORT=y CONFIG_MMC_SDHCI=y diff --git a/configs/amd_versal2_mini_ospi_defconfig b/configs/amd_versal2_mini_ospi_defconfig index 2242960392f..d064165d79b 100644 --- a/configs/amd_versal2_mini_ospi_defconfig +++ b/configs/amd_versal2_mini_ospi_defconfig @@ -56,7 +56,7 @@ CONFIG_CMD_CACHE=y # CONFIG_CMD_SLEEP is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/amd_versal2_mini_qspi_defconfig b/configs/amd_versal2_mini_qspi_defconfig index 3360c1546a2..e48c26243b8 100644 --- a/configs/amd_versal2_mini_qspi_defconfig +++ b/configs/amd_versal2_mini_qspi_defconfig @@ -56,7 +56,7 @@ CONFIG_CMD_CACHE=y # CONFIG_CMD_SLEEP is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig index a03509bf467..937c27a947e 100644 --- a/configs/anbernic-rgxx3-rk3566_defconfig +++ b/configs/anbernic-rgxx3-rk3566_defconfig @@ -41,7 +41,7 @@ CONFIG_OF_LIVE=y # CONFIG_OF_UPSTREAM is not set CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_REGMAP=y CONFIG_SPL_SYSCON=y diff --git a/configs/ap143_defconfig b/configs/ap143_defconfig index c22048c1b53..13842e6c0f8 100644 --- a/configs/ap143_defconfig +++ b/configs/ap143_defconfig @@ -46,7 +46,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-flash.0:256k(u-boot),64k(u-boot-env),6336k CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SPI_MAX_HZ=25000000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MTD=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH_ATMEL=y diff --git a/configs/ap152_defconfig b/configs/ap152_defconfig index ec700a5b3f0..5cc0ad2e682 100644 --- a/configs/ap152_defconfig +++ b/configs/ap152_defconfig @@ -46,7 +46,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-flash.0:256k(u-boot),64k(u-boot-env),6336k CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SPI_MAX_HZ=25000000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MTD=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH_BAR=y diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index dca6e0ca8ba..d491a5d03c5 100644 --- a/configs/apple_m1_defconfig +++ b/configs/apple_m1_defconfig @@ -11,7 +11,7 @@ CONFIG_SYS_PBSIZE=276 CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_BOARD_LATE_INIT=y CONFIG_CMD_SELECT_FONT=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SYS_64BIT_LBA=y CONFIG_APPLE_SPI_KEYB=y # CONFIG_MMC is not set diff --git a/configs/astro_mcf5373l_defconfig b/configs/astro_mcf5373l_defconfig index d1942c28971..8dd369d68a1 100644 --- a/configs/astro_mcf5373l_defconfig +++ b/configs/astro_mcf5373l_defconfig @@ -27,7 +27,7 @@ CONFIG_CMD_I2C=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_CACHE=y CONFIG_CMD_JFFS2=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_FPGA_ALTERA=y CONFIG_FPGA_CYCLON2=y CONFIG_FPGA_XILINX=y diff --git a/configs/at91sam9rlek_dataflash_defconfig b/configs/at91sam9rlek_dataflash_defconfig index 931af2b2fda..01ac2cc8d1e 100644 --- a/configs/at91sam9rlek_dataflash_defconfig +++ b/configs/at91sam9rlek_dataflash_defconfig @@ -41,7 +41,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SPI_MAX_HZ=15000000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_GPIO=y diff --git a/configs/at91sam9rlek_mmc_defconfig b/configs/at91sam9rlek_mmc_defconfig index 70d431c1f52..93f7d762109 100644 --- a/configs/at91sam9rlek_mmc_defconfig +++ b/configs/at91sam9rlek_mmc_defconfig @@ -39,7 +39,7 @@ CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_FAT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_GPIO=y diff --git a/configs/at91sam9rlek_nandflash_defconfig b/configs/at91sam9rlek_nandflash_defconfig index 1277a357cd2..928ad9f4f70 100644 --- a/configs/at91sam9rlek_nandflash_defconfig +++ b/configs/at91sam9rlek_nandflash_defconfig @@ -40,7 +40,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_NAND=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_GPIO=y diff --git a/configs/bcm7260_defconfig b/configs/bcm7260_defconfig index 2bf3c0d7fbe..345e37bca7e 100644 --- a/configs/bcm7260_defconfig +++ b/configs/bcm7260_defconfig @@ -35,7 +35,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_BCMSTB=y CONFIG_MTD=y diff --git a/configs/bcm7445_defconfig b/configs/bcm7445_defconfig index 07e3b57ac33..eb6629ba57a 100644 --- a/configs/bcm7445_defconfig +++ b/configs/bcm7445_defconfig @@ -37,7 +37,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_BCMSTB=y CONFIG_MTD=y diff --git a/configs/bcm968380gerg_ram_defconfig b/configs/bcm968380gerg_ram_defconfig index 6c119eb42a6..053c459e05c 100644 --- a/configs/bcm968380gerg_ram_defconfig +++ b/configs/bcm968380gerg_ram_defconfig @@ -41,7 +41,7 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_NAND=y # CONFIG_CMD_SLEEP is not set CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_BCM6345_GPIO=y CONFIG_LED=y diff --git a/configs/bcmns_defconfig b/configs/bcmns_defconfig index 365284e94c3..f2719821656 100644 --- a/configs/bcmns_defconfig +++ b/configs/bcmns_defconfig @@ -28,7 +28,7 @@ CONFIG_CMD_CACHE=y CONFIG_OF_EMBED=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="NS" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_MTD=y CONFIG_DM_MTD=y diff --git a/configs/chromebook_samus_tpl_defconfig b/configs/chromebook_samus_tpl_defconfig index 1be57560f89..075e3f192a3 100644 --- a/configs/chromebook_samus_tpl_defconfig +++ b/configs/chromebook_samus_tpl_defconfig @@ -74,7 +74,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="bzImage" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_ACPIGEN is not set diff --git a/configs/cortina_presidio-asic-base_defconfig b/configs/cortina_presidio-asic-base_defconfig index eb5743da64d..78167d56d83 100644 --- a/configs/cortina_presidio-asic-base_defconfig +++ b/configs/cortina_presidio-asic-base_defconfig @@ -31,7 +31,7 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_SMC=y CONFIG_OF_CONTROL=y CONFIG_OF_LIVE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CORTINA_GPIO=y # CONFIG_MMC is not set CONFIG_DM_SERIAL=y diff --git a/configs/cortina_presidio-asic-pnand_defconfig b/configs/cortina_presidio-asic-pnand_defconfig index c7367d4d91c..f1526227d65 100644 --- a/configs/cortina_presidio-asic-pnand_defconfig +++ b/configs/cortina_presidio-asic-pnand_defconfig @@ -32,7 +32,7 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_SMC=y CONFIG_OF_CONTROL=y CONFIG_OF_LIVE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CORTINA_GPIO=y # CONFIG_MMC is not set CONFIG_MTD=y diff --git a/configs/durian_defconfig b/configs/durian_defconfig index f1d45ca3064..ae7a05edee1 100644 --- a/configs/durian_defconfig +++ b/configs/durian_defconfig @@ -28,7 +28,7 @@ CONFIG_SYS_PROMPT="durian#" CONFIG_CMD_PCI=y CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SCSI_AHCI=y CONFIG_AHCI_PCI=y # CONFIG_MMC is not set diff --git a/configs/e850-96_defconfig b/configs/e850-96_defconfig index e5d90996234..5797c6cb1f9 100644 --- a/configs/e850-96_defconfig +++ b/configs/e850-96_defconfig @@ -20,7 +20,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PART=y CONFIG_CMD_TIME=y CONFIG_CMD_RNG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK_EXYNOS850=y CONFIG_MMC_DW=y CONFIG_SOC_SAMSUNG=y diff --git a/configs/ea-lpc3250devkitv2_defconfig b/configs/ea-lpc3250devkitv2_defconfig index af9fc5f2f5c..c3af7afced1 100644 --- a/configs/ea-lpc3250devkitv2_defconfig +++ b/configs/ea-lpc3250devkitv2_defconfig @@ -25,7 +25,7 @@ CONFIG_SYS_PROMPT="EA-LPC3250v2=> " CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_OF_CONTROL=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_LPC32XX_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_LPC32XX=y diff --git a/configs/efi-x86_app32_defconfig b/configs/efi-x86_app32_defconfig index 53ec63461d5..c2856b4000f 100644 --- a/configs/efi-x86_app32_defconfig +++ b/configs/efi-x86_app32_defconfig @@ -35,7 +35,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="bzImage" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_GZIP is not set diff --git a/configs/efi-x86_app64_defconfig b/configs/efi-x86_app64_defconfig index 3d021483dd0..0b709cf4dad 100644 --- a/configs/efi-x86_app64_defconfig +++ b/configs/efi-x86_app64_defconfig @@ -38,7 +38,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="bzImage" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_REGMAP=y CONFIG_SYSCON=y CONFIG_CONSOLE_SCROLL_LINES=5 diff --git a/configs/emsdp_defconfig b/configs/emsdp_defconfig index 07bed2b5623..26efa794058 100644 --- a/configs/emsdp_defconfig +++ b/configs/emsdp_defconfig @@ -30,7 +30,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="app.bin" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MMC=y CONFIG_MMC_DW=y CONFIG_MMC_DW_SNPS=y diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig index ccd38831533..8efab0c2fc0 100644 --- a/configs/evb-px5_defconfig +++ b/configs/evb-px5_defconfig @@ -57,7 +57,7 @@ CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent" CONFIG_TPL_OF_PLATDATA=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_TPL_DM=y CONFIG_REGMAP=y CONFIG_SPL_REGMAP=y diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig index 66a33afbbaf..383dad3087b 100644 --- a/configs/generic-rk3568_defconfig +++ b/configs/generic-rk3568_defconfig @@ -40,7 +40,7 @@ CONFIG_OF_LIVE=y # CONFIG_OF_UPSTREAM is not set CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_REGMAP=y CONFIG_SPL_SYSCON=y diff --git a/configs/generic-rk3588_defconfig b/configs/generic-rk3588_defconfig index 42bc2c9a765..3c81401968d 100644 --- a/configs/generic-rk3588_defconfig +++ b/configs/generic-rk3588_defconfig @@ -35,7 +35,7 @@ CONFIG_OF_LIVE=y # CONFIG_OF_UPSTREAM is not set CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_REGMAP=y CONFIG_SPL_SYSCON=y diff --git a/configs/hc2910_2aghd05_defconfig b/configs/hc2910_2aghd05_defconfig index e68b44478a9..4302436d2e6 100644 --- a/configs/hc2910_2aghd05_defconfig +++ b/configs/hc2910_2aghd05_defconfig @@ -36,7 +36,7 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_PARTITION_TYPE_GUID=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_GPIO is not set # CONFIG_I2C is not set # CONFIG_INPUT is not set diff --git a/configs/igep00x0_defconfig b/configs/igep00x0_defconfig index f1d9bb34aba..51c825d3fbe 100644 --- a/configs/igep00x0_defconfig +++ b/configs/igep00x0_defconfig @@ -60,7 +60,7 @@ CONFIG_ENV_UBI_VOLUME="config" CONFIG_ENV_UBI_VOLUME_REDUND="config_r" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_DM_I2C=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y diff --git a/configs/imx6q_bosch_acc_defconfig b/configs/imx6q_bosch_acc_defconfig index dce1b64bf69..3fca5d5139d 100644 --- a/configs/imx6q_bosch_acc_defconfig +++ b/configs/imx6q_bosch_acc_defconfig @@ -81,7 +81,7 @@ CONFIG_SYS_MMC_ENV_PART=1 CONFIG_ENV_WRITEABLE_LIST=y CONFIG_ENV_ACCESS_IGNORE_FORCE=y CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_DM_BOOTCOUNT=y diff --git a/configs/imx6ulz_smm_m2_defconfig b/configs/imx6ulz_smm_m2_defconfig index 93ead4c373b..c2adff17abf 100644 --- a/configs/imx6ulz_smm_m2_defconfig +++ b/configs/imx6ulz_smm_m2_defconfig @@ -42,7 +42,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_NAND=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_BOUNCE_BUFFER=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0x82000000 diff --git a/configs/iot_devkit_defconfig b/configs/iot_devkit_defconfig index c4920052f82..3dda897f765 100644 --- a/configs/iot_devkit_defconfig +++ b/configs/iot_devkit_defconfig @@ -34,7 +34,7 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="app.bin" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MMC=y CONFIG_MMC_DW=y CONFIG_MMC_DW_SNPS=y diff --git a/configs/j722s_evm_r5_defconfig b/configs/j722s_evm_r5_defconfig index e574be9e19d..fd3259f6afb 100644 --- a/configs/j722s_evm_r5_defconfig +++ b/configs/j722s_evm_r5_defconfig @@ -72,7 +72,7 @@ CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_PART=1 -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_SPL_DM_DEVICE_REMOVE=y CONFIG_SPL_DM_SEQ_ALIAS=y diff --git a/configs/legoev3_defconfig b/configs/legoev3_defconfig index 34ef3493cac..60b7a84205c 100644 --- a/configs/legoev3_defconfig +++ b/configs/legoev3_defconfig @@ -44,7 +44,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_DM_I2C=y CONFIG_SYS_I2C_DAVINCI=y diff --git a/configs/mk808_defconfig b/configs/mk808_defconfig index 9a342d3a33a..36ab4b03401 100644 --- a/configs/mk808_defconfig +++ b/configs/mk808_defconfig @@ -68,7 +68,7 @@ CONFIG_OF_DTB_PROPS_REMOVE=y CONFIG_SPL_OF_PLATDATA=y CONFIG_TPL_OF_PLATDATA=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_TPL_DM=y CONFIG_REGMAP=y CONFIG_SPL_REGMAP=y diff --git a/configs/mx23evk_defconfig b/configs/mx23evk_defconfig index 7d0e7cc1e00..59ab64ec97a 100644 --- a/configs/mx23evk_defconfig +++ b/configs/mx23evk_defconfig @@ -41,7 +41,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_MXS_GPIO=y CONFIG_MMC_MXS=y CONFIG_PINCTRL=y diff --git a/configs/mx28evk_defconfig b/configs/mx28evk_defconfig index dddb57efd3e..1295ff80c7b 100644 --- a/configs/mx28evk_defconfig +++ b/configs/mx28evk_defconfig @@ -47,7 +47,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_MXS_GPIO=y CONFIG_MMC_MXS=y diff --git a/configs/mx6memcal_defconfig b/configs/mx6memcal_defconfig index 4c8a5960d38..5cc8236feb9 100644 --- a/configs/mx6memcal_defconfig +++ b/configs/mx6memcal_defconfig @@ -38,7 +38,7 @@ CONFIG_CMD_MEMTEST=y CONFIG_CMD_CACHE=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_BOUNCE_BUFFER=y # CONFIG_MMC is not set CONFIG_FSL_USDHC=y diff --git a/configs/mx6ulz_14x14_evk_defconfig b/configs/mx6ulz_14x14_evk_defconfig index d57b47ef47a..2c13dd4dbc3 100644 --- a/configs/mx6ulz_14x14_evk_defconfig +++ b/configs/mx6ulz_14x14_evk_defconfig @@ -36,7 +36,7 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_DEV=1 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_BOUNCE_BUFFER=y CONFIG_DM_74X164=y CONFIG_DM_I2C=y diff --git a/configs/mx7ulp_com_defconfig b/configs/mx7ulp_com_defconfig index f8dcc0abef5..6ea84c053ca 100644 --- a/configs/mx7ulp_com_defconfig +++ b/configs/mx7ulp_com_defconfig @@ -33,7 +33,7 @@ CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_BOUNCE_BUFFER=y CONFIG_IMX_RGPIO2P=y # CONFIG_MXC_GPIO is not set diff --git a/configs/mx7ulp_evk_defconfig b/configs/mx7ulp_evk_defconfig index 38e6b62df45..5aadb9e93f1 100644 --- a/configs/mx7ulp_evk_defconfig +++ b/configs/mx7ulp_evk_defconfig @@ -33,7 +33,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_BOUNCE_BUFFER=y CONFIG_IMX_RGPIO2P=y # CONFIG_MXC_GPIO is not set diff --git a/configs/mx7ulp_evk_plugin_defconfig b/configs/mx7ulp_evk_plugin_defconfig index d007d180969..2f45fac0a89 100644 --- a/configs/mx7ulp_evk_plugin_defconfig +++ b/configs/mx7ulp_evk_plugin_defconfig @@ -31,7 +31,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_BOUNCE_BUFFER=y CONFIG_IMX_RGPIO2P=y # CONFIG_MXC_GPIO is not set diff --git a/configs/netgear_cg3100d_ram_defconfig b/configs/netgear_cg3100d_ram_defconfig index 352b98fc0a5..377cc26f937 100644 --- a/configs/netgear_cg3100d_ram_defconfig +++ b/configs/netgear_cg3100d_ram_defconfig @@ -39,7 +39,7 @@ CONFIG_CMD_MEMINFO=y CONFIG_CMD_SPI=y # CONFIG_CMD_SLEEP is not set CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_BCM6345_GPIO=y CONFIG_LED=y diff --git a/configs/nsim_700_defconfig b/configs/nsim_700_defconfig index be2539e8cd7..e8400c2dc30 100644 --- a/configs/nsim_700_defconfig +++ b/configs/nsim_700_defconfig @@ -25,7 +25,7 @@ CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y diff --git a/configs/nsim_700be_defconfig b/configs/nsim_700be_defconfig index 1fcf36a28a5..9ce1a255227 100644 --- a/configs/nsim_700be_defconfig +++ b/configs/nsim_700be_defconfig @@ -26,7 +26,7 @@ CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y diff --git a/configs/nsim_hs38be_defconfig b/configs/nsim_hs38be_defconfig index 9c26e4da7d2..80d0e54192d 100644 --- a/configs/nsim_hs38be_defconfig +++ b/configs/nsim_hs38be_defconfig @@ -27,7 +27,7 @@ CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_BOOTFILE=y CONFIG_BOOTFILE="uImage" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y diff --git a/configs/openpiton_riscv64_defconfig b/configs/openpiton_riscv64_defconfig index cdb9e1c932e..9df92e5c318 100644 --- a/configs/openpiton_riscv64_defconfig +++ b/configs/openpiton_riscv64_defconfig @@ -61,7 +61,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y # CONFIG_DOS_PARTITION is not set CONFIG_OF_EMBED=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CPU=y CONFIG_MMC=y # CONFIG_MMC_WRITE is not set diff --git a/configs/openpiton_riscv64_spl_defconfig b/configs/openpiton_riscv64_spl_defconfig index a08040d878d..29304cc50fe 100644 --- a/configs/openpiton_riscv64_spl_defconfig +++ b/configs/openpiton_riscv64_spl_defconfig @@ -77,7 +77,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y # CONFIG_DOS_PARTITION is not set # CONFIG_SPL_PARTITION_UUIDS is not set -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CPU=y CONFIG_MMC=y # CONFIG_MMC_WRITE is not set diff --git a/configs/origen_defconfig b/configs/origen_defconfig index dc9285d4e99..26702d77079 100644 --- a/configs/origen_defconfig +++ b/configs/origen_defconfig @@ -41,7 +41,7 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DFU_MMC=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_MMC_DW=y diff --git a/configs/pe2201_defconfig b/configs/pe2201_defconfig index 5d32cbf8bf1..91fe7ebf982 100644 --- a/configs/pe2201_defconfig +++ b/configs/pe2201_defconfig @@ -27,7 +27,7 @@ CONFIG_CMD_DM=y CONFIG_CMD_PCI=y CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SCSI_AHCI=y CONFIG_AHCI_PCI=y # CONFIG_MMC is not set diff --git a/configs/pinecube_defconfig b/configs/pinecube_defconfig index 7cc0a862949..7567a6aa739 100644 --- a/configs/pinecube_defconfig +++ b/configs/pinecube_defconfig @@ -9,7 +9,7 @@ CONFIG_DRAM_ODT_EN=y CONFIG_I2C0_ENABLE=y # CONFIG_HAS_ARMV7_SECURE_BASE is not set CONFIG_SPL_I2C=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MVTWSI=y CONFIG_SYS_I2C_SLAVE=0x7f diff --git a/configs/pm9261_defconfig b/configs/pm9261_defconfig index 9f4d434f3e2..026c6de3109 100644 --- a/configs/pm9261_defconfig +++ b/configs/pm9261_defconfig @@ -37,7 +37,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=physmap-flash.0:256k(u-boot)ro,64k(u-boot-env) CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_GPIO=y diff --git a/configs/s5p4418_nanopi2_defconfig b/configs/s5p4418_nanopi2_defconfig index ee72778995b..0bee0008294 100644 --- a/configs/s5p4418_nanopi2_defconfig +++ b/configs/s5p4418_nanopi2_defconfig @@ -49,7 +49,7 @@ CONFIG_CMD_FAT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_MMC_ENV_DEV=2 -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_NEXELL=y CONFIG_MMC_DW=y diff --git a/configs/s5p_goni_defconfig b/configs/s5p_goni_defconfig index 4316510541c..084e19e1258 100644 --- a/configs/s5p_goni_defconfig +++ b/configs/s5p_goni_defconfig @@ -44,7 +44,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DFU_MMC=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_DM_I2C_GPIO=y diff --git a/configs/s5pc210_universal_defconfig b/configs/s5pc210_universal_defconfig index 67959ad79cd..99e873ff427 100644 --- a/configs/s5pc210_universal_defconfig +++ b/configs/s5pc210_universal_defconfig @@ -41,7 +41,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DFU_MMC=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_SYS_I2C_S3C24X0=y diff --git a/configs/sama5d27_giantboard_defconfig b/configs/sama5d27_giantboard_defconfig index 283c9300c56..34274ca4a32 100644 --- a/configs/sama5d27_giantboard_defconfig +++ b/configs/sama5d27_giantboard_defconfig @@ -64,7 +64,7 @@ CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dmas dma-names" CONFIG_ENV_IS_IN_FAT=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_CLK=y diff --git a/configs/sama5d29_curiosity_mmc1_defconfig b/configs/sama5d29_curiosity_mmc1_defconfig index 61edb23b196..5d9173a0e57 100644 --- a/configs/sama5d29_curiosity_mmc1_defconfig +++ b/configs/sama5d29_curiosity_mmc1_defconfig @@ -70,7 +70,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="SAMA5D29" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_UTMI=y diff --git a/configs/sama5d29_curiosity_mmc_defconfig b/configs/sama5d29_curiosity_mmc_defconfig index 0b16f386735..2b765f56dda 100644 --- a/configs/sama5d29_curiosity_mmc_defconfig +++ b/configs/sama5d29_curiosity_mmc_defconfig @@ -69,7 +69,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="SAMA5D29" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_UTMI=y diff --git a/configs/sama5d29_curiosity_qspiflash_defconfig b/configs/sama5d29_curiosity_qspiflash_defconfig index 9b522e81ef5..d840d0f3d6f 100644 --- a/configs/sama5d29_curiosity_qspiflash_defconfig +++ b/configs/sama5d29_curiosity_qspiflash_defconfig @@ -69,7 +69,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="SAMA5D29" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_AT91=y CONFIG_AT91_UTMI=y diff --git a/configs/sama7g54_curiosity_mmc_defconfig b/configs/sama7g54_curiosity_mmc_defconfig index 00a091df0e5..ba8643c912c 100644 --- a/configs/sama7g54_curiosity_mmc_defconfig +++ b/configs/sama7g54_curiosity_mmc_defconfig @@ -74,7 +74,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="SAMA7G54" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_CCF=y CONFIG_CLK_AT91=y diff --git a/configs/sama7g54_curiosity_nandflash_defconfig b/configs/sama7g54_curiosity_nandflash_defconfig index 0b2116d0419..49b08d3fc2b 100644 --- a/configs/sama7g54_curiosity_nandflash_defconfig +++ b/configs/sama7g54_curiosity_nandflash_defconfig @@ -72,7 +72,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="SAMA7G54" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_CCF=y CONFIG_CLK_AT91=y diff --git a/configs/sama7g54_curiosity_qspiflash_defconfig b/configs/sama7g54_curiosity_qspiflash_defconfig index 00e5362a1fa..8fa5857e245 100644 --- a/configs/sama7g54_curiosity_qspiflash_defconfig +++ b/configs/sama7g54_curiosity_qspiflash_defconfig @@ -73,7 +73,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="SAMA7G54" CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y CONFIG_CLK_CCF=y CONFIG_CLK_AT91=y diff --git a/configs/sipeed_maix_bitm_defconfig b/configs/sipeed_maix_bitm_defconfig index 67d5a007a8e..8788eabf55a 100644 --- a/configs/sipeed_maix_bitm_defconfig +++ b/configs/sipeed_maix_bitm_defconfig @@ -17,7 +17,7 @@ CONFIG_BOARD_EARLY_INIT_F=y CONFIG_HUSH_PARSER=y CONFIG_MTDIDS_DEFAULT="nor0=spi3:0" CONFIG_MTDPARTS_DEFAULT="nor0:1M(u-boot),0x1000@0xfff000(env)" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK_K210_SET_RATE=y # CONFIG_INPUT is not set CONFIG_SF_DEFAULT_BUS=3 diff --git a/configs/sipeed_maix_smode_defconfig b/configs/sipeed_maix_smode_defconfig index 049fac02cac..c8d8b1ac9e1 100644 --- a/configs/sipeed_maix_smode_defconfig +++ b/configs/sipeed_maix_smode_defconfig @@ -18,7 +18,7 @@ CONFIG_SYS_PBSIZE=276 CONFIG_HUSH_PARSER=y CONFIG_MTDIDS_DEFAULT="nor0=spi3:0" CONFIG_MTDPARTS_DEFAULT="nor0:1M(u-boot),0x1000@0xfff000(env)" -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_INPUT is not set CONFIG_SF_DEFAULT_BUS=3 CONFIG_FS_EXT4=y diff --git a/configs/stemmy_defconfig b/configs/stemmy_defconfig index ee8e6be6e2c..efa3b477a6e 100644 --- a/configs/stemmy_defconfig +++ b/configs/stemmy_defconfig @@ -28,7 +28,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PART=y CONFIG_CMD_GETTIME=y CONFIG_EFI_PARTITION=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0x18100000 CONFIG_FASTBOOT_FLASH=y diff --git a/configs/stm32f429-discovery_defconfig b/configs/stm32f429-discovery_defconfig index 5d59edb7381..21a466572bd 100644 --- a/configs/stm32f429-discovery_defconfig +++ b/configs/stm32f429-discovery_defconfig @@ -27,7 +27,7 @@ CONFIG_CMD_IMLS=y CONFIG_CMD_TIMER=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_FLASH=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_MMC is not set CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y diff --git a/configs/stm32f429-evaluation_defconfig b/configs/stm32f429-evaluation_defconfig index 3e220d73984..8f20d4ca3f5 100644 --- a/configs/stm32f429-evaluation_defconfig +++ b/configs/stm32f429-evaluation_defconfig @@ -25,7 +25,7 @@ CONFIG_CMD_TIMER=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_ARM_PL180_MMCI=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y diff --git a/configs/stm32f469-discovery_defconfig b/configs/stm32f469-discovery_defconfig index 9b5f38b9efa..33292bfaf0c 100644 --- a/configs/stm32f469-discovery_defconfig +++ b/configs/stm32f469-discovery_defconfig @@ -26,7 +26,7 @@ CONFIG_CMD_TIMER=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_ARM_PL180_MMCI=y CONFIG_MTD=y CONFIG_DM_MTD=y diff --git a/configs/stm32h743-disco_defconfig b/configs/stm32h743-disco_defconfig index 89d79e98b6f..f098b8dd6da 100644 --- a/configs/stm32h743-disco_defconfig +++ b/configs/stm32h743-disco_defconfig @@ -30,6 +30,6 @@ CONFIG_CMD_EXT4_WRITE=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_STM32_SDMMC2=y # CONFIG_PINCTRL_FULL is not set diff --git a/configs/stm32h743-eval_defconfig b/configs/stm32h743-eval_defconfig index 6b4ebd11691..82823e8631f 100644 --- a/configs/stm32h743-eval_defconfig +++ b/configs/stm32h743-eval_defconfig @@ -30,6 +30,6 @@ CONFIG_CMD_EXT4_WRITE=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_STM32_SDMMC2=y # CONFIG_PINCTRL_FULL is not set diff --git a/configs/stm32h750-art-pi_defconfig b/configs/stm32h750-art-pi_defconfig index 319b3033a40..df3ff43f4a9 100644 --- a/configs/stm32h750-art-pi_defconfig +++ b/configs/stm32h750-art-pi_defconfig @@ -36,7 +36,7 @@ CONFIG_CMD_EXT4_WRITE=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DM_DMA=y CONFIG_STM32_SDMMC2=y # CONFIG_PINCTRL_FULL is not set diff --git a/configs/stm32mp25_defconfig b/configs/stm32mp25_defconfig index f5623a19bb2..9533e30db4d 100644 --- a/configs/stm32mp25_defconfig +++ b/configs/stm32mp25_defconfig @@ -31,7 +31,7 @@ CONFIG_CMD_TIMER=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_LOG=y CONFIG_OF_LIVE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_GPIO_HOG=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_STM32F7=y diff --git a/configs/stmark2_defconfig b/configs/stmark2_defconfig index f43a24c5b5e..79b21acd032 100644 --- a/configs/stmark2_defconfig +++ b/configs/stmark2_defconfig @@ -39,7 +39,7 @@ CONFIG_ENV_SPI_CS=1 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_USE_HOSTNAME=y CONFIG_HOSTNAME="stmark2" -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_FSL=y CONFIG_MTD=y diff --git a/configs/th1520_lpi4a_defconfig b/configs/th1520_lpi4a_defconfig index db80e33870b..9ab228256b0 100644 --- a/configs/th1520_lpi4a_defconfig +++ b/configs/th1520_lpi4a_defconfig @@ -58,7 +58,7 @@ CONFIG_CMD_BOOTMENU=y CONFIG_PARTITION_TYPE_GUID=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_VERSION_VARIABLE=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_BLOCK_CACHE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/thunderx_88xx_defconfig b/configs/thunderx_88xx_defconfig index b754cc01cc8..107ad279e1b 100644 --- a/configs/thunderx_88xx_defconfig +++ b/configs/thunderx_88xx_defconfig @@ -32,7 +32,7 @@ CONFIG_SYS_PROMPT="ThunderX_88XX> " # CONFIG_CMD_SAVEENV is not set # CONFIG_CMD_ENV_EXISTS is not set CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_MMC is not set CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART_SKIP_INIT=y diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig index b54d2cefa10..e00f2c48598 100644 --- a/configs/tools-only_defconfig +++ b/configs/tools-only_defconfig @@ -22,7 +22,7 @@ CONFIG_BOOTCOMMAND="run distro_bootcmd" # CONFIG_CMD_DATE is not set CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_ACPIGEN is not set CONFIG_AXI=y CONFIG_AXI_SANDBOX=y diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig index 638d7306146..74b03d19ffb 100644 --- a/configs/topic_miami_defconfig +++ b/configs/topic_miami_defconfig @@ -52,7 +52,7 @@ CONFIG_CMD_CACHE=y CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_RAM=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000 diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig index af47fab83c0..46071399a4d 100644 --- a/configs/topic_miamilite_defconfig +++ b/configs/topic_miamilite_defconfig @@ -52,7 +52,7 @@ CONFIG_CMD_CACHE=y CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_RAM=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000 diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig index ad321749694..5562c738c5e 100644 --- a/configs/topic_miamiplus_defconfig +++ b/configs/topic_miamiplus_defconfig @@ -52,7 +52,7 @@ CONFIG_CMD_CACHE=y CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_DFU_RAM=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000 diff --git a/configs/total_compute_defconfig b/configs/total_compute_defconfig index 5f21d2e367a..b3d2e5c88a6 100644 --- a/configs/total_compute_defconfig +++ b/configs/total_compute_defconfig @@ -43,7 +43,7 @@ CONFIG_CMD_AVB=y CONFIG_CMD_UBI=y # CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_CLK=y # CONFIG_MMC_WRITE is not set CONFIG_ARM_PL180_MMCI=y diff --git a/configs/trats2_defconfig b/configs/trats2_defconfig index 67561368128..acfc42842e3 100644 --- a/configs/trats2_defconfig +++ b/configs/trats2_defconfig @@ -43,7 +43,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DFU_MMC=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_DM_I2C_GPIO=y diff --git a/configs/trats_defconfig b/configs/trats_defconfig index 98925243bf4..070ab268474 100644 --- a/configs/trats_defconfig +++ b/configs/trats_defconfig @@ -42,7 +42,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set +CONFIG_NO_NET=y CONFIG_DFU_MMC=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000 CONFIG_DM_I2C_GPIO=y diff --git a/configs/xenguest_arm64_defconfig b/configs/xenguest_arm64_defconfig index 6d040c2c15c..91657e0cd8b 100644 --- a/configs/xenguest_arm64_defconfig +++ b/configs/xenguest_arm64_defconfig @@ -37,7 +37,7 @@ CONFIG_CMD_PVBLOCK=y # CONFIG_CMD_SLEEP is not set CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_MMC is not set # CONFIG_REQUIRE_SERIAL_CONSOLE is not set CONFIG_DM_SERIAL=y diff --git a/configs/xenguest_arm64_virtio_defconfig b/configs/xenguest_arm64_virtio_defconfig index d00a1ba0143..217b45a2c5e 100644 --- a/configs/xenguest_arm64_virtio_defconfig +++ b/configs/xenguest_arm64_virtio_defconfig @@ -42,7 +42,7 @@ CONFIG_CMD_PCI=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_PARTITION_TYPE_GUID=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_MMC is not set CONFIG_DM_PCI_COMPAT=y CONFIG_PCI_REGION_MULTI_ENTRY=y diff --git a/configs/xilinx_versal_mini_defconfig b/configs/xilinx_versal_mini_defconfig index b97bf5e60a9..e9183bc8071 100644 --- a/configs/xilinx_versal_mini_defconfig +++ b/configs/xilinx_versal_mini_defconfig @@ -57,7 +57,7 @@ CONFIG_SYS_ALT_MEMTEST=y # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_SLEEP is not set CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_MMC is not set CONFIG_ARM_DCC=y diff --git a/configs/xilinx_versal_mini_emmc0_defconfig b/configs/xilinx_versal_mini_emmc0_defconfig index 5c949e34442..7ba7e65597a 100644 --- a/configs/xilinx_versal_mini_emmc0_defconfig +++ b/configs/xilinx_versal_mini_emmc0_defconfig @@ -55,7 +55,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_versal_mini_emmc1_defconfig b/configs/xilinx_versal_mini_emmc1_defconfig index 04cba5bc72d..54cc51ee7f3 100644 --- a/configs/xilinx_versal_mini_emmc1_defconfig +++ b/configs/xilinx_versal_mini_emmc1_defconfig @@ -55,7 +55,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_versal_mini_ospi_defconfig b/configs/xilinx_versal_mini_ospi_defconfig index 8f162597603..5ffb2cd5bfb 100644 --- a/configs/xilinx_versal_mini_ospi_defconfig +++ b/configs/xilinx_versal_mini_ospi_defconfig @@ -51,7 +51,7 @@ CONFIG_SYS_PROMPT="Versal> " # CONFIG_CMD_ITEST is not set # CONFIG_CMD_SOURCE is not set # CONFIG_CMD_SETEXPR is not set -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_MMC is not set CONFIG_MTD=y diff --git a/configs/xilinx_versal_mini_qspi_defconfig b/configs/xilinx_versal_mini_qspi_defconfig index 8fbde1c7d3c..552cbdd740b 100644 --- a/configs/xilinx_versal_mini_qspi_defconfig +++ b/configs/xilinx_versal_mini_qspi_defconfig @@ -53,7 +53,7 @@ CONFIG_SYS_PROMPT="Versal> " # CONFIG_CMD_SOURCE is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG is not set -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/xilinx_versal_net_mini_defconfig b/configs/xilinx_versal_net_mini_defconfig index d6ebd080463..c4b1a5d5416 100644 --- a/configs/xilinx_versal_net_mini_defconfig +++ b/configs/xilinx_versal_net_mini_defconfig @@ -61,7 +61,7 @@ CONFIG_CMD_CACHE=y # CONFIG_CMD_SLEEP is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/xilinx_versal_net_mini_emmc_defconfig b/configs/xilinx_versal_net_mini_emmc_defconfig index fc88eee10af..c64ab92533b 100644 --- a/configs/xilinx_versal_net_mini_emmc_defconfig +++ b/configs/xilinx_versal_net_mini_emmc_defconfig @@ -50,7 +50,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_MMC_HS200_SUPPORT=y CONFIG_MMC_SDHCI=y diff --git a/configs/xilinx_versal_net_mini_ospi_defconfig b/configs/xilinx_versal_net_mini_ospi_defconfig index 872a4a55952..f1a136fe52c 100644 --- a/configs/xilinx_versal_net_mini_ospi_defconfig +++ b/configs/xilinx_versal_net_mini_ospi_defconfig @@ -50,7 +50,7 @@ CONFIG_SYS_PROMPT="Versal NET> " # CONFIG_CMD_ITEST is not set # CONFIG_CMD_SOURCE is not set # CONFIG_CMD_SETEXPR is not set -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_MMC is not set CONFIG_MTD=y diff --git a/configs/xilinx_versal_net_mini_qspi_defconfig b/configs/xilinx_versal_net_mini_qspi_defconfig index 00319e06102..75589c478d8 100644 --- a/configs/xilinx_versal_net_mini_qspi_defconfig +++ b/configs/xilinx_versal_net_mini_qspi_defconfig @@ -52,7 +52,7 @@ CONFIG_SYS_PROMPT="Versal NET> " # CONFIG_CMD_SOURCE is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG is not set -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_GPIO is not set # CONFIG_I2C is not set diff --git a/configs/xilinx_zynqmp_mini_defconfig b/configs/xilinx_zynqmp_mini_defconfig index 4b45074efc4..09d73b0617f 100644 --- a/configs/xilinx_zynqmp_mini_defconfig +++ b/configs/xilinx_zynqmp_mini_defconfig @@ -53,7 +53,7 @@ CONFIG_CMD_CACHE=y # CONFIG_CMD_SLEEP is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_DM_MAILBOX is not set # CONFIG_MMC is not set diff --git a/configs/xilinx_zynqmp_mini_emmc0_defconfig b/configs/xilinx_zynqmp_mini_emmc0_defconfig index 49c7235fb8c..0e0242d8aac 100644 --- a/configs/xilinx_zynqmp_mini_emmc0_defconfig +++ b/configs/xilinx_zynqmp_mini_emmc0_defconfig @@ -64,7 +64,7 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_DM_MAILBOX is not set diff --git a/configs/xilinx_zynqmp_mini_emmc1_defconfig b/configs/xilinx_zynqmp_mini_emmc1_defconfig index 1ef89f50444..01297f615b8 100644 --- a/configs/xilinx_zynqmp_mini_emmc1_defconfig +++ b/configs/xilinx_zynqmp_mini_emmc1_defconfig @@ -64,7 +64,7 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_DM_MAILBOX is not set diff --git a/configs/xilinx_zynqmp_mini_nand_defconfig b/configs/xilinx_zynqmp_mini_nand_defconfig index b4719536be1..fd27f565b03 100644 --- a/configs/xilinx_zynqmp_mini_nand_defconfig +++ b/configs/xilinx_zynqmp_mini_nand_defconfig @@ -48,7 +48,7 @@ CONFIG_CLOCKS=y # CONFIG_CMD_SETEXPR is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_DM_MAILBOX is not set # CONFIG_MMC is not set diff --git a/configs/xilinx_zynqmp_mini_nand_single_defconfig b/configs/xilinx_zynqmp_mini_nand_single_defconfig index 7ede17654dd..480c00ed152 100644 --- a/configs/xilinx_zynqmp_mini_nand_single_defconfig +++ b/configs/xilinx_zynqmp_mini_nand_single_defconfig @@ -48,7 +48,7 @@ CONFIG_CLOCKS=y # CONFIG_CMD_SETEXPR is not set CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set # CONFIG_DM_MAILBOX is not set # CONFIG_MMC is not set diff --git a/configs/xilinx_zynqmp_mini_qspi_defconfig b/configs/xilinx_zynqmp_mini_qspi_defconfig index 0d79ecece71..d8830a6f247 100644 --- a/configs/xilinx_zynqmp_mini_qspi_defconfig +++ b/configs/xilinx_zynqmp_mini_qspi_defconfig @@ -67,7 +67,7 @@ CONFIG_SPL_SYS_MALLOC_SIZE=0x1000000 CONFIG_SPL_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_FIRMWARE is not set diff --git a/configs/zynq_cse_nand_defconfig b/configs/zynq_cse_nand_defconfig index 750ea0db2b2..e7414c78d1e 100644 --- a/configs/zynq_cse_nand_defconfig +++ b/configs/zynq_cse_nand_defconfig @@ -69,7 +69,7 @@ CONFIG_SYS_MAXARGS=32 CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_MMC is not set diff --git a/configs/zynq_cse_nor_defconfig b/configs/zynq_cse_nor_defconfig index 3155fe0b378..4f2186b2a51 100644 --- a/configs/zynq_cse_nor_defconfig +++ b/configs/zynq_cse_nor_defconfig @@ -69,7 +69,7 @@ CONFIG_SYS_MAXARGS=32 CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_MMC is not set diff --git a/configs/zynq_cse_qspi_defconfig b/configs/zynq_cse_qspi_defconfig index f2e1aa6d3ab..a372a13fe2d 100644 --- a/configs/zynq_cse_qspi_defconfig +++ b/configs/zynq_cse_qspi_defconfig @@ -78,7 +78,7 @@ CONFIG_SYS_MAXARGS=32 CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -# CONFIG_NET is not set +CONFIG_NO_NET=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_MMC is not set From patchwork Thu Oct 3 15:22:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832406 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343402wra; Thu, 3 Oct 2024 08:24:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOqx/RU/d6gbMO/paJljRo6QOjeguxVDxmTYN650LF7IVewYV8h0TfApD/lJEI1EA1YKgCIQ==@linaro.org X-Google-Smtp-Source: AGHT+IFzWbfsrpBlvkb8eda5Rx/IhCUC/GBsn535abxMOFjg5xZXlQj1zls3eFiFN7gw63dHBUXC X-Received: by 2002:a05:6602:13d4:b0:82a:a454:6306 with SMTP id ca18e2360f4ac-834d83d6dcamr763118339f.1.1727969096131; Thu, 03 Oct 2024 08:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969096; cv=none; d=google.com; s=arc-20240605; b=Nb8o/krPq0vYN2FW7KB+caJ/WftIeVcGYBDl7/V7wkxoeguvpeiZEB61zIrwK3FgjO H3eng9BuMicofQ76Rt0eE5PaPwHaDOHps2AF2BUHYIPIVJ7w1Rq8l3uKD1ZMPzR4uK6z X31cLMoo8vyJmOFKvVguWPtmzvO0Lcndl/WbDInUV8T8Ze8NmgCwaPXba4oDLu7zk2FX 8RxYgGOUAnHxddzaEj4RnN8C76LkdH9SNWoq/q/8p9voWIKYnygTleGBXgs5zzYfT0HN 1YDJyLKsp/Y17f8F0nJr7hF8J7gtjR2I+I1a/lDAtv23+LeWaXKfFJL6ommX1sAilbm9 DgJA== 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=3XcapJP2m7mXtfILwLv4s7+5/EncTd4XSjfBLsP7DZs=; fh=mIL0finYjqz0qIIVYNJ6sMMoXDEm4/sWKXFblyuJxvM=; b=fnK3Q+EftxxQkCKZi2hV7TmJ1jEsq0xGsrxeOsgj936xBTTqxV86otfk447QkJc6Aa E+Nuxy6FItLvEJ6+5wXjWfXzEUuIN1qXNdquBm4q7fJkgpE8CZcGpxcKbaLIxZtZcxWg lE8ob/1eMYCbT5Qs4lF9FZroNKRPFFKPHd0C+SiOgfO7h02RO5MMHTeVGSx/KgXFnL8x f8IHS77l/xBx5L/edvROkxT66FmDjXZgaNtMWwDV/IPxtgBO8H/45AexNiwP9sPUDNIH 3dLQtQrCUPGonZYhCZomjuDFk8BB7W4q0GeMhClEAyuwIx3J1pDjgKSL9Q/8DkwlKdsD Feqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eAd1ufG1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail 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 ca18e2360f4ac-834efcb16e8si69927939f.42.2024.10.03.08.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:56 -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=fail header.i=@linaro.org header.s=google header.b=eAd1ufG1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 598E688F16; Thu, 3 Oct 2024 17:24:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eAd1ufG1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56A9188F03; Thu, 3 Oct 2024 17:24:21 +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=unavailable 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 B56D288641 for ; Thu, 3 Oct 2024 17:24:17 +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-37ccfba5df5so867622f8f.0 for ; Thu, 03 Oct 2024 08:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969056; x=1728573856; 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=3XcapJP2m7mXtfILwLv4s7+5/EncTd4XSjfBLsP7DZs=; b=eAd1ufG1b//3OqdAan2Sgg7l0dm0iFbHirn99VGRt1GU6mLbovYAcuCJsh1XAOQ4/g o9KZBZBtmlkhzXG845Gvou5IoxErKyoXZJ9SE9T3+XmuislkiQGY/5wZM21YiRCIgZag ojGg49wUzN/7xREMGhaj9/t5DdUjkt1hLO/QatDF0X4Smi13MDvZeWzOUqwv8Zl+CRRX rKtHTVnBZbirh6RpHOJtDjry4fzUZ+RQHP9A65Lp6Boc6QxRwAOCJLFN93re1oHKsTKZ Qfu5YoF7ldZcnbM0B0TzQ4+ncKzJtCWvmmx8+I1dbJX7AW7VPRiHO0QKEe/5EXXd8T5N rWFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969056; x=1728573856; 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=3XcapJP2m7mXtfILwLv4s7+5/EncTd4XSjfBLsP7DZs=; b=c29leObSxzUr6arj766/cJOoo5mpEeW0YejS2TumcZHfqWzxiV2rnpPoJnZ1Grhua6 5jnN1V2WHQgeSKaGoMcwbdZat9qZpHLyAZznOF61TSBtZY8mg2ML6mEN8jHS33+LNYPh d8CamqNTFU3TBJBTN9ybItMHWxhK74umhpcYyOteSyNQvl3347/+UgnVFVfw6Jg5a39s SARhnYiRZ6iY1I9nUK65YNERhJ8SDYTjVrjTD9sqCBkP7absVd+LdHFm3oNBdVyGtTVR cCPdJ0WfNVMgYSHwVUl/mlNjsnoymTAo3BW6r315omPIou7nCNzhfsgUgsYECJJ1PVfJ 6hYA== X-Gm-Message-State: AOJu0Yy340Vvfvms96Sq9+byxcEaPZFGHbUcGUpEd2WOnRFbuoAtTTuZ lymQGT2UqpRsU4n9SOeCqOeuxvtW5eeTJmakuWZAFTgFzLkSrg+Obgv7miz+UocvBnfI5CKzBZg UZke7Zz// X-Received: by 2002:a5d:6584:0:b0:373:b87:55d8 with SMTP id ffacd0b85a97d-37cfb8b1636mr3936809f8f.3.1727969055261; Thu, 03 Oct 2024 08:24:15 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:14 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Heinrich Schuchardt , Rasmus Villemoes , Andrew Davis , Sumit Garg , Bryan Brattlof , "Leon M. Busch-George" , Masahisa Kojima , Sean Anderson , Marek Vasut Subject: [PATCH v11 09/29] net: split include/net.h into net{, -common, -legacy, -lwip}.h Date: Thu, 3 Oct 2024 17:22:55 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Make net.h a wrapper which includes net-common.h and either net-legacy.h or net-lwip.h based on NET_LWIP. Signed-off-by: Jerome Forissier Acked-by: Ilias Apalodimas --- Makefile | 4 +- include/net-common.h | 501 +++++++++++++++++++++++ include/net-legacy.h | 544 +++++++++++++++++++++++++ include/net-lwip.h | 14 + include/net.h | 943 +------------------------------------------ 5 files changed, 1066 insertions(+), 940 deletions(-) create mode 100644 include/net-common.h create mode 100644 include/net-legacy.h create mode 100644 include/net-lwip.h diff --git a/Makefile b/Makefile index 96211738b2f..0910d8692d7 100644 --- a/Makefile +++ b/Makefile @@ -836,7 +836,9 @@ UBOOTINCLUDE := \ -I$(srctree)/arch/arm/thumb1/include)) \ -I$(srctree)/arch/$(ARCH)/include \ -include $(srctree)/include/linux/kconfig.h \ - -I$(srctree)/dts/upstream/include + -I$(srctree)/dts/upstream/include \ + $(if $(CONFIG_NET_LWIP), -I$(srctree)/lib/lwip/lwip/src/include \ + -I$(srctree)/lib/lwip/u-boot) NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) diff --git a/include/net-common.h b/include/net-common.h new file mode 100644 index 00000000000..543f528a4a4 --- /dev/null +++ b/include/net-common.h @@ -0,0 +1,501 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef __NET_COMMON_H__ +#define __NET_COMMON_H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEBUG_NET_PKT_TRACE 0 /* Trace all packet data */ + +/* + * The number of receive packet buffers, and the required packet buffer + * alignment in memory. + * + */ +#define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER +#define PKTALIGN ARCH_DMA_MINALIGN + +/* IPv4 addresses are always 32 bits in size */ +struct in_addr { + __be32 s_addr; +}; + +#define PROT_IP 0x0800 /* IP protocol */ +#define PROT_ARP 0x0806 /* IP ARP protocol */ +#define PROT_WOL 0x0842 /* ether-wake WoL protocol */ +#define PROT_RARP 0x8035 /* IP ARP protocol */ +#define PROT_VLAN 0x8100 /* IEEE 802.1q protocol */ +#define PROT_IPV6 0x86dd /* IPv6 over bluebook */ +#define PROT_PPP_SES 0x8864 /* PPPoE session messages */ +#define PROT_NCSI 0x88f8 /* NC-SI control packets */ + +#define IPPROTO_ICMP 1 /* Internet Control Message Protocol */ +#define IPPROTO_TCP 6 /* Transmission Control Protocol */ +#define IPPROTO_UDP 17 /* User Datagram Protocol */ + +#define IP_OFFS 0x1fff /* ip offset *= 8 */ +#define IP_FLAGS 0xe000 /* first 3 bits */ +#define IP_FLAGS_RES 0x8000 /* reserved */ +#define IP_FLAGS_DFRAG 0x4000 /* don't fragments */ +#define IP_FLAGS_MFRAG 0x2000 /* more fragments */ + +#define IP_HDR_SIZE (sizeof(struct ip_hdr)) + +#define IP_MIN_FRAG_DATAGRAM_SIZE (IP_HDR_SIZE + 8) + +/* + * Internet Protocol (IP) + UDP header. + */ +struct ip_udp_hdr { + u8 ip_hl_v; /* header length and version */ + u8 ip_tos; /* type of service */ + u16 ip_len; /* total length */ + u16 ip_id; /* identification */ + u16 ip_off; /* fragment offset field */ + u8 ip_ttl; /* time to live */ + u8 ip_p; /* protocol */ + u16 ip_sum; /* checksum */ + struct in_addr ip_src; /* Source IP address */ + struct in_addr ip_dst; /* Destination IP address */ + u16 udp_src; /* UDP source port */ + u16 udp_dst; /* UDP destination port */ + u16 udp_len; /* Length of UDP packet */ + u16 udp_xsum; /* Checksum */ +} __attribute__((packed)); + +#define IP_UDP_HDR_SIZE (sizeof(struct ip_udp_hdr)) +#define UDP_HDR_SIZE (IP_UDP_HDR_SIZE - IP_HDR_SIZE) + +/* Number of packets processed together */ +#define ETH_PACKETS_BATCH_RECV 32 + +/* ARP hardware address length */ +#define ARP_HLEN 6 +/* + * The size of a MAC address in string form, each digit requires two chars + * and five separator characters to form '00:00:00:00:00:00'. + */ +#define ARP_HLEN_ASCII (ARP_HLEN * 2) + (ARP_HLEN - 1) + +#define ARP_HDR_SIZE (8+20) /* Size assuming ethernet */ + +# define ARP_ETHER 1 /* Ethernet hardware address */ + +/* + * Maximum packet size; used to allocate packet storage. Use + * the maxium Ethernet frame size as specified by the Ethernet + * standard including the 802.1Q tag (VLAN tagging). + * maximum packet size = 1522 + * maximum packet size and multiple of 32 bytes = 1536 + */ +#define PKTSIZE 1522 +#ifndef CONFIG_DM_DSA +#define PKTSIZE_ALIGN 1536 +#else +/* Maximum DSA tagging overhead (headroom and/or tailroom) */ +#define DSA_MAX_OVR 256 +#define PKTSIZE_ALIGN (1536 + DSA_MAX_OVR) +#endif + +/* + * Maximum receive ring size; that is, the number of packets + * we can buffer before overflow happens. Basically, this just + * needs to be enough to prevent a packet being discarded while + * we are processing the previous one. + * Used only in drivers/net/mvgbe.c. + */ +#define RINGSZ 4 +#define RINGSZ_LOG2 2 + +extern int net_restart_wrap; /* Tried all network devices */ +extern uchar *net_rx_packets[PKTBUFSRX]; /* Receive packets */ +extern const u8 net_bcast_ethaddr[ARP_HLEN]; /* Ethernet broadcast address */ +extern char net_boot_file_name[1024];/* Boot File name */ + +/** + * compute_ip_checksum() - Compute IP checksum + * + * @addr: Address to check (must be 16-bit aligned) + * @nbytes: Number of bytes to check (normally a multiple of 2) + * Return: 16-bit IP checksum + */ +unsigned compute_ip_checksum(const void *addr, unsigned nbytes); + +/** + * ip_checksum_ok() - check if a checksum is correct + * + * This works by making sure the checksum sums to 0 + * + * @addr: Address to check (must be 16-bit aligned) + * @nbytes: Number of bytes to check (normally a multiple of 2) + * Return: true if the checksum matches, false if not + */ +int ip_checksum_ok(const void *addr, unsigned nbytes); + +/** + * add_ip_checksums() - add two IP checksums + * + * @offset: Offset of first sum (if odd we do a byte-swap) + * @sum: First checksum + * @new_sum: New checksum to add + * Return: updated 16-bit IP checksum + */ +unsigned add_ip_checksums(unsigned offset, unsigned sum, unsigned new_sum); + +/* + * The devname can be either an exact name given by the driver or device tree + * or it can be an alias of the form "eth%d" + */ +struct udevice *eth_get_dev_by_name(const char *devname); +int eth_is_active(struct udevice *dev); /* Test device for active state */ + +/* + * Get the hardware address for an ethernet interface . + * Args: + * base_name - base name for device (normally "eth") + * index - device index number (0 for first) + * enetaddr - returns 6 byte hardware address + * Returns: + * Return true if the address is valid. + */ +int eth_env_get_enetaddr_by_index(const char *base_name, int index, + uchar *enetaddr); + +/** + * 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); + +/* + * Initialize USB ethernet device with CONFIG_DM_ETH + * Returns: + * 0 is success, non-zero is error status. + */ +int usb_ether_init(void); + +int eth_init(void); /* Initialize the device */ +int eth_send(void *packet, int length); /* Send a packet */ +#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +int eth_receive(void *packet, int length); /* Receive a packet*/ +extern void (*push_packet)(void *packet, int length); +#endif +int eth_rx(void); /* Check for received packets */ + +/** + * reset_phy() - Reset the Ethernet PHY + * + * This should be implemented by boards if CONFIG_RESET_PHY_R is enabled + */ +void reset_phy(void); + +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP) +/** + * eth_set_enable_bootdevs() - Enable or disable binding of Ethernet bootdevs + * + * These get in the way of bootstd testing, so are normally disabled by tests. + * This provide control of this setting. It only affects binding of Ethernet + * devices, so if that has already happened, this flag does nothing. + * + * @enable: true to enable binding of bootdevs when binding new Ethernet + * devices, false to disable it + */ +void eth_set_enable_bootdevs(bool enable); +#else +static inline void eth_set_enable_bootdevs(bool enable) {} +#endif + +static inline void net_send_packet(uchar *pkt, int len) +{ + if (DEBUG_NET_PKT_TRACE) + print_hex_dump_bytes("tx: ", DUMP_PREFIX_OFFSET, pkt, len); + /* Currently no way to return errors from eth_send() */ + (void) eth_send(pkt, len); +} + +enum eth_recv_flags { + /* + * Check hardware device for new packets (otherwise only return those + * which are already in the memory buffer ready to process) + */ + ETH_RECV_CHECK_DEVICE = 1 << 0, +}; + +/** + * struct eth_ops - functions of Ethernet MAC controllers + * + * start: Prepare the hardware to send and receive packets + * send: Send the bytes passed in "packet" as a packet on the wire + * recv: Check if the hardware received a packet. If so, set the pointer to the + * packet buffer in the packetp parameter. If not, return an error or 0 to + * indicate that the hardware receive FIFO is empty. If 0 is returned, the + * network stack will not process the empty packet, but free_pkt() will be + * called if supplied + * free_pkt: Give the driver an opportunity to manage its packet buffer memory + * when the network stack is finished processing it. This will only be + * called when no error was returned from recv - optional + * stop: Stop the hardware from looking for packets - may be called even if + * state == PASSIVE + * mcast: Join or leave a multicast group (for TFTP) - optional + * write_hwaddr: Write a MAC address to the hardware (used to pass it to Linux + * on some platforms like ARM). This function expects the + * eth_pdata::enetaddr field to be populated. The method can + * return -ENOSYS to indicate that this is not implemented for + this hardware - optional. + * read_rom_hwaddr: Some devices have a backup of the MAC address stored in a + * ROM on the board. This is how the driver should expose it + * to the network stack. This function should fill in the + * eth_pdata::enetaddr field - optional + * set_promisc: Enable or Disable promiscuous mode + * get_sset_count: Number of statistics counters + * get_string: Names of the statistic counters + * get_stats: The values of the statistic counters + */ +struct eth_ops { + int (*start)(struct udevice *dev); + int (*send)(struct udevice *dev, void *packet, int length); + int (*recv)(struct udevice *dev, int flags, uchar **packetp); + int (*free_pkt)(struct udevice *dev, uchar *packet, int length); + void (*stop)(struct udevice *dev); + int (*mcast)(struct udevice *dev, const u8 *enetaddr, int join); + int (*write_hwaddr)(struct udevice *dev); + int (*read_rom_hwaddr)(struct udevice *dev); + int (*set_promisc)(struct udevice *dev, bool enable); + int (*get_sset_count)(struct udevice *dev); + void (*get_strings)(struct udevice *dev, u8 *data); + void (*get_stats)(struct udevice *dev, u64 *data); +}; + +#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops) + +struct udevice *eth_get_dev(void); /* get the current device */ +unsigned char *eth_get_ethaddr(void); /* get the current device MAC */ +int eth_rx(void); /* Check for received packets */ +void eth_halt(void); /* stop SCC */ +const char *eth_get_name(void); /* get name of current device */ +int eth_get_dev_index(void); + +int eth_initialize(void); /* Initialize network subsystem */ +void eth_try_another(int first_restart); /* Change the device */ +void eth_set_current(void); /* set nterface to ethcur var */ + +enum eth_state_t { + ETH_STATE_INIT, + ETH_STATE_PASSIVE, + ETH_STATE_ACTIVE +}; + +/** + * struct eth_pdata - Platform data for Ethernet MAC controllers + * + * @iobase: The base address of the hardware registers + * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env + * @phy_interface: PHY interface to use - see PHY_INTERFACE_MODE_... + * @max_speed: Maximum speed of Ethernet connection supported by MAC + * @priv_pdata: device specific plat + */ +struct eth_pdata { + phys_addr_t iobase; + unsigned char enetaddr[ARP_HLEN]; + int phy_interface; + int max_speed; + void *priv_pdata; +}; + +struct ethernet_hdr { + u8 et_dest[ARP_HLEN]; /* Destination node */ + u8 et_src[ARP_HLEN]; /* Source node */ + u16 et_protlen; /* Protocol or length */ +} __attribute__((packed)); + +/* Ethernet header size */ +#define ETHER_HDR_SIZE (sizeof(struct ethernet_hdr)) + +/** + * net_random_ethaddr - Generate software assigned random Ethernet address + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Generate a random Ethernet address (MAC) that is not multicast + * and has the local assigned bit set. + */ +static inline void net_random_ethaddr(uchar *addr) +{ + int i; + unsigned int seed = get_ticks(); + + for (i = 0; i < 6; i++) + addr[i] = rand_r(&seed); + + addr[0] &= 0xfe; /* clear multicast bit */ + addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ +} + +/** + * is_zero_ethaddr - Determine if give Ethernet address is all zeros. + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is all zeroes. + */ +static inline int is_zero_ethaddr(const u8 *addr) +{ + return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); +} + +/** + * is_multicast_ethaddr - Determine if the Ethernet address is a multicast. + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is a multicast address. + * By definition the broadcast address is also a multicast address. + */ +static inline int is_multicast_ethaddr(const u8 *addr) +{ + return 0x01 & addr[0]; +} + +/* + * is_broadcast_ethaddr - Determine if the Ethernet address is broadcast + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is the broadcast address. + */ +static inline int is_broadcast_ethaddr(const u8 *addr) +{ + return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == + 0xff; +} + +/* + * is_valid_ethaddr - Determine if the given Ethernet address is valid + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not + * a multicast address, and is not FF:FF:FF:FF:FF:FF. + * + * Return true if the address is valid. + */ +static inline int is_valid_ethaddr(const u8 *addr) +{ + /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to + * explicitly check for it here. */ + return !is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr); +} + +/** + * string_to_enetaddr() - Parse a MAC address + * + * Convert a string MAC address + * + * Implemented in lib/net_utils.c (built unconditionally) + * + * @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit + * hex value + * @enetaddr: Place to put MAC address (6 bytes) + */ +void string_to_enetaddr(const char *addr, uint8_t *enetaddr); + +/** + * string_to_ip() - Convert a string to ip address + * + * Implemented in lib/net_utils.c (built unconditionally) + * + * @s: Input string to parse + * @return: in_addr struct containing the parsed IP address + */ +struct in_addr string_to_ip(const char *s); + +/* copy a filename (allow for "..." notation, limit length) */ +void copy_filename(char *dst, const char *src, int size); + +/* Processes a received packet */ +void net_process_received_packet(uchar *in_packet, int len); + +/** + * update_tftp - Update firmware over TFTP (via DFU) + * + * This function updates board's firmware via TFTP + * + * @param addr - memory address where data is stored + * @param interface - the DFU medium name - e.g. "mmc" + * @param devstring - the DFU medium number - e.g. "1" + * + * Return: - 0 on success, other value on failure + */ +int update_tftp(ulong addr, char *interface, char *devstring); + +/** + * env_get_ip() - Convert an environment value to to an ip address + * + * @var: Environment variable to convert. The value of this variable must be + * in the format format a.b.c.d, where each value is a decimal number from + * 0 to 255 + * Return: IP address, or 0 if invalid + */ +static inline struct in_addr env_get_ip(char *var) +{ + return string_to_ip(env_get(var)); +} + +int net_init(void); + +/** + * dhcp_run() - Run DHCP on the current ethernet device + * + * This sets the autoload variable, then puts it back to similar to its original + * state (y, n or unset). + * + * @addr: Address to load the file into (0 if @autoload is false) + * @fname: Filename of file to load (NULL if @autoload is false or to use the + * default filename) + * @autoload: true to load the file, false to just get the network IP + * @return 0 if OK, -EINVAL if the environment failed, -ENOENT if ant file was + * not found + */ +int dhcp_run(ulong addr, const char *fname, bool autoload); + +/** + * do_tftpb - Run the tftpboot command + * + * @cmdtp: Command information for tftpboot + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * Return: result (see enum command_ret_t) + */ +int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); + +/** + * wget_with_dns() - runs dns host IP address resulution before wget + * + * @dst_addr: destination address to download the file + * @uri: uri string of target file of wget + * Return: downloaded file size, negative if failed + */ +int wget_with_dns(ulong dst_addr, char *uri); +/** + * wget_validate_uri() - varidate the uri + * + * @uri: uri string of target file of wget + * Return: true if uri is valid, false if uri is invalid + */ +bool wget_validate_uri(char *uri); +//int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); + +#endif /* __NET_COMMON_H__ */ diff --git a/include/net-legacy.h b/include/net-legacy.h new file mode 100644 index 00000000000..19c991e12f6 --- /dev/null +++ b/include/net-legacy.h @@ -0,0 +1,544 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * LiMon Monitor (LiMon) - Network. + * + * Copyright 1994 - 2000 Neil Russell. + * (See License) + * + * History + * 9/16/00 bor adapted to TQM823L/STK8xxL board, RARP/TFTP boot added + */ + +#ifndef __NET_LEGACY_H__ +#define __NET_LEGACY_H__ + +#include +#include /* for nton* / ntoh* stuff */ +#include +#include +#include + +struct bd_info; +struct cmd_tbl; +struct udevice; + +#define DEBUG_LL_STATE 0 /* Link local state machine changes */ +#define DEBUG_DEV_PKT 0 /* Packets or info directed to the device */ +#define DEBUG_NET_PKT 0 /* Packets on info on the network at large */ +#define DEBUG_INT_STATE 0 /* Internal network state changes */ + +/* ARP hardware address length */ +#define ARP_HLEN 6 +/* + * The size of a MAC address in string form, each digit requires two chars + * and five separator characters to form '00:00:00:00:00:00'. + */ +#define ARP_HLEN_ASCII (ARP_HLEN * 2) + (ARP_HLEN - 1) + +/** + * An incoming packet handler. + * @param pkt pointer to the application packet + * @param dport destination UDP port + * @param sip source IP address + * @param sport source UDP port + * @param len packet length + */ +typedef void rxhand_f(uchar *pkt, unsigned dport, + struct in_addr sip, unsigned sport, + unsigned len); + +/** + * An incoming ICMP packet handler. + * @param type ICMP type + * @param code ICMP code + * @param dport destination UDP port + * @param sip source IP address + * @param sport source UDP port + * @param pkt pointer to the ICMP packet data + * @param len packet length + */ +typedef void rxhand_icmp_f(unsigned type, unsigned code, unsigned dport, + struct in_addr sip, unsigned sport, uchar *pkt, unsigned len); + +/* + * A timeout handler. Called after time interval has expired. + */ +typedef void thand_f(void); + +/* + * The devname can be either an exact name given by the driver or device tree + * or it can be an alias of the form "eth%d" + */ +struct udevice *eth_get_dev_by_name(const char *devname); +int eth_init_state_only(void); /* Set active state */ +void eth_halt_state_only(void); /* Set passive state */ + +/** + * 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); + +/* + * Get the hardware address for an ethernet interface . + * Args: + * base_name - base name for device (normally "eth") + * index - device index number (0 for first) + * enetaddr - returns 6 byte hardware address + * Returns: + * Return true if the address is valid. + */ +int eth_env_get_enetaddr_by_index(const char *base_name, int index, + uchar *enetaddr); + +int eth_send(void *packet, int length); /* Send a packet */ + +#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +int eth_receive(void *packet, int length); /* Receive a packet*/ +extern void (*push_packet)(void *packet, int length); +#endif +int eth_mcast_join(struct in_addr mcast_addr, int join); + +/**********************************************************************/ +/* + * Protocol headers. + */ + +#define ETH_FCS_LEN 4 /* Octets in the FCS */ + +struct e802_hdr { + u8 et_dest[ARP_HLEN]; /* Destination node */ + u8 et_src[ARP_HLEN]; /* Source node */ + u16 et_protlen; /* Protocol or length */ + u8 et_dsap; /* 802 DSAP */ + u8 et_ssap; /* 802 SSAP */ + u8 et_ctl; /* 802 control */ + u8 et_snap1; /* SNAP */ + u8 et_snap2; + u8 et_snap3; + u16 et_prot; /* 802 protocol */ +} __attribute__((packed)); + +/* 802 + SNAP + ethernet header size */ +#define E802_HDR_SIZE (sizeof(struct e802_hdr)) + +/* + * Virtual LAN Ethernet header + */ +struct vlan_ethernet_hdr { + u8 vet_dest[ARP_HLEN]; /* Destination node */ + u8 vet_src[ARP_HLEN]; /* Source node */ + u16 vet_vlan_type; /* PROT_VLAN */ + u16 vet_tag; /* TAG of VLAN */ + u16 vet_type; /* protocol type */ +} __attribute__((packed)); + +/* VLAN Ethernet header size */ +#define VLAN_ETHER_HDR_SIZE (sizeof(struct vlan_ethernet_hdr)) + +/* + * Internet Protocol (IP) header. + */ +struct ip_hdr { + u8 ip_hl_v; /* header length and version */ + u8 ip_tos; /* type of service */ + u16 ip_len; /* total length */ + u16 ip_id; /* identification */ + u16 ip_off; /* fragment offset field */ + u8 ip_ttl; /* time to live */ + u8 ip_p; /* protocol */ + u16 ip_sum; /* checksum */ + struct in_addr ip_src; /* Source IP address */ + struct in_addr ip_dst; /* Destination IP address */ +} __attribute__((packed)); + +#define IP_OFFS 0x1fff /* ip offset *= 8 */ +#define IP_FLAGS 0xe000 /* first 3 bits */ +#define IP_FLAGS_RES 0x8000 /* reserved */ +#define IP_FLAGS_DFRAG 0x4000 /* don't fragments */ +#define IP_FLAGS_MFRAG 0x2000 /* more fragments */ + +#define IP_HDR_SIZE (sizeof(struct ip_hdr)) + +#define IP_MIN_FRAG_DATAGRAM_SIZE (IP_HDR_SIZE + 8) + +/* + * Address Resolution Protocol (ARP) header. + */ +struct arp_hdr { + u16 ar_hrd; /* Format of hardware address */ +# define ARP_ETHER 1 /* Ethernet hardware address */ + u16 ar_pro; /* Format of protocol address */ + u8 ar_hln; /* Length of hardware address */ + u8 ar_pln; /* Length of protocol address */ +# define ARP_PLEN 4 + u16 ar_op; /* Operation */ +# define ARPOP_REQUEST 1 /* Request to resolve address */ +# define ARPOP_REPLY 2 /* Response to previous request */ + +# define RARPOP_REQUEST 3 /* Request to resolve address */ +# define RARPOP_REPLY 4 /* Response to previous request */ + + /* + * The remaining fields are variable in size, according to + * the sizes above, and are defined as appropriate for + * specific hardware/protocol combinations. + */ + u8 ar_data[0]; +#define ar_sha ar_data[0] +#define ar_spa ar_data[ARP_HLEN] +#define ar_tha ar_data[ARP_HLEN + ARP_PLEN] +#define ar_tpa ar_data[ARP_HLEN + ARP_PLEN + ARP_HLEN] +#if 0 + u8 ar_sha[]; /* Sender hardware address */ + u8 ar_spa[]; /* Sender protocol address */ + u8 ar_tha[]; /* Target hardware address */ + u8 ar_tpa[]; /* Target protocol address */ +#endif /* 0 */ +} __attribute__((packed)); + + +/* + * ICMP stuff (just enough to handle (host) redirect messages) + */ +#define ICMP_ECHO_REPLY 0 /* Echo reply */ +#define ICMP_NOT_REACH 3 /* Detination unreachable */ +#define ICMP_REDIRECT 5 /* Redirect (change route) */ +#define ICMP_ECHO_REQUEST 8 /* Echo request */ + +/* Codes for REDIRECT. */ +#define ICMP_REDIR_NET 0 /* Redirect Net */ +#define ICMP_REDIR_HOST 1 /* Redirect Host */ + +/* Codes for NOT_REACH */ +#define ICMP_NOT_REACH_PORT 3 /* Port unreachable */ + +struct icmp_hdr { + u8 type; + u8 code; + u16 checksum; + union { + struct { + u16 id; + u16 sequence; + } echo; + u32 gateway; + struct { + u16 unused; + u16 mtu; + } frag; + u8 data[0]; + } un; +} __attribute__((packed)); + +#define ICMP_HDR_SIZE (sizeof(struct icmp_hdr)) +#define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE) + +/* + * Maximum packet size; used to allocate packet storage. Use + * the maxium Ethernet frame size as specified by the Ethernet + * standard including the 802.1Q tag (VLAN tagging). + * maximum packet size = 1522 + * maximum packet size and multiple of 32 bytes = 1536 + */ +#define PKTSIZE 1522 +#ifndef CONFIG_DM_DSA +#define PKTSIZE_ALIGN 1536 +#else +/* Maximum DSA tagging overhead (headroom and/or tailroom) */ +#define DSA_MAX_OVR 256 +#define PKTSIZE_ALIGN (1536 + DSA_MAX_OVR) +#endif + +/**********************************************************************/ +/* + * Globals. + * + * Note: + * + * All variables of type struct in_addr are stored in NETWORK byte order + * (big endian). + */ + +/* net.c */ +/** BOOTP EXTENTIONS **/ +extern struct in_addr net_gateway; /* Our gateway IP address */ +extern struct in_addr net_netmask; /* Our subnet mask (0 = unknown) */ +/* Our Domain Name Server (0 = unknown) */ +extern struct in_addr net_dns_server; +#if defined(CONFIG_BOOTP_DNS2) +/* Our 2nd Domain Name Server (0 = unknown) */ +extern struct in_addr net_dns_server2; +#endif +extern char net_nis_domain[32]; /* Our IS domain */ +extern char net_hostname[32]; /* Our hostname */ +#ifdef CONFIG_NET +extern char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN]; /* Our root path */ +#endif +/* Indicates whether the pxe path prefix / config file was specified in dhcp option */ +extern char *pxelinux_configfile; +/** END OF BOOTP EXTENTIONS **/ +extern u8 net_ethaddr[ARP_HLEN]; /* Our ethernet address */ +extern u8 net_server_ethaddr[ARP_HLEN]; /* Boot server enet address */ +extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */ +extern struct in_addr net_server_ip; /* Server IP addr (0 = unknown) */ +extern uchar *net_tx_packet; /* THE transmit packet */ +extern uchar *net_rx_packets[PKTBUFSRX]; /* Receive packets */ +extern uchar *net_rx_packet; /* Current receive packet */ +extern int net_rx_packet_len; /* Current rx packet length */ +extern const u8 net_null_ethaddr[ARP_HLEN]; + +#define VLAN_NONE 4095 /* untagged */ +#define VLAN_IDMASK 0x0fff /* mask of valid vlan id */ +extern ushort net_our_vlan; /* Our VLAN */ +extern ushort net_native_vlan; /* Our Native VLAN */ + +extern int net_restart_wrap; /* Tried all network devices */ + +enum proto_t { + BOOTP, RARP, ARP, TFTPGET, DHCP, DHCP6, PING, PING6, DNS, NFS, CDP, + NETCONS, SNTP, TFTPSRV, TFTPPUT, LINKLOCAL, FASTBOOT_UDP, FASTBOOT_TCP, + WOL, UDP, NCSI, WGET, RS +}; +/* Indicates whether the file name was specified on the command line */ +extern bool net_boot_file_name_explicit; +/* The actual transferred size of the bootfile (in bytes) */ +extern u32 net_boot_file_size; +/* Boot file size in blocks as reported by the DHCP server */ +extern u32 net_boot_file_expected_size_in_blocks; + +#if defined(CONFIG_CMD_DNS) +extern char *net_dns_resolve; /* The host to resolve */ +extern char *net_dns_env_var; /* the env var to put the ip into */ +#endif + +#if defined(CONFIG_CMD_PING) +extern struct in_addr net_ping_ip; /* the ip address to ping */ +#endif + +#if defined(CONFIG_CMD_CDP) +/* when CDP completes these hold the return values */ +extern ushort cdp_native_vlan; /* CDP returned native VLAN */ +extern ushort cdp_appliance_vlan; /* CDP returned appliance VLAN */ + +/* + * Check for a CDP packet by examining the received MAC address field + */ +static inline int is_cdp_packet(const uchar *ethaddr) +{ + extern const u8 net_cdp_ethaddr[ARP_HLEN]; + + return memcmp(ethaddr, net_cdp_ethaddr, ARP_HLEN) == 0; +} +#endif + +#if defined(CONFIG_CMD_SNTP) +extern struct in_addr net_ntp_server; /* the ip address to NTP */ +extern int net_ntp_time_offset; /* offset time from UTC */ +#endif + +int net_loop(enum proto_t); + +/* Load failed. Start again. */ +int net_start_again(void); + +/* Get size of the ethernet header when we send */ +int net_eth_hdr_size(void); + +/* Set ethernet header; returns the size of the header */ +int net_set_ether(uchar *xet, const uchar *dest_ethaddr, uint prot); +int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot); + +/* Set IP header */ +void net_set_ip_header(uchar *pkt, struct in_addr dest, struct in_addr source, + u16 pkt_len, u8 proto); +void net_set_udp_header(uchar *pkt, struct in_addr dest, int dport, + int sport, int len); + +/* Callbacks */ +rxhand_f *net_get_udp_handler(void); /* Get UDP RX packet handler */ +void net_set_udp_handler(rxhand_f *); /* Set UDP RX packet handler */ +rxhand_f *net_get_arp_handler(void); /* Get ARP RX packet handler */ +void net_set_arp_handler(rxhand_f *); /* Set ARP RX packet handler */ +bool arp_is_waiting(void); /* Waiting for ARP reply? */ +void net_set_icmp_handler(rxhand_icmp_f *f); /* Set ICMP RX handler */ +void net_set_timeout_handler(ulong, thand_f *);/* Set timeout handler */ + +/* Network loop state */ +enum net_loop_state { + NETLOOP_CONTINUE, + NETLOOP_RESTART, + NETLOOP_SUCCESS, + NETLOOP_FAIL +}; +extern enum net_loop_state net_state; + +static inline void net_set_state(enum net_loop_state state) +{ + debug_cond(DEBUG_INT_STATE, "--- NetState set to %d\n", state); + net_state = state; +} + +/* + * net_get_async_tx_pkt_buf - Get a packet buffer that is not in use for + * sending an asynchronous reply + * + * returns - ptr to packet buffer + */ +uchar * net_get_async_tx_pkt_buf(void); + +/** + * net_send_ip_packet() - Transmit "net_tx_packet" as UDP or TCP packet, + * send ARP request if needed (ether will be populated) + * @ether: Raw packet buffer + * @dest: IP address to send the datagram to + * @dport: Destination UDP port + * @sport: Source UDP port + * @payload_len: Length of data after the UDP header + * @action: TCP action to be performed + * @tcp_seq_num: TCP sequence number of this transmission + * @tcp_ack_num: TCP stream acknolegement number + * + * Return: 0 on success, other value on failure + */ +int net_send_ip_packet(uchar *ether, struct in_addr dest, int dport, int sport, + int payload_len, int proto, u8 action, u32 tcp_seq_num, + u32 tcp_ack_num); +/** + * net_send_tcp_packet() - Transmit TCP packet. + * @payload_len: length of payload + * @dport: Destination TCP port + * @sport: Source TCP port + * @action: TCP action to be performed + * @tcp_seq_num: TCP sequence number of this transmission + * @tcp_ack_num: TCP stream acknolegement number + * + * Return: 0 on success, other value on failure + */ +int net_send_tcp_packet(int payload_len, int dport, int sport, u8 action, + u32 tcp_seq_num, u32 tcp_ack_num); +int net_send_udp_packet(uchar *ether, struct in_addr dest, int dport, + int sport, int payload_len); + +#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD) +void nc_start(void); +int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port, + unsigned src_port, unsigned len); +#endif + +static __always_inline int eth_is_on_demand_init(void) +{ +#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD) + extern enum proto_t net_loop_last_protocol; + + return net_loop_last_protocol != NETCONS; +#else + return 1; +#endif +} + +static inline void eth_set_last_protocol(int protocol) +{ +#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD) + extern enum proto_t net_loop_last_protocol; + + net_loop_last_protocol = protocol; +#endif +} + +/* + * Check if autoload is enabled. If so, use either NFS or TFTP to download + * the boot file. + */ +void net_auto_load(void); + +/* + * The following functions are a bit ugly, but necessary to deal with + * alignment restrictions on ARM. + * + * We're using inline functions, which had the smallest memory + * footprint in our tests. + */ +/* return IP *in network byteorder* */ +static inline struct in_addr net_read_ip(void *from) +{ + struct in_addr ip; + + memcpy((void *)&ip, (void *)from, sizeof(ip)); + return ip; +} + +/* return ulong *in network byteorder* */ +static inline u32 net_read_u32(void *from) +{ + u32 l; + + memcpy((void *)&l, (void *)from, sizeof(l)); + return l; +} + +/* write IP *in network byteorder* */ +static inline void net_write_ip(void *to, struct in_addr ip) +{ + memcpy(to, (void *)&ip, sizeof(ip)); +} + +/* copy IP */ +static inline void net_copy_ip(void *to, void *from) +{ + memcpy((void *)to, from, sizeof(struct in_addr)); +} + +/* copy ulong */ +static inline void net_copy_u32(void *to, void *from) +{ + memcpy((void *)to, (void *)from, sizeof(u32)); +} + +/* Convert an IP address to a string */ +void ip_to_string(struct in_addr x, char *s); + +/** + * string_to_ip() - Convert a string to ip address + * + * Implemented in lib/net_utils.c (built unconditionally) + * + * @s: Input string to parse + * @return: in_addr struct containing the parsed IP address + */ +struct in_addr string_to_ip(const char *s); + +/* Convert a VLAN id to a string */ +void vlan_to_string(ushort x, char *s); + +/* Convert a string to a vlan id */ +ushort string_to_vlan(const char *s); + +/* read a VLAN id from an environment variable */ +ushort env_get_vlan(char *); + +/* check if serverip is specified in filename from the command line */ +int is_serverip_in_cmd(void); + +/** + * net_parse_bootfile - Parse the bootfile env var / cmd line param + * + * @param ipaddr - a pointer to the ipaddr to populate if included in bootfile + * @param filename - a pointer to the string to save the filename part + * @param max_len - The longest - 1 that the filename part can be + * + * return 1 if parsed, 0 if bootfile is empty + */ +int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len); + +#endif /* __NET_LEGACY_H__ */ diff --git a/include/net-lwip.h b/include/net-lwip.h new file mode 100644 index 00000000000..5c3f9e7e86c --- /dev/null +++ b/include/net-lwip.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef __NET_LWIP_H__ +#define __NET_LWIP_H__ + +#include +#include + +struct netif *net_lwip_new_netif(struct udevice *udev); +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); + +#endif /* __NET_LWIP_H__ */ diff --git a/include/net.h b/include/net.h index bb2ae20f52a..afa46f239ee 100644 --- a/include/net.h +++ b/include/net.h @@ -1,949 +1,14 @@ /* SPDX-License-Identifier: GPL-2.0 */ -/* - * LiMon Monitor (LiMon) - Network. - * - * Copyright 1994 - 2000 Neil Russell. - * (See License) - * - * History - * 9/16/00 bor adapted to TQM823L/STK8xxL board, RARP/TFTP boot added - */ #ifndef __NET_H__ #define __NET_H__ -#include -#include -#include /* for nton* / ntoh* stuff */ -#include -#include -#include -#include -#include -#include +#include -struct bd_info; -struct cmd_tbl; -struct udevice; - -#define DEBUG_LL_STATE 0 /* Link local state machine changes */ -#define DEBUG_DEV_PKT 0 /* Packets or info directed to the device */ -#define DEBUG_NET_PKT 0 /* Packets on info on the network at large */ -#define DEBUG_INT_STATE 0 /* Internal network state changes */ -#define DEBUG_NET_PKT_TRACE 0 /* Trace all packet data */ - -/* - * The number of receive packet buffers, and the required packet buffer - * alignment in memory. - * - */ -#define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER -#define PKTALIGN ARCH_DMA_MINALIGN - -/* Number of packets processed together */ -#define ETH_PACKETS_BATCH_RECV 32 - -/* ARP hardware address length */ -#define ARP_HLEN 6 -/* - * The size of a MAC address in string form, each digit requires two chars - * and five separator characters to form '00:00:00:00:00:00'. - */ -#define ARP_HLEN_ASCII (ARP_HLEN * 2) + (ARP_HLEN - 1) - -/* IPv4 addresses are always 32 bits in size */ -struct in_addr { - __be32 s_addr; -}; - -/** - * do_tftpb - Run the tftpboot command - * - * @cmdtp: Command information for tftpboot - * @flag: Command flags (CMD_FLAG_...) - * @argc: Number of arguments - * @argv: List of arguments - * Return: result (see enum command_ret_t) - */ -int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); - -/** - * dhcp_run() - Run DHCP on the current ethernet device - * - * This sets the autoload variable, then puts it back to similar to its original - * state (y, n or unset). - * - * @addr: Address to load the file into (0 if @autoload is false) - * @fname: Filename of file to load (NULL if @autoload is false or to use the - * default filename) - * @autoload: true to load the file, false to just get the network IP - * @return 0 if OK, -EINVAL if the environment failed, -ENOENT if ant file was - * not found - */ -int dhcp_run(ulong addr, const char *fname, bool autoload); - -/** - * An incoming packet handler. - * @param pkt pointer to the application packet - * @param dport destination UDP port - * @param sip source IP address - * @param sport source UDP port - * @param len packet length - */ -typedef void rxhand_f(uchar *pkt, unsigned dport, - struct in_addr sip, unsigned sport, - unsigned len); - -/** - * An incoming ICMP packet handler. - * @param type ICMP type - * @param code ICMP code - * @param dport destination UDP port - * @param sip source IP address - * @param sport source UDP port - * @param pkt pointer to the ICMP packet data - * @param len packet length - */ -typedef void rxhand_icmp_f(unsigned type, unsigned code, unsigned dport, - struct in_addr sip, unsigned sport, uchar *pkt, unsigned len); - -/* - * A timeout handler. Called after time interval has expired. - */ -typedef void thand_f(void); - -enum eth_state_t { - ETH_STATE_INIT, - ETH_STATE_PASSIVE, - ETH_STATE_ACTIVE -}; - -/** - * struct eth_pdata - Platform data for Ethernet MAC controllers - * - * @iobase: The base address of the hardware registers - * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env - * @phy_interface: PHY interface to use - see PHY_INTERFACE_MODE_... - * @max_speed: Maximum speed of Ethernet connection supported by MAC - * @priv_pdata: device specific plat - */ -struct eth_pdata { - phys_addr_t iobase; - unsigned char enetaddr[ARP_HLEN]; - int phy_interface; - int max_speed; - void *priv_pdata; -}; - -enum eth_recv_flags { - /* - * Check hardware device for new packets (otherwise only return those - * which are already in the memory buffer ready to process) - */ - ETH_RECV_CHECK_DEVICE = 1 << 0, -}; - -/** - * struct eth_ops - functions of Ethernet MAC controllers - * - * start: Prepare the hardware to send and receive packets - * send: Send the bytes passed in "packet" as a packet on the wire - * recv: Check if the hardware received a packet. If so, set the pointer to the - * packet buffer in the packetp parameter. If not, return an error or 0 to - * indicate that the hardware receive FIFO is empty. If 0 is returned, the - * network stack will not process the empty packet, but free_pkt() will be - * called if supplied - * free_pkt: Give the driver an opportunity to manage its packet buffer memory - * when the network stack is finished processing it. This will only be - * called when no error was returned from recv - optional - * stop: Stop the hardware from looking for packets - may be called even if - * state == PASSIVE - * mcast: Join or leave a multicast group (for TFTP) - optional - * write_hwaddr: Write a MAC address to the hardware (used to pass it to Linux - * on some platforms like ARM). This function expects the - * eth_pdata::enetaddr field to be populated. The method can - * return -ENOSYS to indicate that this is not implemented for - this hardware - optional. - * read_rom_hwaddr: Some devices have a backup of the MAC address stored in a - * ROM on the board. This is how the driver should expose it - * to the network stack. This function should fill in the - * eth_pdata::enetaddr field - optional - * set_promisc: Enable or Disable promiscuous mode - * get_sset_count: Number of statistics counters - * get_string: Names of the statistic counters - * get_stats: The values of the statistic counters - */ -struct eth_ops { - int (*start)(struct udevice *dev); - int (*send)(struct udevice *dev, void *packet, int length); - int (*recv)(struct udevice *dev, int flags, uchar **packetp); - int (*free_pkt)(struct udevice *dev, uchar *packet, int length); - void (*stop)(struct udevice *dev); - int (*mcast)(struct udevice *dev, const u8 *enetaddr, int join); - int (*write_hwaddr)(struct udevice *dev); - int (*read_rom_hwaddr)(struct udevice *dev); - int (*set_promisc)(struct udevice *dev, bool enable); - int (*get_sset_count)(struct udevice *dev); - void (*get_strings)(struct udevice *dev, u8 *data); - void (*get_stats)(struct udevice *dev, u64 *data); -}; - -#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops) - -struct udevice *eth_get_dev(void); /* get the current device */ -/* - * The devname can be either an exact name given by the driver or device tree - * or it can be an alias of the form "eth%d" - */ -struct udevice *eth_get_dev_by_name(const char *devname); -unsigned char *eth_get_ethaddr(void); /* get the current device MAC */ - -/* Used only when NetConsole is enabled */ -int eth_is_active(struct udevice *dev); /* Test device for active state */ -int eth_init_state_only(void); /* Set active state */ -void eth_halt_state_only(void); /* Set passive state */ - -int eth_initialize(void); /* Initialize network subsystem */ -void eth_try_another(int first_restart); /* Change the device */ -void eth_set_current(void); /* set nterface to ethcur var */ - -int eth_get_dev_index(void); /* get the device index */ - -/** - * 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); - -/* - * Initialize USB ethernet device with CONFIG_DM_ETH - * Returns: - * 0 is success, non-zero is error status. - */ -int usb_ether_init(void); - -/* - * Get the hardware address for an ethernet interface . - * Args: - * base_name - base name for device (normally "eth") - * index - device index number (0 for first) - * enetaddr - returns 6 byte hardware address - * Returns: - * Return true if the address is valid. - */ -int eth_env_get_enetaddr_by_index(const char *base_name, int index, - uchar *enetaddr); - -int eth_init(void); /* Initialize the device */ -int eth_send(void *packet, int length); /* Send a packet */ - -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) -int eth_receive(void *packet, int length); /* Receive a packet*/ -extern void (*push_packet)(void *packet, int length); -#endif -int eth_rx(void); /* Check for received packets */ -void eth_halt(void); /* stop SCC */ -const char *eth_get_name(void); /* get name of current device */ -int eth_mcast_join(struct in_addr mcast_addr, int join); - -/**********************************************************************/ -/* - * Protocol headers. - */ - -/* - * Ethernet header - */ - -struct ethernet_hdr { - u8 et_dest[ARP_HLEN]; /* Destination node */ - u8 et_src[ARP_HLEN]; /* Source node */ - u16 et_protlen; /* Protocol or length */ -} __attribute__((packed)); - -/* Ethernet header size */ -#define ETHER_HDR_SIZE (sizeof(struct ethernet_hdr)) - -#define ETH_FCS_LEN 4 /* Octets in the FCS */ - -struct e802_hdr { - u8 et_dest[ARP_HLEN]; /* Destination node */ - u8 et_src[ARP_HLEN]; /* Source node */ - u16 et_protlen; /* Protocol or length */ - u8 et_dsap; /* 802 DSAP */ - u8 et_ssap; /* 802 SSAP */ - u8 et_ctl; /* 802 control */ - u8 et_snap1; /* SNAP */ - u8 et_snap2; - u8 et_snap3; - u16 et_prot; /* 802 protocol */ -} __attribute__((packed)); - -/* 802 + SNAP + ethernet header size */ -#define E802_HDR_SIZE (sizeof(struct e802_hdr)) - -/* - * Virtual LAN Ethernet header - */ -struct vlan_ethernet_hdr { - u8 vet_dest[ARP_HLEN]; /* Destination node */ - u8 vet_src[ARP_HLEN]; /* Source node */ - u16 vet_vlan_type; /* PROT_VLAN */ - u16 vet_tag; /* TAG of VLAN */ - u16 vet_type; /* protocol type */ -} __attribute__((packed)); - -/* VLAN Ethernet header size */ -#define VLAN_ETHER_HDR_SIZE (sizeof(struct vlan_ethernet_hdr)) - -#define PROT_IP 0x0800 /* IP protocol */ -#define PROT_ARP 0x0806 /* IP ARP protocol */ -#define PROT_WOL 0x0842 /* ether-wake WoL protocol */ -#define PROT_RARP 0x8035 /* IP ARP protocol */ -#define PROT_VLAN 0x8100 /* IEEE 802.1q protocol */ -#define PROT_IPV6 0x86dd /* IPv6 over bluebook */ -#define PROT_PPP_SES 0x8864 /* PPPoE session messages */ -#define PROT_NCSI 0x88f8 /* NC-SI control packets */ - -#define IPPROTO_ICMP 1 /* Internet Control Message Protocol */ -#define IPPROTO_TCP 6 /* Transmission Control Protocol */ -#define IPPROTO_UDP 17 /* User Datagram Protocol */ - -/* - * Internet Protocol (IP) header. - */ -struct ip_hdr { - u8 ip_hl_v; /* header length and version */ - u8 ip_tos; /* type of service */ - u16 ip_len; /* total length */ - u16 ip_id; /* identification */ - u16 ip_off; /* fragment offset field */ - u8 ip_ttl; /* time to live */ - u8 ip_p; /* protocol */ - u16 ip_sum; /* checksum */ - struct in_addr ip_src; /* Source IP address */ - struct in_addr ip_dst; /* Destination IP address */ -} __attribute__((packed)); - -#define IP_OFFS 0x1fff /* ip offset *= 8 */ -#define IP_FLAGS 0xe000 /* first 3 bits */ -#define IP_FLAGS_RES 0x8000 /* reserved */ -#define IP_FLAGS_DFRAG 0x4000 /* don't fragments */ -#define IP_FLAGS_MFRAG 0x2000 /* more fragments */ - -#define IP_HDR_SIZE (sizeof(struct ip_hdr)) - -#define IP_MIN_FRAG_DATAGRAM_SIZE (IP_HDR_SIZE + 8) - -/* - * Internet Protocol (IP) + UDP header. - */ -struct ip_udp_hdr { - u8 ip_hl_v; /* header length and version */ - u8 ip_tos; /* type of service */ - u16 ip_len; /* total length */ - u16 ip_id; /* identification */ - u16 ip_off; /* fragment offset field */ - u8 ip_ttl; /* time to live */ - u8 ip_p; /* protocol */ - u16 ip_sum; /* checksum */ - struct in_addr ip_src; /* Source IP address */ - struct in_addr ip_dst; /* Destination IP address */ - u16 udp_src; /* UDP source port */ - u16 udp_dst; /* UDP destination port */ - u16 udp_len; /* Length of UDP packet */ - u16 udp_xsum; /* Checksum */ -} __attribute__((packed)); - -#define IP_UDP_HDR_SIZE (sizeof(struct ip_udp_hdr)) -#define UDP_HDR_SIZE (IP_UDP_HDR_SIZE - IP_HDR_SIZE) - -/* - * Address Resolution Protocol (ARP) header. - */ -struct arp_hdr { - u16 ar_hrd; /* Format of hardware address */ -# define ARP_ETHER 1 /* Ethernet hardware address */ - u16 ar_pro; /* Format of protocol address */ - u8 ar_hln; /* Length of hardware address */ - u8 ar_pln; /* Length of protocol address */ -# define ARP_PLEN 4 - u16 ar_op; /* Operation */ -# define ARPOP_REQUEST 1 /* Request to resolve address */ -# define ARPOP_REPLY 2 /* Response to previous request */ - -# define RARPOP_REQUEST 3 /* Request to resolve address */ -# define RARPOP_REPLY 4 /* Response to previous request */ - - /* - * The remaining fields are variable in size, according to - * the sizes above, and are defined as appropriate for - * specific hardware/protocol combinations. - */ - u8 ar_data[0]; -#define ar_sha ar_data[0] -#define ar_spa ar_data[ARP_HLEN] -#define ar_tha ar_data[ARP_HLEN + ARP_PLEN] -#define ar_tpa ar_data[ARP_HLEN + ARP_PLEN + ARP_HLEN] -#if 0 - u8 ar_sha[]; /* Sender hardware address */ - u8 ar_spa[]; /* Sender protocol address */ - u8 ar_tha[]; /* Target hardware address */ - u8 ar_tpa[]; /* Target protocol address */ -#endif /* 0 */ -} __attribute__((packed)); - -#define ARP_HDR_SIZE (8+20) /* Size assuming ethernet */ - -/* - * ICMP stuff (just enough to handle (host) redirect messages) - */ -#define ICMP_ECHO_REPLY 0 /* Echo reply */ -#define ICMP_NOT_REACH 3 /* Detination unreachable */ -#define ICMP_REDIRECT 5 /* Redirect (change route) */ -#define ICMP_ECHO_REQUEST 8 /* Echo request */ - -/* Codes for REDIRECT. */ -#define ICMP_REDIR_NET 0 /* Redirect Net */ -#define ICMP_REDIR_HOST 1 /* Redirect Host */ - -/* Codes for NOT_REACH */ -#define ICMP_NOT_REACH_PORT 3 /* Port unreachable */ - -struct icmp_hdr { - u8 type; - u8 code; - u16 checksum; - union { - struct { - u16 id; - u16 sequence; - } echo; - u32 gateway; - struct { - u16 unused; - u16 mtu; - } frag; - u8 data[0]; - } un; -} __attribute__((packed)); - -#define ICMP_HDR_SIZE (sizeof(struct icmp_hdr)) -#define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE) - -/* - * Maximum packet size; used to allocate packet storage. Use - * the maxium Ethernet frame size as specified by the Ethernet - * standard including the 802.1Q tag (VLAN tagging). - * maximum packet size = 1522 - * maximum packet size and multiple of 32 bytes = 1536 - */ -#define PKTSIZE 1522 -#ifndef CONFIG_DM_DSA -#define PKTSIZE_ALIGN 1536 +#if defined(CONFIG_NET_LWIP) +#include #else -/* Maximum DSA tagging overhead (headroom and/or tailroom) */ -#define DSA_MAX_OVR 256 -#define PKTSIZE_ALIGN (1536 + DSA_MAX_OVR) -#endif - -/* - * Maximum receive ring size; that is, the number of packets - * we can buffer before overflow happens. Basically, this just - * needs to be enough to prevent a packet being discarded while - * we are processing the previous one. - */ -#define RINGSZ 4 -#define RINGSZ_LOG2 2 - -/**********************************************************************/ -/* - * Globals. - * - * Note: - * - * All variables of type struct in_addr are stored in NETWORK byte order - * (big endian). - */ - -/* net.c */ -/** BOOTP EXTENTIONS **/ -extern struct in_addr net_gateway; /* Our gateway IP address */ -extern struct in_addr net_netmask; /* Our subnet mask (0 = unknown) */ -/* Our Domain Name Server (0 = unknown) */ -extern struct in_addr net_dns_server; -#if defined(CONFIG_BOOTP_DNS2) -/* Our 2nd Domain Name Server (0 = unknown) */ -extern struct in_addr net_dns_server2; +#include #endif -extern char net_nis_domain[32]; /* Our IS domain */ -extern char net_hostname[32]; /* Our hostname */ -#ifdef CONFIG_NET -extern char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN]; /* Our root path */ -#endif -/* Indicates whether the pxe path prefix / config file was specified in dhcp option */ -extern char *pxelinux_configfile; -/** END OF BOOTP EXTENTIONS **/ -extern u8 net_ethaddr[ARP_HLEN]; /* Our ethernet address */ -extern u8 net_server_ethaddr[ARP_HLEN]; /* Boot server enet address */ -extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */ -extern struct in_addr net_server_ip; /* Server IP addr (0 = unknown) */ -extern uchar *net_tx_packet; /* THE transmit packet */ -extern uchar *net_rx_packets[PKTBUFSRX]; /* Receive packets */ -extern uchar *net_rx_packet; /* Current receive packet */ -extern int net_rx_packet_len; /* Current rx packet length */ -extern const u8 net_bcast_ethaddr[ARP_HLEN]; /* Ethernet broadcast address */ -extern const u8 net_null_ethaddr[ARP_HLEN]; - -#define VLAN_NONE 4095 /* untagged */ -#define VLAN_IDMASK 0x0fff /* mask of valid vlan id */ -extern ushort net_our_vlan; /* Our VLAN */ -extern ushort net_native_vlan; /* Our Native VLAN */ - -extern int net_restart_wrap; /* Tried all network devices */ - -enum proto_t { - BOOTP, RARP, ARP, TFTPGET, DHCP, DHCP6, PING, PING6, DNS, NFS, CDP, - NETCONS, SNTP, TFTPSRV, TFTPPUT, LINKLOCAL, FASTBOOT_UDP, FASTBOOT_TCP, - WOL, UDP, NCSI, WGET, RS -}; - -extern char net_boot_file_name[1024];/* Boot File name */ -/* Indicates whether the file name was specified on the command line */ -extern bool net_boot_file_name_explicit; -/* The actual transferred size of the bootfile (in bytes) */ -extern u32 net_boot_file_size; -/* Boot file size in blocks as reported by the DHCP server */ -extern u32 net_boot_file_expected_size_in_blocks; - -#if defined(CONFIG_CMD_DNS) -extern char *net_dns_resolve; /* The host to resolve */ -extern char *net_dns_env_var; /* the env var to put the ip into */ -#endif - -#if defined(CONFIG_CMD_PING) -extern struct in_addr net_ping_ip; /* the ip address to ping */ -#endif - -#if defined(CONFIG_CMD_CDP) -/* when CDP completes these hold the return values */ -extern ushort cdp_native_vlan; /* CDP returned native VLAN */ -extern ushort cdp_appliance_vlan; /* CDP returned appliance VLAN */ - -/* - * Check for a CDP packet by examining the received MAC address field - */ -static inline int is_cdp_packet(const uchar *ethaddr) -{ - extern const u8 net_cdp_ethaddr[ARP_HLEN]; - - return memcmp(ethaddr, net_cdp_ethaddr, ARP_HLEN) == 0; -} -#endif - -#if defined(CONFIG_CMD_SNTP) -extern struct in_addr net_ntp_server; /* the ip address to NTP */ -extern int net_ntp_time_offset; /* offset time from UTC */ -#endif - -/* Initialize the network adapter */ -int net_init(void); -int net_loop(enum proto_t); - -/* Load failed. Start again. */ -int net_start_again(void); - -/* Get size of the ethernet header when we send */ -int net_eth_hdr_size(void); - -/* Set ethernet header; returns the size of the header */ -int net_set_ether(uchar *xet, const uchar *dest_ethaddr, uint prot); -int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot); - -/* Set IP header */ -void net_set_ip_header(uchar *pkt, struct in_addr dest, struct in_addr source, - u16 pkt_len, u8 proto); -void net_set_udp_header(uchar *pkt, struct in_addr dest, int dport, - int sport, int len); - -/** - * compute_ip_checksum() - Compute IP checksum - * - * @addr: Address to check (must be 16-bit aligned) - * @nbytes: Number of bytes to check (normally a multiple of 2) - * Return: 16-bit IP checksum - */ -unsigned compute_ip_checksum(const void *addr, unsigned nbytes); - -/** - * add_ip_checksums() - add two IP checksums - * - * @offset: Offset of first sum (if odd we do a byte-swap) - * @sum: First checksum - * @new_sum: New checksum to add - * Return: updated 16-bit IP checksum - */ -unsigned add_ip_checksums(unsigned offset, unsigned sum, unsigned new_sum); - -/** - * ip_checksum_ok() - check if a checksum is correct - * - * This works by making sure the checksum sums to 0 - * - * @addr: Address to check (must be 16-bit aligned) - * @nbytes: Number of bytes to check (normally a multiple of 2) - * Return: true if the checksum matches, false if not - */ -int ip_checksum_ok(const void *addr, unsigned nbytes); - -/* Callbacks */ -rxhand_f *net_get_udp_handler(void); /* Get UDP RX packet handler */ -void net_set_udp_handler(rxhand_f *); /* Set UDP RX packet handler */ -rxhand_f *net_get_arp_handler(void); /* Get ARP RX packet handler */ -void net_set_arp_handler(rxhand_f *); /* Set ARP RX packet handler */ -bool arp_is_waiting(void); /* Waiting for ARP reply? */ -void net_set_icmp_handler(rxhand_icmp_f *f); /* Set ICMP RX handler */ -void net_set_timeout_handler(ulong, thand_f *);/* Set timeout handler */ - -/* Network loop state */ -enum net_loop_state { - NETLOOP_CONTINUE, - NETLOOP_RESTART, - NETLOOP_SUCCESS, - NETLOOP_FAIL -}; -extern enum net_loop_state net_state; - -static inline void net_set_state(enum net_loop_state state) -{ - debug_cond(DEBUG_INT_STATE, "--- NetState set to %d\n", state); - net_state = state; -} - -/* - * net_get_async_tx_pkt_buf - Get a packet buffer that is not in use for - * sending an asynchronous reply - * - * returns - ptr to packet buffer - */ -uchar * net_get_async_tx_pkt_buf(void); - -/* Transmit a packet */ -static inline void net_send_packet(uchar *pkt, int len) -{ - if (DEBUG_NET_PKT_TRACE) - print_hex_dump_bytes("tx: ", DUMP_PREFIX_OFFSET, pkt, len); - /* Currently no way to return errors from eth_send() */ - (void) eth_send(pkt, len); -} - -/** - * net_send_ip_packet() - Transmit "net_tx_packet" as UDP or TCP packet, - * send ARP request if needed (ether will be populated) - * @ether: Raw packet buffer - * @dest: IP address to send the datagram to - * @dport: Destination UDP port - * @sport: Source UDP port - * @payload_len: Length of data after the UDP header - * @action: TCP action to be performed - * @tcp_seq_num: TCP sequence number of this transmission - * @tcp_ack_num: TCP stream acknolegement number - * - * Return: 0 on success, other value on failure - */ -int net_send_ip_packet(uchar *ether, struct in_addr dest, int dport, int sport, - int payload_len, int proto, u8 action, u32 tcp_seq_num, - u32 tcp_ack_num); -/** - * net_send_tcp_packet() - Transmit TCP packet. - * @payload_len: length of payload - * @dport: Destination TCP port - * @sport: Source TCP port - * @action: TCP action to be performed - * @tcp_seq_num: TCP sequence number of this transmission - * @tcp_ack_num: TCP stream acknolegement number - * - * Return: 0 on success, other value on failure - */ -int net_send_tcp_packet(int payload_len, int dport, int sport, u8 action, - u32 tcp_seq_num, u32 tcp_ack_num); -int net_send_udp_packet(uchar *ether, struct in_addr dest, int dport, - int sport, int payload_len); - -/* Processes a received packet */ -void net_process_received_packet(uchar *in_packet, int len); - -#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD) -void nc_start(void); -int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port, - unsigned src_port, unsigned len); -#endif - -static __always_inline int eth_is_on_demand_init(void) -{ -#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD) - extern enum proto_t net_loop_last_protocol; - - return net_loop_last_protocol != NETCONS; -#else - return 1; -#endif -} - -static inline void eth_set_last_protocol(int protocol) -{ -#if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD) - extern enum proto_t net_loop_last_protocol; - - net_loop_last_protocol = protocol; -#endif -} - -/* - * Check if autoload is enabled. If so, use either NFS or TFTP to download - * the boot file. - */ -void net_auto_load(void); - -/* - * The following functions are a bit ugly, but necessary to deal with - * alignment restrictions on ARM. - * - * We're using inline functions, which had the smallest memory - * footprint in our tests. - */ -/* return IP *in network byteorder* */ -static inline struct in_addr net_read_ip(void *from) -{ - struct in_addr ip; - - memcpy((void *)&ip, (void *)from, sizeof(ip)); - return ip; -} - -/* return ulong *in network byteorder* */ -static inline u32 net_read_u32(void *from) -{ - u32 l; - - memcpy((void *)&l, (void *)from, sizeof(l)); - return l; -} - -/* write IP *in network byteorder* */ -static inline void net_write_ip(void *to, struct in_addr ip) -{ - memcpy(to, (void *)&ip, sizeof(ip)); -} - -/* copy IP */ -static inline void net_copy_ip(void *to, void *from) -{ - memcpy((void *)to, from, sizeof(struct in_addr)); -} - -/* copy ulong */ -static inline void net_copy_u32(void *to, void *from) -{ - memcpy((void *)to, (void *)from, sizeof(u32)); -} - -/** - * is_zero_ethaddr - Determine if give Ethernet address is all zeros. - * @addr: Pointer to a six-byte array containing the Ethernet address - * - * Return true if the address is all zeroes. - */ -static inline int is_zero_ethaddr(const u8 *addr) -{ - return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); -} - -/** - * is_multicast_ethaddr - Determine if the Ethernet address is a multicast. - * @addr: Pointer to a six-byte array containing the Ethernet address - * - * Return true if the address is a multicast address. - * By definition the broadcast address is also a multicast address. - */ -static inline int is_multicast_ethaddr(const u8 *addr) -{ - return 0x01 & addr[0]; -} - -/* - * is_broadcast_ethaddr - Determine if the Ethernet address is broadcast - * @addr: Pointer to a six-byte array containing the Ethernet address - * - * Return true if the address is the broadcast address. - */ -static inline int is_broadcast_ethaddr(const u8 *addr) -{ - return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == - 0xff; -} - -/* - * is_valid_ethaddr - Determine if the given Ethernet address is valid - * @addr: Pointer to a six-byte array containing the Ethernet address - * - * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not - * a multicast address, and is not FF:FF:FF:FF:FF:FF. - * - * Return true if the address is valid. - */ -static inline int is_valid_ethaddr(const u8 *addr) -{ - /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to - * explicitly check for it here. */ - return !is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr); -} - -/** - * net_random_ethaddr - Generate software assigned random Ethernet address - * @addr: Pointer to a six-byte array containing the Ethernet address - * - * Generate a random Ethernet address (MAC) that is not multicast - * and has the local assigned bit set. - */ -static inline void net_random_ethaddr(uchar *addr) -{ - int i; - unsigned int seed = get_ticks(); - - for (i = 0; i < 6; i++) - addr[i] = rand_r(&seed); - - addr[0] &= 0xfe; /* clear multicast bit */ - addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ -} - -/** - * string_to_enetaddr() - Parse a MAC address - * - * Convert a string MAC address - * - * Implemented in lib/net_utils.c (built unconditionally) - * - * @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit - * hex value - * @enetaddr: Place to put MAC address (6 bytes) - */ -void string_to_enetaddr(const char *addr, uint8_t *enetaddr); - -/* Convert an IP address to a string */ -void ip_to_string(struct in_addr x, char *s); - -/** - * string_to_ip() - Convert a string to ip address - * - * Implemented in lib/net_utils.c (built unconditionally) - * - * @s: Input string to parse - * @return: in_addr struct containing the parsed IP address - */ -struct in_addr string_to_ip(const char *s); - -/* Convert a VLAN id to a string */ -void vlan_to_string(ushort x, char *s); - -/* Convert a string to a vlan id */ -ushort string_to_vlan(const char *s); - -/* read a VLAN id from an environment variable */ -ushort env_get_vlan(char *); - -/* copy a filename (allow for "..." notation, limit length) */ -void copy_filename(char *dst, const char *src, int size); - -/* check if serverip is specified in filename from the command line */ -int is_serverip_in_cmd(void); - -/** - * net_parse_bootfile - Parse the bootfile env var / cmd line param - * - * @param ipaddr - a pointer to the ipaddr to populate if included in bootfile - * @param filename - a pointer to the string to save the filename part - * @param max_len - The longest - 1 that the filename part can be - * - * return 1 if parsed, 0 if bootfile is empty - */ -int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len); - -/** - * update_tftp - Update firmware over TFTP (via DFU) - * - * This function updates board's firmware via TFTP - * - * @param addr - memory address where data is stored - * @param interface - the DFU medium name - e.g. "mmc" - * @param devstring - the DFU medium number - e.g. "1" - * - * Return: - 0 on success, other value on failure - */ -int update_tftp(ulong addr, char *interface, char *devstring); - -/** - * env_get_ip() - Convert an environment value to to an ip address - * - * @var: Environment variable to convert. The value of this variable must be - * in the format format a.b.c.d, where each value is a decimal number from - * 0 to 255 - * Return: IP address, or 0 if invalid - */ -static inline struct in_addr env_get_ip(char *var) -{ - return string_to_ip(env_get(var)); -} - -/** - * reset_phy() - Reset the Ethernet PHY - * - * This should be implemented by boards if CONFIG_RESET_PHY_R is enabled - */ -void reset_phy(void); - -#if CONFIG_IS_ENABLED(NET) -/** - * eth_set_enable_bootdevs() - Enable or disable binding of Ethernet bootdevs - * - * These get in the way of bootstd testing, so are normally disabled by tests. - * This provide control of this setting. It only affects binding of Ethernet - * devices, so if that has already happened, this flag does nothing. - * - * @enable: true to enable binding of bootdevs when binding new Ethernet - * devices, false to disable it - */ -void eth_set_enable_bootdevs(bool enable); -#else -static inline void eth_set_enable_bootdevs(bool enable) {} -#endif - -/** - * wget_with_dns() - runs dns host IP address resulution before wget - * - * @dst_addr: destination address to download the file - * @uri: uri string of target file of wget - * Return: downloaded file size, negative if failed - */ -int wget_with_dns(ulong dst_addr, char *uri); - -/** - * wget_validate_uri() - varidate the uri - * - * @uri: uri string of target file of wget - * Return: true if uri is valid, false if uri is invalid - */ -bool wget_validate_uri(char *uri); #endif /* __NET_H__ */ From patchwork Thu Oct 3 15:22:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832407 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343509wra; Thu, 3 Oct 2024 08:25:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXSAgMTM8K8/xDqYb4uYh+iIRqOy5GFswNnZr1MWOcenuEgj1WScaUhnfEhe5BevZRD+bbhgw==@linaro.org X-Google-Smtp-Source: AGHT+IHvvbNTuCit5jIH5CaBOyYIxGgWLcDEWVcBSAeh+33AFBXbGF7+494+TGPu08jmjYuKH3Of X-Received: by 2002:a05:6e02:1389:b0:3a1:a243:c7a7 with SMTP id e9e14a558f8ab-3a3659133efmr66443645ab.2.1727969108069; Thu, 03 Oct 2024 08:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969108; cv=none; d=google.com; s=arc-20240605; b=iZZTRl/m04wJO1JjXtLiNbnO8kyEKeQ03od46gY9Ho+DDypxqc0eWPPKzHJkRmQRqW h9B1/kr4BTmBoZpZwHI90JvqY4TZ5ZbsIktY7hJSc1vOdosoneAZTrTZo2xqWzahB2SW QGh+4F5SXGUdrl5tVlw3WuCxUUCM9vLGGh0pciPj/fAvYXhWF30nWGIhWlnOdlcaz3dT lee0nQlZFUhjMI3gGeJ4+gJpMuJTZhtZwcRzeZ3ec1c3Ayo5foa+zVRCUgKpYkuFMX+R IvYnuIJJs4h7Vs9Mwuxh6jP7l1LZvlTfRVaUd+lpJ50NDfhUOWGSvX0zznRwwRbH9bUc 5sfQ== 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=nw/+cdQPG/ROM9iilfJJB8oj5oic8yJ+2SSNidMrUsc=; fh=N71yvI/Nz5UjFUcisPepCeU5xIdAepUnjOJlwzY1wVc=; b=TJyt+xCiTlJ/SDlGfTsRUS8lPeVCWEUgbIm1j+ojE3mBHk51tneluEq2W0STCXSeSJ I6WjSw+Bx3SAJiilUoXiR+VZHkTWrrwAmdoKTw8GbMNCvmkt1IOhCUDj5tAkKIwZMBfr uQORrT+nLdEHaE3ujrxUAUGc7cF2vi4f0gHLiF5MmsEs4Mr5YlutKQXtlFB1U0J6qYvS IsjuE17RIcfOmhQQIMxOYevm+ps3GM/QZ5pGRcotlm4K5SGKEjwawo6/eRBcNMmWQx0L rXKyLA//uCKRcfLsoeRy5vgZSd3xUe/LoJoKzAT8WCQVGWWw/OMNbjf4M+ry3hCxqHig MwtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zdf4OVRh; 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 e9e14a558f8ab-3a371391635si5998205ab.14.2024.10.03.08.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:25:08 -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=zdf4OVRh; 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 BD7D088F3A; Thu, 3 Oct 2024 17:24:22 +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="zdf4OVRh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 72E7D88F07; Thu, 3 Oct 2024 17:24:21 +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-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 81B1688E94 for ; Thu, 3 Oct 2024 17:24:19 +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-x435.google.com with SMTP id ffacd0b85a97d-37cd8972738so858281f8f.3 for ; Thu, 03 Oct 2024 08:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969058; x=1728573858; 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=nw/+cdQPG/ROM9iilfJJB8oj5oic8yJ+2SSNidMrUsc=; b=zdf4OVRhaoVoYKl4EB+cGuF9SN7P3rcd0Rk4BCS3o0J8OJ12gOspQZmwarFVMbgqjg uhu2cpycR7FxTMHoOAt0jMaObJLReeCredGux1fnbTi5tBwz0ta+EWdsRMkOiaY7iatq TanUQjP6EU91wNRfwX1b4c1g4N/QpGlkMdiuXJimFMaSJRNAjCP8LHwGNeKTesuIVZ17 aKCZspuwvCyZOXDnY/Jye1EvRuk7KZeepTDWUMkWt81jqc5DhoMPCZEfoqQ48sW3ZxFi geWGWUBCXFuxiEhvv+JWRccKqfEv7MrvsUb9mqmoTAH/viDSzd+gnWRI+HEppOtjSJHw 9Z4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969058; x=1728573858; 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=nw/+cdQPG/ROM9iilfJJB8oj5oic8yJ+2SSNidMrUsc=; b=BrJQP4XwuefwR5DrJwfGwFPQZcxH3sKTVw34qgBsW6Y7hEqEvIasMhMZdFTeG057qP dcJ4t3Y2DCK7mcUsrz2NJSH+/uwqnkmiZ/PGJLd7rmQlYN4eJIRoA7UPiNRKycR98yUB YjJNhxuS3nJiQNW0FAqfHIDTT1DqIfJwE0I8idC0xCr0noOXcFOkWeAjVkpHLTA1U7Qm /TVNookXYrst1vCBmho3iXHt7rjoATuiV2R8d56p82Wy3ulsSby2AcW3ZioDlMdIAYy9 hO2E3uQNVGdRdgAohMPH64Cdbg7SQov5pN6rRd0x8FPE35FD2yNpY4BW88flL6AuEGvv 1NgQ== X-Gm-Message-State: AOJu0Yx7jq0Tv0FLvfjOBzRkprWhqSnXCCYfAXbXhR0MGDxfNQg5azEb PKIm3Re4Jz2+A0w57gMZSnlCBKQhzcpxqEx8JuwNlFtdSjtpJ1SCHiaqGYXHKkImkGBjZqzKm55 ClJ1EzkiP X-Received: by 2002:a05:6000:a84:b0:374:cd96:f73 with SMTP id ffacd0b85a97d-37cfb8b6405mr3844807f8f.3.1727969058241; Thu, 03 Oct 2024 08:24:18 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:16 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Sean Anderson , Marek Vasut Subject: [PATCH v11 10/29] net: move copy_filename() to new file net/net-common.c Date: Thu, 3 Oct 2024 17:22:56 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 copy_filename() can be useful when NET_LWIP is enabled, therefore move it out of net/net.c which is built only when networking choice is NET. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- net/Makefile | 2 ++ net/net-common.c | 13 +++++++++++++ net/net.c | 12 ------------ 3 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 net/net-common.c diff --git a/net/Makefile b/net/Makefile index 70eec8caf0d..a9cecee637a 100644 --- a/net/Makefile +++ b/net/Makefile @@ -42,3 +42,5 @@ obj-$(CONFIG_CMD_WGET) += wget.o CFLAGS_eth_common.o += -Wno-format-extra-args endif + +obj-y += net-common.o diff --git a/net/net-common.c b/net/net-common.c new file mode 100644 index 00000000000..a7f767d5e9c --- /dev/null +++ b/net/net-common.c @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 + +void copy_filename(char *dst, const char *src, int size) +{ + if (src && *src && (*src == '"')) { + ++src; + --size; + } + + while ((--size > 0) && src && *src && (*src != '"')) + *dst++ = *src++; + *dst = '\0'; +} diff --git a/net/net.c b/net/net.c index 1e0b7c85624..c1d10a77b9e 100644 --- a/net/net.c +++ b/net/net.c @@ -1689,18 +1689,6 @@ void net_set_udp_header(uchar *pkt, struct in_addr dest, int dport, int sport, ip->udp_xsum = 0; } -void copy_filename(char *dst, const char *src, int size) -{ - if (src && *src && (*src == '"')) { - ++src; - --size; - } - - while ((--size > 0) && src && *src && (*src != '"')) - *dst++ = *src++; - *dst = '\0'; -} - int is_serverip_in_cmd(void) { return !!strchr(net_boot_file_name, ':'); From patchwork Thu Oct 3 15:22:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832408 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp343601wra; Thu, 3 Oct 2024 08:25:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWgUPlN+8qhHa471fN5QdhjD5wjHWUnF77M+ExRir3BVlOGfw9iPlbhSSJrmv/EO8FNx+0KoA==@linaro.org X-Google-Smtp-Source: AGHT+IG+2H7PS5ozJHuy5zdmrqcu2gMh650AjahXx5RDPp604a27gOQUyqdFYlksHr70x+lr9lot X-Received: by 2002:a05:6602:1586:b0:82c:fd75:813a with SMTP id ca18e2360f4ac-834d8408f9amr810519839f.1.1727969120252; Thu, 03 Oct 2024 08:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727969120; cv=none; d=google.com; s=arc-20240605; b=FMj08ntjfPCY9pkAyssyQBBW56vrOlQy7fIk3j9AFNuJRm47xKoPMP3gruVFlXkdDq cgNAnqTf7PbRs/l0BAfZdWw41yrUrXmAQhMcS+FIIsyn9NdUCSfdFvkyf97mDgZndpiN gilvRroTC6mUOIE2ZTtHg3z/wnvEGjPuOh1AJfq02UpCc9qO7PmXLCO5bVqZNuz7kEsu rEs+CJ3dFEXZfGz22Z6m13FDlJCnrnkl8zLmTw4XVX5cb/KNg4o2QJ9ZXsf7PnYv+dxU ojg235OsArfJJbD6ZONL94Uah9H+vYR9kcyS9sANP7XYGTZg1Ri0Jsmouw9jvV9y7Cac vf+A== 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=vlz3ngfSd00AiIHBl1lrcajvkbsIxEryhXrcWbIeGOM=; fh=lphk7YaHh21cLnTmMuTi5CNJ8q5UV4RSwyvl1y7dF7w=; b=AtMra8mSvMao8c83j0s5NUkyJzrxqhqB/mirCaiebHXP8E5mGPP5S3G7VEWE3deTkz QHG2puX9YwZgRruGufee7XEnnIGjGGI7WZ8drr1KJn8eTnGCZeJCDzoQNbkkznT9fKmM be0P2fE7PELPM+Agz5ZOigG9FP253mmttjKF0vXVeU3520UdPPOqsAKw1yBJ9KYn5WzT kzJk0asyfhnvczyDt+r6A29B3RWlFdTGV0TGFyqox9clSr8Zn/2tzwjkKB1xu2vH90Wa ppONDQ/xaeEeHlgoReOmL6AdYgK2hY8+STi7C1sbeGd/pmTR3eu8C8c7nwxZJxquAV09 +3Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nr7MaAHN; 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 8926c6da1cb9f-4db559b17b6si746590173.83.2024.10.03.08.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:25:20 -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=nr7MaAHN; 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 23F7188E19; Thu, 3 Oct 2024 17:24:26 +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="nr7MaAHN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 71E3F88641; Thu, 3 Oct 2024 17:24:24 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 E14F488F0A for ; Thu, 3 Oct 2024 17:24:21 +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-x436.google.com with SMTP id ffacd0b85a97d-37cd0b5515fso713955f8f.2 for ; Thu, 03 Oct 2024 08:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727969060; x=1728573860; 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=vlz3ngfSd00AiIHBl1lrcajvkbsIxEryhXrcWbIeGOM=; b=nr7MaAHNZGob6yvWy/0WN+TpSDM3RWix1VRU5i+13W8jTja5Wx7UZ+YH2sCzoplZF9 Wc0oEceINzwwIE6MaXh8LELmZtjsDu6NI1A0axuH7AhQRv6g017E+3Drfu7ZUKhcDOKE GolLZeWoFounuhqwM2i9dVxazHyqS5RMj/qOhvWK78xTpxF1cTC4+asweKDweuRca8O5 X6exeoGKve2HbZ36oIZFDs2YZjucfsStVa0sScND+PvN6PwvZefPxv+8fZAZbHmrL2nB vr2EvYEaKrPl2Rj47GVhZLgsv7nwPI8gS1hEMvcsJqN7mytpYQtxcrTEBRoY8SDutU81 ed5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727969060; x=1728573860; 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=vlz3ngfSd00AiIHBl1lrcajvkbsIxEryhXrcWbIeGOM=; b=i9xpbd3wn58KcLigCORy/Q0pgvnnbI4SGvR16zKU/Pkxd4qmo+7sVv+YesdmU6sUx5 +LoTvcTaRcI2+MJav80QLkoRiaqbRCjbt+k22j21AIx6rCFBs1d9EiQbqBTtvZ4c9uWw 1CbNpZ5beeW/V7eHoswGB98MHtqIg6llB2skhBBkLWBT1VuNU218uXfMDHiRK0LssiqT QIrRel9r2jH5Dj1vigzMUaYBGlcK2eZprCY19GmRwnU+Ww/AXs734SbDoXauXJQvvAIa XkmuJkQs/gq6MjlDTWfUJ0cipuEx+l177aUnm+htsj3C1+qqK1t9FFRYNqHIs9DFbk58 RlPQ== X-Gm-Message-State: AOJu0YzNDgyPZUqQiRdHvCZKvG0DrFWxNi7SpgdnSZlNsVjQDGtAZIgE 3X15087anQUAhHVv0wCN9D6QYAo15vYE1r/oEYTHo60/qXJ3YqzX9kDAR7DTNfZzBSTD3RInSUR 9OObw7rPb X-Received: by 2002:adf:9b96:0:b0:37c:d515:7662 with SMTP id ffacd0b85a97d-37cfb8a5d09mr4387712f8f.1.1727969060048; Thu, 03 Oct 2024 08:24:20 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d081f7482sm1506220f8f.8.2024.10.03.08.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:24:19 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Masahisa Kojima , Simon Glass , Sean Anderson , Marek Vasut , Matthias Schiffer , Fabio Estevam , Michal Simek Subject: [PATCH v11 11/29] net: eth-uclass: add function eth_start_udev() Date: Thu, 3 Oct 2024 17:22:57 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 function to start a given network device, and update eth_init() to use it. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- include/net-common.h | 1 + net/eth-uclass.c | 38 +++++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/include/net-common.h b/include/net-common.h index 543f528a4a4..6bc76658d9d 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -192,6 +192,7 @@ int eth_env_set_enetaddr_by_index(const char *base_name, int index, int usb_ether_init(void); int eth_init(void); /* Initialize the device */ +int eth_start_udev(struct udevice *dev); /* ->start() if not already running */ int eth_send(void *packet, int length); /* Send a packet */ #if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) int eth_receive(void *packet, int length); /* Receive a packet*/ diff --git a/net/eth-uclass.c b/net/eth-uclass.c index e34d7af0229..5555f82f23e 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -284,6 +284,27 @@ static int on_ethaddr(const char *name, const char *value, enum env_op op, } U_BOOT_ENV_CALLBACK(ethaddr, on_ethaddr); +int eth_start_udev(struct udevice *dev) +{ + struct eth_device_priv *priv = dev_get_uclass_priv(dev); + int ret; + + if (priv->running) + return 0; + + if (!device_active(dev)) + return -EINVAL; + + ret = eth_get_ops(dev)->start(dev); + if (ret < 0) + return ret; + + priv->state = ETH_STATE_ACTIVE; + priv->running = true; + + return 0; +} + int eth_init(void) { struct udevice *current = NULL; @@ -328,20 +349,11 @@ int eth_init(void) if (current) { debug("Trying %s\n", current->name); - if (device_active(current)) { - ret = eth_get_ops(current)->start(current); - if (ret >= 0) { - struct eth_device_priv *priv = - dev_get_uclass_priv(current); - - priv->state = ETH_STATE_ACTIVE; - priv->running = true; - ret = 0; - goto end; - } - } else { + ret = eth_start_udev(current); + if (ret < 0) ret = eth_errno; - } + else + break; debug("FAIL\n"); } else { From patchwork Thu Oct 3 15:46:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832411 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp353660wra; Thu, 3 Oct 2024 08:47:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULa+7A3cX/xFJi55Zq3u6/7zcBzxHD9WUqwydPJFgd7tV55C0LUsFSKjK0QQiK+Pbp+f/tZg==@linaro.org X-Google-Smtp-Source: AGHT+IH7uhNO/xV3q25GrHTBQ5/KkOz63dnVhNDdGtZiBTBlt9zhL6iF/ldGxrHEAPtcuwYimMHW X-Received: by 2002:a05:6e02:190a:b0:3a0:8c83:91fb with SMTP id e9e14a558f8ab-3a365964b22mr55000925ab.20.1727970420937; Thu, 03 Oct 2024 08:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970420; cv=none; d=google.com; s=arc-20240605; b=fn8unU9w3dz4/fDYjVa+3YiDdRpZJahWWAfzstdvQSETrAGU6aAVHem8s/x40ilx5A QbiFOelejAiD0/w48LBQyZG8z/TiIl9liKm3hw3OW/VciQGZM/OybmApcPhbmlkmvIUP MYcEZAvhnPu+J8hMSctiCHtWth3+ivCc/qGsdYMGN04ye+xMOPwN52YndLPP3DUhiWVz KPAXYvljFZytRWh9smw6H8Te3ZhXI7xLubXZEUu/uErnMrF28rnoNS8Zdu3ItdDJei9i hwzjcWQ7gXHRgJCu375O7AMB64dQHwmKOcCo8gvGdSy1AJvdfk8z+48iEQY2Dwuz3fPW JMaA== 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=BXwJuHuJkaYwNJp70oZY3Gg3OJCqLeksLoF9BDeEReY=; fh=/dQ2Ocyc8C+xJ/x6jdrpMhexlotUtYif56Iob5opd1E=; b=Stsx8Xj11KVaE+elkLUwyJOBPjaCA+S/Ftg5fG8U1D0vOEanIIrpSUQVAOqbAv+vFg hGceacszNSL3IrCqJQ6xbfdrduo2Wihtw6p6N0c4+m7ZS4l43ImcUAvLJWt3nmDNJiIb iFYMj3GUyvZfwMhBugctrQN/Ms+aMF2DrqqMPxOFRtwCeGD9P8BBDFAxn8GMhiIU2y40 oLBvJUUdVeftfJVlDaUHcMKMTDcQnEa0LyzqHATj4dT4rzJ9SSHfg7M7ArqcRTZ+qkar RrQLv/XRSMGY/eD7nCTpg6AsjiQwW8W2sJdw+5QMUWIqUc/x9HydJzKoALp8IthapmQr A2VA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lSF4h8Kt; 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 e9e14a558f8ab-3a37162d657si6277805ab.144.2024.10.03.08.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:00 -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=lSF4h8Kt; 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 D1AA788B5F; Thu, 3 Oct 2024 17:46: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="lSF4h8Kt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B84988DE9; Thu, 3 Oct 2024 17:46:58 +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 1BEC888A4C for ; Thu, 3 Oct 2024 17:46:56 +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-42cb5b3c57eso10732195e9.2 for ; Thu, 03 Oct 2024 08:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970415; x=1728575215; 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=BXwJuHuJkaYwNJp70oZY3Gg3OJCqLeksLoF9BDeEReY=; b=lSF4h8KtrPZjS4jTqibQczZzqGRxxjpJ/wbx0jbSuCXKv2g291RX99Jm3pbzpr4qfC 6AxDPm6ngT1EW9oogORvRTgKfC9Ywh9mCYgPklkQuuHwYYUEbWwtKVbrbDfse4GNwhpn L0gYyiGvn291GtNUTda5vrObylfDIrTKMaPoXzCKNMjQR5usPd85tL+0lsSRLypv6cAm GGXErhTea40s2PAGkwmBwoIHfpb3DclZgpcylGk8/c5ZUdpB4ytP9h69Xo00BWosCFGb eutaKfI5fHo/3kXexPgqLgXWRsVXnPFydJLAeQpAm/ZCQEv9wQbAWYL1AzV2q/y9HT/A t9IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970415; x=1728575215; 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=BXwJuHuJkaYwNJp70oZY3Gg3OJCqLeksLoF9BDeEReY=; b=fNv4GQ+LpxomU6nkyp/dibWGg3mUbjhviXYpg+2SXU5JYBGMRQPWzQuBvPhNsIyqg4 IMM8ojdC40Ib2CPOcZwF7dAhb08f5k+JSjst8EQXSzIUIJjtdNAReMSQBNU78OeGKumW k0gCmyhL7y6k6O0G7k6X62SyJiKtjdrCqQ6RGoDjOH7BZ/jUh/g+TV3Uimz+D7t7pvQ1 +7rJtlnlOSIr6gSDDTyMRJg/KclmTaVoiXAo02txnKg2DoDAI7fYtEznK9HDv6+iaG8v N4mSjDhJ2+k2LAos2mSwSPAtbQzlpduMM77HThsRkxTiq/gKukyKuF9WlRQvU1Gu/zw+ L5wA== X-Gm-Message-State: AOJu0Yzipxh6pMIV41q2vDmhHuFR07N/SAWMNgmYKjvcLHcD6s29JChl du/Fc1u6NHmJCWZmOE5JW92trFtlQ+7kI0Y1gj/vF7rRfVFTnqIYhXrTOtUeX21iylWv2BYkhaL dgdWo4sRZ X-Received: by 2002:adf:fc49:0:b0:37c:d57d:71cd with SMTP id ffacd0b85a97d-37cfba19a73mr4825780f8f.52.1727970414734; Thu, 03 Oct 2024 08:46:54 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:46:53 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Sughosh Ganu , Sean Anderson Subject: [PATCH v11 12/29] net-lwip: build lwIP Date: Thu, 3 Oct 2024 17:46:16 +0200 Message-Id: <79d104a7ec7a2e0ffabcc477ca33bf6727eba92c.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Build the lwIP library when NET_LWIP is enabled. The following files are adaptation layers written specially for U-Boot: lib/lwip/u-boot/arch/cc.h lib/lwip/u-boot/arch/sys_arch.h (empty) lib/lwip/u-boot/limits.h (empty) lib/lwip/u-boot/lwipopts.h They were initially contributed by Maxim in a previous RFC patch series. Signed-off-by: Jerome Forissier Co-developed-by: Maxim Uvarov Cc: Maxim Uvarov Acked-by: Ilias Apalodimas --- lib/Makefile | 2 + lib/lwip/Makefile | 55 +++++++++++ lib/lwip/u-boot/arch/cc.h | 45 +++++++++ lib/lwip/u-boot/arch/sys_arch.h | 0 lib/lwip/u-boot/limits.h | 0 lib/lwip/u-boot/lwipopts.h | 157 ++++++++++++++++++++++++++++++++ 6 files changed, 259 insertions(+) create mode 100644 lib/lwip/Makefile create mode 100644 lib/lwip/u-boot/arch/cc.h create mode 100644 lib/lwip/u-boot/arch/sys_arch.h create mode 100644 lib/lwip/u-boot/limits.h create mode 100644 lib/lwip/u-boot/lwipopts.h diff --git a/lib/Makefile b/lib/Makefile index d300249f57c..00bfd11002a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -96,6 +96,8 @@ obj-$(CONFIG_LIBAVB) += libavb/ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += libfdt/ obj-$(CONFIG_$(SPL_TPL_)OF_REAL) += fdtdec_common.o fdtdec.o +obj-$(CONFIG_NET_LWIP) += lwip/ + ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16-ccitt.o obj-$(CONFIG_$(SPL_TPL_)HASH) += crc16-ccitt.o diff --git a/lib/lwip/Makefile b/lib/lwip/Makefile new file mode 100644 index 00000000000..dfcd700ca47 --- /dev/null +++ b/lib/lwip/Makefile @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2024 Linaro Ltd. + +obj-y += \ + lwip/src/api/api_lib.o \ + lwip/src/api/api_msg.o \ + lwip/src/api/err.o \ + lwip/src/api/if_api.o \ + lwip/src/api/netbuf.o \ + lwip/src/api/netdb.o \ + lwip/src/api/netifapi.o \ + lwip/src/api/sockets.o \ + lwip/src/api/tcpip.o \ + lwip/src/apps/http/http_client.o \ + lwip/src/apps/tftp/tftp.o \ + lwip/src/core/altcp_alloc.o \ + lwip/src/core/altcp.o \ + lwip/src/core/altcp_tcp.o \ + lwip/src/core/def.o \ + lwip/src/core/dns.o \ + lwip/src/core/inet_chksum.o \ + lwip/src/core/init.o \ + lwip/src/core/ip.o \ + lwip/src/core/ipv4/acd.o \ + lwip/src/core/ipv4/autoip.o \ + lwip/src/core/ipv4/dhcp.o \ + lwip/src/core/ipv4/etharp.o \ + lwip/src/core/ipv4/icmp.o \ + lwip/src/core/ipv4/igmp.o \ + lwip/src/core/ipv4/ip4_addr.o \ + lwip/src/core/ipv4/ip4.o \ + lwip/src/core/ipv4/ip4_frag.o \ + lwip/src/core/ipv6/dhcp6.o \ + lwip/src/core/ipv6/ethip6.o \ + lwip/src/core/ipv6/icmp6.o \ + lwip/src/core/ipv6/inet6.o \ + lwip/src/core/ipv6/ip6_addr.o \ + lwip/src/core/ipv6/ip6.o \ + lwip/src/core/ipv6/ip6_frag.o \ + lwip/src/core/ipv6/mld6.o \ + lwip/src/core/ipv6/nd6.o \ + lwip/src/core/mem.o \ + lwip/src/core/memp.o \ + lwip/src/core/netif.o \ + lwip/src/core/pbuf.o \ + lwip/src/core/raw.o \ + lwip/src/core/stats.o \ + lwip/src/core/sys.o \ + lwip/src/core/tcp.o \ + lwip/src/core/tcp_in.o \ + lwip/src/core/tcp_out.o \ + lwip/src/core/timeouts.o \ + lwip/src/core/udp.o \ + lwip/src/netif/ethernet.o diff --git a/lib/lwip/u-boot/arch/cc.h b/lib/lwip/u-boot/arch/cc.h new file mode 100644 index 00000000000..563d3bfa98b --- /dev/null +++ b/lib/lwip/u-boot/arch/cc.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (C) 2023 Linaro Ltd. */ + +#ifndef LWIP_ARCH_CC_H +#define LWIP_ARCH_CC_H + +#include +#include +#include +#include + +#define LWIP_ERRNO_INCLUDE + +#define LWIP_ERRNO_STDINCLUDE 1 +#define LWIP_NO_UNISTD_H 1 +#define LWIP_TIMEVAL_PRIVATE 1 + +#ifdef CONFIG_LIB_RAND +#define LWIP_RAND() ((u32_t)rand()) +#else +#define LWIP_DNS_SECURE 0 +#endif + +/* different handling for unit test, normally not needed */ +#ifdef LWIP_NOASSERT_ON_ERROR +#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ + handler; }} while (0) +#endif + +#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS + +#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ + x, __LINE__, __FILE__); } while (0) + +#define atoi(str) (int)dectoul(str, NULL) +#define lwip_strnstr(a, b, c) strstr(a, b) + +#define LWIP_ERR_T int +#define LWIP_CONST_CAST(target_type, val) ((target_type)((uintptr_t)val)) + +#if defined(CONFIG_SYS_BIG_ENDIAN) +#define BYTE_ORDER BIG_ENDIAN +#endif + +#endif /* LWIP_ARCH_CC_H */ diff --git a/lib/lwip/u-boot/arch/sys_arch.h b/lib/lwip/u-boot/arch/sys_arch.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/lwip/u-boot/limits.h b/lib/lwip/u-boot/limits.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/lwip/u-boot/lwipopts.h b/lib/lwip/u-boot/lwipopts.h new file mode 100644 index 00000000000..9d618625fac --- /dev/null +++ b/lib/lwip/u-boot/lwipopts.h @@ -0,0 +1,157 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* Copyright (C) 2023 Linaro Ltd. */ + +#ifndef LWIP_UBOOT_LWIPOPTS_H +#define LWIP_UBOOT_LWIPOPTS_H + +#if defined(CONFIG_LWIP_DEBUG) +#define LWIP_DEBUG 1 +#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL +#define LWIP_DBG_TYPES_ON LWIP_DBG_ON +#define ETHARP_DEBUG LWIP_DBG_ON +#define NETIF_DEBUG LWIP_DBG_ON +#define PBUF_DEBUG LWIP_DBG_OFF +#define API_LIB_DEBUG LWIP_DBG_ON +#define API_MSG_DEBUG LWIP_DBG_OFF +#define SOCKETS_DEBUG LWIP_DBG_OFF +#define ICMP_DEBUG LWIP_DBG_OFF +#define IGMP_DEBUG LWIP_DBG_OFF +#define INET_DEBUG LWIP_DBG_OFF +#define IP_DEBUG LWIP_DBG_ON +#define IP_REASS_DEBUG LWIP_DBG_OFF +#define RAW_DEBUG LWIP_DBG_OFF +#define MEM_DEBUG LWIP_DBG_OFF +#define MEMP_DEBUG LWIP_DBG_OFF +#define SYS_DEBUG LWIP_DBG_OFF +#define TIMERS_DEBUG LWIP_DBG_ON +#define TCP_DEBUG LWIP_DBG_OFF +#define TCP_INPUT_DEBUG LWIP_DBG_OFF +#define TCP_FR_DEBUG LWIP_DBG_OFF +#define TCP_RTO_DEBUG LWIP_DBG_OFF +#define TCP_CWND_DEBUG LWIP_DBG_OFF +#define TCP_WND_DEBUG LWIP_DBG_OFF +#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF +#define TCP_RST_DEBUG LWIP_DBG_OFF +#define TCP_QLEN_DEBUG LWIP_DBG_OFF +#define UDP_DEBUG LWIP_DBG_OFF +#define TCPIP_DEBUG LWIP_DBG_OFF +#define SLIP_DEBUG LWIP_DBG_OFF +#define DHCP_DEBUG LWIP_DBG_ON +#define AUTOIP_DEBUG LWIP_DBG_ON +#define DNS_DEBUG LWIP_DBG_ON +#define IP6_DEBUG LWIP_DBG_OFF +#define DHCP6_DEBUG LWIP_DBG_OFF +#endif + +#define LWIP_TESTMODE 0 + +#if !defined(CONFIG_LWIP_ASSERT) +#define LWIP_NOASSERT 1 +#define LWIP_ASSERT(message, assertion) +#endif + +#include "lwip/debug.h" + +#define SYS_LIGHTWEIGHT_PROT 0 +#define NO_SYS 1 + +#define LWIP_IPV4 1 +#define LWIP_IPV6 0 + +#define MEM_ALIGNMENT 8 + +#define MEMP_NUM_TCP_SEG 16 +#define PBUF_POOL_SIZE 8 + +#define LWIP_ARP 1 +#define ARP_TABLE_SIZE 4 +#define ARP_QUEUEING 1 + +#define IP_FORWARD 0 +#define IP_OPTIONS_ALLOWED 1 +#define IP_REASSEMBLY 0 +#define IP_FRAG 0 +#define IP_REASS_MAXAGE 3 +#define IP_REASS_MAX_PBUFS 4 +#define IP_FRAG_USES_STATIC_BUF 0 + +#define IP_DEFAULT_TTL 255 + +#define LWIP_ICMP 0 + +#if defined(CONFIG_PROT_RAW_LWIP) +#define LWIP_RAW 1 +#else +#define LWIP_RAW 0 +#endif + +#if defined(CONFIG_PROT_DHCP_LWIP) +#define LWIP_DHCP 1 +#define LWIP_DHCP_BOOTP_FILE 1 +#else +#define LWIP_DHCP 0 +#endif + +#define LWIP_DHCP_DOES_ACD_CHECK 0 + +#define LWIP_AUTOIP 0 + +#define LWIP_SNMP 0 + +#define LWIP_IGMP 0 + +#if defined(CONFIG_PROT_DNS_LWIP) +#define LWIP_DNS 1 +#define DNS_TABLE_SIZE 1 +#else +#define LWIP_DNS 0 +#endif + +#if defined(CONFIG_PROT_UDP_LWIP) +#define LWIP_UDP 1 +#else +#define LWIP_UDP 0 +#endif + +#if defined(CONFIG_PROT_TCP_LWIP) +#define LWIP_TCP 1 +#define TCP_MSS 1460 +#define TCP_WND CONFIG_LWIP_TCP_WND +#define LWIP_WND_SCALE 1 +#define TCP_RCV_SCALE 0x7 +#define TCP_SND_BUF (2 * TCP_MSS) +#ifdef CONFIG_PROT_TCP_SACK_LWIP +#define LWIP_TCP_SACK_OUT 1 +#endif +#else +#define LWIP_TCP 0 +#endif + +#define LWIP_LISTEN_BACKLOG 0 + +#define PBUF_LINK_HLEN 14 +#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS + 40 + PBUF_LINK_HLEN) + +#define LWIP_HAVE_LOOPIF 0 + +#define LWIP_NETCONN 0 +#define LWIP_DISABLE_MEMP_SANITY_CHECKS 1 + +#define LWIP_SOCKET 0 +#define SO_REUSE 0 + +#define LWIP_STATS 0 + +#define PPP_SUPPORT 0 + +#define LWIP_TCPIP_CORE_LOCKING 0 + +#define LWIP_NETIF_LOOPBACK 0 + +/* use malloc instead of pool */ +#define MEMP_MEM_MALLOC 1 +#define MEMP_MEM_INIT 1 +#define MEM_LIBC_MALLOC 1 + +#endif /* LWIP_UBOOT_LWIPOPTS_H */ From patchwork Thu Oct 3 15:46:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832428 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp366301wra; Thu, 3 Oct 2024 09:11:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXPYDrN6zByGQzeMtF3CZtnAN+0X2FEKyMvLjeN5X+M0dLdIjWbnBTXw19eJ7OegLDJCCx+Zw==@linaro.org X-Google-Smtp-Source: AGHT+IG/TzH/E7T1gz95m6Wg3gyLtsHPJ0EU4rOE+yxk5tvj4Mzxq3OTDOPpLVRiPxOCXlL0hDbk X-Received: by 2002:a05:6602:6d8a:b0:82c:d768:aa4d with SMTP id ca18e2360f4ac-834d843ede4mr572386039f.9.1727971910467; Thu, 03 Oct 2024 09:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727971910; cv=none; d=google.com; s=arc-20240605; b=X6kdl95KpTE6TYD2C9SLQV5tPfgp9A5BH2Imm9RMoSZfFU6pKexAtPpFS0UKOYbs+R yNrBioHR/KAVfb8QR1D0d48lPh2yduOKehj1k4PTEec4itbt4hEFihIxhpvczaxz7my0 9it9U/DZggBNxDCJ/SxKlOzgVS6F4Axp6cVaSYTCEPWNJrxfxKK1wfIfz3VWhD4Wq9Ax CI0GAcl2d2qWGdZM21TPSsMgpQm4URwf7eigxGWeWCBL/4wuKpOJTjy/oyKXtwK1Qjgm CKw3tZzV0yFEswg5gHMUQu3Ia1AzApWDrEivp04TrPuGfE4sDHUh8TKP3elZh3SJqKL8 Hyhg== 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=D6T8MPFWQVifW4AmTfng+k+WEPqiE2ByoBIjEqOxYuo=; fh=JuBK7/3UQrnWyDd8/403jV9wFPTtc1/zztC5iaIv+c8=; b=GFgTWCIzo17YckJZeOJ8LZuaDmJrTYxRkh2obZ7DIJC0btXloH6D3wYChpf2UJnHvY ApaJLd2bc+SVUZiG1RWhzphKHk5TcAnFehp7xx8RN6dNpDHbpzkrry/lzkphGuI43TwD 7Zb2S97lOZOaHf06i+ZZzQ2AXJmUPix6XC8gz2QeXsCuMQE29TbZDQY+QEOTtQ+sUTGi XOurBtswOXZey/V5dAe1g6AZTVgA7LhE63u9wtRqNtn04mBHBXwfNpntamOg0vUz04I/ 5K5O2JAatilf5mLwUvnNfzBdDzxDEqVzhhYn9SKcIngqkHXNb/XglSthkKnc4DM6ivri icXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wPUSRyA+; 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 8926c6da1cb9f-4db55aa4789si718935173.146.2024.10.03.09.11.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 09:11: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=wPUSRyA+; 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 03E6F88ED2; Thu, 3 Oct 2024 18:11: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="wPUSRyA+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2536D882EF; Thu, 3 Oct 2024 17:47:08 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 BC17C88E5F for ; Thu, 3 Oct 2024 17:47:03 +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-x333.google.com with SMTP id 5b1f17b1804b1-42f6bec84b5so11127295e9.1 for ; Thu, 03 Oct 2024 08:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970422; x=1728575222; 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=D6T8MPFWQVifW4AmTfng+k+WEPqiE2ByoBIjEqOxYuo=; b=wPUSRyA+ZmcRhxVciF4KqlJvGu1k41fj6FZ92/XKSBBlVbomBSWXItXDrLHeF9XQ6z JYhNyoCXRO7IZ2rf64yyTTvkkdOdcK8ZDbVHtAK5zT5fK7+E8rfCSM2ZrzFeM6VPd8WZ OjAxXgWiVIcpz7CpjbPWalRBcNJtGBxbuTgjYUP8dM7VX2r4TyZfPHrhO4ZZo89Y2cue UyeDMzDXxvnFWIcOZbdAEVr/2WTm9OBTnGnJpCOMbt81qpY+0O6aS6ki77rJxuBYy0Z4 lvYzoeUuYLfe6wrTZ4fFR4a64evyYdZ/beLTUPRFfl088wkHmHyI6xPg1WF/KEOGkeAn Df2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970422; x=1728575222; 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=D6T8MPFWQVifW4AmTfng+k+WEPqiE2ByoBIjEqOxYuo=; b=bSP/n6eeZgT+aTDoM2c51VS7s2QnTdG6qKnJzsdbBWuRhqXnRHHRerYPuZnamqq1RE AD6LoKQcrOvvCoZxdO5qJL7G4VhLNqZlWOH3jFDmNy4o+PQcC7VHfFq10q5RYKq2zknj bCO95MKrcFXSN6I4EMwM1v2X8qunkU2w4J4cJtqKewFbaKSa2L/uO4lKw8zZq39/UW+M b9bDexXu2dPEcjq9wHp44S1V874uHG8ZISZpLpx2VyK6S8k4/CQZ/ZzRFqipT+b1y4Lx 5FM2R9YOwjGeGa5SEK3X5Iz1YkC1CMp2sJnJ2DaoXc3MO5bPYgziy0gxroE98Vk2A1W1 in+Q== X-Gm-Message-State: AOJu0YwAmcFcw6glnjz3ep+TbP8vzJ2zTk437mIkqCPDNvnl9pdzO82h kONNMT2e+ldpev4d9g5gmvpBs+FUHy9ERliFpegYgUGaV7RbvVTArCQp4jCZAtyPTthIPONhiHv uvdZVunNy X-Received: by 2002:a05:600c:3515:b0:42c:b1e1:a45b with SMTP id 5b1f17b1804b1-42f7c76d5dfmr40532115e9.19.1727970422133; Thu, 03 Oct 2024 08:47:02 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:00 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Manoj Sai , Matteo Lisi , Tom Rini , Gilles Talis , Michal Simek , Marek Vasut , Joe Hershberger , Ramon Fried , Peng Fan , Nishanth Menon , Simon Glass , Sughosh Ganu , Padmarao Begari , Venkatesh Yadav Abbarapu , James Hilliard , Petr Zejdl , Mattijs Korpershoek , Heinrich Schuchardt , AKASHI Takahiro , Francis Laniel , Maxim Moskalets , Sean Anderson , Rasmus Villemoes , Artur Rojek , Janne Grunau , Neal Gompa , Yang Xiwen , Boon Khai Ng , Robert Marko , Philip Oberfichtner , Jonas Karlman , Masahisa Kojima Subject: [PATCH v11 13/29] net-lwip: add DHCP support and dhcp commmand Date: Thu, 3 Oct 2024 17:46:17 +0200 Message-Id: <122c4866fe98a74dc22b18b048b462cb3564c73a.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 03 Oct 2024 18:11:48 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add what it takes to enable NETDEVICES with NET_LWIP and enable DHCP as well as the dhcp command. CMD_TFTPBOOT is selected by BOOTMETH_EFI due to this code having an implicit dependency on do_tftpb(). Note that PXE is likely non-fonctional with NET_LWIP (or at least not 100% functional) because DHCP option 209 is not supported by the lwIP library. Therefore, BOOTP_PXE_DHCP_OPTION cannot be enabled. Signed-off-by: Jerome Forissier Tested-by: Ilias Apalodimas --- board/engicam/imx8mp/icore_mx8mp.c | 2 +- .../imx8mp_debix_model_a.c | 2 +- board/ti/am335x/board.c | 3 +- board/xilinx/common/board.c | 3 +- cmd/Kconfig | 100 +++--- cmd/Makefile | 6 +- cmd/elf.c | 2 +- cmd/net-lwip.c | 13 + common/board_r.c | 4 +- common/usb_kbd.c | 2 +- drivers/net/Kconfig | 2 +- include/net-common.h | 3 + include/net-legacy.h | 3 - include/net-lwip.h | 3 + lib/tiny-printf.c | 3 +- net/Makefile | 14 +- net/lwip/Makefile | 5 + net/lwip/dhcp.c | 127 ++++++++ net/lwip/eth_internal.h | 35 +++ net/lwip/net-lwip.c | 291 ++++++++++++++++++ net/lwip/tftp.c | 11 + 21 files changed, 572 insertions(+), 62 deletions(-) create mode 100644 cmd/net-lwip.c create mode 100644 net/lwip/Makefile create mode 100644 net/lwip/dhcp.c create mode 100644 net/lwip/eth_internal.h create mode 100644 net/lwip/net-lwip.c create mode 100644 net/lwip/tftp.c diff --git a/board/engicam/imx8mp/icore_mx8mp.c b/board/engicam/imx8mp/icore_mx8mp.c index e2ed70caa43..bfdc447c478 100644 --- a/board/engicam/imx8mp/icore_mx8mp.c +++ b/board/engicam/imx8mp/icore_mx8mp.c @@ -33,7 +33,7 @@ static void setup_fec(void) setbits_le32(&gpr->gpr[1], BIT(22)); } -#if CONFIG_IS_ENABLED(NET) +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP) int board_phy_config(struct phy_device *phydev) { if (phydev->drv->config) diff --git a/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c b/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c index 112770ba493..c709d017483 100644 --- a/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c +++ b/board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c @@ -29,7 +29,7 @@ static void setup_fec(void) setbits_le32(&gpr->gpr[1], BIT(22)); } -#if CONFIG_IS_ENABLED(NET) +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP) int board_phy_config(struct phy_device *phydev) { if (phydev->drv->config) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 681002ba1da..249c9fd2e7e 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -900,7 +900,8 @@ int board_late_init(void) #endif /* CPSW plat */ -#if CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL) +#if (CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)) && \ + !CONFIG_IS_ENABLED(OF_CONTROL) struct cpsw_slave_data slave_data[] = { { .slave_reg_ofs = CPSW_SLAVE0_OFFSET, diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 5e5eb49ddf3..b6a2381c909 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -491,7 +491,8 @@ int board_late_init_xilinx(void) ret |= env_set_by_index("uuid", id, uuid); } - if (!CONFIG_IS_ENABLED(NET)) + if (!(CONFIG_IS_ENABLED(NET) || + CONFIG_IS_ENABLED(NET_LWIP))) continue; for (i = 0; i < EEPROM_HDR_NO_OF_MAC_ADDR; i++) { diff --git a/cmd/Kconfig b/cmd/Kconfig index 3beddd72583..d09c237a52f 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1798,12 +1798,16 @@ config CMD_AB_SELECT endmenu -if NET +if NET || NET_LWIP menuconfig CMD_NET bool "Network commands" default y +endif + +if NET + if CMD_NET config CMD_BOOTP @@ -1812,12 +1816,6 @@ config CMD_BOOTP help bootp - boot image via network using BOOTP/TFTP protocol -config CMD_DHCP - bool "dhcp" - depends on CMD_BOOTP - help - Boot image via network using DHCP/TFTP protocol - config CMD_DHCP6 bool "dhcp6" depends on IPV6 @@ -1961,12 +1959,6 @@ config BOOTP_VCI_STRING default "U-Boot.arm" if ARM default "U-Boot" -config CMD_TFTPBOOT - bool "tftpboot" - default y - help - tftpboot - load file via network using TFTP protocol - config CMD_TFTPPUT bool "tftp put" depends on CMD_TFTPBOOT @@ -2026,29 +2018,6 @@ config CMD_WGET wget is a simple command to download kernel, or other files, from a http server over TCP. -config CMD_MII - bool "mii" - imply CMD_MDIO - help - If set, allows 802.3(clause 22) MII Management functions interface access - The management interface specified in Clause 22 provides - a simple, two signal, serial interface to connect a - Station Management entity and a managed PHY for providing access - to management parameters and services. - The interface is referred to as the MII management interface. - -config MII_INIT - bool "Call mii_init() in the mii command" - depends on CMD_MII && (MPC8XX_FEC || FSLDMAFE || MCFFEC) - -config CMD_MDIO - bool "mdio" - depends on PHYLIB - help - If set, allows Enable 802.3(clause 45) MDIO interface registers access - The MDIO interface is orthogonal to the MII interface and extends - it by adding access to more registers through indirect addressing. - config CMD_PING bool "ping" help @@ -2097,7 +2066,7 @@ config IPV6_ROUTER_DISCOVERY help Will automatically perform router solicitation on first IPv6 network operation -endif +endif # if CMD_NET config CMD_ETHSW bool "ethsw" @@ -2107,6 +2076,56 @@ config CMD_ETHSW operations such as enabling / disabling a port and viewing/maintaining the filtering database (FDB) +config CMD_WOL + bool "wol" + help + Wait for wake-on-lan Magic Packet + +endif # if NET + +if NET || NET_LWIP + +if CMD_NET + +config CMD_DHCP + bool "dhcp" + select PROT_DHCP_LWIP if NET_LWIP + help + Boot image via network using DHCP/TFTP protocol + +config CMD_MII + bool "mii" + imply CMD_MDIO + help + If set, allows 802.3(clause 22) MII Management functions interface access + The management interface specified in Clause 22 provides + a simple, two signal, serial interface to connect a + Station Management entity and a managed PHY for providing access + to management parameters and services. + The interface is referred to as the MII management interface. + +config MII_INIT + bool "Call mii_init() in the mii command" + depends on CMD_MII && (MPC8XX_FEC || FSLDMAFE || MCFFEC) + +config CMD_MDIO + bool "mdio" + depends on PHYLIB + help + If set, allows Enable 802.3(clause 45) MDIO interface registers access + The MDIO interface is orthogonal to the MII interface and extends + it by adding access to more registers through indirect addressing. + +config CMD_TFTPBOOT + bool "tftp" + select PROT_UDP_LWIP if NET_LWIP + default n + help + tftpboot - load file via network using TFTP protocol + Currently a placeholder (not implemented) when NET_LWIP=y. + +endif # if CMD_NET + config CMD_PXE bool "pxe" select PXE_UTILS @@ -2114,12 +2133,7 @@ config CMD_PXE help Boot image via network using PXE protocol -config CMD_WOL - bool "wol" - help - Wait for wake-on-lan Magic Packet - -endif +endif # if NET || NET_LWIP menu "Misc commands" diff --git a/cmd/Makefile b/cmd/Makefile index 91227f1249c..1c8cc42503d 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -127,7 +127,11 @@ obj-y += legacy-mtd-utils.o endif obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o -obj-$(CONFIG_CMD_NET) += net.o +ifdef CONFIG_CMD_NET +obj-$(CONFIG_NET) += net.o +obj-$(CONFIG_NET_LWIP) += net-lwip.o +CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o obj-$(CONFIG_CMD_ONENAND) += onenand.o diff --git a/cmd/elf.c b/cmd/elf.c index f07e344a596..e4c68744d5f 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -130,7 +130,7 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) else addr = hextoul(argv[1], NULL); -#if defined(CONFIG_CMD_NET) +#if defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_LWIP) /* * Check to see if we need to tftp the image ourselves * before starting diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c new file mode 100644 index 00000000000..82edb5fd2e6 --- /dev/null +++ b/cmd/net-lwip.c @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 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 diff --git a/common/board_r.c b/common/board_r.c index 4faaa202421..49347370a1f 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -472,7 +472,7 @@ static int initr_status_led(void) } #endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET) static int initr_net(void) { puts("Net: "); @@ -738,7 +738,7 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_PCI_ENDPOINT pci_ep_init, #endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET) INIT_FUNC_WATCHDOG_RESET initr_net, #endif diff --git a/common/usb_kbd.c b/common/usb_kbd.c index bbfee23bc26..36107a3b278 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -423,7 +423,7 @@ static int usb_kbd_testc(struct stdio_dev *sdev) */ unsigned long poll_delay = CONFIG_SYS_HZ / 50; -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_LWIP) /* * If net_busy_flag is 1, NET transfer is running, * then we check key-pressed every second (first check may be diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 9c042808b44..25084b4103d 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -97,7 +97,7 @@ config DSA_SANDBOX menuconfig NETDEVICES bool "Network device support" - depends on NET + depends on NET || NET_LWIP select DM_ETH help You must select Y to enable any network device support diff --git a/include/net-common.h b/include/net-common.h index 6bc76658d9d..cbcac178c82 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -118,6 +118,9 @@ extern int net_restart_wrap; /* Tried all network devices */ extern uchar *net_rx_packets[PKTBUFSRX]; /* Receive packets */ extern const u8 net_bcast_ethaddr[ARP_HLEN]; /* Ethernet broadcast address */ extern char net_boot_file_name[1024];/* Boot File name */ +extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */ +/* Indicates whether the pxe path prefix / config file was specified in dhcp option */ +extern char *pxelinux_configfile; /** * compute_ip_checksum() - Compute IP checksum diff --git a/include/net-legacy.h b/include/net-legacy.h index 19c991e12f6..bdca904a0f8 100644 --- a/include/net-legacy.h +++ b/include/net-legacy.h @@ -285,12 +285,9 @@ extern char net_hostname[32]; /* Our hostname */ #ifdef CONFIG_NET extern char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN]; /* Our root path */ #endif -/* Indicates whether the pxe path prefix / config file was specified in dhcp option */ -extern char *pxelinux_configfile; /** END OF BOOTP EXTENTIONS **/ extern u8 net_ethaddr[ARP_HLEN]; /* Our ethernet address */ extern u8 net_server_ethaddr[ARP_HLEN]; /* Boot server enet address */ -extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */ extern struct in_addr net_server_ip; /* Server IP addr (0 = unknown) */ extern uchar *net_tx_packet; /* THE transmit packet */ extern uchar *net_rx_packets[PKTBUFSRX]; /* Receive packets */ diff --git a/include/net-lwip.h b/include/net-lwip.h index 5c3f9e7e86c..cfd06726577 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -10,5 +10,8 @@ struct netif *net_lwip_new_netif(struct udevice *udev); 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 do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); #endif /* __NET_LWIP_H__ */ diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index 9a70c6095b3..f6727360097 100644 --- a/lib/tiny-printf.c +++ b/lib/tiny-printf.c @@ -269,7 +269,8 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va) } break; case 'p': - if (CONFIG_IS_ENABLED(NET) || _DEBUG) { + if (CONFIG_IS_ENABLED(NET) || + CONFIG_IS_ENABLED(NET_LWIP) || _DEBUG) { pointer(info, fmt, va_arg(va, void *)); /* * Skip this because it pulls in _ctype which is diff --git a/net/Makefile b/net/Makefile index a9cecee637a..68370595a8e 100644 --- a/net/Makefile +++ b/net/Makefile @@ -12,11 +12,6 @@ obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_DM_DSA) += dsa-uclass.o -obj-$(CONFIG_$(SPL_)DM_ETH) += eth-uclass.o -obj-$(CONFIG_$(SPL_TPL_)BOOTDEV_ETH) += eth_bootdev.o -obj-$(CONFIG_DM_MDIO) += mdio-uclass.o -obj-$(CONFIG_DM_MDIO_MUX) += mdio-mux-uclass.o -obj-$(CONFIG_$(SPL_)DM_ETH) += eth_common.o obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o obj-$(CONFIG_IPV6) += ndisc.o obj-$(CONFIG_$(SPL_)DM_ETH) += net.o @@ -43,4 +38,13 @@ CFLAGS_eth_common.o += -Wno-format-extra-args endif +ifeq ($(filter y,$(CONFIG_NET) $(CONFIG_NET_LWIP)),y) +obj-$(CONFIG_$(SPL_TPL_)BOOTDEV_ETH) += eth_bootdev.o +obj-$(CONFIG_DM_MDIO) += mdio-uclass.o +obj-$(CONFIG_DM_MDIO_MUX) += mdio-mux-uclass.o +obj-$(CONFIG_$(SPL_)DM_ETH) += eth-uclass.o +obj-$(CONFIG_$(SPL_)DM_ETH) += eth_common.o obj-y += net-common.o +endif + +obj-$(CONFIG_NET_LWIP) += lwip/ diff --git a/net/lwip/Makefile b/net/lwip/Makefile new file mode 100644 index 00000000000..4e92a101ddb --- /dev/null +++ b/net/lwip/Makefile @@ -0,0 +1,5 @@ +ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot + +obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o +obj-$(CONFIG_CMD_DHCP) += dhcp.o +obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c new file mode 100644 index 00000000000..be458d554cb --- /dev/null +++ b/net/lwip/dhcp.c @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DHCP_TIMEOUT_MS 10000 + +#ifdef CONFIG_CMD_TFTPBOOT +/* Boot file obtained from DHCP (if present) */ +static char boot_file_name[DHCP_BOOT_FILE_LEN]; +#endif + +static void call_lwip_dhcp_fine_tmr(void *ctx) +{ + dhcp_fine_tmr(); + sys_timeout(10, call_lwip_dhcp_fine_tmr, NULL); +} + +static int dhcp_loop(struct udevice *udev) +{ + char *ipstr = "ipaddr\0\0"; + char *maskstr = "netmask\0\0"; + char *gwstr = "gatewayip\0\0"; + unsigned long start; + struct netif *netif; + struct dhcp *dhcp; + bool bound; + int idx; + + idx = dev_seq(udev); + if (idx < 0 || idx > 99) { + log_err("unexpected idx %d\n", idx); + return CMD_RET_FAILURE; + } + + netif = net_lwip_new_netif_noip(udev); + if (!netif) + return CMD_RET_FAILURE; + + start = get_timer(0); + dhcp_start(netif); + call_lwip_dhcp_fine_tmr(NULL); + + /* Wait for DHCP to complete */ + do { + net_lwip_rx(udev, netif); + sys_check_timeouts(); + bound = dhcp_supplied_address(netif); + if (bound) + break; + if (ctrlc()) { + printf("Abort\n"); + break; + } + mdelay(1); + } while (get_timer(start) < DHCP_TIMEOUT_MS); + + sys_untimeout(call_lwip_dhcp_fine_tmr, NULL); + + if (!bound) { + net_lwip_remove_netif(netif); + return CMD_RET_FAILURE; + } + + dhcp = netif_dhcp_data(netif); + + env_set("bootfile", dhcp->boot_file_name); + + if (idx > 0) { + sprintf(ipstr, "ipaddr%d", idx); + sprintf(maskstr, "netmask%d", idx); + sprintf(gwstr, "gatewayip%d", idx); + } else { + net_ip.s_addr = dhcp->offered_ip_addr.addr; + } + + env_set(ipstr, ip4addr_ntoa(&dhcp->offered_ip_addr)); + env_set(maskstr, ip4addr_ntoa(&dhcp->offered_sn_mask)); + env_set("serverip", ip4addr_ntoa(&dhcp->server_ip_addr)); + if (dhcp->offered_gw_addr.addr != 0) + env_set(gwstr, ip4addr_ntoa(&dhcp->offered_gw_addr)); + +#ifdef CONFIG_PROT_DNS_LWIP + env_set("dnsip", ip4addr_ntoa(dns_getserver(0))); + env_set("dnsip2", ip4addr_ntoa(dns_getserver(1))); +#endif +#ifdef CONFIG_CMD_TFTPBOOT + if (dhcp->boot_file_name[0] != '\0') + strncpy(boot_file_name, dhcp->boot_file_name, + sizeof(boot_file_name)); +#endif + + printf("DHCP client bound to address %pI4 (%lu ms)\n", + &dhcp->offered_ip_addr, get_timer(start)); + + net_lwip_remove_netif(netif); + return CMD_RET_SUCCESS; +} + +int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + eth_set_current(); + + return dhcp_loop(eth_get_dev()); +} + +int dhcp_run(ulong addr, const char *fname, bool autoload) +{ + char *dhcp_argv[] = {"dhcp", NULL, }; + struct cmd_tbl cmdtp = {}; /* dummy */ + + if (autoload) { + /* Will be supported when TFTP is added */ + return -EOPNOTSUPP; + } + + return do_dhcp(&cmdtp, 0, 1, dhcp_argv); +} diff --git a/net/lwip/eth_internal.h b/net/lwip/eth_internal.h new file mode 100644 index 00000000000..0b829a8d388 --- /dev/null +++ b/net/lwip/eth_internal.h @@ -0,0 +1,35 @@ +/* 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 diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c new file mode 100644 index 00000000000..ca5426d058b --- /dev/null +++ b/net/lwip/net-lwip.c @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* Copyright (C) 2024 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* xx:xx:xx:xx:xx:xx\0 */ +#define MAC_ADDR_STRLEN 18 + +#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +void (*push_packet)(void *, int len) = 0; +#endif +int net_restart_wrap; +static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]; +uchar *net_rx_packets[PKTBUFSRX]; +uchar *net_rx_packet; +const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +char *pxelinux_configfile; +/* Our IP addr (0 = unknown) */ +struct in_addr net_ip; + +static err_t linkoutput(struct netif *netif, struct pbuf *p) +{ + struct udevice *udev = netif->state; + void *pp = NULL; + int err; + + if ((unsigned long)p->payload % PKTALIGN) { + /* + * Some net drivers have strict alignment requirements and may + * fail or output invalid data if the packet is not aligned. + */ + pp = memalign(PKTALIGN, p->len); + if (!pp) + return ERR_ABRT; + memcpy(pp, p->payload, p->len); + } + + err = eth_get_ops(udev)->send(udev, pp ? pp : p->payload, p->len); + free(pp); + if (err) { + log_err("send error %d\n", err); + return ERR_ABRT; + } + + return ERR_OK; +} + +static err_t net_lwip_if_init(struct netif *netif) +{ +#if LWIP_IPV4 + netif->output = etharp_output; +#endif + netif->linkoutput = linkoutput; + netif->mtu = 1500; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; + + return ERR_OK; +} + +static void eth_init_rings(void) +{ + int i; + + for (i = 0; i < PKTBUFSRX; i++) + net_rx_packets[i] = net_pkt_buf + i * PKTSIZE_ALIGN; +} + +struct netif *net_lwip_get_netif(void) +{ + struct netif *netif, *found = NULL; + + NETIF_FOREACH(netif) { + if (!found) + found = netif; + else + printf("Error: more than one netif in lwIP\n"); + } + return found; +} + +static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip, + ip4_addr_t *mask, ip4_addr_t *gw) +{ + char *ipstr = "ipaddr\0\0"; + char *maskstr = "netmask\0\0"; + char *gwstr = "gatewayip\0\0"; + int idx = dev_seq(dev); + char *env; + + if (idx < 0 || idx > 99) { + log_err("unexpected idx %d\n", idx); + return -1; + } + + if (idx) { + sprintf(ipstr, "ipaddr%d", idx); + sprintf(maskstr, "netmask%d", idx); + sprintf(gwstr, "gatewayip%d", idx); + } + + ip4_addr_set_zero(ip); + ip4_addr_set_zero(mask); + ip4_addr_set_zero(gw); + + env = env_get(ipstr); + if (env) + ip4addr_aton(env, ip); + + env = env_get(maskstr); + if (env) + ip4addr_aton(env, mask); + + env = env_get(gwstr); + if (env) + ip4addr_aton(env, gw); + + return 0; +} + +static struct netif *new_netif(struct udevice *udev, bool with_ip) +{ + unsigned char enetaddr[ARP_HLEN]; + char hwstr[MAC_ADDR_STRLEN]; + ip4_addr_t ip, mask, gw; + struct netif *netif; + int ret = 0; + static bool first_call = true; + + if (!udev) + return NULL; + + if (first_call) { + eth_init_rings(); + /* Pick a valid active device, if any */ + eth_init(); + lwip_init(); + first_call = false; + } + + if (eth_start_udev(udev) < 0) { + log_err("Could not start %s\n", udev->name); + return NULL; + } + + netif_remove(net_lwip_get_netif()); + + ip4_addr_set_zero(&ip); + ip4_addr_set_zero(&mask); + ip4_addr_set_zero(&gw); + + if (with_ip) + if (get_udev_ipv4_info(udev, &ip, &mask, &gw) < 0) + return NULL; + + eth_env_get_enetaddr_by_index("eth", dev_seq(udev), enetaddr); + ret = snprintf(hwstr, MAC_ADDR_STRLEN, "%pM", enetaddr); + if (ret < 0 || ret >= MAC_ADDR_STRLEN) + return NULL; + + netif = calloc(1, sizeof(struct netif)); + if (!netif) + return NULL; + + netif->name[0] = 'e'; + netif->name[1] = 't'; + + string_to_enetaddr(hwstr, netif->hwaddr); + netif->hwaddr_len = ETHARP_HWADDR_LEN; + debug("adding lwIP netif for %s with hwaddr:%s ip:%s ", udev->name, + hwstr, ip4addr_ntoa(&ip)); + debug("mask:%s ", ip4addr_ntoa(&mask)); + debug("gw:%s\n", ip4addr_ntoa(&gw)); + + if (!netif_add(netif, &ip, &mask, &gw, udev, net_lwip_if_init, + netif_input)) { + printf("error: netif_add() failed\n"); + free(netif); + return NULL; + } + + netif_set_up(netif); + netif_set_link_up(netif); + /* Routing: use this interface to reach the default gateway */ + netif_set_default(netif); + + return netif; +} + +struct netif *net_lwip_new_netif(struct udevice *udev) +{ + return new_netif(udev, true); +} + +struct netif *net_lwip_new_netif_noip(struct udevice *udev) +{ + + return new_netif(udev, false); +} + +void net_lwip_remove_netif(struct netif *netif) +{ + netif_remove(netif); + free(netif); +} + +int net_init(void) +{ + eth_set_current(); + + net_lwip_new_netif(eth_get_dev()); + + return 0; +} + +static struct pbuf *alloc_pbuf_and_copy(uchar *data, int len) +{ + struct pbuf *p, *q; + + /* We allocate a pbuf chain of pbufs from the pool. */ + p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL); + if (!p) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + return NULL; + } + + for (q = p; q != NULL; q = q->next) { + memcpy(q->payload, data, q->len); + data += q->len; + } + + LINK_STATS_INC(link.recv); + + return p; +} + +int net_lwip_rx(struct udevice *udev, struct netif *netif) +{ + struct pbuf *pbuf; + uchar *packet; + int flags; + int len; + int i; + + if (!eth_is_active(udev)) + return -EINVAL; + + flags = ETH_RECV_CHECK_DEVICE; + for (i = 0; i < ETH_PACKETS_BATCH_RECV; i++) { + len = eth_get_ops(udev)->recv(udev, flags, &packet); + flags = 0; + + if (len > 0) { + pbuf = alloc_pbuf_and_copy(packet, len); + if (pbuf) + netif->input(pbuf, netif); + } + if (len >= 0 && eth_get_ops(udev)->free_pkt) + eth_get_ops(udev)->free_pkt(udev, packet, len); + if (len <= 0) + break; + } + if (len == -EAGAIN) + len = 0; + + return len; +} + +void net_process_received_packet(uchar *in_packet, int len) +{ +#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) + if (push_packet) + (*push_packet)(in_packet, len); +#endif +} + +u32_t sys_now(void) +{ + return get_timer(0); +} diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c new file mode 100644 index 00000000000..1fa246f55d9 --- /dev/null +++ b/net/lwip/tftp.c @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include +#include + +int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + /* Not implemented */ + return CMD_RET_FAILURE; +} From patchwork Thu Oct 3 15:46:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832412 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp353717wra; Thu, 3 Oct 2024 08:47:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX2jMZWBGI8xtAmZM8S1wgiHnR+mvfcZ9FzaUvPvEbfjXkWs1wGrdjvVR1IjiyyE2FpVK0+Mw==@linaro.org X-Google-Smtp-Source: AGHT+IEtGjAx2mwvWaufkGE/M2EwUrFMoPRjgVwX4XWLqWc4LI5d+BzAV5aRew7ipGVh7Wi5mFnL X-Received: by 2002:a05:6602:340d:b0:82c:d843:edcc with SMTP id ca18e2360f4ac-834d8518081mr664150939f.11.1727970430747; Thu, 03 Oct 2024 08:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970430; cv=none; d=google.com; s=arc-20240605; b=WusdEmWUZ00Rw9Sj5L19XQVCldgDI2lQhq51LUQrmcMuSLRk/cL1oXwHpCbtixTXEC BKWmwCGRAuol2JFsFBRd9XWm78R8N0aZwYUAjb65BR0N93aSwNXeUrOcfK3Fd5rYgr8J DRmP3TBtSI/dHb5gG/AzzdLkp4y0RbrlcUKIXOJTBsrTvlbcT0bGSCyfof7fpy+cdoRP uuF40FM/2IlDqCvzsKAcmRTptX6F+PF1pimv3XbZVwfHORRjisL0eUliFiuVsSC1BUsa QaNzL38KvO0k6xwXlNsiRjhmQFHo3mQfYjuk13wrJ6KoCfbCgMrWJxkgsu+G1W+Jl+MR h3Cw== 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=wj69R6ikNoWeeLXnoHmRr+jR91T4/HWFHpytBi3xnWU=; fh=ThdVVZAeTRhYRIsitiRafY870JZ08RRoQKK9619Vak0=; b=On39KJBpslDvuzeSv5m6ydMV+M3ztvH8AckhfNE/I7yQrxHsL/phnAR64tqbpB1Y41 /bP+ZRTFpPyd+GzgISW7b+7sGg/ZbrKc4dqp6/0ZigQCWzM34Im6pJrdXhVPIiRaA7Uq xdvHzlqIb7Cawpz8ukaugLZUItHc1RMS5cdQWgWBLiqRIQ7opO+Dd675PNeePFJm7+s9 4IJAzzbhEb3vUXmO2yIWywn5QhDeGohZwf5AkSN/xD1wE12UfY3Ns3zG/JPp+cE5+Jtr lZu23+jRY6I5eGDLINe4EQ97qD1WObZNh/FhJ452nQclOOPGIcCN+0/nOj94g6nSyap5 MAOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xRLOKtI7; 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 ca18e2360f4ac-834efe3bff6si69781139f.90.2024.10.03.08.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:10 -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=xRLOKtI7; 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 40619884DB; Thu, 3 Oct 2024 17:47:09 +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="xRLOKtI7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F88487FED; Thu, 3 Oct 2024 17:47:08 +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-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 8B4C288E3F for ; Thu, 3 Oct 2024 17:47:05 +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-x434.google.com with SMTP id ffacd0b85a97d-37ce18b042fso895452f8f.1 for ; Thu, 03 Oct 2024 08:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970424; x=1728575224; 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=wj69R6ikNoWeeLXnoHmRr+jR91T4/HWFHpytBi3xnWU=; b=xRLOKtI7cVGwe6nnE5tty4sTG8JmMgti3zSDIAxagzr1lBZ6NCMlRCNRtA4PE3XMxW YXCV1M0KD+h3l/mFZQBRwfdk88EhtxTPfe5aYgPCP43VdK2OVc4hRsP1pvqz8IGOAb8s ixnXXnqx4D0PfAuctsKz78mbUsIz2z+WJuY0uApMI3Dz4Ftx9LQX/y+i0ubGiNyRluF8 G1HEBmTC6AZRUhXyaeivMwUwpRISM41H1J9ijX95AiRWix1YSQn5JABp5otDMT4Dywjk 7ABvHFYXX1/w49KgaBbhp01TgOKoKT9AauI//o/m000aZ4uQUzL4EzEIzRAali3nXB3u zpRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970424; x=1728575224; 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=wj69R6ikNoWeeLXnoHmRr+jR91T4/HWFHpytBi3xnWU=; b=nwU6+qfWlWcuA0g7OTBvNVI0sKiAIkLO5dgg43bqNRVr8lPto4ToFMJFTzm9B11dN3 310En4J7y1uTyKyPwmKQMgjSP9WZitQ9qdYCCANRg05hLNdd4AipjthZ+BNz5ADsMHBG dlga8+TtlRw+HwlnYXlCzY4XOJKB+pTJVKpc30YqPZn1Z2oZJEYyj/oE16Hf9W09/YzI 4Vq20Tu8IMpaZuxDjFGkTf0WuEgRCQOOMVC+dcCIFe1Mzp0uZUTpbviv3fxMa5+wL3KI aQVWcGmSeGsylJjgF6TrNLqASnlqaTp0iFB9edEzbs3GDD0RTwGtI/qlpzB4QSMRJJfA Rzmg== X-Gm-Message-State: AOJu0Yzhr0M8Lan7q4wpnL930MciCgvbWA3uglTVCiDB5OiReq5/ozFP l6CCMOg3kr/VHLPsaTnZ8ReAlq7u3NGulqoN9oTBlXgLeVIoaUn7Ln3JOQbkDJPTNGi5vPHUHYS f0M9uupDd X-Received: by 2002:a5d:464f:0:b0:37c:d23f:e464 with SMTP id ffacd0b85a97d-37cfba0694fmr4393669f8f.38.1727970424248; Thu, 03 Oct 2024 08:47:04 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:02 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini Subject: [PATCH v11 14/29] lwip: tftp: bind to TFTP port only when in server mode Date: Thu, 3 Oct 2024 17:46:18 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 TFTP app should not bind to the TFTP server port when configured as a client. Instead, the local port should be chosen from the dynamic range (49152 ~ 65535) so that if the application is stopped and started again, the remote server will not consider the new packets as part of the same context (which would cause an error since a new RRQ would be unexpected). Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- lib/lwip/lwip/src/apps/tftp/tftp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/lwip/lwip/src/apps/tftp/tftp.c b/lib/lwip/lwip/src/apps/tftp/tftp.c index ddfdbfc0c1b..74fc1fbe586 100644 --- a/lib/lwip/lwip/src/apps/tftp/tftp.c +++ b/lib/lwip/lwip/src/apps/tftp/tftp.c @@ -454,10 +454,12 @@ tftp_init_common(u8_t mode, const struct tftp_context *ctx) return ERR_MEM; } - ret = udp_bind(pcb, IP_ANY_TYPE, TFTP_PORT); - if (ret != ERR_OK) { - udp_remove(pcb); - return ret; + if (mode == LWIP_TFTP_MODE_SERVER) { + ret = udp_bind(pcb, IP_ANY_TYPE, TFTP_PORT); + if (ret != ERR_OK) { + udp_remove(pcb); + return ret; + } } tftp_state.handle = NULL; From patchwork Thu Oct 3 15:46:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832413 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp353818wra; Thu, 3 Oct 2024 08:47:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWoL89wumPK6NBKHaoqKQ8SLvVUa9vngtCoaZhsm7skSecaIAEWyAHNahYtgajXmN732rLd3g==@linaro.org X-Google-Smtp-Source: AGHT+IEIJCELd/NSi20ehTh6I4bJd6WUzBQMQBCKcoy5idUr4u1L69gz2y7zfSjZn/HDiADzQzfL X-Received: by 2002:a05:6602:6301:b0:834:f671:4a89 with SMTP id ca18e2360f4ac-834f6714adfmr40696339f.14.1727970443605; Thu, 03 Oct 2024 08:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970443; cv=none; d=google.com; s=arc-20240605; b=ld112UcypEJ2LcOgFo5Ynxy3QooTEHeT05sQ0x3ca5a9nJo4QqnpKa//mYQKYbX7O9 UzWElVCWJBH+uozfbALGIHF4wkdLWilTGydeHE3RdqSbucjmzzMw6Wbn3lfL7+OotpZw autKsisMd2jffD8rmGaqJJgXYaCxAiNlfnnpVlNn2sJPg/sWojB4SApmWvTPjRL7IDK7 ydJCosvI0lK2GJ4LGs0liQzQcGkBEoCYGRWzWS+RsacauOwIFdbx3LG7AZ18mtTTyvAO PoXYOodOeTv8KXjz0UMcb0Yi+UElJnV6DpIErnF23qHFOuqQ1+m4tqCPB/KhAUbJHaYN +rvw== 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=WfZkN40BGwrsplDkoL4zYsrJ+IyWbxoUOxHvT2T1WTI=; fh=FgCRIYvJkZ/iM2xzhuY4c3H5B93+cF0V7SXi5repgig=; b=ary+SMpFuoFCCIl7czfId7jq3Bpkw4bDgFM683pZq+1IaVnsSlnGlWE/ZSmwD5PLKX lOepe0xEC6KblgXoUrNH1AplVciWpFXEQvXbK6m3qcYMFmpIqzKvtpewPWI7pQNVuS5w yLxuoaM1gzUakEJlnLduIZzBh5lBjF4s8ZBoMokiErcD2xmR9c1mtu0XSoMwPpnijwdt lsixH0SegeG9Gs6mhRTKaCV5f42U5BzyPBQ1cl5f8Kg/BsgqwNnL+LIS1mHaTe7XTOhu Fro1xTrbILUfjjO23r4tFfDQr1JMoiBV6rbYXq0c5kFeov50f0owu2nlIqP8kChYpmcT 71sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d/esfZvT"; 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 8926c6da1cb9f-4db55a630c3si868441173.106.2024.10.03.08.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:23 -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="d/esfZvT"; 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 C997E88E4A; Thu, 3 Oct 2024 17:47:12 +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="d/esfZvT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2F608843A; Thu, 3 Oct 2024 17:47:11 +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-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 BB24288E5A for ; Thu, 3 Oct 2024 17:47:09 +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-x329.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso9378375e9.1 for ; Thu, 03 Oct 2024 08:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970428; x=1728575228; 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=WfZkN40BGwrsplDkoL4zYsrJ+IyWbxoUOxHvT2T1WTI=; b=d/esfZvTcPD9ezFy7YdSAyO7Wsb8qpTTvbCZ5GcJ8G7VUNNFE185SVl39uzn2izvhJ k2Di1qA3eEv6bsuXUPyxCyG8qaouTrwy2Ac6BLH1I4Ki9LbL3ugxDtq38QzVNHRIjpFJ Wp/29sW7PdsZkmPXMbDMI4iggzKIG7xo+nQXXLTbQLK7rjOIg7WsO646ZEI4wjaizLgw Zqpu6gn/dDLttXzFBb7Os5p5boUhkK9ya0g/IAtXh839xn/T9MCMeSbXZmi1X002ySbA 774AaDSLxjngN0vzR/Z6perRJMCMhx8qFklATGetK5TdNHP27qORv5615thONyMsdJMv SMOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970428; x=1728575228; 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=WfZkN40BGwrsplDkoL4zYsrJ+IyWbxoUOxHvT2T1WTI=; b=axwB99e8ee6uhiArLxK9OteD+GmdJKzg8lfrYcJ2+wuimHfWpapXpo1NumaFmVw8fx I9iWsUfEk63qbOlw1ZyIIM8Djg3PGcansKHn1u6EzWvJDEZowxbVmmukwtuVTblH2uy0 P8i17vaKklPmEJFbmiFIrKBYrKjaFBsCi6bppk2nvqQ8Mt7tRCZgiacsCiDzS5JtCg6m r5miQwJVqInqtC/NNhwqUMZCsCQ5Lfhmucs2Aq/+0pg2NcEIatoU/Ms6ZtI4oyXbt2Q6 cnQkSJEyfor4nmVr/UAa/sINsG98cpC09VERocbjBRUwljgk5K2Eos3da0tZqs6pNApU 9fsw== X-Gm-Message-State: AOJu0YyaVfpzw5oB6nWI8R8gQ+6h2VkvEakz7qfITKA/8+YZfDDZ6I1u mKhO7F6weNK35HCuumPaRu2RgDUOBsn5Sn7+PBOeQXF0oHpg4r+xjviLQPoSdZZcFcNZiNx8JvI CO1ZJ80ww X-Received: by 2002:a05:600c:4710:b0:42c:b4f1:f2ad with SMTP id 5b1f17b1804b1-42f778f3815mr50000615e9.33.1727970428165; Thu, 03 Oct 2024 08:47:08 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:07 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Mattijs Korpershoek , AKASHI Takahiro , Heinrich Schuchardt , Masahisa Kojima , Marek Vasut , Sean Anderson Subject: [PATCH v11 15/29] net-lwip: add TFTP support and tftpboot command Date: Thu, 3 Oct 2024 17:46:19 +0200 Message-Id: <6ebffbe03de27d5177bec361fdc5e26816ceb849.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 do_tftpb(). This implementation of the tftp command supports an optional port number. For example: tftp 192.168.0.30:9069:file.bin It also supports taking the server IP from ${tftpserverip} if defined, before falling back to ${serverip}. Signed-off-by: Jerome Forissier Acked-by: Ilias Apalodimas Tested-by: Ilias Apalodimas --- cmd/Kconfig | 3 +- cmd/net-lwip.c | 8 ++ include/net-common.h | 4 + include/net-lwip.h | 4 + lib/binman.c | 1 + net/lwip/dhcp.c | 11 +- net/lwip/net-lwip.c | 16 +++ net/lwip/tftp.c | 283 ++++++++++++++++++++++++++++++++++++++++++- 8 files changed, 324 insertions(+), 6 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index d09c237a52f..f1372a025b7 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2119,10 +2119,9 @@ config CMD_MDIO config CMD_TFTPBOOT bool "tftp" select PROT_UDP_LWIP if NET_LWIP - default n + default y help tftpboot - load file via network using TFTP protocol - Currently a placeholder (not implemented) when NET_LWIP=y. endif # if CMD_NET diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c index 82edb5fd2e6..80f0872bb8f 100644 --- a/cmd/net-lwip.c +++ b/cmd/net-lwip.c @@ -11,3 +11,11 @@ U_BOOT_CMD( "[loadAddress] [[hostIPaddr:]bootfilename]" ); #endif + +#if defined(CONFIG_CMD_TFTPBOOT) +U_BOOT_CMD( + tftpboot, 3, 0, do_tftpb, + "boot image via network using TFTP protocol\n", + "[loadAddress] [[hostIPaddr:]bootfilename]" +); +#endif diff --git a/include/net-common.h b/include/net-common.h index cbcac178c82..fd7c5e7b488 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -459,6 +459,10 @@ static inline struct in_addr env_get_ip(char *var) int net_init(void); +/* NET compatibility */ +enum proto_t; +int net_loop(enum proto_t protocol); + /** * dhcp_run() - Run DHCP on the current ethernet device * diff --git a/include/net-lwip.h b/include/net-lwip.h index cfd06726577..37744b0e2cd 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -6,6 +6,10 @@ #include #include +enum proto_t { + TFTPGET +}; + struct netif *net_lwip_new_netif(struct udevice *udev); struct netif *net_lwip_new_netif_noip(struct udevice *udev); void net_lwip_remove_netif(struct netif *netif); diff --git a/lib/binman.c b/lib/binman.c index 9047f5275f3..93d85548116 100644 --- a/lib/binman.c +++ b/lib/binman.c @@ -137,6 +137,7 @@ int binman_init(void) { int ret; + return 0; binman = malloc(sizeof(struct binman_info)); if (!binman) return log_msg_ret("space for binman", -ENOMEM); diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c index be458d554cb..14685cf7825 100644 --- a/net/lwip/dhcp.c +++ b/net/lwip/dhcp.c @@ -116,11 +116,20 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) int dhcp_run(ulong addr, const char *fname, bool autoload) { char *dhcp_argv[] = {"dhcp", NULL, }; +#ifdef CONFIG_CMD_TFTPBOOT + char *tftp_argv[] = {"tftpboot", boot_file_name, NULL, }; +#endif struct cmd_tbl cmdtp = {}; /* dummy */ if (autoload) { - /* Will be supported when TFTP is added */ +#ifdef CONFIG_CMD_TFTPBOOT + /* Assume DHCP was already performed */ + if (boot_file_name[0]) + return do_tftpb(&cmdtp, 0, 2, tftp_argv); + return 0; +#else return -EOPNOTSUPP; +#endif } return do_dhcp(&cmdtp, 0, 1, dhcp_argv); diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index ca5426d058b..6a27d71de73 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -28,6 +28,7 @@ const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; char *pxelinux_configfile; /* Our IP addr (0 = unknown) */ struct in_addr net_ip; +char net_boot_file_name[1024]; static err_t linkoutput(struct netif *netif, struct pbuf *p) { @@ -285,6 +286,21 @@ void net_process_received_packet(uchar *in_packet, int len) #endif } +int net_loop(enum proto_t protocol) +{ + char *argv[1]; + + switch (protocol) { + case TFTPGET: + argv[0] = "tftpboot"; + return do_tftpb(NULL, 0, 1, argv); + default: + return -EINVAL; + } + + return -EINVAL; +} + u32_t sys_now(void) { return get_timer(0); diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c index 1fa246f55d9..26978643313 100644 --- a/net/lwip/tftp.c +++ b/net/lwip/tftp.c @@ -2,10 +2,287 @@ /* Copyright (C) 2024 Linaro Ltd. */ #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PROGRESS_PRINT_STEP_BYTES (10 * 1024) + +enum done_state { + NOT_DONE = 0, + SUCCESS, + FAILURE, + ABORTED +}; + +struct tftp_ctx { + ulong daddr; + ulong size; + ulong block_count; + ulong start_time; + enum done_state done; +}; + +static void *tftp_open(const char *fname, const char *mode, u8_t is_write) +{ + return NULL; +} + +static void tftp_close(void *handle) +{ + struct tftp_ctx *ctx = handle; + ulong elapsed; + + if (ctx->done == FAILURE || ctx->done == ABORTED) { + /* Closing after an error or Ctrl-C */ + return; + } + ctx->done = SUCCESS; + + elapsed = get_timer(ctx->start_time); + if (elapsed > 0) { + puts("\n\t "); /* Line up with "Loading: " */ + print_size(ctx->size / elapsed * 1000, "/s"); + } + puts("\ndone\n"); + printf("Bytes transferred = %lu (%lx hex)\n", ctx->size, ctx->size); + + if (env_set_hex("filesize", ctx->size)) { + log_err("filesize not updated\n"); + return; + } +} + +static int tftp_read(void *handle, void *buf, int bytes) +{ + return 0; +} + +static int tftp_write(void *handle, struct pbuf *p) +{ + struct tftp_ctx *ctx = handle; + struct pbuf *q; + + for (q = p; q != NULL; q = q->next) { + memcpy((void *)ctx->daddr, q->payload, q->len); + ctx->daddr += q->len; + ctx->size += q->len; + ctx->block_count++; + if (ctx->block_count % 10 == 0) { + putc('#'); + if (ctx->block_count % (65 * 10) == 0) + puts("\n\t "); + } + } + + return 0; +} + +static void tftp_error(void *handle, int err, const char *msg, int size) +{ + struct tftp_ctx *ctx = handle; + char message[100]; + + ctx->done = FAILURE; + memset(message, 0, sizeof(message)); + memcpy(message, msg, LWIP_MIN(sizeof(message) - 1, (size_t)size)); + + printf("\nTFTP error: %d (%s)\n", err, message); +} + +static const struct tftp_context tftp_context = { + tftp_open, + tftp_close, + tftp_read, + tftp_write, + tftp_error +}; + +static int tftp_loop(struct udevice *udev, ulong addr, char *fname, + ip_addr_t srvip, uint16_t srvport) +{ + struct netif *netif; + struct tftp_ctx ctx; + err_t err; + + if (!fname || addr == 0) + return -1; + + if (!srvport) + srvport = TFTP_PORT; + + netif = net_lwip_new_netif(udev); + if (!netif) + return -1; + + ctx.done = NOT_DONE; + ctx.size = 0; + ctx.block_count = 0; + ctx.daddr = addr; + + printf("Using %s device\n", udev->name); + printf("TFTP from server %s; our IP address is %s\n", + ip4addr_ntoa(&srvip), env_get("ipaddr")); + printf("Filename '%s'.\n", fname); + printf("Load address: 0x%lx\n", ctx.daddr); + printf("Loading: "); + + err = tftp_init_client(&tftp_context); + if (!(err == ERR_OK || err == ERR_USE)) + log_err("tftp_init_client err: %d\n", err); + + ctx.start_time = get_timer(0); + err = tftp_get(&ctx, &srvip, srvport, fname, TFTP_MODE_OCTET); + /* might return different errors, like routing problems */ + if (err != ERR_OK) { + printf("tftp_get() error %d\n", err); + net_lwip_remove_netif(netif); + return -1; + } + + while (!ctx.done) { + net_lwip_rx(udev, netif); + sys_check_timeouts(); + if (ctrlc()) { + printf("\nAbort\n"); + ctx.done = ABORTED; + break; + } + } + + tftp_cleanup(); + + net_lwip_remove_netif(netif); + + if (ctx.done == SUCCESS) { + if (env_set_hex("fileaddr", addr)) { + log_err("fileaddr not updated\n"); + return -1; + } + efi_set_bootdev("Net", "", fname, map_sysmem(addr, 0), + ctx.size); + return 0; + } + + return -1; +} int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - /* Not implemented */ - return CMD_RET_FAILURE; + int ret = CMD_RET_SUCCESS; + char *arg = NULL; + char *words[3] = { }; + char *fname = NULL; + char *server_ip = NULL; + char *server_port = NULL; + char *end; + ip_addr_t srvip; + uint16_t port = TFTP_PORT; + ulong laddr; + ulong addr; + int i; + + laddr = env_get_ulong("loadaddr", 16, image_load_addr); + + switch (argc) { + case 1: + fname = env_get("bootfile"); + break; + case 2: + /* + * Only one arg - accept two forms: + * Just load address, or just boot file name. The latter + * form must be written in a format which can not be + * mis-interpreted as a valid number. + */ + addr = hextoul(argv[1], &end); + if (end == (argv[1] + strlen(argv[1]))) { + laddr = addr; + fname = env_get("bootfile"); + } else { + arg = strdup(argv[1]); + } + break; + case 3: + laddr = hextoul(argv[1], NULL); + arg = strdup(argv[2]); + break; + default: + ret = CMD_RET_USAGE; + goto out; + } + + if (!arg) + arg = net_boot_file_name; + + if (arg) { + /* Parse [ip:[port:]]fname */ + i = 0; + while ((*(words + i) = strsep(&arg,":"))) + i++; + + switch (i) { + case 3: + server_ip = words[0]; + server_port = words[1]; + fname = words[2]; + break; + case 2: + server_ip = words[0]; + fname = words[1]; + break; + case 1: + fname = words[0]; + break; + default: + break; + } + } + + if (!server_ip) + server_ip = env_get("tftpserverip"); + if (!server_ip) + server_ip = env_get("serverip"); + if (!server_ip) { + log_err("error: tftpserverip/serverip has to be set\n"); + ret = CMD_RET_FAILURE; + goto out; + } + + if (server_port) + port = dectoul(server_port, NULL); + + if (!ipaddr_aton(server_ip, &srvip)) { + log_err("error: ipaddr_aton\n"); + ret = CMD_RET_FAILURE; + goto out; + } + + if (!fname) { + log_err("error: no file name\n"); + ret = CMD_RET_FAILURE; + goto out; + } + + if (!laddr) { + log_err("error: no load address\n"); + ret = CMD_RET_FAILURE; + goto out; + } + + eth_set_current(); + + if (tftp_loop(eth_get_dev(), laddr, fname, srvip, port) < 0) + ret = CMD_RET_FAILURE; +out: + free(arg); + return ret; } From patchwork Thu Oct 3 15:46:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832414 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp353942wra; Thu, 3 Oct 2024 08:47:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVqRwIgzl7GIO1IoelY2TfZlUXeCSlw/vI2UOiQfauJrWptX1VSQZFQ7lWW/fs3D6hMpy0YSQ==@linaro.org X-Google-Smtp-Source: AGHT+IGzLEBiywhH+b2AeJTyafSxfFoQIH5sIPViClkS8vbWEgV6OEtm8JKecrDzET09lWKT77ex X-Received: by 2002:a05:6e02:2146:b0:3a3:4221:b0d3 with SMTP id e9e14a558f8ab-3a3658b9932mr66791775ab.0.1727970458358; Thu, 03 Oct 2024 08:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970458; cv=none; d=google.com; s=arc-20240605; b=C4Lewfe7U5IFfzPm9WUIfigq2k7WTGUk7yntQv/Xhejaiq4VrTwDuIldAhe+fZDTaj 5USlGRWh4G+T+ibCK1cM45u7vnhyOOZV+lhEImO2dlboMJBJHuJUOqxuFBS4NTx+LrAX IXiGalodK8X4KyXjl1SgqC3aGEmSUkavIliK2X3VPfDFMFbJP8sldb8njeQeQNeqiOF1 PGzn39NBhasXTMyJcSOosdxM3e73SGUxD6OAc7dnXrQvc0C8wTJSr9mvcJurXaC9lnFr qyoMrFUvL7RlqWdnq/5pqP5ziHMagRG9fiXuXqRxiWlSJsiPDw7ycdyWMNtc01TjSH0p D+ZQ== 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=V2/npB77HLvelb5+ykN3cF3n0km3w96Ew+Z8Xb4Vtao=; fh=M1S23L4OuXqF/0xVUVC1y8b6k04LnWuSUlGL53OIcXM=; b=HOax0N/AufsS6vnMy46eozUQ8GwGjbO1ghQnc/MhPALUlZnOhwVsrcmS6fpGGA7sMt 9Y1WQ9hPCPOLoCAD5ru0N/v3ZESfKcHL0RMhSK88RN4h0LlE6w2HpU8ZhWqdJaJfTymt gNha1HddPrl9aOtZZUe//MXEHT3+fv0LPLPQ3+a+8+ecrOZUr8Z6B+Fpbfp2psJtOjpn 3gZCuWDH3ljCu5L1UAkivWefQnfoffTuZL7rfYj8zpjQgd+YGFQSQ/7SlHDyFTBEimm2 wlG2XyS4a9HcV2wy2+IqNn5sH7x6m6nQpBWCj3+P9tzMz1lB9Q3iQrDjHsROoUNtnr14 s+Sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=arNkhDz4; 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 8926c6da1cb9f-4db55861555si819687173.11.2024.10.03.08.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47: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=arNkhDz4; 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 3479988E7E; Thu, 3 Oct 2024 17:47:15 +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="arNkhDz4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 634C788E6C; Thu, 3 Oct 2024 17:47:14 +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-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 51D1D8843A for ; Thu, 3 Oct 2024 17:47:12 +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-x333.google.com with SMTP id 5b1f17b1804b1-42cae4eb026so11220255e9.0 for ; Thu, 03 Oct 2024 08:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970431; x=1728575231; 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=V2/npB77HLvelb5+ykN3cF3n0km3w96Ew+Z8Xb4Vtao=; b=arNkhDz4WHJ26NjXjUwzXh0Boo9SPeT2Yuj79A+HZD7uVZQU4svIqZSSgzOoksoz3s I+dU/tQ+LrVc06+dqK2gfsYJr26/nniH7Vc2HQvZtGzbWvxEQh2kZ4wzJGQR4rGuccay xEh/f+DCOWzMNVmZpkVuxj1X5lohAqdZuBfUPmE6kv5QBxWpymeduNja1lRVxJwqbQ7C ZsBzRu6dXEOcgMR5qYaJ1v1T2m1VJelAbdPuxzWc+Gh6otiEBkqYTqQQexJosOd3G2tN PZgG6sqTqizN/cwPzFtwe+kazXYi27wq+WjIcLAT+ZaQXaxit+FmudRu9+GXruwpKldO T+UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970431; x=1728575231; 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=V2/npB77HLvelb5+ykN3cF3n0km3w96Ew+Z8Xb4Vtao=; b=dRaD0EgqVgrqZ67nD779YkhBthMmxqpWqz0QrcTs70dm05eQ5KzFF1SlZLQKi6MCyR pq/IsH1vuIqeWdBujdfxC0oTcr+kT+mYgB8Zpn4R+uHdBCJT7YOhxkNUJgGo8sPoe8Xb AhG938+rZ2eDXUidQPSZesjwIHVhQPJJTsa8KU7tyscGMTTaHRKMYl3eKP/XuWFsj2tT HL9yyJXsXJM4n41h7MdPfafwNE76mBHEiFPiZjBo9LOVEQ60Hq9nq2zoIO49hzFoB0MU MdxOG9+fuV46f4OeeiqfcJLb10Kfj6HX1zUZdPCG/OHgvYq3sLL0Q6vsobo414QfDUKS +QvA== X-Gm-Message-State: AOJu0YwATMa54SjS5gSGq6iUJrjGSo69eNYEUGyXA3XK0GXrjAxzdwoL ML5RL8qPwhDE3tumEA6bmSjbPWbk+Tw7D1hV00cUbhVjjivxKvY6fKPPUGfC7PwbXcJHYqVoK4X 0n+u/S+KP X-Received: by 2002:a5d:484d:0:b0:37c:cc60:2c68 with SMTP id ffacd0b85a97d-37cfb8b152dmr4206687f8f.5.1727970431022; Thu, 03 Oct 2024 08:47:11 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:10 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Mattijs Korpershoek , Heinrich Schuchardt , AKASHI Takahiro Subject: [PATCH v11 16/29] net-lwip: add ping command Date: Thu, 3 Oct 2024 17:46:20 +0200 Message-Id: <47c1f64132e420a17a2f4c9e33f937f0b0217ec1.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 support for the the ping command with NET_LWIP. The implementation is derived from lwIP's contrib/apps/ping/ping.c. Signed-off-by: Jerome Forissier --- cmd/Kconfig | 11 +-- cmd/net-lwip.c | 8 ++ include/net-lwip.h | 1 + net/lwip/Makefile | 1 + net/lwip/ping.c | 177 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 193 insertions(+), 5 deletions(-) create mode 100644 net/lwip/ping.c diff --git a/cmd/Kconfig b/cmd/Kconfig index f1372a025b7..d784a454915 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2018,11 +2018,6 @@ config CMD_WGET wget is a simple command to download kernel, or other files, from a http server over TCP. -config CMD_PING - bool "ping" - help - Send ICMP ECHO_REQUEST to network host - config CMD_PING6 bool "ping6" depends on IPV6 @@ -2116,6 +2111,12 @@ config CMD_MDIO The MDIO interface is orthogonal to the MII interface and extends it by adding access to more registers through indirect addressing. +config CMD_PING + bool "ping" + select PROT_RAW_LWIP if NET_LWIP + help + Send ICMP ECHO_REQUEST to network host + 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 80f0872bb8f..feed719beef 100644 --- a/cmd/net-lwip.c +++ b/cmd/net-lwip.c @@ -12,6 +12,14 @@ U_BOOT_CMD( ); #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, diff --git a/include/net-lwip.h b/include/net-lwip.h index 37744b0e2cd..9aa371e962c 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -17,5 +17,6 @@ struct netif *net_lwip_get_netif(void); int net_lwip_rx(struct udevice *udev, struct netif *netif); int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); #endif /* __NET_LWIP_H__ */ diff --git a/net/lwip/Makefile b/net/lwip/Makefile index 4e92a101ddb..b5af37a9b18 100644 --- a/net/lwip/Makefile +++ b/net/lwip/Makefile @@ -2,4 +2,5 @@ ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP) += dhcp.o +obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o diff --git a/net/lwip/ping.c b/net/lwip/ping.c new file mode 100644 index 00000000000..8dafa25959f --- /dev/null +++ b/net/lwip/ping.c @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PING_DELAY_MS 1000 +#define PING_COUNT 5 +/* Ping identifier - must fit on a u16_t */ +#define PING_ID 0xAFAF + +struct ping_ctx { + ip_addr_t target; + struct raw_pcb *pcb; + struct icmp_echo_hdr *iecho; + uint16_t seq_num; + bool alive; +}; + +static u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, + const ip_addr_t *addr) +{ + struct ping_ctx *ctx = arg; + struct icmp_echo_hdr *iecho = ctx->iecho; + + if (addr->addr != ctx->target.addr) + return 0; + + if ((p->tot_len >= (IP_HLEN + sizeof(struct icmp_echo_hdr))) && + pbuf_remove_header(p, IP_HLEN) == 0) { + iecho = (struct icmp_echo_hdr *)p->payload; + + if ((iecho->id == PING_ID) && + (iecho->seqno == lwip_htons(ctx->seq_num))) { + ctx->alive = true; + printf("host %s is alive\n", ipaddr_ntoa(addr)); + pbuf_free(p); + return 1; /* eat the packet */ + } + /* not eaten, restore original packet */ + pbuf_add_header(p, IP_HLEN); + } + + return 0; /* don't eat the packet */ +} + +static int ping_raw_init(struct ping_ctx *ctx) +{ + ctx->pcb = raw_new(IP_PROTO_ICMP); + if (!ctx->pcb) + return -ENOMEM; + + raw_recv(ctx->pcb, ping_recv, ctx); + raw_bind(ctx->pcb, IP_ADDR_ANY); + + return 0; +} + +static void ping_raw_stop(struct ping_ctx *ctx) +{ + if (ctx->pcb) + raw_remove(ctx->pcb); +} + +static void ping_prepare_echo(struct ping_ctx *ctx) +{ + struct icmp_echo_hdr *iecho = ctx->iecho; + + ICMPH_TYPE_SET(iecho, ICMP_ECHO); + ICMPH_CODE_SET(iecho, 0); + iecho->chksum = 0; + iecho->id = PING_ID; + iecho->seqno = lwip_htons(ctx->seq_num); + + iecho->chksum = inet_chksum(iecho, sizeof(*iecho)); +} + +static void ping_send_icmp(struct ping_ctx *ctx) +{ + struct pbuf *p; + size_t ping_size = sizeof(struct icmp_echo_hdr); + + p = pbuf_alloc(PBUF_IP, (u16_t)ping_size, PBUF_RAM); + if (!p) + return; + + if ((p->len == p->tot_len) && !p->next) { + ctx->iecho = (struct icmp_echo_hdr *)p->payload; + ping_prepare_echo(ctx); + raw_sendto(ctx->pcb, p, &ctx->target); + } + + pbuf_free(p); +} + +static void ping_send(void *arg) +{ + struct ping_ctx *ctx = arg; + + ctx->seq_num++; + if (ctx->seq_num <= PING_COUNT) { + ping_send_icmp(ctx); + sys_timeout(PING_DELAY_MS, ping_send, ctx); + } +} + +static int ping_loop(struct udevice *udev, const ip_addr_t* addr) +{ + struct ping_ctx ctx = {}; + struct netif *netif; + int ret; + + netif = net_lwip_new_netif(udev); + if (!netif) + return CMD_RET_FAILURE; + + printf("Using %s device\n", udev->name); + + ret = ping_raw_init(&ctx); + if (ret < 0) { + net_lwip_remove_netif(netif); + return ret; + } + + ctx.target = *addr; + + ping_send(&ctx); + + do { + sys_check_timeouts(); + net_lwip_rx(udev, netif); + if (ctx.alive) + break; + if (ctrlc()) { + printf("\nAbort\n"); + break; + } + } while (ctx.seq_num <= PING_COUNT); + + sys_untimeout(ping_send, &ctx); + ping_raw_stop(&ctx); + + net_lwip_remove_netif(netif); + + if (ctx.alive) + return 0; + + printf("ping failed; host %s is not alive\n", ipaddr_ntoa(addr)); + return -1; +} + +int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + ip_addr_t addr; + + if (argc < 2) + return CMD_RET_USAGE; + + if (!ipaddr_aton(argv[1], &addr)) + return CMD_RET_USAGE; + + eth_set_current(); + + if (ping_loop(eth_get_dev(), &addr) < 0) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} From patchwork Thu Oct 3 15:46:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832415 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp353999wra; Thu, 3 Oct 2024 08:47:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV1sR4kZQJn9JaBWPHq+QlzxJJPj8odAvpPDIy4Z6bncXKCGG5dDfn66cdwE745hOPYnof93g==@linaro.org X-Google-Smtp-Source: AGHT+IEnJu2Q2Ff6bgb2zIvnowAoDk7IrolYbPiRZLDnNvMFFGX0b+S0vZXh/idhNnwyy3hjVDdw X-Received: by 2002:a05:6e02:2182:b0:3a0:986e:e112 with SMTP id e9e14a558f8ab-3a36596e37dmr64453325ab.23.1727970469372; Thu, 03 Oct 2024 08:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970469; cv=none; d=google.com; s=arc-20240605; b=OZ70pA+E779Qmp9COZfw/f+2XJbW/Lo2uoyPD1QR3sY2vQNBht5l4P25HYKckkw7ig SqNbgneZTYe0F64aLAkMkk/A1HJsZuLWZwzWmym0QBL8RrykzNPT9GnD6E9NunJ48lkN 8xEVVDb9qXGKmLt32h8mio9DJSTxAh78RJXB5HBxmn1SJ4kSFi2tcGcK4ib+Pql6ha9H x0Xb9bT3bIEsLLcC/0dKrKUDh2tbsFXrefVparVYJD5EmZS9anPGVJHns9JNOgetiEGd 1ygMms7G9IT4iv5ouiio7h6xxzYT/Ui2XRoWcVq/Kavp2OYy1OJB8C/k+5ptfVuoKXl2 ew1w== 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=3gZH2S/lRugyMaJdrxgxyJb4FoaPWxYOGvbloJ82+kU=; fh=M1S23L4OuXqF/0xVUVC1y8b6k04LnWuSUlGL53OIcXM=; b=PMQ8TBDszuQuMangIV3ien/2C1s7dyD4q4f/H/Mt53LI1bV0JrXsKIhGvF+RlncZeU cu9fsMcEVPzyJ5x2ct1j/6Rd+0rPNtpGjiBH+i3bL2e0SHd1zOfdW795X3ZdhodkK7hA iuYrbQHH9KfimFsFgT3hNWi+aaFIz+J+VsQAKjiLKR8BTOmqKDfsNzjinlEQNzRvVJq3 noK7t6LJXus4h8tqrEMbaE6rbximYLeMASN/lh1jKsGirk/IhLY5InbrUUDprJ7uvbwf DoEky5n8JO/bf7ztdK7W/E9x8AZZyBwpO9og0EzXvgzdvkuz9R/y5xvFdEELJ66zC0AR EraA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Bm/oftUZ"; 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 e9e14a558f8ab-3a371637602si6467845ab.183.2024.10.03.08.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:49 -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="Bm/oftUZ"; 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 98BF288F16; Thu, 3 Oct 2024 17:47:18 +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="Bm/oftUZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3737088EFB; Thu, 3 Oct 2024 17:47:17 +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 3048E88E7A for ; Thu, 3 Oct 2024 17:47:15 +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-42e7b7bef42so10367375e9.3 for ; Thu, 03 Oct 2024 08:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970434; x=1728575234; 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=3gZH2S/lRugyMaJdrxgxyJb4FoaPWxYOGvbloJ82+kU=; b=Bm/oftUZW11Qk6B/asNaQLHQ2RuMnCAnBqRLHNObF8J6+mLfhT0jU1u2SLy3WjPYpf 2glTOYPnEHzgZ7VS+J3ZdENxUFP7t5U9n8YRySUq1pO5yBmTDURs/r+EYBz+gLbhSlrh GkGVGWgLT182XOGkMWa0OkiNVEe10naTKcnMfLgTPEDSE92Uiaax37aM1y9ND4xV9rrG roAvj/v5+voIK6thaAZsv/pDYRDszoYl+BvK9sxhUwuIhs5HIeTIRMZZ0jiN1/4rgqFS cIWPD03sF6hdqbkqFsHLxW0Z81Ulr+lK3NUZQpKdsCmc664aOYkbyR0LOKeM3rAgj4DP 4mKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970434; x=1728575234; 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=3gZH2S/lRugyMaJdrxgxyJb4FoaPWxYOGvbloJ82+kU=; b=afW+z/ADVC5+Lzt2lXE+XP8Xq5eotF+SGilXG+vByP4WAe0RZdQp2kQOFOw5Kl21I4 ULEvoa4M+OkqYUIRkhhDuM1ADzk/8uWkRFwYzd0c2fvyH7/PSuPqecjLazqY8gcMQZqk JISh5RMaSD002c4+/nTzmIwl0mb9HGcjxr+M9A7c3TVpyNEjFbkn697e+3sD7Su3N0Aj lYRT/n0D/Nm1Q/taMiGNxG8fPSCxAIjBS+TtpFNQR0Fso5Lk6+xrfe+sBm0WFfSDQhEe 8j+28LyYWrqS16rEBpho9Up0ZXGzitS6DvlG0ncFw8wLpvhLms9SA3oWNSe5kYx62+0U QFcQ== X-Gm-Message-State: AOJu0Yx2/YjgEkgGCbpU4iavUjtYM5AazemcnD+9Z7m9bk6p/tj9DN8h zSZSp8lqYgmmK9nS41T2nMe1eJP6a4nHDOpYam8jjt//OQw9GlM227tC7UrN4nkNWMPFD37NUtS OOWQEFrLH X-Received: by 2002:a05:6000:2cb:b0:37c:d507:b44b with SMTP id ffacd0b85a97d-37cfb8cb57emr5410880f8f.26.1727970433888; Thu, 03 Oct 2024 08:47:13 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:13 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Mattijs Korpershoek , Heinrich Schuchardt , AKASHI Takahiro Subject: [PATCH v11 17/29] net-lwip: add dns command Date: Thu, 3 Oct 2024 17:46:21 +0200 Message-Id: <4e217dadcb2d832482487d25ceee63368e99bff8.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 CMD_DNS when NET_LWIP is enabled to provide the dns command using lwIP. Signed-off-by: Jerome Forissier --- cmd/Kconfig | 11 ++-- cmd/net-lwip.c | 8 +++ include/net-lwip.h | 1 + net/lwip/Makefile | 1 + net/lwip/dns.c | 127 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 net/lwip/dns.c diff --git a/cmd/Kconfig b/cmd/Kconfig index d784a454915..b50fff78a68 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2036,11 +2036,6 @@ config CMD_SNTP help Synchronize RTC via network -config CMD_DNS - bool "dns" - help - Lookup the IP of a hostname - config CMD_LINK_LOCAL bool "linklocal" select LIB_RAND @@ -2088,6 +2083,12 @@ config CMD_DHCP help Boot image via network using DHCP/TFTP protocol +config CMD_DNS + bool "dns" + select PROT_DNS_LWIP if NET_LWIP + help + Lookup the IP of a hostname + config CMD_MII bool "mii" imply CMD_MDIO diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c index feed719beef..c021da6a674 100644 --- a/cmd/net-lwip.c +++ b/cmd/net-lwip.c @@ -27,3 +27,11 @@ U_BOOT_CMD( "[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 diff --git a/include/net-lwip.h b/include/net-lwip.h index 9aa371e962c..ff9d03b23e8 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -17,6 +17,7 @@ struct netif *net_lwip_get_netif(void); int net_lwip_rx(struct udevice *udev, struct netif *netif); int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); #endif /* __NET_LWIP_H__ */ diff --git a/net/lwip/Makefile b/net/lwip/Makefile index b5af37a9b18..645d8a8c457 100644 --- a/net/lwip/Makefile +++ b/net/lwip/Makefile @@ -2,5 +2,6 @@ ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot obj-$(CONFIG_$(SPL_)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 diff --git a/net/lwip/dns.c b/net/lwip/dns.c new file mode 100644 index 00000000000..4b937feaee1 --- /dev/null +++ b/net/lwip/dns.c @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include + +#define DNS_RESEND_MS 1000 +#define DNS_TIMEOUT_MS 10000 + +struct dns_cb_arg { + ip_addr_t host_ipaddr; + const char *var; + bool done; +}; + +static void do_dns_tmr(void *arg) +{ + dns_tmr(); +} + +static void dns_cb(const char *name, const ip_addr_t *ipaddr, void *arg) +{ + struct dns_cb_arg *dns_cb_arg = arg; + char *ipstr = ip4addr_ntoa(ipaddr); + + dns_cb_arg->done = true; + + if (!ipaddr) { + printf("DNS: host not found\n"); + dns_cb_arg->host_ipaddr.addr = 0; + return; + } + + 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) +{ + struct dns_cb_arg dns_cb_arg = { }; + bool has_server = false; + struct netif *netif; + ip_addr_t ipaddr; + ip_addr_t ns; + ulong start; + char *nsenv; + int ret; + + dns_cb_arg.var = var; + + netif = net_lwip_new_netif(udev); + if (!netif) + return -1; + + dns_init(); + + nsenv = env_get("dnsip"); + if (nsenv && ipaddr_aton(nsenv, &ns)) { + dns_setserver(0, &ns); + has_server = true; + } + + nsenv = env_get("dnsip2"); + if (nsenv && ipaddr_aton(nsenv, &ns)) { + dns_setserver(1, &ns); + has_server = true; + } + + if (!has_server) { + log_err("No valid name server (dnsip/dnsip2)\n"); + net_lwip_remove_netif(netif); + return CMD_RET_FAILURE; + } + + dns_cb_arg.done = false; + + ret = dns_gethostbyname(name, &ipaddr, dns_cb, &dns_cb_arg); + + if (ret == ERR_OK) { + dns_cb(name, &ipaddr, &dns_cb_arg); + } else if (ret == ERR_INPROGRESS) { + start = get_timer(0); + sys_timeout(DNS_RESEND_MS, do_dns_tmr, NULL); + do { + net_lwip_rx(udev, netif); + if (dns_cb_arg.done) + break; + sys_check_timeouts(); + if (ctrlc()) { + printf("\nAbort\n"); + break; + } + } while (get_timer(start) < DNS_TIMEOUT_MS); + sys_untimeout(do_dns_tmr, NULL); + } + + net_lwip_remove_netif(netif); + + if (dns_cb_arg.done && dns_cb_arg.host_ipaddr.addr != 0) + return CMD_RET_SUCCESS; + + return CMD_RET_FAILURE; +} + +int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + char *name; + char *var = NULL; + + if (argc == 1 || argc > 3) + return CMD_RET_USAGE; + + name = argv[1]; + + if (argc == 3) + var = argv[2]; + + eth_set_current(); + + return dns_loop(eth_get_dev(), name, var); +} From patchwork Thu Oct 3 15:46:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832416 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354065wra; Thu, 3 Oct 2024 08:48:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXJtjTVXmWRCQWi4r6jGlii7GQ6qQkHHBog5h7ZsG/+jBhOgF0xMLZMuY0LAZskw8jbE0NhSA==@linaro.org X-Google-Smtp-Source: AGHT+IE2kV5yGt1pyVTtSVUS+329jxMhKXUwe/asoHx+fQEvI7QjojIfwJLi2M8Q/Cee73+YMsIt X-Received: by 2002:a05:6602:1553:b0:82d:129f:acb6 with SMTP id ca18e2360f4ac-834d84d4e60mr672588539f.14.1727970480620; Thu, 03 Oct 2024 08:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970480; cv=none; d=google.com; s=arc-20240605; b=RaJb15+Mnt+j9IL3NqmDR2JPmZhbV2RlDmGZxRqq0+S1P4wlk0d8trnAj1abmF+7O7 Zrs+BprBW3ASwx6CiAFKz+S8gDuEvDchykJFpMZpOcw4q+oFyr6TrQIzruqUEylfjBuD PKEIN8FQgmuRygp7YftteZ/hgETQQZDrMwMHdbvIQwT9YKPDs+XegFZ7NdkfuVz8DlUO /MMcEDylJwHL3AkEWMj45AaYiGxuyXw5rKaTkAduGvJGu8ssYvhnFmjZUirDzWAT0aIA E57sTNT0ckFZviUYYzBxxVM3pqONyiLJioFf4Ouszy8oXh1m0o0EPz09uRPC6dE8Cw+G oZ2Q== 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=iVonNGzNZsYIUAIi+/WsLR7n6+fuHVplypDzeikmB/0=; fh=E+olN/+XQyrUXjNwyxLQ3oNMSxnIYEkqZ5ur5mSMPMo=; b=kV1zE5j7XD2NXTE2erZtE4FMccO6O273SzkkwVbWHtlRX+k9LDIb097LCWOmmVDogr nmn21R3QD5URRN5xa5gFaJ0m98zfL27jqwG+Pq53FT7D4j5JJHlPrmfSuKG7uslc1dYr gI1X8rb8Ax4yNbFE1c9gknvFOnJFZ1Doe7yl/7h351eAb1TTrLxfQ+KrXfhaUJQf+pV+ M2Cjh+nftauPip/Nxz+GQKKnjcJkQoOIdf1SXnKdB7NQNLcAzT9wxMNemUKoLiBZ4XR1 K+4JoBzJZR2QFQGkEIbJvkFLS1yZ5f+tK/+XhwJGiN7uVwZvfsvggRSSKF/lFbBHWVil c+qQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sWfQ6cOI; 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 ca18e2360f4ac-834efe85e42si72564439f.136.2024.10.03.08.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:48:00 -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=sWfQ6cOI; 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 04B6D88EA3; Thu, 3 Oct 2024 17:47:20 +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="sWfQ6cOI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 867F088EA3; Thu, 3 Oct 2024 17:47:19 +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 6416088EFB for ; Thu, 3 Oct 2024 17:47:17 +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-37ccd81de57so715147f8f.0 for ; Thu, 03 Oct 2024 08:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970436; x=1728575236; 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=iVonNGzNZsYIUAIi+/WsLR7n6+fuHVplypDzeikmB/0=; b=sWfQ6cOIMRyvIhgmCi51Juhj9IlsyjyU6bbZZe+IKLjFfboo2EiWJlVMU9fDhP4/E3 cLvxcOJ3XbaB9ddJ31IWg5cEiNCf1G1nJGhSusxEKAv20d4rFClylVz2Q2rFMl9Q6p/A 2ZREwaRQFAFii/6BX/huGbu0kyYHRsJdL+RhYZuhPZoYRLFcg1sNKiELNbEw+kQxFHCv CtZo5gnHcKYAU1fd7Rhj5p42LrKJ8EsL3Ox6h7Ihd4igK/4OSkMBkwhtz1JzNRoPRvZ9 YpVDlJmdVtstyKDDdRkjiWFaN06wMe90aOsELSvKPtyu1Vg2ns5DYapMrtsFIc5IuE7O Wzeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970436; x=1728575236; 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=iVonNGzNZsYIUAIi+/WsLR7n6+fuHVplypDzeikmB/0=; b=rVo45jhKHFFrAd/F1XJ046kVKMRMyIv4YXR7niFytPost6HvsqsUZZtdkT6Hye/d5L EVh4VVvMKRZRzR8BsE/h3fZGgJSmgRftO3ZEFdi6mkkWFJAMo6xjJ3cX8OTEl3AAmtT4 KoCZU4di18h1LWFLzxYekM94T036jmrk2R3WZYKPyf493mRs1rAGJdfip64NJ6BKUaoZ Xuo8cnfdxrHgJz8/UILRXPaPeXD3biloRc83dlcGPzEsXKnycFryf5QfQJUuXEZUgBRR Dxxo+KQe5EKTDdV1L/VyFK8jf1RbkW5sJz2jiL38MnLGq2S5AeZeas1PR024Skfsih8Z NSWw== X-Gm-Message-State: AOJu0YxA6UHt2zuG6x/QXiTFYaB2njMYMzZHK9Dnem8bYHPWDX3dTG9Z 8KLE3TiZATxUjWoViWxYE3XZVPoAHg9tu3GPROR1BTqzQHi0kqe2+qLnkW8+0Qo1w/bbNyQW2IS 5mgR7rNWm X-Received: by 2002:a05:6000:1565:b0:374:cb28:b3f8 with SMTP id ffacd0b85a97d-37d049dd43dmr3208279f8f.1.1727970436096; Thu, 03 Oct 2024 08:47:16 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:15 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Heinrich Schuchardt , Francis Laniel , Marek Vasut Subject: [PATCH v11 18/29] net: split cmd/net.c into cmd/net.c and cmd/net-common.c Date: Thu, 3 Oct 2024 17:46:22 +0200 Message-Id: <3960c7cacf36a3627e71daaf67a3eafa7a40bed9.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 some code from cmd/net.c that will be useful in a subsequent commit to implement wget with NET_LWIP. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- cmd/Makefile | 5 ++- cmd/net-common.c | 109 ++++++++++++++++++++++++++++++++++++++++++++ cmd/net.c | 115 ----------------------------------------------- 3 files changed, 113 insertions(+), 116 deletions(-) create mode 100644 cmd/net-common.c diff --git a/cmd/Makefile b/cmd/Makefile index 1c8cc42503d..75e85feb017 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -130,7 +130,10 @@ obj-$(CONFIG_CMD_NAND) += nand.o ifdef CONFIG_CMD_NET obj-$(CONFIG_NET) += net.o obj-$(CONFIG_NET_LWIP) += net-lwip.o -CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +obj-$(filter y,$(CONFIG_CMD_NET) $(CONFIG_CMD_NET_LWIP)) += net-common.o +lwip-includes := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +CFLAGS_net-lwip.o := $(lwip-includes) +CFLAGS_net-common.o := $(lwip-includes) endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o diff --git a/cmd/net-common.c b/cmd/net-common.c new file mode 100644 index 00000000000..1c9fb83b896 --- /dev/null +++ b/cmd/net-common.c @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2000 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#include +#include +#include +#include +#include +#include + +static int do_net_list(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + const struct udevice *current = eth_get_dev(); + unsigned char env_enetaddr[ARP_HLEN]; + const struct udevice *dev; + struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { + eth_env_get_enetaddr_by_index("eth", dev_seq(dev), env_enetaddr); + printf("eth%d : %s %pM %s\n", dev_seq(dev), dev->name, env_enetaddr, + current == dev ? "active" : ""); + } + return CMD_RET_SUCCESS; +} + +static int do_net_stats(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + int nstats, err, i, off; + struct udevice *dev; + u64 *values; + u8 *strings; + + if (argc < 2) + return CMD_RET_USAGE; + + err = uclass_get_device_by_name(UCLASS_ETH, argv[1], &dev); + if (err) { + printf("Could not find device %s\n", argv[1]); + return CMD_RET_FAILURE; + } + + if (!eth_get_ops(dev)->get_sset_count || + !eth_get_ops(dev)->get_strings || + !eth_get_ops(dev)->get_stats) { + printf("Driver does not implement stats dump!\n"); + return CMD_RET_FAILURE; + } + + nstats = eth_get_ops(dev)->get_sset_count(dev); + strings = kcalloc(nstats, ETH_GSTRING_LEN, GFP_KERNEL); + if (!strings) + return CMD_RET_FAILURE; + + values = kcalloc(nstats, sizeof(u64), GFP_KERNEL); + if (!values) + goto err_free_strings; + + eth_get_ops(dev)->get_strings(dev, strings); + eth_get_ops(dev)->get_stats(dev, values); + + off = 0; + for (i = 0; i < nstats; i++) { + printf(" %s: %llu\n", &strings[off], values[i]); + off += ETH_GSTRING_LEN; + }; + + kfree(strings); + kfree(values); + + return CMD_RET_SUCCESS; + +err_free_strings: + kfree(strings); + + return CMD_RET_FAILURE; +} + +static struct cmd_tbl cmd_net[] = { + U_BOOT_CMD_MKENT(list, 1, 0, do_net_list, "", ""), + U_BOOT_CMD_MKENT(stats, 2, 0, do_net_stats, "", ""), +}; + +static int do_net(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + struct cmd_tbl *cp; + + cp = find_cmd_tbl(argv[1], cmd_net, ARRAY_SIZE(cmd_net)); + + /* Drop the net command */ + argc--; + argv++; + + if (!cp || argc > cp->maxargs) + return CMD_RET_USAGE; + if (flag == CMD_FLAG_REPEAT && !cmd_is_repeatable(cp)) + return CMD_RET_SUCCESS; + + return cp->cmd(cmdtp, flag, argc, argv); +} + +U_BOOT_CMD( + net, 3, 1, do_net, + "NET sub-system", + "list - list available devices\n" + "stats - dump statistics for specified device\n" +); diff --git a/cmd/net.c b/cmd/net.c index 53ce2bc5d0c..c90578e1b9f 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -674,118 +674,3 @@ U_BOOT_CMD( ); #endif /* CONFIG_CMD_LINK_LOCAL */ - -static int do_net_list(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - const struct udevice *current = eth_get_dev(); - unsigned char env_enetaddr[ARP_HLEN]; - const struct udevice *dev; - struct uclass *uc; - - uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { - eth_env_get_enetaddr_by_index("eth", dev_seq(dev), env_enetaddr); - printf("eth%d : %s %pM %s\n", dev_seq(dev), dev->name, env_enetaddr, - current == dev ? "active" : ""); - } - return CMD_RET_SUCCESS; -} - -static int do_net_stats(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - int nstats, err, i, off; - struct udevice *dev; - u64 *values; - u8 *strings; - - if (argc < 2) - return CMD_RET_USAGE; - - err = uclass_get_device_by_name(UCLASS_ETH, argv[1], &dev); - if (err) { - printf("Could not find device %s\n", argv[1]); - return CMD_RET_FAILURE; - } - - if (!eth_get_ops(dev)->get_sset_count || - !eth_get_ops(dev)->get_strings || - !eth_get_ops(dev)->get_stats) { - printf("Driver does not implement stats dump!\n"); - return CMD_RET_FAILURE; - } - - nstats = eth_get_ops(dev)->get_sset_count(dev); - strings = kcalloc(nstats, ETH_GSTRING_LEN, GFP_KERNEL); - if (!strings) - return CMD_RET_FAILURE; - - values = kcalloc(nstats, sizeof(u64), GFP_KERNEL); - if (!values) - goto err_free_strings; - - eth_get_ops(dev)->get_strings(dev, strings); - eth_get_ops(dev)->get_stats(dev, values); - - off = 0; - for (i = 0; i < nstats; i++) { - printf(" %s: %llu\n", &strings[off], values[i]); - off += ETH_GSTRING_LEN; - }; - - return CMD_RET_SUCCESS; - -err_free_strings: - kfree(strings); - - return CMD_RET_FAILURE; -} - -static struct cmd_tbl cmd_net[] = { - U_BOOT_CMD_MKENT(list, 1, 0, do_net_list, "", ""), - U_BOOT_CMD_MKENT(stats, 2, 0, do_net_stats, "", ""), -}; - -static int do_net(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - struct cmd_tbl *cp; - - cp = find_cmd_tbl(argv[1], cmd_net, ARRAY_SIZE(cmd_net)); - - /* Drop the net command */ - argc--; - argv++; - - if (!cp || argc > cp->maxargs) - return CMD_RET_USAGE; - if (flag == CMD_FLAG_REPEAT && !cmd_is_repeatable(cp)) - return CMD_RET_SUCCESS; - - return cp->cmd(cmdtp, flag, argc, argv); -} - -U_BOOT_CMD( - net, 3, 1, do_net, - "NET sub-system", - "list - list available devices\n" - "stats - dump statistics for specified device\n" -); - -#if defined(CONFIG_CMD_NCSI) -static int do_ncsi(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) -{ - if (!phy_interface_is_ncsi() || !ncsi_active()) { - printf("Device not configured for NC-SI\n"); - return CMD_RET_FAILURE; - } - - if (net_loop(NCSI) < 0) - return CMD_RET_FAILURE; - - return CMD_RET_SUCCESS; -} - -U_BOOT_CMD( - ncsi, 1, 1, do_ncsi, - "Configure attached NIC via NC-SI", - "" -); -#endif /* CONFIG_CMD_NCSI */ From patchwork Thu Oct 3 15:46:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832417 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354209wra; Thu, 3 Oct 2024 08:48:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXFDKCK+C5lZGKjAZv+ah8HxUbma461ipG3mUc7kdxg/pHsFaIgMFOUIylaCjMh2BaY0WwZsw==@linaro.org X-Google-Smtp-Source: AGHT+IFfprK+7aqg6DxV1/R3yyRz8Jvi8u2Z/wkUnLi2USecyop5ti+A39Q7Mpxw6ixKZSWVX/+R X-Received: by 2002:a05:6e02:20ee:b0:3a0:8e92:ecd1 with SMTP id e9e14a558f8ab-3a3659154f8mr69478235ab.2.1727970501073; Thu, 03 Oct 2024 08:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970501; cv=none; d=google.com; s=arc-20240605; b=BXFujRxuycoNY1ydZ9MXzAINujrzBkpMGd1PsiWPVDOzNx4eR7EHe9c7IMSwDf8BpG kfJaCXri5efWnsjA7wr1QiQOfoZEY6NuYnaI6lckM2SE1uwVLSQ+teUrgDo6v/+2JP2M cIh7FmTbUkZC0v5OefAvvcuyFQi1+vE5BuB4H2gPxjQhMfExUhTCqanYZPlwfkvQexOZ 2La9XZxyisaue8Po+L70k6AFpIDJ/W+SzIxySlWEvHvX7sAyCtDFkSiHp4n+3oK66SPF Dg84YH1FLRYyfv46X+U91OofJ0ezk1GgVFtKRVlbdzvB5aXVAmzlcSZHTioykyYquw7N yriw== 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=Y3DgJBEUpqOFtghcTQksmrU3/9ps6EIq+mtZv3cEV6U=; fh=beRXill8TderJa5IcMdhXLyNh93zy3wRpHR09XGwi4g=; b=cGIhHOPHq/wJKjRy7hYNu2tHE2KMJr7Q28johGc0VSfR5Hkvz1RM17Bkf/aCxeIPEv iNOjagcpJx/T8jE8r5J47CQ/W4pudjHtr4i3JdY5mkifJbQcqrfRpuHAFY68Tz3k1NdI HEEgHNE9mSWvLVvsWh9bTnx8CoG2+hGl8O0GVhOQuVm2nG+OJTCNhyj5xguyHkIKS5RA 1ObNhSbt15Ov4qgdveGq/BDpEvAwQwdSpVvdO8CeyZHotOhnDV4W+Eh+OyRtDaCRN5Tw gVo/1p4zj8W+HUiu+TQFd7LXexOWQecYRS7NMLemzti6of4S0K7iZVsMc+s5JfnDheAo ivKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GvUjdLrE; 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 e9e14a558f8ab-3a371390f15si7419005ab.1.2024.10.03.08.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:48:21 -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=GvUjdLrE; 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 3FE0288F08; Thu, 3 Oct 2024 17:47:24 +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="GvUjdLrE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9038C88F0C; Thu, 3 Oct 2024 17:47:23 +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-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 4EF7388EE8 for ; Thu, 3 Oct 2024 17:47:21 +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-x331.google.com with SMTP id 5b1f17b1804b1-42cc8782869so11173555e9.2 for ; Thu, 03 Oct 2024 08:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970440; x=1728575240; 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=Y3DgJBEUpqOFtghcTQksmrU3/9ps6EIq+mtZv3cEV6U=; b=GvUjdLrEIagILneklc+suidLWJrWtE8H2q758GML9liAgif0fDdIGDfqxpYkV0wt+4 WtJBsIxghHlIMbvthu8Uq9lsD+nZXe9OSCQQlfQKNwVmbNBsECNTZZ+zMR2Po0Nibo5c Xk2g2W6+9vzFtJ+OytqaOO/HKKceAUqCWnJfVYrpUucUsQO0JnVzdLo08+g6nS08WJbG nJT3N+s4OOwLDu0Oae2HnWHjfUNC5B3I5Yx/UB+q/61YcpP93xVbTSqETB+3e04S4ud2 IYEF4Z1qVGUCjzjvq0W69TvMFbXKYg9EYQePjndUwkqc63IfmkOJ8QX2bP/N97OR/bqV szoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970440; x=1728575240; 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=Y3DgJBEUpqOFtghcTQksmrU3/9ps6EIq+mtZv3cEV6U=; b=AkPbKrvyRZj9zgPkoGb3nxCICEfYCjO/U6xFRVMAeMSML03Ean0HXxTii4siaqJ0Wx DVmU2bHD7qyhgCKA5Da/ARrIPhxKXpSaC/4optaiEb19kV8Wy65Ouo4IbpPLcx+MIeHE hsWGvG4S+m9UVirxPvcpFcUKLB06pTy6B4svwesNEuMPnbL4yBEHJyJg8GLiNlMAEC0B a6kWTthqPlud4IexTYWoIF+sCbuN52LRh3igR+E2QKmufVRw0FvA7rZJdg6JIB1NskEu q5y+lcm4D/FRpKrx6M1GGLbvXvOza6o+QiY0fOeVJdMRY7UdO8P88X3p6rWCYrU86eqp XJ9Q== X-Gm-Message-State: AOJu0YyWu+xP0SyEC5+VtUI2b5FHNCoSzOMSsujPJh1f4FLfTxTxKIUr UBr+BYdB0lUrLT1lS8d5+q52pEw7PSn6ZPvannAxfoe47gf1Y8YJJsEW/KifqDSMUQ98m3obrdK 2Dle6pCd6 X-Received: by 2002:adf:eac9:0:b0:37c:d001:856d with SMTP id ffacd0b85a97d-37cfba059d3mr4596737f8f.42.1727970440006; Thu, 03 Oct 2024 08:47:20 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:18 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Joe Hershberger , Ramon Fried , Simon Glass , Mattijs Korpershoek , AKASHI Takahiro , Heinrich Schuchardt , Jonathan Humphreys Subject: [PATCH v11 19/29] net-lwip: add wget command Date: Thu, 3 Oct 2024 17:46:23 +0200 Message-Id: <38cb9b1122ebec2f34e1a8273c0e58da47e77f36.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 support for the wget command with NET_LWIP. The command normally expects a URL: wget [loadaddr] url, but it also accepts the legacy syntax: wget [loadaddr] [server:]file. The server IP may alternatively be supplied via ${httpserverip} which has higher priority than ${serverip}. Based on code initially developed by Maxim U. Signed-off-by: Jerome Forissier Co-developed-by: Maxim Uvarov Cc: Maxim Uvarov Signed-off-by: Jerome Forissier --- cmd/Kconfig | 18 ++- cmd/net-lwip.c | 8 + include/net-lwip.h | 18 +++ net/lwip/Makefile | 1 + net/lwip/wget.c | 363 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 400 insertions(+), 8 deletions(-) create mode 100644 net/lwip/wget.c diff --git a/cmd/Kconfig b/cmd/Kconfig index b50fff78a68..8444ae45bb5 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2010,14 +2010,6 @@ config SYS_DISABLE_AUTOLOAD is complete. Enable this option to disable this behavior and instead require files to be loaded over the network by subsequent commands. -config CMD_WGET - bool "wget" - select PROT_TCP - default y if SANDBOX - help - wget is a simple command to download kernel, or other files, - from a http server over TCP. - config CMD_PING6 bool "ping6" depends on IPV6 @@ -2125,6 +2117,16 @@ config CMD_TFTPBOOT help tftpboot - load file via network using TFTP protocol +config CMD_WGET + bool "wget" + default y if SANDBOX + select PROT_TCP if NET + select PROT_TCP_LWIP if NET_LWIP + select PROT_DNS_LWIP if NET_LWIP + help + wget is a simple command to download kernel, or other files, + from a http server over TCP. + endif # if CMD_NET config CMD_PXE diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c index c021da6a674..42f8bd6b259 100644 --- a/cmd/net-lwip.c +++ b/cmd/net-lwip.c @@ -35,3 +35,11 @@ U_BOOT_CMD( "hostname [envvar]" ); #endif + +#if defined(CONFIG_CMD_WGET) +U_BOOT_CMD( + wget, 3, 1, do_wget, + "boot image via network using HTTP protocol", + "[loadAddress] URL" +); +#endif diff --git a/include/net-lwip.h b/include/net-lwip.h index ff9d03b23e8..1c3583f82a1 100644 --- a/include/net-lwip.h +++ b/include/net-lwip.h @@ -16,8 +16,26 @@ 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); +/** + * wget_with_dns() - runs dns host IP address resulution before wget + * + * @dst_addr: destination address to download the file + * @uri: uri string of target file of wget + * Return: downloaded file size, negative if failed + */ + +int wget_with_dns(ulong dst_addr, char *uri); +/** + * wget_validate_uri() - varidate the uri + * + * @uri: uri string of target file of wget + * Return: true if uri is valid, false if uri is invalid + */ +bool wget_validate_uri(char *uri); + int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); #endif /* __NET_LWIP_H__ */ diff --git a/net/lwip/Makefile b/net/lwip/Makefile index 645d8a8c457..f2558f8763a 100644 --- a/net/lwip/Makefile +++ b/net/lwip/Makefile @@ -5,3 +5,4 @@ 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/net/lwip/wget.c b/net/lwip/wget.c new file mode 100644 index 00000000000..e8768fc2acd --- /dev/null +++ b/net/lwip/wget.c @@ -0,0 +1,363 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SERVER_NAME_SIZE 200 +#define HTTP_PORT_DEFAULT 80 +#define PROGRESS_PRINT_STEP_BYTES (100 * 1024) + +enum done_state { + NOT_DONE = 0, + SUCCESS = 1, + FAILURE = 2 +}; + +struct wget_ctx { + char *path; + ulong daddr; + ulong saved_daddr; + ulong size; + ulong prevsize; + ulong start_time; + enum done_state done; +}; + +static int parse_url(char *url, char *host, u16 *port, char **path) +{ + char *p, *pp; + long lport; + + p = strstr(url, "http://"); + if (!p) { + log_err("only http:// is supported\n"); + return -EINVAL; + } + + p += strlen("http://"); + + /* Parse hostname */ + pp = strchr(p, ':'); + if (!pp) + pp = strchr(p, '/'); + if (!pp) + return -EINVAL; + + if (p + SERVER_NAME_SIZE <= pp) + return -EINVAL; + + memcpy(host, p, pp - p); + host[pp - p] = '\0'; + + if (*pp == ':') { + /* Parse port number */ + p = pp + 1; + lport = simple_strtol(p, &pp, 10); + if (pp && *pp != '/') + return -EINVAL; + if (lport > 65535) + return -EINVAL; + *port = (u16)lport; + } else { + *port = HTTP_PORT_DEFAULT; + } + if (*pp != '/') + return -EINVAL; + *path = pp; + + 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; +} + +static err_t httpc_recv_cb(void *arg, struct altcp_pcb *pcb, struct pbuf *pbuf, + err_t err) +{ + struct wget_ctx *ctx = arg; + struct pbuf *buf; + + if (!pbuf) + return ERR_BUF; + + if (!ctx->start_time) + ctx->start_time = get_timer(0); + + for (buf = pbuf; buf; buf = buf->next) { + memcpy((void *)ctx->daddr, buf->payload, buf->len); + ctx->daddr += buf->len; + ctx->size += buf->len; + if (ctx->size - ctx->prevsize > PROGRESS_PRINT_STEP_BYTES) { + printf("#"); + ctx->prevsize = ctx->size; + } + } + + altcp_recved(pcb, pbuf->tot_len); + pbuf_free(pbuf); + return ERR_OK; +} + +static void httpc_result_cb(void *arg, httpc_result_t httpc_result, + u32_t rx_content_len, u32_t srv_res, err_t err) +{ + struct wget_ctx *ctx = arg; + ulong elapsed; + + if (httpc_result != HTTPC_RESULT_OK) { + log_err("\nHTTP client error %d\n", httpc_result); + ctx->done = FAILURE; + return; + } + if (srv_res != 200) { + log_err("\nHTTP server error %d\n", srv_res); + ctx->done = FAILURE; + return; + } + + elapsed = get_timer(ctx->start_time); + if (!elapsed) + elapsed = 1; + if (rx_content_len > PROGRESS_PRINT_STEP_BYTES) + printf("\n"); + printf("%u bytes transferred in %lu ms (", rx_content_len, elapsed); + print_size(rx_content_len / elapsed * 1000, "/s)\n"); + printf("Bytes transferred = %lu (%lx hex)\n", ctx->size, ctx->size); + efi_set_bootdev("Net", "", ctx->path, map_sysmem(ctx->saved_daddr, 0), + rx_content_len); + if (env_set_hex("filesize", rx_content_len) || + env_set_hex("fileaddr", ctx->saved_daddr)) { + log_err("Could not set filesize or fileaddr\n"); + ctx->done = FAILURE; + return; + } + + ctx->done = SUCCESS; +} + +static int wget_loop(struct udevice *udev, ulong dst_addr, char *uri) +{ + char server_name[SERVER_NAME_SIZE]; + httpc_connection_t conn; + httpc_state_t *state; + struct netif *netif; + struct wget_ctx ctx; + char *path; + u16 port; + + ctx.daddr = dst_addr; + ctx.saved_daddr = dst_addr; + ctx.done = NOT_DONE; + ctx.size = 0; + ctx.prevsize = 0; + ctx.start_time = 0; + + if (parse_url(uri, server_name, &port, &path)) + return CMD_RET_USAGE; + + netif = net_lwip_new_netif(udev); + if (!netif) + return -1; + + memset(&conn, 0, sizeof(conn)); + conn.result_fn = httpc_result_cb; + ctx.path = path; + if (httpc_get_file_dns(server_name, port, path, &conn, httpc_recv_cb, + &ctx, &state)) { + net_lwip_remove_netif(netif); + return CMD_RET_FAILURE; + } + + while (!ctx.done) { + net_lwip_rx(udev, netif); + sys_check_timeouts(); + if (ctrlc()) + break; + } + + net_lwip_remove_netif(netif); + + if (ctx.done == SUCCESS) + return 0; + + return -1; +} + +int wget_with_dns(ulong dst_addr, char *uri) +{ + eth_set_current(); + + return wget_loop(eth_get_dev(), dst_addr, uri); +} + +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 (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; + + if (wget_with_dns(dst_addr, nurl)) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} + +/** + * wget_validate_uri() - validate the uri for wget + * + * @uri: uri string + * + * This function follows the current U-Boot wget implementation. + * scheme: only "http:" is supported + * authority: + * - user information: not supported + * - host: supported + * - port: not supported(always use the default port) + * + * Uri is expected to be correctly percent encoded. + * This is the minimum check, control codes(0x1-0x19, 0x7F, except '\0') + * and space character(0x20) are not allowed. + * + * TODO: stricter uri conformance check + * + * Return: true on success, false on failure + */ +bool wget_validate_uri(char *uri) +{ + char c; + bool ret = true; + char *str_copy, *s, *authority; + + for (c = 0x1; c < 0x21; c++) { + if (strchr(uri, c)) { + log_err("invalid character is used\n"); + return false; + } + } + if (strchr(uri, 0x7f)) { + log_err("invalid character is used\n"); + return false; + } + + if (strncmp(uri, "http://", 7)) { + log_err("only http:// is supported\n"); + return false; + } + str_copy = strdup(uri); + if (!str_copy) + return false; + + s = str_copy + strlen("http://"); + authority = strsep(&s, "/"); + if (!s) { + log_err("invalid uri, no file path\n"); + ret = false; + goto out; + } + s = strchr(authority, '@'); + if (s) { + log_err("user information is not supported\n"); + ret = false; + goto out; + } + s = strchr(authority, ':'); + if (s) { + log_err("user defined port is not supported\n"); + ret = false; + goto out; + } + +out: + free(str_copy); + + return ret; +} From patchwork Thu Oct 3 15:46:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832418 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354277wra; Thu, 3 Oct 2024 08:48:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBm1Ki0Wdi7FKWwPRzOnRh+fLKzjCdJt5OZFwI6T80CpxJ6UJhPMkYTvkPZK1ehCga1rLAgA==@linaro.org X-Google-Smtp-Source: AGHT+IEfslML8s3yUKqcSJdzYjMUeWi/07W3Nb8WD3pExD2Dt5vIEjNLUUPAZ49pjc/ftkXP3SJ+ X-Received: by 2002:a05:6602:2cc1:b0:82c:ee41:72e9 with SMTP id ca18e2360f4ac-834d83c3b77mr837463039f.2.1727970514630; Thu, 03 Oct 2024 08:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970514; cv=none; d=google.com; s=arc-20240605; b=AXoOK7lMoF14S1RDFnQbNUvwfyqINGWGpEV69Mj0yakdUjFptYLT5bG4iCki3bLuSx ZKzJYM8Gaj10ojQSCipECxqOK/5BAiylgVon9UjohHyU+QJQNdOTdFWplsPESFRL9Og4 qgh7MOJBmn3wHqIuPB50sjYHkwdBS9j9Wc2T+9iBBzHxiCxe4EAavZUh+sKFaDmfQGMh EM5tvB7k/g9IBGAGXt+dP6hMGcX9MdJcv9FfT8C5JbE0Sqz8X25QvVXZz4xFrdjABW+z gt+TjVRsz0aPfnVCr92yry45uxXws/qqfR4YqTc5Fl4jfepG7E4vlLw8WL3Gud4rXWkC 3Dsg== 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=OU2VUMRGCTc+MvFx1Y4JV6qJNct5kwe7bvtCsqQAkio=; fh=unfva7WENhDSyGD/OHzzL8mLaBX2u/JXKBZjiHda3XI=; b=dGc7DTpEpoTkgkTJwMLq00Y03i19263xYm656RKmelheC18vBL1SYTXuogM2F93stL rn76LhiS8UuMdyDn2n5uvsrZwwmr3OuXsiyEhxTeqeO6b6QpC1zj3E7NMvTABFZINFI2 mCAxL8VCU2d0wddQSilQvLNtZUilzTQglM+PLLoz2NQByeJeXaClnW4HA36R6PWvwFvZ pDhqmsrne4QmsDJaWb+0V4PGdjZ9k4Sl4bG2DFHfNy78mn4N0IRE6StSLmCZJQfQ6KhG ubrpAo2iQyge7ivND0goEFCIHeLq1ndHDqx2Or/M1l0L8CdskYYRyELngbkJFOl8VjcW ITQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMqHK3W7; 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 ca18e2360f4ac-834efe8b079si70389039f.146.2024.10.03.08.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:48:34 -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=kMqHK3W7; 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 9ABDC88F0A; Thu, 3 Oct 2024 17:47:26 +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="kMqHK3W7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 331FC88E7A; Thu, 3 Oct 2024 17:47:25 +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-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 4545788EFA for ; Thu, 3 Oct 2024 17:47:23 +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-x332.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso9380935e9.1 for ; Thu, 03 Oct 2024 08:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970442; x=1728575242; 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=OU2VUMRGCTc+MvFx1Y4JV6qJNct5kwe7bvtCsqQAkio=; b=kMqHK3W7c+OpAPM5MklH60oUf08xss+mUhEVs3x2jAWgQijaBLPXxSJ13Md5C7JX7F yqp+U7Nmbph5rSbOepaCeyIRislv2IfwsVbB2PNgdFrnBHWMiewZFifg2SUeOrUcsV9O E9FwNiET94Ln9LSYinyMB4gM2ORdwNXwXVNl36x4ZN5jJQ6s0XGY/S6jyNw87Jf4Lr2L tl41A1+AryQBJQiArnMASYHkiXVJNY5avAauWumu0Zf/yQ0iaK3ojCFASBArsD0RrjxP h77ZtNq9D+u2GgzegOJwITUXCPYYn8wV1jhdLZ/VGqmzjdZ4Fsa4fLjUkAe/Y0O8ycng zXsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970442; x=1728575242; 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=OU2VUMRGCTc+MvFx1Y4JV6qJNct5kwe7bvtCsqQAkio=; b=mXhmtZXrxqANSVTDFdpnVEsnZ0ndBfJjYM329QbuXMI6ZRAtKc6nNtXs3t6o9T5GoW NJoUM4P+XFntmE+dIqTj3GAPZN5cNq7P+9r9RsivkkQUCccQRAQ2y9i6iBfcrYhOLIBS slw50Qo3BOsLevrYRzY7hbtpVgt7bbfGigtw/W53zx2taP2IatRWVbWK8WxepjcuvQk7 3MOPq4q/gjyJm1Bl+SSqpecpksIxzggb+s/F2SKG5LzhfLUnDz7Tg4/AVS/MtdTUdm+F 57fu5DQOAA4kPU28lfqLbMaXog7mkOFd2tGzahjx1JAstLMN3MmDd9JlmsTpovrihUr4 Kqjw== X-Gm-Message-State: AOJu0Yxxw2N3B9IV113AddE3gxay7YahUJ0/skm0/rxqOI+wbJwfTfhH N0z4S/YMdW3qwRrYeBDuPGc24PKzdq2JlahqGCd4IZ/+HOg4/iWE6rmRDGoMX83qAq03DsWXNZd GgA4TuU8n X-Received: by 2002:a05:600c:46d1:b0:42c:bf0b:c489 with SMTP id 5b1f17b1804b1-42f777c27f1mr53152185e9.18.1727970442011; Thu, 03 Oct 2024 08:47:22 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:21 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jonathan Humphreys , Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini Subject: [PATCH v11 20/29] net-lwip: lwIP wget supports user defined port in the uri, so allow it. Date: Thu, 3 Oct 2024 17:46:24 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 From: Jonathan Humphreys Signed-off-by: Jonathan Humphreys Signed-off-by: Jerome Forissier --- net/lwip/wget.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/net/lwip/wget.c b/net/lwip/wget.c index e8768fc2acd..b495ebd1aa9 100644 --- a/net/lwip/wget.c +++ b/net/lwip/wget.c @@ -349,12 +349,6 @@ bool wget_validate_uri(char *uri) ret = false; goto out; } - s = strchr(authority, ':'); - if (s) { - log_err("user defined port is not supported\n"); - ret = false; - goto out; - } out: free(str_copy); From patchwork Thu Oct 3 15:46:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832419 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354354wra; Thu, 3 Oct 2024 08:48:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVtiMGEzHxeCNld4aBJQ0p+7NGUboS2Vs+N3TTalKBdCtKtJ4ZdawtTg3jJs/E3hmJnQZedfw==@linaro.org X-Google-Smtp-Source: AGHT+IGJFB6vAsvGMFK9P7QXR7kkCAJg9qpax4uidh97dW5bhIy8oJ5/HFecXtzOFU4rDBUnwMey X-Received: by 2002:a05:6602:6009:b0:82c:fd13:271c with SMTP id ca18e2360f4ac-834d8410f96mr703293239f.4.1727970528010; Thu, 03 Oct 2024 08:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970527; cv=none; d=google.com; s=arc-20240605; b=WfWu3A/bjS+htVikgPoPiPlXCB41L9b/7V8YE9nOYOshK3dLAyT6tcFWVGjzmGL/kL 5pVonFLzwD6gYuAYLC+qk2QcBqNlbdluXhWWMxY7gNsnXcQ5Kwfh6/YXzwkF6Xq4JJuK wJloSjcdTUArQxEOhnDP5PkILarKOu2iyJzQ7ysO26FgstD79T/5ad57hAxBR4tJLMA+ sWVYG1DgXdPHPzzZ9ilE2EDdLIgJA+KiUc5vxxbq2AWqWmUEqmSYm886oOrrM/cgqm9W FPyFP7uBxXJlqnIz6s99PsvUsvXSel37XIUR3xLsis9lVlJ/47uVo0Fn44xjXgxIMb1H Uy1g== 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=+9X+r8Q8NFzSd6Hb1M2hwnGKuGR3j9GDjlrMCZXXI9M=; fh=eGos3Vk2IgbznXK02juYbfSQo9F55l6bAOEVf1vmgKI=; b=gFc73+39v7yp6/lh15Ip1Xk/WMu8WGZMYVbCIdQzpOJKtr2tH/lj6xlVJ5Ljr2t/ZH txxj8jBMx+O1aib+VvBwjYKrq2TV6OrfYsceOUujOZOH/PoAEtQNX6TgG7ocfZWWIWhF j93zZPCIMfCWUbrZhAwSFKd1yGjmG9PpUptpC6j+ZAcRiDkBf06ozxREMjwa2/9vw+2T 4C2ZAlyFQ2tj3TSqghTMG6XY1dO0IQK43DhFA3vBq5CykwrEYDSmXVsLqvJNZyIXU09z n1go50m5ENRxV5yGSalnfenWzFaAlLgdBfRg/w+mE1KM8LNjuAUSuztBQh0XIDIM9tP2 e3Xw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UwzqyZo9; 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 8926c6da1cb9f-4db55aa47c4si662056173.139.2024.10.03.08.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:48:47 -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=UwzqyZo9; 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 01DA388EFA; Thu, 3 Oct 2024 17:47:28 +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="UwzqyZo9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD9F288F3F; Thu, 3 Oct 2024 17:47:27 +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-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 C082E88E7A for ; Thu, 3 Oct 2024 17:47:25 +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-x329.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso11371115e9.2 for ; Thu, 03 Oct 2024 08:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970444; x=1728575244; 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=+9X+r8Q8NFzSd6Hb1M2hwnGKuGR3j9GDjlrMCZXXI9M=; b=UwzqyZo9QK9uNy4LByyAkqPlBR/kWclCEn73FXk9NluRwCqUyP8TwlHDdXWxrgzUor wGPXVmSlrCtbwrasy8JUmS/YFamzmMZrgUq8t+R41UGrrhbgXZ56raLiqmFJCvUMuwEY vTPNVvF1HBuM+wHXY7x20hUBkv2t38ruXFO9FIkW8oBoJTwAET/wvtQe3/2zaECOy+3Y nfG5aD8xDZs2qyt7RvJwhTOf8Hs+XD8+LGpHK7PBSy8UKIwv6zITyZF67sr0g6Ova5A6 0lN1Knq7xzTIwtUGNuUuISNwuRBhqxYAv0mulLK5t9HisBq3BXpLr+tJFA3z1qhh7voV vERQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970444; x=1728575244; 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=+9X+r8Q8NFzSd6Hb1M2hwnGKuGR3j9GDjlrMCZXXI9M=; b=lV9AY8eC58SBVPUcoqRzXkTqSk60wOnWhtzIFKyuYl1cIgtqP9GwYxOaez9J59PNZW 4EOMgmdKTGqvlZ9n8YuQAlMRp/BiDl6FMgwkPIJgBbnGqIhdtxDcOTYJr6VCbxMMyQ26 xReHhIySTQpe+/K/eTY6LFsiHzQ3sV9WBLZOEqpOlLsPtgRr6YQMqegL3ySefYnP5ec5 EMK4ltqohBj02JJw0fsxbJTfwm1vVmS6rYQfq1T+4x4ant1q5uMGo1kWYp3oCWPydC5u itKdix0MMoeLlUFj6uMnMHlfCOsbYRV0RZTvHnp1mQKH34MU/hqd0LElHfynkTmvul5O /Aug== X-Gm-Message-State: AOJu0YwlpVNvM5n62crtaJHIyJsh9u+Njsj0KMY+YvHCaOFQ0ySnkj8b dpP7WDhwfqDVmVSunBMTBK4YmYpuuF+Wdg6A+MMZPczoctiTI7AR55Q9PCFDQ6DPCf7B2zk2zjD 0EQcaT0A4 X-Received: by 2002:adf:f8c3:0:b0:374:b35e:ea6c with SMTP id ffacd0b85a97d-37cfba0786fmr4075603f8f.40.1727970444574; Thu, 03 Oct 2024 08:47:24 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:23 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Marek Vasut , Sughosh Ganu Subject: [PATCH v11 21/29] cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y Date: Thu, 3 Oct 2024 17:46:25 +0200 Message-Id: <6e2f569d54ee386294a0ed918f71c2e177e9fa2f.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Support "bdinfo -e" when lwIP is selected. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas Reviewed-by: Tom Rini --- cmd/bdinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index f6e534dd5bb..4c0e2adabc3 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -151,7 +151,7 @@ static int bdinfo_print_all(struct bd_info *bd) bdinfo_print_num_l("relocaddr", gd->relocaddr); bdinfo_print_num_l("reloc off", gd->reloc_off); printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8); - if (IS_ENABLED(CONFIG_CMD_NET)) + if (IS_ENABLED(CONFIG_CMD_NET) || IS_ENABLED(CONFIG_CMD_NET_LWIP)) print_eth(); bdinfo_print_num_l("fdt_blob", (ulong)map_to_sysmem(gd->fdt_blob)); if (IS_ENABLED(CONFIG_VIDEO)) @@ -192,7 +192,8 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) case 'a': return bdinfo_print_all(bd); case 'e': - if (!IS_ENABLED(CONFIG_CMD_NET)) + if (!IS_ENABLED(CONFIG_CMD_NET) && + !IS_ENABLED(CONFIG_CMD_NET_LWIP)) return CMD_RET_USAGE; print_eth(); return CMD_RET_SUCCESS; From patchwork Thu Oct 3 15:46:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832420 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354433wra; Thu, 3 Oct 2024 08:49:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8r2m9YJvomPTW0XSnZA3oJnO6iSPXZeNqZjgZiMx8Fw3hky/76Hefd28BPbaAbDwohlIhHg==@linaro.org X-Google-Smtp-Source: AGHT+IEWNeVqfSYD6YNR1ICBxdmdAf9H4VKQa2vz0FCLvZtMdOAEqM55f6gC54wevCDKMCtaBLXK X-Received: by 2002:a05:6e02:194c:b0:3a1:a163:ba64 with SMTP id e9e14a558f8ab-3a365912354mr70604195ab.3.1727970541950; Thu, 03 Oct 2024 08:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970541; cv=none; d=google.com; s=arc-20240605; b=Gn3oqJcUwY2eqwBBq6bIyAC+QYfRd9AFex7EmAvkQGGabHMKuFDvVFa+6niGRLdxNC rlFBqVEy71v30IUmUJy0s7+gycP5hZhzBPvhkv1hYn49BdV8tU5+/aQYug6BD4i/67Sq dQXjW0hIeILPQMir9RC86XxGq8VZfwd8HFaWyqCb80SDL8HiTogmQUA63gGwSPbSYO4O BZDNI8uZJTWzE6Ah50ubKkyuBJ1O764lN+F1OUM3Vcj9Tuuf4++gzPP/MHjHtXlVCEOI VeSVvDRiY37rM6CcpePI4BRRvhFhmgOwkU9ayPojSmMUEd+ShPzvvj3CO8Td4cxYzJ1O a9FA== 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=bZUXRSXDL/APhwEIqrep5SEH02GfIyM2tVPaQe75C/w=; fh=ThdVVZAeTRhYRIsitiRafY870JZ08RRoQKK9619Vak0=; b=YbjCQvtmyH9rKSxGJrhDOnRYjzAI8ZeEKp5GzRmZDYkx5mn3w7Qk4skn6Z1QNt+UCJ dY5uVhUXDG7LidpahtPQQ+3m1lQnDvUARKiC+h8PgUAiRYzk4Yu2q0J+fGiw5B0zdye0 yJrb6RE/NiEBE99uMFWo3z3K6Yj7BEoGnQ/VwwxeTGUqP0gYCSntSn9elQjCYIXz9vAG D8ULWiOcG5+FKuIvhTA/Lo0eLrnWofXwdA3xESQYLl/HZrAJorOA5gkwD0I/PB4YRKrh CWkMltSPRKZm1CEO7tgQhT+IEbA3xgfznZgfGgNzgK5/gO9cvOWJc5dDOEtUepv66p0b gEOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y0BhCkGO; 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 e9e14a558f8ab-3a37162d725si6343365ab.149.2024.10.03.08.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:49: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=y0BhCkGO; 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 5E90788F73; Thu, 3 Oct 2024 17:47:30 +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="y0BhCkGO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7252288F5E; Thu, 3 Oct 2024 17:47:29 +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 8AB8C88EBA for ; Thu, 3 Oct 2024 17:47:27 +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-42cd46f3a26so9962825e9.2 for ; Thu, 03 Oct 2024 08:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970446; x=1728575246; 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=bZUXRSXDL/APhwEIqrep5SEH02GfIyM2tVPaQe75C/w=; b=y0BhCkGO8Yh+gKTMNQr3S+b5s6TIv1SBzhaJm4sOmJzj9HtGRLZwQ9h0PMbi2vZ86A 1CqXxpnRPgLSfKc+d2wHujZf90McH0oGJVmx0K/64WNmgj+GMWWTvh16NRfBJXyP9kvk 8+HS0+cQbPH0/or92UXvFEMeLEirv23UiUyXxF2pPxSlakMgKWVBCoX2C86napzex/PN qnocldNB9jZj1drWgl/tyrJKk31qg22sYfBHNWm4nEEmy2QtnXqgHzJ/054UE2yupmcV lsoLsGAvDhtvBj0PF6CRYI+d2nwY/TdRiQ8/Wxtybuxn/hTS4ACbXxY8VbpAYNfQgO77 h08Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970446; x=1728575246; 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=bZUXRSXDL/APhwEIqrep5SEH02GfIyM2tVPaQe75C/w=; b=FLDiFav+XuGixLuIfn1BHmJ3bwm1GthHEEKdU1AssnMaM9RteIaB2VWweeYqlvAAIa d67Pi5rWcu8gxQahyPHcKihn+MisGlVtOC8UbnYGV+b5/vTH0ZvxQDrwNemg5C25wLMn 8B1t9lwWO6J6HtceEFtDqfGwlwrCZDQ8aZmzJfTJIktaDnM05ZZCxxnba5Acrva1gXSa 7VqhvP8+qpqiuubxwK8e4ZQoMkTj7WVBVCLnHt5Bro4MUdjDgY7sLWAbwN6NDWxkMxvj yG+lWrOoGZ9KOwuGsymwUl0zhDup+JXb1swmrmhmwiKmgkYASMl6V5c8IlJF0HosuiuD JHkA== X-Gm-Message-State: AOJu0YxGB9X6+CHkle0tQIcAjCGt02Z1IWFYtICte2E+YlYOHI6AK4uq uyS2Cy6fcs3s0wm9IgukFEC5JJR3d8wiBfFjEGESiielC1czaNgqeJbhyQ4UrTWRQLHMHOChlo6 1rcceE0Mn X-Received: by 2002:a05:600c:4f4d:b0:42f:80a7:84e0 with SMTP id 5b1f17b1804b1-42f80a787c0mr17237185e9.32.1727970446322; Thu, 03 Oct 2024 08:47:26 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:25 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini Subject: [PATCH v11 22/29] configs: add qemu_arm64_lwip_defconfig Date: Thu, 3 Oct 2024 17:46:26 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 qemu_arm64_lwip_defconfig which #include's qemu_arm64_defconfig and selects NET_LWIP instead of NET. This config has all the supported net commands enabled. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- configs/qemu_arm64_lwip_defconfig | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfig diff --git a/configs/qemu_arm64_lwip_defconfig b/configs/qemu_arm64_lwip_defconfig new file mode 100644 index 00000000000..d3d8ef16e66 --- /dev/null +++ b/configs/qemu_arm64_lwip_defconfig @@ -0,0 +1,9 @@ +#include + +CONFIG_ARM=y +CONFIG_ARCH_QEMU=y + +CONFIG_NET_LWIP=y +CONFIG_CMD_DNS=y +CONFIG_CMD_WGET=y +CONFIG_EFI_HTTP_BOOT=y From patchwork Thu Oct 3 15:46:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832422 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354597wra; Thu, 3 Oct 2024 08:49:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVNOyQdwALU2dM2be0kT4ipVSVLJ17R8L5TNp8C2cB/9V3j1CSJFNNYhLpMkH6d+/Q+FJoZFQ==@linaro.org X-Google-Smtp-Source: AGHT+IEF1y/VP9M80ayKZmB/OvP7qz4UNgtgXqtnNn6uW4TVbzm6/PcensNt0dzzTusmYY2n9myV X-Received: by 2002:a05:6e02:1a8f:b0:3a3:6045:f8bd with SMTP id e9e14a558f8ab-3a3659156b1mr69217965ab.5.1727970568684; Thu, 03 Oct 2024 08:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970568; cv=none; d=google.com; s=arc-20240605; b=fL3AqsY0yJZK3CL6RKRVZNPcP1hh1ExGJDJKZBnbzNiMriE7qFZvrZzxZauaTCXqBG nhCUtA/n/wip16PW7CDbon455vaYMYRbPue3ORN95C1DDXJDD4UNROQHPaEVPKSOS14c k6yaf+kkmhUoqahzNVRaqNWUlOijMjpkt+eFFs6Lprpf2AtgQf/Ess4FcIHK6Clu4vMr S/JAKPsav4afmgZvfo96ZdgSRJdYgoZyYtYFEQocbJ8m1R3tbmUkfLN5RMcTzOB4KeQr gu9A09AktvAqMsEbYqVxjkESzx+U/7wxfciTBJcNu5ycysJgA34gBLQFrnYTBcvKfOZM d+fg== 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=3wz69cklJBmi/gyynP/MNmECb+F1rpo4+jC/BQdSi/0=; fh=ThdVVZAeTRhYRIsitiRafY870JZ08RRoQKK9619Vak0=; b=aBHLyBcf3Elwr5jMOTufFinmx09gzg0EtO+KT7zuZFwjm43P8F6dq2awADHciDbYpY 3YGUYfBevyWrwFzatBNFrkIlMa0t87in8v73Y2MF4shFOQEx1TBj25/5MgGf4oLiZ5ml 9tkOpMHsZHZmYxeyWFtr88nNeayNd1P1CJ8CGmMsKiPmX4//QTldEHy19UD2oeNpM6sV hmVdLMDzVZ31IDQMHzue4LVRf9deotv++p5u7Wyn4BO4Ounc1EatICXZ8rUvLoRPdUxf Y/8tbarXNcC9tCFpqYXWoZOKY1WzTKYEkV23X4TtTVjXsHGeB/oQIsYxnYulnYoW6Kk5 dZKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V76QXAWt; 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 e9e14a558f8ab-3a3713a5e66si6666175ab.75.2024.10.03.08.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:49:28 -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=V76QXAWt; 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 26B5188F4E; Thu, 3 Oct 2024 17:47:35 +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="V76QXAWt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B6DEF88EBA; Thu, 3 Oct 2024 17:47:33 +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-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 926CD88F62 for ; Thu, 3 Oct 2024 17:47:29 +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-x432.google.com with SMTP id ffacd0b85a97d-37cce5b140bso808032f8f.3 for ; Thu, 03 Oct 2024 08:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970448; x=1728575248; 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=3wz69cklJBmi/gyynP/MNmECb+F1rpo4+jC/BQdSi/0=; b=V76QXAWtz4jMp4+YbvPDripMJrc5kHLEdEqVFeO44GN156atB0CrxCSacwcWNkAZj8 eCQO/wXFjtgTNnyAWK+SNmDoDV4m5KombzvKzsUJhbADT97VdnpafQtnmoqDNoknuFFb hh/fd/iOkWsEzyBkEIkv5yssYaK+jL0dSqCtYXt6XatlD1fn+sxCu2kffq+nq0YkIZI4 xQAulV1Qb8ZPhjzSyvYKJVyG3KZpjgqXe93DtweLvTN7uF44tSbgd51Ha/+fez1/STNy qsO9XkXJswxW7AKhnpQ/egvTSHXT3zE5N4xTAb0B5eVIle4Zd6n33kYAUy9O7E9eiO/Y PYpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970448; x=1728575248; 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=3wz69cklJBmi/gyynP/MNmECb+F1rpo4+jC/BQdSi/0=; b=pJ8W1PnYqrtpmb6Ki7piypmxPvYQl9WiEDfjDzrCHDkbc7iLm4Z8el+aTLWZBnIkGD 87JwFnU/QbwNNaDX4+23vTMqsi95nxr7He9HFK/N4+NBIpoclYB5PpYaF5bKbHHODHuu EA+c1zygk3dcKtlFvgEIhcSuDApK7nkc8+zs9hPyIo8RuUTATzQ+rT0AO3oDBZi+zfOo VxxpKncqrWxNPIKEYiaW1eeYPlYO1WnnHv1ngc1ZdI+RgZ1zBI585L5FQmZRfvzruRJY F9OU581oF2nW6jg9Aj2+sFnIUrJcEnpW2UD88G77Nx6KIldxT8h4BzieZlsKXHScbNlW tPuQ== X-Gm-Message-State: AOJu0YxP0q3xOoxSHu/M95QNxveJaUQMwGRI6XYW9lLr5YNiE4rw+Mji fOhNZXZCPusiHretVpx+uhtqx+Gmw+eh/Wo73WRXem5HWSzGi4vZh/fABhXmF116Djrr51hFASL 2o6vUxgna X-Received: by 2002:adf:e3ca:0:b0:37c:cd1d:b87e with SMTP id ffacd0b85a97d-37cfb8cb7a9mr4177972f8f.18.1727970448065; Thu, 03 Oct 2024 08:47:28 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:27 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini Subject: [PATCH v11 23/29] lwip: tftp: add support of blksize option to client Date: Thu, 3 Oct 2024 17:46:27 +0200 Message-Id: <4fd1d5e3848d3e433664165d427dde5e30a99597.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 TFTP protocol uses a default block size of 512 bytes. This value is sub-optimal for ethernet devices, which have a MTU (Maximum Transmission Unit) of 1500 bytes. When taking into acount the overhead of the IP and UDP layers, this leaves 1468 bytes for the TFTP payload. This patch introduces a new function: tftp_client_set_blksize() which may be used to change the block size from the default. It has to be called after tftp_client_init() and before tftp_get(). If the server does not support the option, the client will still accept to receive 512-byte blocks. Signed-off-by: Jerome Forissier Acked-by: Ilias Apalodimas --- lib/lwip/lwip/src/apps/tftp/tftp.c | 94 +++++++++++++++++-- .../lwip/src/include/lwip/apps/tftp_client.h | 1 + 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/lib/lwip/lwip/src/apps/tftp/tftp.c b/lib/lwip/lwip/src/apps/tftp/tftp.c index 74fc1fbe586..8e0c071772a 100644 --- a/lib/lwip/lwip/src/apps/tftp/tftp.c +++ b/lib/lwip/lwip/src/apps/tftp/tftp.c @@ -57,7 +57,7 @@ #include "lwip/timeouts.h" #include "lwip/debug.h" -#define TFTP_MAX_PAYLOAD_SIZE 512 +#define TFTP_DEFAULT_BLOCK_SIZE 512 #define TFTP_HEADER_LENGTH 4 #define TFTP_RRQ 1 @@ -65,6 +65,7 @@ #define TFTP_DATA 3 #define TFTP_ACK 4 #define TFTP_ERROR 5 +#define TFTP_OACK 6 enum tftp_error { TFTP_ERROR_FILE_NOT_FOUND = 1, @@ -88,9 +89,11 @@ struct tftp_state { int timer; int last_pkt; u16_t blknum; + u16_t blksize; u8_t retries; u8_t mode_write; u8_t tftp_mode; + bool wait_oack; }; static struct tftp_state tftp_state; @@ -137,10 +140,24 @@ send_request(const ip_addr_t *addr, u16_t port, u16_t opcode, const char* fname, { size_t fname_length = strlen(fname)+1; size_t mode_length = strlen(mode)+1; - struct pbuf* p = init_packet(opcode, 0, fname_length + mode_length - 2); + size_t blksize_length = 0; + struct pbuf* p; char* payload; err_t ret; + if (tftp_state.blksize) { + blksize_length = 14; /* maximum (blksize is a u16_t): 'blksize\0XXXXX\0' */ + if (tftp_state.blksize < 10000) + blksize_length--; + if (tftp_state.blksize < 1000) + blksize_length--; + if (tftp_state.blksize < 100) + blksize_length--; + if (tftp_state.blksize < 10) + blksize_length--; + } + + p = init_packet(opcode, 0, fname_length + mode_length + blksize_length - 2); if (p == NULL) { return ERR_MEM; } @@ -148,7 +165,10 @@ send_request(const ip_addr_t *addr, u16_t port, u16_t opcode, const char* fname, payload = (char*) p->payload; MEMCPY(payload+2, fname, fname_length); MEMCPY(payload+2+fname_length, mode, mode_length); + if (tftp_state.blksize) + sprintf(payload+2+fname_length+mode_length, "blksize%c%d%c", 0, tftp_state.blksize, 0); + tftp_state.wait_oack = true; ret = udp_sendto(tftp_state.upcb, p, addr, port); pbuf_free(p); return ret; @@ -221,14 +241,14 @@ send_data(const ip_addr_t *addr, u16_t port) pbuf_free(tftp_state.last_data); } - tftp_state.last_data = init_packet(TFTP_DATA, tftp_state.blknum, TFTP_MAX_PAYLOAD_SIZE); + tftp_state.last_data = init_packet(TFTP_DATA, tftp_state.blknum, TFTP_DEFAULT_BLOCK_SIZE); if (tftp_state.last_data == NULL) { return; } payload = (u16_t *) tftp_state.last_data->payload; - ret = tftp_state.ctx->read(tftp_state.handle, &payload[2], TFTP_MAX_PAYLOAD_SIZE); + ret = tftp_state.ctx->read(tftp_state.handle, &payload[2], TFTP_DEFAULT_BLOCK_SIZE); if (ret < 0) { send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Error occurred while reading the file."); close_handle(); @@ -239,6 +259,28 @@ send_data(const ip_addr_t *addr, u16_t port) resend_data(addr, port); } +static u16_t payload_size(void) +{ + if (tftp_state.blksize) + return tftp_state.blksize; + return TFTP_DEFAULT_BLOCK_SIZE; +} + +static const char * +find_option(struct pbuf *p, const char *option) +{ + int i; + u16_t optlen = strlen(option); + const char *b = p->payload; + + for (i = 0; i + optlen + 1 < p->len; i++) { + if (lwip_strnstr(b + i, option, optlen)) + return b + i + optlen + 2; + } + + return NULL; +} + static void tftp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) { @@ -338,6 +380,15 @@ tftp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr } blknum = lwip_ntohs(sbuf[1]); + if (tftp_state.blksize && tftp_state.wait_oack) { + /* + * Data received while we are expecting an OACK for our blksize option. + * This means the server doesn't support it, let's switch back to the + * default block size. + */ + tftp_state.blksize = 0; + tftp_state.wait_oack = false; + } if (blknum == tftp_state.blknum) { pbuf_remove_header(p, TFTP_HEADER_LENGTH); @@ -349,7 +400,7 @@ tftp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr send_ack(addr, port, blknum); } - if (p->tot_len < TFTP_MAX_PAYLOAD_SIZE) { + if (p->tot_len < payload_size()) { close_handle(); } else { tftp_state.blknum++; @@ -386,7 +437,7 @@ tftp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr lastpkt = 0; if (tftp_state.last_data != NULL) { - lastpkt = tftp_state.last_data->tot_len != (TFTP_MAX_PAYLOAD_SIZE + TFTP_HEADER_LENGTH); + lastpkt = tftp_state.last_data->tot_len != (TFTP_DEFAULT_BLOCK_SIZE + TFTP_HEADER_LENGTH); } if (!lastpkt) { @@ -405,6 +456,25 @@ tftp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr close_handle(); } break; + case PP_HTONS(TFTP_OACK): { + const char *optval = find_option(p, "blksize"); + u16_t srv_blksize = 0; + tftp_state.wait_oack = false; + if (optval) { + if (!tftp_state.blksize) { + /* We did not request this option */ + send_error(addr, port, TFTP_ERROR_ILLEGAL_OPERATION, "blksize unexpected"); + } + srv_blksize = atoi(optval); + if (srv_blksize <= 0 || srv_blksize > tftp_state.blksize) { + send_error(addr, port, TFTP_ERROR_ILLEGAL_OPERATION, "Invalid blksize"); + } + LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, ("tftp: accepting blksize=%d\n", srv_blksize)); + tftp_state.blksize = srv_blksize; + } + send_ack(addr, port, 0); + break; + } default: send_error(addr, port, TFTP_ERROR_ILLEGAL_OPERATION, "Unknown operation"); break; @@ -495,6 +565,18 @@ tftp_init_client(const struct tftp_context *ctx) return tftp_init_common(LWIP_TFTP_MODE_CLIENT, ctx); } +/** @ingroup tftp + * Set the block size to be used by the TFTP client. The server may choose to + * accept a lower value. + * @param blksize Block size in bytes + */ +void +tftp_client_set_blksize(u16_t blksize) +{ + if (blksize != TFTP_DEFAULT_BLOCK_SIZE) + tftp_state.blksize = blksize; +} + /** @ingroup tftp * Deinitialize ("turn off") TFTP client/server. */ diff --git a/lib/lwip/lwip/src/include/lwip/apps/tftp_client.h b/lib/lwip/lwip/src/include/lwip/apps/tftp_client.h index 24dbda6a8c9..e1e21d06b67 100644 --- a/lib/lwip/lwip/src/include/lwip/apps/tftp_client.h +++ b/lib/lwip/lwip/src/include/lwip/apps/tftp_client.h @@ -44,6 +44,7 @@ enum tftp_transfer_mode { }; err_t tftp_init_client(const struct tftp_context* ctx); +void tftp_client_set_blksize(u16_t blksize); err_t tftp_get(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enum tftp_transfer_mode mode); err_t tftp_put(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enum tftp_transfer_mode mode); From patchwork Thu Oct 3 15:46:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832421 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354511wra; Thu, 3 Oct 2024 08:49:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWSBm13eLGfXE847/pXnjLeBkUb118l51OaUj2iYLlrLWcJN/5IGzZTsVbT92nHjVikdD9ALQ==@linaro.org X-Google-Smtp-Source: AGHT+IGh3f77jMUTJ/d2RehgKEQx46/k0sWnCW0vmdS6PIVioYNGumjzmkCMAc3oqcFF0pyAg3RR X-Received: by 2002:a92:cd87:0:b0:3a0:9238:d3c with SMTP id e9e14a558f8ab-3a36e219623mr25432005ab.3.1727970555624; Thu, 03 Oct 2024 08:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970555; cv=none; d=google.com; s=arc-20240605; b=EnKuwZawQb3t7wwB9YUap2dQMkc2TOEA+Kv1malw8WZ0VMyy+N53vsYNmcxRmyJiNF ZNNB1k0NrjkAB9/Mz8+vUy7bMzT0aY366BF1MBzfL+4HlbD66dnlkpyqw+KRJ2HQgx8n mkod5N2447YlVVUM6WWAEPo9ZPKNmbZgHD6kw+aGdc3YDDPKykIZmLb+KiALqF3MKUZd KWbtPvmwOrLTvt5EjGRAa7FWmqfFg4Kqm+lUt1VPe5kN0vkyBvziyS0RYQzA2NmFmng9 LUD/aU9PcQzsfFNA5V/75k3D+iV27wlFECpGLxbjk7QnHV+qhTzu6BWtWLKZsUupXxoj ED0w== 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=5G+9QtFQpBdFjhMWrV1vO4Z5+gjUnIBRwFl+FYgTv68=; fh=0b25qEv3hzIOOWq4VOVebC/hTOJSSO0hOqDEspxbJTk=; b=li+kA2aWSCsjy0I9WYhtaOaeMvRz5ImgHlupTxbMcFeoPkvEDU1EyXBjowPxmMO3QH d7jbikUfarxYfiYKCHL7k3JjNY5Zi2QsrD0m3Unx0GGbExdIqTBjzjr6qbzBCJFHVPqx tbAGDgnXKhN8a/Oqp/rSChPCxzzIa+gFOjko/gIXbSMAS3u8pOozLCQtpI3/dlR8Tq2y 8wXk58Sz3D3MpfQj8dSGjkWXt7epyYYxwRsK7Jx7YTts6W0MTuHwbrk41CrRkCcyz+y+ UA/TY5EqF6rUqZ4e4aNEmB7sjYwAxZv3GnI95yad2Wm8bi1NwZ/iJVIAjARqffYflnbe Eryg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zh+KgQvP; 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 e9e14a558f8ab-3a3716362basi6259055ab.176.2024.10.03.08.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:49:15 -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=Zh+KgQvP; 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 C184388EF7; Thu, 3 Oct 2024 17:47:34 +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="Zh+KgQvP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F0D688EE8; Thu, 3 Oct 2024 17:47:33 +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-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 950E688F3D for ; Thu, 3 Oct 2024 17:47:31 +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-x329.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so11349385e9.3 for ; Thu, 03 Oct 2024 08:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970450; x=1728575250; 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=5G+9QtFQpBdFjhMWrV1vO4Z5+gjUnIBRwFl+FYgTv68=; b=Zh+KgQvPS9qXyjUYV/rKdHE5VwXnaNoaJrvVPYxNI02B8SUXxZLihk91ClFy2sAHQv rRpNUaJvCQcGpFujeI4K1sal7lE7yWplJ8vnIH3NXgvs63BSNp05eshtLh17s1Nzm/q6 WK3mZRnwhXz03+Bp5mT61VYtw3SigcoWsilgJdgeN49xToxPr9ChcW/xmQ+o4/C60Mjp lgGFyz3mNptvZITxiHLgZCRWA/R3Ulur+cyjWgU0r2BoM8H4kjAShQ5vXJMc9AXaRh7q /0KHzbn2w/LROFYaEOMV8hxgFF0yoxxGkdEH20q7JumglF/j4PZfBQM7CFR3WwxoV69c ZPrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970450; x=1728575250; 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=5G+9QtFQpBdFjhMWrV1vO4Z5+gjUnIBRwFl+FYgTv68=; b=Lvw4tRlb8j7F0twAgpjmQbNOXbuS68+sdL1eW1WE117zf0FHzNVLozgmbtqG/4VDwL FYJbzOpQdc4PyxCU8Ee0HHHExuxXEy2R4EqCRMlF4XviGGjnNhfHqSpqKagNZb/FxrQz uH2NOxBaL6uGUiey50/rGjP4o+8lnB4mz0/eE1uU/vQH+5JazqUrhAXHf4FJlQaEWu5A fg0F0UN1Bw75SSZN8I6A8Kqal6VLWDUhSFjIDpChE8+VS6gtkNjWX4bwFMLypM0Ntymy 61WMW1PBcwHG3Od9E58Nttx2SqP6xVkmexCrMcZz8YKI3Ag6AQxJIEJ08Q6jQWNiV1tN zLsw== X-Gm-Message-State: AOJu0YwvNi6hSHeybVe0w9kOhBATI3QHPvkLyo1UdUBU2vz2BXSiotaX S7ChAN9IBmroCYW2msA3uZpPfgym2SUpWUeEPzjZJDsGh0reZoMUwzEJvpr92dxbUcu8PeiPr71 PQjX0ynvo X-Received: by 2002:adf:9bcf:0:b0:374:c847:83a with SMTP id ffacd0b85a97d-37cfb8b536cmr4373984f8f.8.1727970450523; Thu, 03 Oct 2024 08:47:30 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:29 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Anand Moon , Baruch Siach , Simon Glass Subject: [PATCH v11 24/29] net-lwip: add TFTP_BLOCKSIZE Date: Thu, 3 Oct 2024 17:46:28 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 support for setting the TFTP block size. The default value (1468) is fine for Ethernet and allows a better throughput than the TFTP default (512), if the server supports the blksize option of course. I tested this change with qemu_arm64_lwip_defconfig. The throughput is now 875 KiB/s vs. 313 KiB/s before. That is still a low number, but I think we can't expect more without implementing the windowsize option. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- net/Kconfig | 20 ++++++++++---------- net/lwip/tftp.c | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/net/Kconfig b/net/Kconfig index 16a9de47e94..76ab7d91eeb 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -60,16 +60,6 @@ config SYS_FAULT_ECHO_LINK_DOWN this option is active, then CONFIG_SYS_FAULT_MII_ADDR also needs to be configured. -config TFTP_BLOCKSIZE - int "TFTP block size" - default 1468 - help - Default TFTP block size. - The MTU is typically 1500 for ethernet, so a TFTP block of - 1468 (MTU minus eth.hdrs) provides a good throughput with - almost-MTU block sizes. - You can also activate CONFIG_IP_DEFRAG to set a larger block. - config TFTP_PORT bool "Set TFTP UDP source/destination ports via the environment" help @@ -254,6 +244,16 @@ config NET_RANDOM_ETHADDR generated. It will be saved to the appropriate environment variable, too. +config TFTP_BLOCKSIZE + int "TFTP block size" + default 1468 + help + Default TFTP block size. + The MTU is typically 1500 for ethernet, so a TFTP block of + 1468 (MTU minus eth.hdrs) provides a good throughput with + almost-MTU block sizes. + You can also activate CONFIG_IP_DEFRAG to set a larger block. + endif # if NET || NET_LWIP config SYS_RX_ETH_BUFFER diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c index 26978643313..f4d0a6aa19a 100644 --- a/net/lwip/tftp.c +++ b/net/lwip/tftp.c @@ -139,6 +139,8 @@ static int tftp_loop(struct udevice *udev, ulong addr, char *fname, if (!(err == ERR_OK || err == ERR_USE)) log_err("tftp_init_client err: %d\n", err); + tftp_client_set_blksize(CONFIG_TFTP_BLOCKSIZE); + ctx.start_time = get_timer(0); err = tftp_get(&ctx, &srvip, srvport, fname, TFTP_MODE_OCTET); /* might return different errors, like routing problems */ From patchwork Thu Oct 3 15:46:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832423 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354689wra; Thu, 3 Oct 2024 08:49:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXLw0ShmHGoNK5hI6C41q3S6cSCALtoYRusEkZDJyjAr6GUc9v+Z+c0sEgwKkiOTZInWSHp/g==@linaro.org X-Google-Smtp-Source: AGHT+IGCNpXTYjlDDu0N8kfmW9hdE1jpo5AK+xmVd2MKdQQcuFjJ1ufdrQDmyJQNqx/wGB5PvYeY X-Received: by 2002:a05:6e02:2147:b0:3a0:ce43:fb62 with SMTP id e9e14a558f8ab-3a36e2be9f0mr27149785ab.11.1727970581215; Thu, 03 Oct 2024 08:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970581; cv=none; d=google.com; s=arc-20240605; b=HoMs3JyviVli9xkbtooLVvOoPo63Ra5vXD2eICPIDR7Im4kcFLtJLOMokDSQWo8oQl NbY94IVuhfqRc5fExobvCURQNPil+ZCYpazLTXtMZ+QrWT5XHbB+sSL7KiXsUYJtq/pp GvODoBUlQavPE/fQ4lmXuxqubz6NmCWjGQ/s2ezaoZNTnwpkKkHMY3z02Zi577PljXS3 uo6l5iA5t7izGQtlyLdFo1X/pAKJ/kw14583Xw4pSEym+0l4S97qSrpMZnzGUBCZtQD7 C8CUXWBkqM3h7lLI4xbzJ6N7VW+//V2wBzUnZ3lscBtY90Jy8WrN5lqg1qwrlP4M3COe Y3NA== 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=YReqvMd/BxfFFS2kjHJgaJSXZI3pm+qMN/lkAT63YpM=; fh=OYXFaMVtuHmv9gLCSSMY/uyKNg9f3UktvZpibW2fTHM=; b=VooHmSN7fygc7fE69NEBlXVhBPiHXEqb3HhYTXDgRJCgR39FjsdiF/8wmFcd3ILBq3 irkCoRPi9CHkaYpzkaeQXz9QZhgV5OwyK+b0+z/V2YjIL576tCmsG9uuHt3ykFKzbSat sTp8EXBKqyrDdKcsX/UVVk9N/FOw+hbk5IGRgUlYbMHvv3x0R8KpHgORFGWaQPBP9tQk BWZoaHKisfn6X7briUMQoHJjU0udSF6fH+oTfbH8tH9kb26cjZ37APmTZYTU0T8TOapy 0fNlaftIR7+FWbAemALC9qEqXNJ38+JGbYeHqei+x1w/BIz6MsGhDzhsdve5hF1pCqAd 5/fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wC9oPP7W; 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 8926c6da1cb9f-4db558614a6si817787173.13.2024.10.03.08.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:49:41 -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=wC9oPP7W; 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 83FB888EF8; Thu, 3 Oct 2024 17:47:36 +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="wC9oPP7W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C7E9888F65; Thu, 3 Oct 2024 17:47:35 +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-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 8E4BA88E7A for ; Thu, 3 Oct 2024 17:47:33 +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-x434.google.com with SMTP id ffacd0b85a97d-37cd8a5aac9so709273f8f.2 for ; Thu, 03 Oct 2024 08:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970452; x=1728575252; 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=YReqvMd/BxfFFS2kjHJgaJSXZI3pm+qMN/lkAT63YpM=; b=wC9oPP7W654EgF92w53jOfNWTbxfssbU4FGH5nA2hdwbzq+f3NIJNHhtvJa3iHbUqW k90Z5WShD2RzWvpdhawe4yfhIT2KnLpXPbz0hQZ+lziO11elDiJQwxSdXFGBf/v+Kwlz bES8R8Ohb1OVjSl7SLDmfG5vG8Og9aL6ldBU8OkdTxraf70YleA2S1nAuHR5eTgJS3Kq zPlMEZtvHwCEJj5UOzupjkVrf0oKLLIPwVEHjRecviTdkzWTumYhTnxcrNHbDPhwCZ4r j0dVdUEoS163QTD/dA8mfgkPXSfW3lJ96tI1Wv++DCE+RMW7VkdnFLWfwxYJkZFA5pg4 AB7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970452; x=1728575252; 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=YReqvMd/BxfFFS2kjHJgaJSXZI3pm+qMN/lkAT63YpM=; b=ONZD3LMyf6kQkJle7c752mwfmG6t8WrIveAAW+WHI0NLon9o2Bg9SA0m8t1aOKM21D sYNss7rpwCTmfmVaJKXKtUNogtdiDv9kcLGLQC+JgKYjtbnW4grlHjgvwb1hwla75n0C rh1j7fx9KyZLlKcvrezCfOKIuiTdFtGznf6A/OmENRigs2YR/X031mORwP4xvCQqD1pc kLQ38DkwTQPoZf9F52vP2Cs3g1WI688s30UyA0DrudpvyPhl3Ih9k00NbhZCB0e7O6C5 0Xe1NiUr9VAh6Tr4ZaC0BNn+7/PhikrcEsI3BKpmNUQTqGJpmZGHTtqpR6QgW0Ty0Mev yd/w== X-Gm-Message-State: AOJu0Yyyi9+J6tfpL/vEht074RwdxxSERX4MhpFTzbxZgh/TIZ/wlKLK t9wplMKncz0U8v7medHx1DWWupQ1tDDNW7WVEInyFsuWpgjRQFFL8eOTn2g0QrnnOIKNK+qqz+4 fqAja3sBn X-Received: by 2002:adf:a152:0:b0:37c:d179:2f77 with SMTP id ffacd0b85a97d-37cfb8a48fdmr4977874f8f.12.1727970452319; Thu, 03 Oct 2024 08:47:32 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:31 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Jiaxun Yang , Heinrich Schuchardt Subject: [PATCH v11 25/29] CI: add qemu_arm64_lwip to the test matrix Date: Thu, 3 Oct 2024 17:46:29 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Build and run qemu_arm64_lwip_defconfig in CI. This tests the lightweight IP (lwIP) implementation of the dhcp, tftpboot and ping commands. Signed-off-by: Jerome Forissier Acked-by: Ilias Apalodimas --- .azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 93111eb6127..59fddb96a48 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -238,6 +238,10 @@ stages: cd \${WORK_DIR} git config --global --add safe.directory \${WORK_DIR} git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks + # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled. + # The test config and the boardenv file from qemu_arm64 can be re-used so create symlinks + ln -s conf.qemu_arm64_na /tmp/uboot-test-hooks/bin/travis-ci/conf.qemu_arm64_lwip_na + ln -s u_boot_boardenv_qemu_arm64_na.py /tmp/uboot-test-hooks/py/travis-ci/u_boot_boardenv_qemu_arm64_lwip_na.py ln -s travis-ci /tmp/uboot-test-hooks/bin/\`hostname\` ln -s travis-ci /tmp/uboot-test-hooks/py/\`hostname\` grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd @@ -415,6 +419,9 @@ stages: qemu_arm64: TEST_PY_BD: "qemu_arm64" TEST_PY_TEST_SPEC: "not sleep" + qemu_arm64_lwip: + TEST_PY_BD: "qemu_arm64_lwip" + TEST_PY_TEST_SPEC: "test_net_dhcp or test_net_ping or test_net_tftpboot" qemu_m68k: TEST_PY_BD: "M5208EVBE" TEST_PY_ID: "--id qemu" From patchwork Thu Oct 3 15:46:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832424 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354767wra; Thu, 3 Oct 2024 08:49:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWWRcAC38Dahezs/MtOJ0r7OQp5KUi3FDBpd/yEocl+oC5sUnd+wI1hOTjfsr1TdmJv9O7Qvw==@linaro.org X-Google-Smtp-Source: AGHT+IFCJB/lRLgYZ02bq4iX3VCYWAyJ+3E11+RojXrH6uw3bLWZ0gY/Wgiw5P1Oc7SrsgHfKgwj X-Received: by 2002:a05:6602:6304:b0:832:123:c470 with SMTP id ca18e2360f4ac-834d84d891cmr665082439f.15.1727970595722; Thu, 03 Oct 2024 08:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970595; cv=none; d=google.com; s=arc-20240605; b=Gl488OQDuBFR3JIQXX7yG/N85NX2mrkImMl6VyfXedCgrhS3TIPZCgvSt2OOtkTUZQ BtXZBB4hxQwoSaw912M4dzr6GGi/NkmpPlnTHLBbVlvYTSDsEAt4FH0lKBUF9FMxBbT0 xU0+nIcm28tJuAZCHGm7OwBDwNjv6Up736LXJhPUuw91VsOClW1b6kth1bMLuw1YBE3a UVcHpLhAvYb05XrlDYcvhefdy8GvxuNKtgS8wVC5j95kNbTo1eQr5UnqZm25Lm/sAhKc JPfhNeABJqr7EeM0kAqkOYo+MU3x6V7aRtUeZ4x7HUfvTBvy/kR8uWNWCq0522QWr6zD BqNg== 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=iR7fwaiaf6ymrpq1AznpcyUra4kodMDvFIUQi7Nly3U=; fh=2nSSMnevpF8G4u1oxvQ3dmbm/++gOSZr/l+0Oy5rCQc=; b=cEw1yU7MduRhPU9E9vzrnPD7vOlA4/VrMCaIIuDD7Xrx/I8NeBZYi5llv5nh0NPLvO wpRUv1eN/Fvu9Wb9jw6MWYeSsmcC07TZptYwkBg8xYLQGJypwV/i+lRLptEV2qMSYG5S Xk55PQAjDjIKZyC08dwxERkcXFLcrf3Ec/An6bxkA2Cz4jE51IRwjw9uc9hjL3qjH+RF N1U1X3LUF946x6tOGx0HEGr2j1FR2tmpwq+SqTr/b2xiA24er1G2glHtZ6aYYmgnv3Ps zEILxjjRQoDI+dYFp1Gq89WsF2gq9Jf50ToBnEWsCgBmtZzLz5GyI9bqOlbcxRyGdE6h slxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XE91zOjv; 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 8926c6da1cb9f-4db558616aesi869846173.18.2024.10.03.08.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:49:55 -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=XE91zOjv; 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 E692888E7A; Thu, 3 Oct 2024 17:47:38 +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="XE91zOjv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A23C88F95; Thu, 3 Oct 2024 17:47:37 +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 5AB6888F5E for ; Thu, 3 Oct 2024 17:47:35 +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-42cbface8d6so14487815e9.3 for ; Thu, 03 Oct 2024 08:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970454; x=1728575254; 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=iR7fwaiaf6ymrpq1AznpcyUra4kodMDvFIUQi7Nly3U=; b=XE91zOjvGjM+wN6SuJYG6SgZ7syfCeGLdhtHaTgMUFqLX3xfPHsmk+7BrNR+TfpRcP VS+gkyvZlMYAFU1atDYRyehMBaP8u6CThQST5DQHZrlwgxaOzIFbqUslDGLZtdQYpKfH cupHVE5CNHhErFP8Aoscq1l+UKQHeuC34l7e8w1u1OHTIn0nP/6QwDeBIKQCU/dl0O05 2jj6ULrFTryCffZ5EQ9f+ChnuEO02bCtsKeCn+1CL/Me1D41fiy4ksBMSAuBWW5709IV OGB/4wzbsz51+9V0yjXDwZKac4Zp7xUtcGeAIG/Oltp0LlnUhVjRc4OtgfJ+Mu3SKV7f T1bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970454; x=1728575254; 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=iR7fwaiaf6ymrpq1AznpcyUra4kodMDvFIUQi7Nly3U=; b=rvxusypdwmTcT7fLy1oumcXc6BwlGt1VKMn/f+Dd2h3SlQqIaWzo0gx54y/edZnyfJ x+tNZTz18XoIfPX3kgAzU9AMiFH/nE7KZ3Cpnm22D5XDRVJM/HmmuS1ieWoOsbuV28Nm IsXt+yRNFX1xoriXIySCtCkkXujhH7iJ8x9qF9gAklIJOWqQd/eMWQmCBNoTf6SJyGnW KERM7PjXLlEcRBloTvSufjotC3GplsriRJUpjPsh2cMD73ZAR5xXSlIUg/RT6CP08rKL 8Z1gIRZWt8xVFA/g28Uooui67hy55DQkLJqV6c8Hvd8sCiTE1YU0EGldarhhzxlmpGka GmNQ== X-Gm-Message-State: AOJu0YwN5C43XtTzUS3p8LzqHxcBL9yv/qt7VBggRxZ+CdTMePMjRNQH OhvZFDZ0ghJSZi4kLtG6A4l7naWAfZKwpkCpvCWkOFmxoCNKbGVVq36j4fjxRQmx/KVOH4JiWqH aKoD4VqSK X-Received: by 2002:a05:6000:1211:b0:37c:d1ea:f1ce with SMTP id ffacd0b85a97d-37cfb9d318amr5296393f8f.25.1727970454109; Thu, 03 Oct 2024 08:47:34 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:33 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Mattijs Korpershoek , Sumit Garg , Neil Armstrong , Caleb Connolly , Robert Marko , Sam Protsenko , Andrew Davis Subject: [PATCH v11 26/29] MAINTAINERS: net-lwip: add myself as a maintainer Date: Thu, 3 Oct 2024 17:46:30 +0200 Message-Id: <97a2a2f8bceaf42aef74ea2daef9d1d6bb4445ac.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 myself as a maintainer for the lwIP network stack integration code and network commands as well as the sandbox ethernet driver for lwIP. Signed-off-by: Jerome Forissier Acked-by: Ilias Apalodimas --- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7ab39d91a55..27d6de67b21 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1352,6 +1352,17 @@ F: drivers/net/ F: include/net.h F: net/ +NETWORK (LWIP) +M: Jerome Forissier +S: Maintained +F: cmd/net-lwip.c +F: configs/qemu_arm64_lwip_defconfig +F: drivers/net/sandbox-lwip.c +F: include/net-lwip.h +F: lib/lwip/Makefile +F: lib/lwip/u-boot/ +F: net/lwip/ + NIOS M: Thomas Chou S: Maintained From patchwork Thu Oct 3 15:46:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832425 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354881wra; Thu, 3 Oct 2024 08:50:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXidLs2+B/+gNfZl1SAACYIwi12lrerR89bh9fu7u842VfxIMs076PdT+nCdNe6Sxl5WYQLg==@linaro.org X-Google-Smtp-Source: AGHT+IH0smM2rdO2QNSr3kflXbBy7oDEvJJyFLfMDoVC8sZnaarnwn8lJJEHYFutGCJLzAJ0vowv X-Received: by 2002:a05:6e02:1543:b0:3a0:9f85:d74f with SMTP id e9e14a558f8ab-3a3659445bcmr68362555ab.16.1727970610474; Thu, 03 Oct 2024 08:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970610; cv=none; d=google.com; s=arc-20240605; b=XWzg/Io+o/lpda+0y5K4ciAkXt1EkTPGELD5BlDJO8A1R5NQIaLtA1yZ/zNp65RjnP SDhfqS527w5AcQ9llsrY50MsrVM32Ka+KoCJCKGjpmMKWirwlbcqGo1VRLiaKkX+a8Id r8fVtj5EWQ/R/Ix2qVi60Uj4U9JlaW4Sy0RmUEoAe1gut9eWlDpOOf2rbao4dBMvvxk4 tBqcbPzE2SXQjCHy/lyDSk8dP6xg2PS/MielasCDiyQ0HX7ifAnl9uibf8DsPOLGtS9z wsIw4EduyvFBYHaPhfg6Js9zQ2VBF3Gdrm8xt2Uf9ZzdKdZDvVPdjxEywinl/qhE/5YR 4IXw== 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=MktPFMTO7Kpc7/pKSJ53v9OJ+XoE2+jn+aez6r7cU7Q=; fh=jsFXu3iLijXIN2uYmlfqKS6I1KzGXFCz88a7kH8+wjU=; b=jh6jKF80bYm7cs0eYKgh+iP4iWUCUFCZLHwokM9sSjelrTO7xmLXezfxoKgHDbygY0 w5iIYIzy8toJ5ab6kczp52akh8sGbA+7qEGVjfiEP3UDToeG1YgwddYt6eR8QZM7N1mJ 0OosXJpL/iVN81WbgH7vYuA9658JNSzU08NAzOZJkuAPmp7KiWykm9ucC1Bds+N924MN fqEb0y6pqKRkCFAmWkgW3drRtxc98RjGC2zjm2rkW8wO9Q6qLoHD8hRSbjSxnKiu9HOf PA8hBlu+QQjUOkQL9TBzv7ch92E+ogHZJ0sPy5GwiZAjq83eMD0nnmc2z/aLIH2HSGE7 LZXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aPzhxr7E; 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 e9e14a558f8ab-3a3713916cdsi6594105ab.33.2024.10.03.08.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:50:10 -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=aPzhxr7E; 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 5850488F62; Thu, 3 Oct 2024 17:47:40 +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="aPzhxr7E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5BB5888F62; Thu, 3 Oct 2024 17:47:39 +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 2536588EE8 for ; Thu, 3 Oct 2024 17:47:37 +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-37cd1ccaf71so1289225f8f.0 for ; Thu, 03 Oct 2024 08:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970456; x=1728575256; 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=MktPFMTO7Kpc7/pKSJ53v9OJ+XoE2+jn+aez6r7cU7Q=; b=aPzhxr7EztjkaH1Vxiz9+88mhsAM25fiBYgGiKCbYNF6UZY5+/sv6Kjru14uiHrfCU vPciiIQ9XtIOUfTBMdhDGHcWu0z8ZboubY5Vppruo5q+WX3gA13zR9COMSI/PLNGeQe2 1meTDtBJTzcuOpYUa8slC7H1AJnrmyhqYBeHBwKR4BfaZ+kQoE0ftCyXWZsh3jx39IPn lDFu4bjIl4RxpRWelRpsE3QFCEKhohfURvPFzGTHTTqE2iXeJ8X3pGOiZ3ij5F44Eq60 48ov0D+tMVo21bmlb5j+ZZk+BUBu50Prxu4wGVA0NLRJtJZPTlXTI0ToANBkvs6OqeDm P87w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970456; x=1728575256; 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=MktPFMTO7Kpc7/pKSJ53v9OJ+XoE2+jn+aez6r7cU7Q=; b=MNGL0w1KR3zfOITEKoXST2BgRN66tUQ5QpfZuhWcviwr8MYXFYTu5F8gyUWynsZL6a j0XKHNDrrZ4vbptNgD97ncqbpdEcv7eQH2rKzSjLUB0THoermCb+4xiLEPdPPmfvDfUS vMi3fWMjlqbh7uEeyBki/C1OTwFfkWiH2SAf0bwWXi/3O3AKxVFyPGgKFC+qsH2xwvro YnlAdw9UdUcIUxXBsdZGulQaSPJmh5Zst0Gt996ELeE8xazWhha7cyNFqBoxQtWI8vLr +Iq43nt39OnGYVvwE6cq9gtt82ICUHk96jLdBqxiUbJLEBEl14qgr9Pxd2i/jyBNKECn sc8w== X-Gm-Message-State: AOJu0YxQpJs6jhNBaL+Yu+OvZk2wNlT+wTM/p1e61UOy2PLsyHmrHMvj 65btEAsle61nNZW/RAtiUz4X3NxOSw2PQiJgF5aWYL1A6gEQ9oYY0TGSZUU2790JblA93fBBa+D AzQvBlqf9 X-Received: by 2002:a5d:688e:0:b0:374:c6b6:c656 with SMTP id ffacd0b85a97d-37d04a32a79mr2203310f8f.21.1727970456286; Thu, 03 Oct 2024 08:47:36 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:34 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass Subject: [PATCH v11 27/29] configs: use syntax CONFIG_FOO=n in tools-only_defconfig Date: Thu, 3 Oct 2024 17:46:31 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 tools-only defconfig causes troubles on MacOSX due to the default C compiler being Clang (LLVM) rather than GCC and more specifically due to [1]. Therefore replace "# CONFIG_FOO is not set" with the equivalent "CONFIG_FOO=n" using the following command: $ sed -i -e 's/# \(CONFIG_[^ ]*\) is not set/\1=n/' \ configs/tools-only_defconfig This fixes the tools_only_macOS CI job on GitHub [2]. [1] https://github.com/llvm/llvm-project/issues/78778 [2] https://dev.azure.com/u-boot/u-boot/_build/results?buildId=9105&view=results Suggested-by: Tom Rini Signed-off-by: Jerome Forissier Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- configs/tools-only_defconfig | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig index e00f2c48598..7511e30d709 100644 --- a/configs/tools-only_defconfig +++ b/configs/tools-only_defconfig @@ -4,26 +4,26 @@ CONFIG_ENV_SIZE=0x2000 CONFIG_DEFAULT_DEVICE_TREE="sandbox" CONFIG_SYS_LOAD_ADDR=0x0 CONFIG_PCI=y -# CONFIG_SANDBOX_SDL is not set +CONFIG_SANDBOX_SDL=n CONFIG_ANDROID_BOOT_IMAGE=y CONFIG_TIMESTAMP=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y -# CONFIG_BOOTSTD_FULL is not set -# CONFIG_BOOTMETH_CROS is not set -# CONFIG_BOOTMETH_VBE is not set +CONFIG_BOOTSTD_FULL=n +CONFIG_BOOTMETH_CROS=n +CONFIG_BOOTMETH_VBE=n CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run distro_bootcmd" -# CONFIG_CMD_BOOTD is not set -# CONFIG_CMD_BOOTM is not set -# CONFIG_CMD_BOOTI is not set -# CONFIG_CMD_ELF is not set -# CONFIG_CMD_EXTENSION is not set -# CONFIG_CMD_DATE is not set +CONFIG_CMD_BOOTD=n +CONFIG_CMD_BOOTM=n +CONFIG_CMD_BOOTI=n +CONFIG_CMD_ELF=n +CONFIG_CMD_EXTENSION=n +CONFIG_CMD_DATE=n CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NO_NET=y -# CONFIG_ACPIGEN is not set +CONFIG_ACPIGEN=n CONFIG_AXI=y CONFIG_AXI_SANDBOX=y CONFIG_SANDBOX_GPIO=y @@ -32,9 +32,9 @@ CONFIG_DM_RTC=y CONFIG_SOUND=y CONFIG_SYSRESET=y CONFIG_TIMER=y -# CONFIG_VIRTIO_MMIO is not set -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTIO_SANDBOX is not set -# CONFIG_GENERATE_ACPI_TABLE is not set -# CONFIG_EFI_LOADER is not set +CONFIG_VIRTIO_MMIO=n +CONFIG_VIRTIO_PCI=n +CONFIG_VIRTIO_SANDBOX=n +CONFIG_GENERATE_ACPI_TABLE=n +CONFIG_EFI_LOADER=n CONFIG_TOOLS_MKEFICAPSULE=y From patchwork Thu Oct 3 15:47:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832427 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp355065wra; Thu, 3 Oct 2024 08:50:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVhM13S2UEvwlHnDfAMHIlvBcMZEFhpcnxorEUroAfOntoduW2DBFq5PD+7hAwhKubRURBCw==@linaro.org X-Google-Smtp-Source: AGHT+IGRPeUdLHOMk43g7EQVz3AmykDLbgtfwuhgr1ofVu5G/iJx29+SXrgbbzzC5yr3LpF2QWwn X-Received: by 2002:a05:6e02:156b:b0:3a3:44b2:acb2 with SMTP id e9e14a558f8ab-3a36594abbcmr64691795ab.25.1727970636156; Thu, 03 Oct 2024 08:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970636; cv=none; d=google.com; s=arc-20240605; b=j3ALfizXf70ZEiDXOo2sEnzW7Ew7eZ3NTCFWkYHNhqIZuqarxsRQmTvA4e1B8+SpNi qgt9ZdG13pAL8VYxVSzDeyj6z5vg2eHTnDPsP2DEC8G6iSrbG8DTDpeeiR8Nb2U1vdil PNeXw944X/MXPx7Y4/AuV99TDD3WLF0MQwMIakaKMInzr+iVg5l83bJBUhuj4FV/W/Bu FxVdu3BDaLouIsMi8yvaKfxf4wjnRm9Yn8OZCGQeeGGc+4I8E2rh7a3AQA6oMO4rsV4o PLyeC/fLk4gYoT2t8n01cJahNM1yZJmpS0k+v8p9xw/oF/1EuP5ZJhrgG/jSfPXqb4Os naWQ== 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=7RhZvZ3tdk5Mh8Ow/UvFZRPsh9uBCSvtkeaZiSHafRM=; fh=nLctY+piC3brlioq4edsEUEEvenyLuk7uWE+vv4aaas=; b=UYOnxoE0khArnXE3HnJM6lxa/oDoWZJ5AvNQo6dlRmQeLLyHK8donnc180cwDOayA5 8rTUlKt6sBD8XjoI4eRQiPQa+IDlksIpveWOcM97sPnC3ZbLOjmKx/QpUsk26YBZ2wDj vXtfMr9ciRcuzLCUgPSQY1QBGcFtj3ojylLy+NsnFe3Qm2b8qzz9MfHRsyzDZBnTMdYE L5cVocVHcIxRC03OSX9g8CBavu/OO3ZUo10b7bvMadfeDaNwZgL+6CEvwdgRGCwNbBFx 2FpIXiFi6gdaYZBJWc/YHJoTS3D1vJjWQvvyIairpaeDR+eBC+ML26xe0Eov+Dp4plSo ocRw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vb04DEY+; 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 8926c6da1cb9f-4db55a63050si873218173.118.2024.10.03.08.50.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:50:36 -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=Vb04DEY+; 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 7E6A888FA9; Thu, 3 Oct 2024 17:48:11 +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="Vb04DEY+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D65AC88C0F; Thu, 3 Oct 2024 17:48:09 +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 48CB988FAF for ; Thu, 3 Oct 2024 17:48:06 +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-42cb57f8b41so14724825e9.0 for ; Thu, 03 Oct 2024 08:48:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970485; x=1728575285; 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=7RhZvZ3tdk5Mh8Ow/UvFZRPsh9uBCSvtkeaZiSHafRM=; b=Vb04DEY+lAMClF5WZ0m5eMYGqWKvFstN1D2/n1sOaNIQjgtRaf51Oq+3+D8KDhQyO+ +UIGcUEmtUF1fkt3DCdfD5OSk79ix2unUXy7Duhdai47m219rIBjxgAl2Ig90G2HXq37 mnWYJGDQvnFJ9Tt8MThva1SPisUemIY2hSTFjxzdUtHiPJpb+eRw12J0+PDurHGLQj9M 6Fxgprv9YQR7Jfhs8lEPft5Vfa05K85jtgWw4G9ZyGLE2AjuJsSDBZQz9Tu6bexdesB3 y4RkVBsJlc6N1x5YeoIM9fzkoaWz0amcEBcXHjgl2mCC7/6aSYW/F8gzV4H2Gj4dGimO SIVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970485; x=1728575285; 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=7RhZvZ3tdk5Mh8Ow/UvFZRPsh9uBCSvtkeaZiSHafRM=; b=MvxUSiu5rG1RcIKZkBhAs79zrpmKezGw7jqCZYAeDieCwYrNxHawrxvEN/bCaVfzQZ jNugo7eBnYnqrucV+Gicj8I78jW0hqGupaS9PMRVuGbmgTKv4gmX1Xt5v2+Cwt4WSvpS qW3qGeOtp2adsuAzKA6k24SSyhqkOeEYy7EQRh5okqUqUigBmrDXKVy9R1M4+3/l9J2/ pF+Oa4iqBfOKW1GMDoJqhQf8pdCdPwKPPPoLKiXzKnpC/rsaTRUlLYEh9i8XMT3oKtNP gZpPyoIOzVObD9b18L5rKjVn8GOUPJSD86OZqFYvYo6zFbbTH1m36Rr7gqcFIMd4RH2M uWPA== X-Gm-Message-State: AOJu0YwbCS0wPlgXyh1CIUlRZJG2M+sUKii4ZkZj2aby0a3h3CZwQjQD ERSMRfJlHcczkDTNbxKz8dE+F9m1xZrVcgwW4+59eV1j7GFrddPf/+fIq3yc25PTevxQsvI4z5O as/SyJnaK X-Received: by 2002:a05:600c:4587:b0:42c:bae0:f05f with SMTP id 5b1f17b1804b1-42f777ba357mr67471075e9.13.1727970485545; Thu, 03 Oct 2024 08:48:05 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d082d22f3sm1531036f8f.103.2024.10.03.08.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:48:05 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Chia-Wei Wang , Maxim Sloyko , Tom Rini Subject: [PATCH v11 28/29] [TESTING] configs: set CONFIG_NET=y for FTGMAC100 Date: Thu, 3 Oct 2024 17:47:51 +0200 Message-Id: <4326113733e2d84c4849f004b30f41021a9a525d.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 FTGMAC100 is not compatible with NET_LWIP which was enabled as the default stack in a previous commit. So enable NET in the defconfig. Signed-off-by: Jerome Forissier Reviewed-by: Chia-Wei Wang Acked-by: Ilias Apalodimas --- configs/evb-ast2500_defconfig | 1 + configs/evb-ast2600_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/evb-ast2500_defconfig b/configs/evb-ast2500_defconfig index 6685f37e3f5..d20ccf16797 100644 --- a/configs/evb-ast2500_defconfig +++ b/configs/evb-ast2500_defconfig @@ -35,6 +35,7 @@ CONFIG_CMD_NCSI=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_NET=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_REGMAP=y CONFIG_CLK=y diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index e6a4e4d1b7c..47faf05a242 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -78,6 +78,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_SECT_SIZE_AUTO=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_NET=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y From patchwork Thu Oct 3 15:47:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832426 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354969wra; Thu, 3 Oct 2024 08:50:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUOFpFNeh3iWEgJxgBFO9pUcm47mDFS00U6RyOHBcNNS44X4vDcgsCxfTRSPtdolavs69WPhA==@linaro.org X-Google-Smtp-Source: AGHT+IH2Xs6ZLpGDH6sN1Vt0G8gicbj6Ov+eHS2pBYDeaF5XaTejeDwTyZ0W4UcldpUenuDza02L X-Received: by 2002:a05:6602:2dd0:b0:831:fbd3:88d3 with SMTP id ca18e2360f4ac-834d83d6dd6mr760505039f.2.1727970623387; Thu, 03 Oct 2024 08:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970623; cv=none; d=google.com; s=arc-20240605; b=Poe1/L9ex5/iPzdU0v4bTVDfQU4OyB2lcFub44ZBGD3IdMR7ZyRlB4wTKJbAx/oeLR C/Ubwj4KHHv7QSUWkARlHFx8AfZAGkpyvMAUHUJmsd1OI00Mcxh0ZptTsWJP0/QOMaZJ 6OzLrcjCQ0wWnnoP6/0ZCsrePU13nImQ1kY0xjpzQgsFTiH6EzGngahx0WAcndg0PGDD 0XhnWa+XHxI+7LdEFxc03u2nj2kgMtA3EIcooCi/YaGtNlxgwGT50fvRAIgfjP7nvvez sOmhq959rl8/J6IhvI76UTlXPHfoISQcUh0oXoV0eUtsycoGOCbjhpu4A92o3aMyLFdJ aSqA== 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=ZC92AK9QFMeBTvjPvqAL1mrcoaCnTtYTGzMIvPRRJuM=; fh=myIbGBF/kz9MJj8FThZouXNUDn5pt8rPpq74+Juggz0=; b=IorNonD4AuudP/sxi5cS1rfgCElCdR6P26HWSWUxRypBCBMDmfCtlutv/TNyTJS0tW e94O1wVq1FvgLs6piy2HWuFwfayetNNCe4L5Zq1NWFM8mPQ4m4tJqZd0iI7KjtLTwjLK smRbO+fb+Nv+zEWEpmLu4bnoLmipo2GLqdMFFNVB//Ql6o6YA8M3MVQfauo/nRHStB5c AfkscvXo6Ys2sBOFGf+luC2Z2dxZihRxtd256BMdh2O/0Cm5Jla/OiR10aV6A3scOGhn l/EiXxTT2BLnD+z2txy5ySZQRrL56lECPQY0eCqOOWZC8hvKm0N6dZkbtbVYS2rJzTkk 5HsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nnU3gXBV; 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 ca18e2360f4ac-834efe3c209si73238639f.95.2024.10.03.08.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:50: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=nnU3gXBV; 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 BF38388E4A; Thu, 3 Oct 2024 17:48:10 +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="nnU3gXBV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9FF2688FB7; Thu, 3 Oct 2024 17:48:09 +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 51E7888FB3 for ; Thu, 3 Oct 2024 17:48:07 +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-37cd831ab06so718826f8f.0 for ; Thu, 03 Oct 2024 08:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970486; x=1728575286; 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=ZC92AK9QFMeBTvjPvqAL1mrcoaCnTtYTGzMIvPRRJuM=; b=nnU3gXBVtKyF4QVBz9muQUScnP4UOYqscfQU3JvoFSIzzRZJDz4//xAjoRUKhAuvyv dOGFKS27FOpZdhEFTy/rB1g4j0ze1E2Rs9DRNdgSmhqrxmpLmLr5qBPNSUYYHIwcntIQ 4uSd6j2o3K2HCmRAP5PXqeElT0jaQ67GWLLm29cznqtNn5pAZglkXCG9nX+Pf3Uk9vmA FfthCIHGTWtis+SSgJQqh9A2RrOsV222vZAoLAzvMKKykXJ+KfXNK7o7+ZGc2iP5vOS3 LgFS8LubgTSN8i0zfBnbfyLhE/EeDqsosB0FKf3lU+V4jPaS6quhSvPfE6otQjCc8Us/ CIZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970486; x=1728575286; 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=ZC92AK9QFMeBTvjPvqAL1mrcoaCnTtYTGzMIvPRRJuM=; b=wTbAsA4qGimZvTLDRUuXojosPEA8tTwF/RHiSzgjg+uPrZdqMRurw8xOa/cPE4spv2 y5eprjEMLFQz8XjRk2VEVdT7rmyi7Wy0JobJCcLnf3dDOfaPvo8dx/xBqXfwEAO55/Q+ l/vH1S+4235ZbK8McReu3NKiMr+RK1nPOuXtZfOEhIzcFLhAnzF6t2az6umk3T0CIbkV GWN7QLRPf2J/Rvk4jy8XX7pFHshyz9CRrGRjbrpHRDrwFB3We87HcJEr4PGXpJ2dir67 HcAeJOts7oRVRsmUjaJjK1cA4o6/6xVGOGbv1PpZoJdmJNwZ9Kjq6oY6IqI6LlukPm5v f/tA== X-Gm-Message-State: AOJu0YzmQhqyIKlLNW3YZm6Za76FmW/LzelH3EgLqibInz5Tzx3c+sRH +OkJhAOM9VHjPGuEDjLnWxuwW/XSX2DO/hVjq+M0Oktt+avGe+FQHa0bQwcXfILJbh/qnScLK1x vUVjV0T3+ X-Received: by 2002:a05:6000:e11:b0:37c:ced1:dd06 with SMTP id ffacd0b85a97d-37cfb9f9ccbmr3984532f8f.41.1727970486523; Thu, 03 Oct 2024 08:48:06 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d082d22f3sm1531036f8f.103.2024.10.03.08.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:48:06 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Paul Kocialkowski , Simon Glass , Svyatoslav Ryhel , Paul Barker , Marek Vasut , Hiago De Franco , Greg Malysa Subject: [PATCH v11 29/29] [TESTING] Kconfig: enable NET_LWIP by default Date: Thu, 3 Oct 2024 17:47:52 +0200 Message-Id: <98207226ad5531b97db1b3a8d798fa9f94877ce9.1727968902.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 NET_LWIP by default for testing purposes. Signed-off-by: Jerome Forissier --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index 9e3a55798f9..0ee281b4574 100644 --- a/Kconfig +++ b/Kconfig @@ -756,7 +756,7 @@ menu Networking choice prompt "Networking stack" - default NET + default NET_LWIP config NO_NET bool "No networking support"