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 6D092C001DB for ; Fri, 4 Aug 2023 15:01:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6E185868FE; Fri, 4 Aug 2023 17:01:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="cR5XseDh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFF568679B; Fri, 4 Aug 2023 17:01:06 +0200 (CEST) Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) (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 AEDD1868F0 for ; Fri, 4 Aug 2023 17:01:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-583b0637c04so32321097b3.1 for ; Fri, 04 Aug 2023 08:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1691161263; x=1691766063; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2XhG/ekzE0xgHgJqLSkWeoieZyPJFP0fGf+v8Krr4R4=; b=cR5XseDhKlzMo4FA8z5VKHHhlYUAvmtcTa4qwV6et8uKNdqmEMucZQQsigSc+nj7+9 hbwctATg9QmfS6bHE7iV6StJ+BUzF1xp4NvOsoBRXZZndfEWlVe7g1AmFMsO0h38wk9+ Gf6W0JnO1+rz26kSWrNiEQS0pgneateIWnUnU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691161263; x=1691766063; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2XhG/ekzE0xgHgJqLSkWeoieZyPJFP0fGf+v8Krr4R4=; b=R36CxiVwMyYiU2JfOPFuiZQiKM2YwCcz5ab3JYcGVe+nbCtbKIcpES27uCrtVKsULI YS/pOQ7TQm5Pq64R5TqQHEyTB4IrAjbQKvwLaYmAvIF89gj042SvdN5kZqtckoh+EPZS pTBRKWyzGZ9hjOCIx+KDIAdse7qd9+RJ5SMjOLNOP2YhdQSazJ9RJoCpru9nz5kU0QkI gJ2P9oDG4VGYXqr3edeVo63Phtm9Qfz6pOJqopRIrtDqsy7piRp51GJNIQNJO38SMdqG 9/Ul+85WwDJi9YhmJKqe1iscLZz4msMvCFHeJgkm046ssSY2dLI4UlgpP0UrbsoNGtLA pM/A== X-Gm-Message-State: AOJu0YwNB5rpr+UEnL11i98GJyE6UfXRZsMOMxOWwno0nLx4FODiONNk qrBGWuqrjnBySiKqyiKhu3jBkw== X-Google-Smtp-Source: AGHT+IF0wJ0Ui848JE+mMUrZ3Z7UWjnOZKE1RlNHSNffXgSOCmPK4RzoD2MLj7somleMtgWgeA4HWg== X-Received: by 2002:a81:9106:0:b0:577:1bdc:b4d with SMTP id i6-20020a819106000000b005771bdc0b4dmr2382808ywg.0.1691161263253; Fri, 04 Aug 2023 08:01:03 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-c37f-6e0c-fce7-d587.res6.spectrum.com. [2603:6081:7b00:6400:c37f:6e0c:fce7:d587]) by smtp.gmail.com with ESMTPSA id p186-20020a0dcdc3000000b005706c3e5dfcsm766009ywd.48.2023.08.04.08.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 08:01:02 -0700 (PDT) Date: Fri, 4 Aug 2023 11:01:00 -0400 From: Tom Rini To: Marek Vasut Cc: Miquel Raynal , 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: <20230804150100.GN3630934@bill-the-cat> References: <20230802124657.31184-1-marex@denx.de> <20230804090028.70aa780d@xps-13> <4833722f-18ab-e885-291a-988115fe39f8@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y0Q9FWVCU+U5ha7Q" Content-Disposition: inline In-Reply-To: <4833722f-18ab-e885-291a-988115fe39f8@denx.de> X-Clacks-Overhead: GNU Terry Pratchett 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 --y0Q9FWVCU+U5ha7Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 04, 2023 at 04:42:13PM +0200, Marek Vasut wrote: > On 8/4/23 09:00, Miquel Raynal wrote: > > Hi Marek, > >=20 > > marex@denx.de wrote on Wed, 2 Aug 2023 14:46:54 +0200: > >=20 > > > 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 > >=20 > > This extra parameter does not seem to work on the BBBW. I cannot select > > the "usb_ether" driver like you do. > >=20 > > Good news though, I am now able to use fastboot, but it is not > > straightforward: > >=20 > > Here is my sequence right after the boot (reducing the dm tree output > > to the usb nodes for clarity): > >=20 > > =3D> dm tree > > misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 > > usb 0 [ + ] ti-musb-peripheral | | |-- usb@474010= 00 > > ethernet 1 [ + ] usb_ether | | | `-- usb_et= her > > bootdev 3 [ ] eth_bootdev | | | `-- us= b_ether.bootdev > > usb 0 [ ] ti-musb-host | | `-- usb@474018= 00 > > =3D> fastboot usb 0 > > couldn't find an available UDC > > g_dnl_register: failed!, error: -19 >=20 > That is expected and not a bug, since the beagle explicitly binds USB > ethernet to MUSB gadget in board file, which is legacy deprecated way. So, we should do away with, probably all of arch_misc_init() in arch/arm/mach-omap2/am33xx/board.c for the non-SPL case. > > exit not allowed from main input shell. > > =3D> unbind /ocp/usb@47400000/usb@47401000 usb_ether >=20 > Does >=20 > =3D> unbind ethernet 0 >=20 > work ? >=20 > If so, 1/4 in this series can be skipped altogether. >=20 > You likely won't even need the rebinding of ti-musb-peripheral anymore. >=20 > > Cannot find a device with path /ocp/usb@47400000/usb@47401000 > > =3D> unbind /ocp/usb@47400000/usb@47401000 > > =3D> dm tree > > misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 > > usb 0 [ ] ti-musb-host | | `-- usb@474018= 00 > > =3D> fastboot usb 0 > > =3D> bind /ocp/usb@47400000/usb@47401000 ti-musb-peripheral > > =3D> dm tree > > misc 0 [ + ] ti-musb-wrapper | |-- usb@47400000 > > usb 0 [ ] ti-musb-host | | |-- usb@474018= 00 > > usb 0 [ ] ti-musb-peripheral | | `-- usb@474010= 00 > > =3D> fastboot usb 0 > > musb-hdrc: peripheral reset irq lost! > > # works! (the irq-related line above as always been there) > >=20 > > So now, how do we make this process easy/understandable? >=20 > What would be your proposal ? Well, what's needed / is it possible to get to the point where we don't _need_ to call bind/unbind for each of these cases? Is there something we're supposed to be setting in the DT that we aren't? --=20 Tom --y0Q9FWVCU+U5ha7Q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTNEqUACgkQFHw5/5Y0 tyy9kQwAguAyHb2BFm+30njuwtw5blOd+QcvFVI4E23EAKP0D0aT6qW0h3m/YnYZ L5BzXd+IEVY4F4rnZ2h5UbqXizAWDn9YrkTGX90+NzpzYoomxd0VHTJYSELwW9es bwRcqBK8ugKLl0ryhsnNFAut1UzOKaIYYJqxa7gSxZI6p8WEj7hvwM2kCEgVB9Ej 7Wax9Au4EY6lHLUz6qmcYzBU6ECHtDNTSOYjX3zEKacVrb9WaMtLqcg4QYdHX9Ai 8gFbMQd8F2u/mlw9W7N0KHdthTYG6bPIynnQLp+G/+t+YAKEYDia9eTf60pDkyvf r1EbyzmIQSWjHWfI29GXG00saUK5SJzleB4bqR16BZ3KYOhjsiIn+29qSK2jo/UW /jwJwvuR9oFex0TyDlx5smLP7njxTJI6soWusdgPnWqKdGdJKSbq6ueXz56HZTto GqN4tJtdP+UlsYz331agFaHUGPB1gD+pOjIc0gmcpZ2n6J5NMVfkmB38brC2/DqO IwqgmY+g =Zld0 -----END PGP SIGNATURE----- --y0Q9FWVCU+U5ha7Q--