From patchwork Wed May 22 16:00:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 798161 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:92:b0:351:d90a:5487 with SMTP id m18csp542336wrx; Wed, 22 May 2024 09:05:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpQzUBs1+9G60fLKxwfPo3JhaCDYo4Ht//sI54tgMUnfQMf+BbXLBN+I1QYOWOf2BD52ayY7fN5IIb2yCcYzZM X-Google-Smtp-Source: AGHT+IHNvJTryOhzUOBmM4VDgNcEPbunFAMB3yyrE/xcQLvooayZpIuSOzf+ChGdFjFb8qKx4qkb X-Received: by 2002:a17:906:7d48:b0:a5a:76e2:c2a8 with SMTP id a640c23a62f3a-a6228083a41mr161176766b.23.1716393929849; Wed, 22 May 2024 09:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716393929; cv=none; d=google.com; s=arc-20160816; b=DIu7KbED+UltFVYbofX+J2zpw6Yonw/HsK2Qbq4JSwYCxFCiHxcxXeUCXbQIoRdrG9 GRfGAuHoYqeAj6a48xTVSoSrkWn4F/kn/dA/HzTzOQ8Rl9vxosajY+lcSlweGtIZulHg DWkpj/P5YQ3zkNFYRRc/pGgfz/KMgVAvJZDFtLLuGKUETyFCGAJCMu/lp3pZcXPDspK9 pqU9SY21yCBSDyx5aYYQZdP7Y+H9TrGtDw6qdpNciwRKw1KVVwcVUXuKAvDj7r1B8kdq RKI0v5wik9cZ7YJm234/j0o2xTffbPDIw1aCu90AJabqfm9t+QMsr1Ro6yghVfZwJYtU fI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=e0NDk26H+iHDAlVRHzZWuWds7SnthG/ogIr2wQPsr/Y=; fh=oUM2sFlyz5kVBChm8wvUgZF7zB3ikycjJEoKfJUFNP4=; b=Ug3fd/Em0umOnaro9hgZOQC3pszsLZeeiyUoqMC/XrlN4FYXTJh0ArkjY2C2bq0TKq j//zme/KVu+kmoOG5XrkkO2OPcmIYZ9qb1RJKBCyyFvkuswfcV5smMp45NHpZWXjHWnD 1sftbiIkK/XGIRxpCe6rBmahBf3tl2uTrpa7+LLPcZu5RoU8Nycf+4oCxH7jjVsGUoPF WSXlYL4w4YAo/PvDy/czz3JrEV5DkwGjOaCWZfxSg8TxIn+KQxAQdBsr9DuPf2f4S9BH BXD+TREZo2Bw2gVi0ZVQ03Q19JuSgrFlqdMuFi5ctuesOsp9L36dtRdOZYNItKbnDpqg +64Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avRg4RCy; 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 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 a640c23a62f3a-a5a66d48818si1141680766b.231.2024.05.22.09.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 09:05:29 -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=avRg4RCy; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1E7B88884; Wed, 22 May 2024 18:04: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=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="avRg4RCy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E61688867; Wed, 22 May 2024 18:04: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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 754E488870 for ; Wed, 22 May 2024 18:04: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-ej1-x631.google.com with SMTP id a640c23a62f3a-a59cc765c29so111032666b.3 for ; Wed, 22 May 2024 09:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716393881; x=1716998681; 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=e0NDk26H+iHDAlVRHzZWuWds7SnthG/ogIr2wQPsr/Y=; b=avRg4RCyDH/7oHNtYokW43dzDrEetP3Rdt9adZmeilMapSncbucAh0RkfogTWB83En IWuuqgnHixLDnIjzB4v4Y3+tO8qbQwFAOqM9O1Glk9vCuuMYwgXPeYqw2TjGifC3Fzpr HINWvKRqfallT/WYPrmBGhJshHLvQWei8n9D4w8Nj1o59zAd2a0LkNcO57iQuzTX0inI igYnIskZ6V8L4XDrNucfi+alLXXJqw1fQZjVKDBvtnEgk9gZH7A/L0xeNKg2Gbige7ad yW+poZshtqzfWpoyr6Vzlf2wF0V+Hs0Y8J3I86s4uUvQoJteTaPx45KAIF9dL9u3c0lP w45A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716393881; x=1716998681; 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=e0NDk26H+iHDAlVRHzZWuWds7SnthG/ogIr2wQPsr/Y=; b=ncsxKuUil0sWOVam/9iqmRd3h0gUldfP4CNhC1K2LE6xELg15eGCh8FZ4hjT+/17Uo akP5H+GIaC8hr5e4wRTzbFxuzfUI6H8edlgSK2jVNT+u/ju026QUrMoEZUCVG1O/hrMO XkahdZh9bVjmOkBGHMvorwncMxZomZkPQ0U21sk4F/iNOcyKNyrAWB3d3cGv1feIlxVM ZRRZFlu6rXB5V+RrkzGOUPy9rp8Xmo82uGvoRU4yyZgMYfILTSVEJm4yw2v34Xw8ZK/A DpjO6cQWx9tXK0NQkIpWM4W3MiLnLaJRVWzEnHnjoyKD/eMzk+lCGU/QH/AFfJqlvSSW GcpA== X-Gm-Message-State: AOJu0YzuAWiEw0hfT0Isj3Pz849PTDIyiBu3nNx+cYOsK7C7vANXGgzr bfyxsO3UV/rEvHrVWtEpMx4SqFPREkw8WiprQsnhJ9pSur0xgkuF+S++XPvnngSNy9XX7iZojS4 iKcU/c2tw X-Received: by 2002:a17:906:f28b:b0:a5a:1b47:dab3 with SMTP id a640c23a62f3a-a6228083cc5mr154929766b.25.1716393880817; Wed, 22 May 2024 09:04:40 -0700 (PDT) Received: from jerome-XPS-13-9310.. ([2a01:e0a:3cb:7bb0:d6a3:fbd6:c45b:172c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6209f64ba8sm367670266b.210.2024.05.22.09.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 09:04:39 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Maxim Uvarov , Jerome Forissier , Heinrich Schuchardt , Tom Rini , Simon Glass , AKASHI Takahiro , Abdellatif El Khlifi , Alper Nebi Yasak , Masahisa Kojima , Sughosh Ganu Subject: [PATCH 09/15] net-lwip: add support for EFI_HTTP_BOOT Date: Wed, 22 May 2024 18:00:09 +0200 Message-Id: <6c98b28ebe3d2371cc1c62c531ae6115bc93c09e.1716393035.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.34.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 the wget_with_dns() function which is needed by CONFIG_EFI_HTTP_BOOT=y. Note that there is no dependency added on CONFIG_CMD_DNS_LWIP because CONFIG_CMD_WGET_LWIP natively supports hostname resolution. Signed-off-by: Jerome Forissier --- lib/efi_loader/Kconfig | 5 +++-- net-lwip/wget.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 430bb7f0f7..9d8dc8c756 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -505,8 +505,9 @@ config EFI_RISCV_BOOT_PROTOCOL config EFI_HTTP_BOOT bool "EFI HTTP Boot support" - select CMD_DNS - select CMD_WGET + select CMD_DNS if NET + select CMD_WGET if NET + select CMD_WGET_LWIP if NET_LWIP select BLKMAP help Enabling this option adds EFI HTTP Boot support. It allows to diff --git a/net-lwip/wget.c b/net-lwip/wget.c index 0ed8b77c47..a3e65dc80e 100644 --- a/net-lwip/wget.c +++ b/net-lwip/wget.c @@ -166,3 +166,19 @@ int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_FAILURE; } + +#if defined(CONFIG_EFI_HTTP_BOOT) +int wget_with_dns(ulong dst_addr, char *uri) +{ + char addr_str[11]; + struct cmd_tbl cmdtp = {}; + char *argv[] = { "wget", addr_str, uri }; + + snprintf(addr_str, sizeof(addr_str), "0x%lx", dst_addr); + + if (do_wget(&cmdtp, 0, ARRAY_SIZE(argv), argv) == CMD_RET_SUCCESS) + return 0; + + return -1; +} +#endif