From patchwork Sat Dec 18 15:08:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1570528 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=BS+L0YXe; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JGTl25qGgz9sVq for ; Sun, 19 Dec 2021 02:08:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 63FDD83057; Sat, 18 Dec 2021 16:08:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BS+L0YXe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93EFA82FE0; Sat, 18 Dec 2021 16:08:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 60CB082FE0 for ; Sat, 18 Dec 2021 16:08:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id k21so7164003ioh.4 for ; Sat, 18 Dec 2021 07:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=z+9Ur0AVQh++KumBB+jYhMwKw9gU22tk5WDDeHSESvY=; b=BS+L0YXexGJvjWn6IjS/h3t84NoQT+pSGLavwPC8R3j6KOgg2haMdkhizNrqspOs9j +pZtbcFIj7KOFXeGN95a176PXj+3QKw8Rtd/AB7yFojkbJcL54wLpoYLtRKRhiDwDy/h 0YJ5vvBYVFVF+mkZjkue0J12XKGp5G6+UnUtI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=z+9Ur0AVQh++KumBB+jYhMwKw9gU22tk5WDDeHSESvY=; b=Ul1oajQreRawdB7HBUfdq+EB6WbLqj+DDr8/MJy7S1BeikYyzwz/+JOtOAyzttMEoZ 6jgbqOW8RmvJLexxWgnZs8hUdpCAxsWb/DUlYuJNSZpzmLOFeUAzVmofmsLtlJw7EPOR z0jGe6SyLp1j3jCCnoaMFiJBvSK1ziO6x4dXknq5s5dO/zB+yQsOPDSCjnH3tITA3+St 0+5dhveTlPt+cmF5sj/RN3HpNYnd7bN5KmaSbYXgvmQbqsgnkgoMrcCVjWGDqWnLG0qv 4esD4y/ZC2IZsANiZAd2oEo0i0T11p6vavLth06V42Lzt8se9q9Evi0abssrv4vdIwSl e9Mw== X-Gm-Message-State: AOAM530jClvg+rWyi58GSaubw3tDoFWxzDv+xffsL8Vdod5w0+BvMUbH Ii7o6o5rsCr4aZCd7ecaZ8MPAnG7UXyGuQ== X-Google-Smtp-Source: ABdhPJxDH4tU2x24NNQpF41hqYGMhKu/gQR+2duiY9HpsQT/NJNru283o20e6hhcp3CjvmgmzTGkeQ== X-Received: by 2002:a05:6638:1926:: with SMTP id p38mr5035877jal.165.1639840088793; Sat, 18 Dec 2021 07:08:08 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id k9sm7011755ilv.61.2021.12.18.07.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 07:08:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Joe Hershberger , Simon Glass , Heinrich Schuchardt , =?utf-8?q?Marek_Beh=C3=BAn?= , Mario Six , Patrick Delaunay , Priyanka Jain , Ramon Fried , Rasmus Villemoes , Stefan Roese Subject: [PATCH 1/4] Convert CONFIG_KEEP_SERVERADDR to Kconfig Date: Sat, 18 Dec 2021 08:08:02 -0700 Message-Id: <20211218150805.1083645-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.173.g76aa8bc2d0-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_KEEP_SERVERADDR Drop the preprocessor usage also. Signed-off-by: Simon Glass --- README | 6 ------ include/configs/sandbox.h | 1 - net/Kconfig | 9 +++++++++ net/arp.c | 5 ++--- scripts/config_whitelist.txt | 1 - 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README b/README index 056b717557b..eaf9170e952 100644 --- a/README +++ b/README @@ -1193,12 +1193,6 @@ The following options need to be configured: server to contact when using the "tftboot" command. (Environment variable "serverip") - CONFIG_KEEP_SERVERADDR - - Keeps the server's MAC address, in the env 'serveraddr' - for passing to bootargs (like Linux's netconsole option) - -- Gateway IP address: CONFIG_GATEWAYIP Defines a default value for the IP address of the diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index cd7d99ec69c..1dd21d5e925 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -25,7 +25,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ 115200} -#define CONFIG_KEEP_SERVERADDR #define CONFIG_UDP_CHECKSUM #define CONFIG_TIMESTAMP #define CONFIG_BOOTP_SERVERIP diff --git a/net/Kconfig b/net/Kconfig index 7a2d1450188..fb6420f9bbe 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -98,4 +98,13 @@ config SERVERIP_FROM_PROXYDHCP_DELAY_MS receiving response from main DHCP server. Has no effect if SERVERIP_FROM_PROXYDHCP is false. +config KEEP_SERVERADDR + bool "Write the server's MAC address to 'serveraddr'" + default y if SANDBOX + help + Keeps the server's MAC address, in the env 'serveraddr' + for passing to bootargs (like Linux's netconsole option). If this is + enabled, when an ARP reply is received, the server's IP address is + written there. + endif # if NET diff --git a/net/arp.c b/net/arp.c index 1d06ed25722..0b086dc8d21 100644 --- a/net/arp.c +++ b/net/arp.c @@ -196,13 +196,12 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) if (!arp_is_waiting()) break; -#ifdef CONFIG_KEEP_SERVERADDR - if (net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) { + if (IS_ENABLED(CONFIG_KEEP_SERVERADDR) && + net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) { char buf[20]; sprintf(buf, "%pM", &arp->ar_sha); env_set("serveraddr", buf); } -#endif reply_ip_addr = net_read_ip(&arp->ar_spa); diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 6d961ccb3e6..3285d3cd30e 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -639,7 +639,6 @@ CONFIG_JFFS2_PART_SIZE CONFIG_JFFS2_SUMMARY CONFIG_JRSTARTR_JR0 CONFIG_JTAG_CONSOLE -CONFIG_KEEP_SERVERADDR CONFIG_KEY_REVOCATION CONFIG_KIRKWOOD_EGIGA_INIT CONFIG_KIRKWOOD_GPIO