[PATCH v2 1/4] cmd: bind: Add unbind command with driver filter

Simon Glass sjg at chromium.org
Wed Jul 19 03:08:21 CEST 2023


On Mon, 17 Jul 2023 at 05:21, Marek Vasut <marex at denx.de> wrote:
>
> 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.
>
> 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 at 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 at 49000000 usb_ether
> "
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> ---
> Cc: Kevin Hilman <khilman at baylibre.com>
> Cc: Lukasz Majewski <lukma at denx.de>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> ---
> V2: No change
> ---
>  cmd/bind.c            | 10 +++++-----
>  drivers/core/device.c | 20 +++++++++++++++-----
>  include/dm/device.h   | 17 +++++++++++++++++
>  3 files changed, 37 insertions(+), 10 deletions(-)

Can we have a test?

Regards,
Simon


More information about the U-Boot mailing list