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 9EB08C04A94 for ; Fri, 4 Aug 2023 07:00:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC37686958; Fri, 4 Aug 2023 09:00:34 +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="YrXrcK70"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D97E866B9; Fri, 4 Aug 2023 09:00:33 +0200 (CEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 1F4718694B for ; Fri, 4 Aug 2023 09:00:31 +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 BE196240007; Fri, 4 Aug 2023 07:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691132430; 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=wz54HaiekHmEJ5Lh+7ZGTe7gGwTRQy69uc1rNb7vPHE=; b=YrXrcK70V81w1Snh6WPngjnjuMeGNeCEYyvNIEfCFwt4F07CAOaJIvgyofRNrnDzWPAUta kMYQs9pNaYBXI6LnRw6taBrmz6FrBodNxMQZV4ZGPeYw3Lc0euceEpJsvXuaNjoME5UN9D qid5Zmv8RbSiWCnEvhfWutlv7qkGBsU0250cP95ZLTLkWHra6FC+0WS2CUtfVcsFOvDIS3 xERsFwAbZ6UOH1bQ4AcmvBIJ2Ohzo3NjNqtGFWDkkw7VLmPseonAgWHa272/IvORoaRjVX m+97kLdR9FE5sV7sFxxsIp+TtVfgNPziz+W3phwsueKS6+EAh+Wp9RgJbjbVWQ== Date: Fri, 4 Aug 2023 09:00:28 +0200 From: Miquel Raynal To: Marek Vasut Cc: u-boot@lists.denx.de, Kevin Hilman , Lukasz Majewski , Simon Glass Subject: Re: [PATCH v4 1/4] cmd: bind: Add unbind command with driver filter Message-ID: <20230804090028.70aa780d@xps-13> In-Reply-To: <20230802124657.31184-1-marex@denx.de> References: <20230802124657.31184-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 Wed, 2 Aug 2023 14:46:54 +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 > 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 This extra parameter does not seem to work on the BBBW. I cannot select the "usb_ether" driver like you do. Good news though, I am now able to use fastboot, but it is not straightforward: Here is my sequence right after the boot (reducing the dm tree output to the usb nodes for clarity): =3D> dm tree =20 misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 usb 0 [ + ] ti-musb-peripheral | | |-- usb@47401000 ethernet 1 [ + ] usb_ether | | | `-- usb_ether bootdev 3 [ ] eth_bootdev | | | `-- usb_eth= er.bootdev usb 0 [ ] ti-musb-host | | `-- usb@47401800 =3D> fastboot usb 0 couldn't find an available UDC g_dnl_register: failed!, error: -19 exit not allowed from main input shell. =3D> unbind /ocp/usb@47400000/usb@47401000 usb_ether Cannot find a device with path /ocp/usb@47400000/usb@47401000 =3D> unbind /ocp/usb@47400000/usb@47401000 =20 =3D> dm tree misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 usb 0 [ ] ti-musb-host | | `-- usb@47401800 =3D> fastboot usb 0 =20 =3D> bind /ocp/usb@47400000/usb@47401000 ti-musb-peripheral=20 =3D> dm tree =20 misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 usb 0 [ ] ti-musb-host | | |-- usb@47401800 usb 0 [ ] ti-musb-peripheral | | `-- usb@47401000 =3D> fastboot usb 0 =20 musb-hdrc: peripheral reset irq lost! # works! (the irq-related line above as always been there) So now, how do we make this process easy/understandable? Thanks, Miqu=C3=A8l