From mboxrd@z Thu Jan 1 00:00:00 1970 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 0D7ADC001B0 for ; Sun, 23 Jul 2023 17:50:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6DC5846EE; Sun, 23 Jul 2023 19:50:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com 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=bootlin.com header.i=@bootlin.com header.b="RCacfnEg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C848586625; Sun, 23 Jul 2023 19:50:00 +0200 (CEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 34F86846EE for ; Sun, 23 Jul 2023 19:49:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=miquel.raynal@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 3038C40005; Sun, 23 Jul 2023 17:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690134597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=abntvcyHvN/z0wex2epIS+wjDxaepRGzMxg4VeZ79cE=; b=RCacfnEgQOG3jnbF4ZjGSChfLx9pKsjaGth89O6KbCKqrBxQrV3m7ReUA1FC9u5a7v645R Pv0H0WHGgEeQLSZ2ZkbDW6SGWkBA9GpvCLh3mfLDMhg7pnJ18XceNgYJYJf3jVSju6Zuyj pXJjJqKSvPwDXONdEByyok4JXYgXbBB+d2Fvzok50jKBVuBLcVREHXEoa9sCzGPjIq1+jq f/E/RE3mAy2sJi24SGiFqaCaNFb+qmceNhm02SgmKM/efM4LDhkThUez4BIgnTP89mJpm7 kfCdh9wxlmae4UzuV54HszdRr5AoUtVkzjD3NwUEOMyjjyjBo9WPt/TJvoHXHQ== Date: Sun, 23 Jul 2023 19:49:55 +0200 From: Miquel Raynal To: Marek Vasut Cc: u-boot@lists.denx.de, Kevin Hilman , Lukasz Majewski , Simon Glass Subject: Re: [PATCH v2 1/4] cmd: bind: Add unbind command with driver filter Message-ID: <20230723194955.7338144c@xps-13> In-Reply-To: <20230717112137.9139-1-marex@denx.de> References: <20230717112137.9139-1-marex@denx.de> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com 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 Hi Marek, marex@denx.de wrote on Mon, 17 Jul 2023 13:21:34 +0200: > Extend the driver core to perform lookup by both OF node and driver > bound to the node. Use this to look up specific device instances to > unbind from nodes in the unbind command. One example where this is > needed is USB peripheral controller, which may have multiple gadget > drivers bound to it. The unbind command has to select that specific > gadget driver instance to unbind from the controller, not unbind the > controller driver itself from the controller. >=20 > USB ethernet gadget usage looks as follows with this change. Notice > the extra 'usb_ether' addition in the 'unbind' command at the end. > " > bind /soc/usb-otg@49000000 usb_ether I don't really get why this is needed? Yes, having proper bind and unbind methods and having them called internally is relevant, but when you have a single OTG controller, why is this needed? It basically breaks the CLI, making bisects more painful and all updates just fail. > setenv ethact usb_ether > setenv loadaddr 0xc2000000 > setenv ipaddr 10.0.0.2 > setenv serverip 10.0.0.1 > setenv netmask 255.255.255.0 > tftpboot 0xc2000000 10.0.0.1:test.file > unbind /soc/usb-otg@49000000 usb_ether > " >=20 > Signed-off-by: Marek Vasut > --- > Cc: Kevin Hilman > Cc: Lukasz Majewski > Cc: Marek Vasut > Cc: Simon Glass I've tested the whole series, unfortunately is does not work on AM335x/BBBW: * Any recovery attempted using the network will now fail in the SPL, where, AFAIK, there is no way to manually bind: U-Boot SPL 2023.07-00806-gac80e6de9cf (Jul 23 2023 - 19:45:51 +0200) Trying to boot from USB eth Could not get PHY for eth_cpsw: addr 0 eth0: eth_cpswusing musb-hdrc, OUT ep1out IN ep1in STATUS ep2in MAC de:ad:be:ef:00:01 HOST MAC de:ad:be:ef:00:00 RNDIS ready , eth1: usb_ether * The bind command was not available on my default configuration, making it even difficult for people unaware that this command is now required to fix their common commands. * Any command that expects the usb_ether driver will now fail badly even after the bind call: =3D> bind /ocp/usb@47400000/usb@47401000 usb_ether =3D> fastboot usb 0 =20 couldn't find an available UDC g_dnl_register: failed!, error: -19 exit not allowed from main input shell. =3D> tftp 0x81000000 zImage dev_get_priv: null device data abort pc : [<9ffa04ba>] lr : [<9ff86d5f>] reloc pc : [<8083b4ba>] lr : [<80821d5f>] sp : 9df2f920 ip : 00000000 fp : 00000003 r10: 9df4cf48 r9 : 9df44ea0 r8 : 9ffec33c r7 : 00004a53 r6 : 00000000 r5 : 00000bb8 r4 : 9df4d3c0 r3 : 9ff97653 r2 : fff1102c r1 : 00000000 r0 : 00000000 Flags: nzcv IRQs off FIQs on Mode SVC_32 (T) Code: 9ffd b508 f7e6 fc4b (6801) 2000=20 Resetting CPU ... Is there anything I missed? Thanks, Miqu=C3=A8l