Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55F96C00140 for ; Mon, 8 Aug 2022 12:57:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F4348416E; Mon, 8 Aug 2022 14:57:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 7A4F684164; Mon, 8 Aug 2022 14:56:59 +0200 (CEST) Received: from 1.mo552.mail-out.ovh.net (1.mo552.mail-out.ovh.net [178.32.96.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 19B218455E for ; Mon, 8 Aug 2022 14:56:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clg@kaod.org Received: from mxplan5.mail.ovh.net (unknown [10.109.138.84]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id EAA3222E34; Mon, 8 Aug 2022 12:56:55 +0000 (UTC) Received: from kaod.org (37.59.142.95) by DAG4EX2.mxp5.local (172.16.2.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Mon, 8 Aug 2022 14:56:54 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-95G0015bedfe41-afd3-4dfd-9268-1aabc0a15e38, 014009DFAA8B86078D729D00C01D9476BEEC0396) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <10365e41-3538-6dc6-2bfc-346d23fbf23c@kaod.org> Date: Mon, 8 Aug 2022 14:56:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v4 2/4] cmd: Add ncsi command Content-Language: en-US To: Joel Stanley , Joe Hershberger , Ramon Fried , Ryan Chen , CC: Samuel Mendoza-Jonas , References: <20220808121606.188002-1-joel@jms.id.au> <20220808121606.188002-3-joel@jms.id.au> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20220808121606.188002-3-joel@jms.id.au> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.95] X-ClientProxiedBy: DAG2EX1.mxp5.local (172.16.2.11) To DAG4EX2.mxp5.local (172.16.2.32) X-Ovh-Tracer-GUID: e109dc9b-976e-421d-99df-6974800d0e77 X-Ovh-Tracer-Id: 582934678425930601 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdefkedgiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeekteejtdelkeejvdevffduhfetteelieefgeefffeugffhfeekheffueefledujeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhnsggprhgtphhtthhopedupdhrtghpthhtohepuhdqsghoohhtsehlihhsthhsrdguvghngidruggvpdfovfetjfhoshhtpehmohehhedv 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.6 at phobos.denx.de X-Virus-Status: Clean On 8/8/22 14:16, Joel Stanley wrote: > From: Samuel Mendoza-Jonas > > Adds an "ncsi" command to manually start NC-SI configuration. > > Signed-off-by: Samuel Mendoza-Jonas > Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater > --- > v4: New patch, split from patch 1 > > cmd/net.c | 22 ++++++++++++++++++++++ > net/net.c | 1 + > cmd/Kconfig | 8 ++++++++ > 3 files changed, 31 insertions(+) > > diff --git a/cmd/net.c b/cmd/net.c > index 3619c843d838..2863fe768118 100644 > --- a/cmd/net.c > +++ b/cmd/net.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > > static int netboot_common(enum proto_t, struct cmd_tbl *, int, char * const []); > > @@ -524,3 +525,24 @@ U_BOOT_CMD( > "list - list available devices\n" > ); > #endif // CONFIG_DM_ETH > + > +#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 */ > diff --git a/net/net.c b/net/net.c > index f0faf33d0d77..a4e645ac4425 100644 > --- a/net/net.c > +++ b/net/net.c > @@ -434,6 +434,7 @@ int net_loop(enum proto_t protocol) > } else { > eth_init_state_only(); > } > + > restart: > #ifdef CONFIG_USB_KEYBOARD > net_busy_flag = 0; > diff --git a/cmd/Kconfig b/cmd/Kconfig > index 3625ff2a50b3..3a5d1bba78a8 100644 > --- a/cmd/Kconfig > +++ b/cmd/Kconfig > @@ -1813,6 +1813,14 @@ config CMD_LINK_LOCAL > help > Acquire a network IP address using the link-local protocol > > +config CMD_NCSI > + bool "ncsi" > + depends on PHY_NCSI > + help > + Manually configure the attached NIC via NC-SI. > + Normally this happens automatically before other network > + operations. > + > endif > > config CMD_ETHSW