1.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Patrice Chotard <patrice.chotard@foss.st.com>
3
4Binding/unbinding a driver
5==========================
6
7This document aims to describe the bind and unbind commands.
8
9For debugging purpose, it should be useful to bind or unbind a driver from
10the U-Boot command line.
11
12The unbind command calls the remove device driver callback and unbind the
13device from its driver.
14
15The bind command binds a device to its driver.
16
17In some cases it can be useful to be able to bind a device to a driver from
18the command line.
19The obvious example is for versatile devices such as USB gadget.
20Another use case is when the devices are not yet ready at startup and
21require some setup before the drivers are bound (ex: FPGA which bitsream is
22fetched from a mass storage or ethernet)
23
24usage:
25
26bind <node path> <driver>
27bind <class> <index> <driver>
28
29unbind <node path>
30unbind <class> <index>
31unbind <class> <index> <driver>
32
33Where:
34 - <node path> is the node's device tree path
35 - <class> is one of the class available in the list given by the "dm uclass"
36   command or first column of "dm tree" command.
37 - <index> is the index of the parent's node (second column of "dm tree" output).
38 - <driver> is the driver name to bind given by the "dm drivers" command or the by
39   the fourth column of "dm tree" output.
40
41example:
42
43bind usb_dev_generic 0 usb_ether
44unbind usb_dev_generic 0 usb_ether
45or
46unbind eth 1
47
48bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether
49unbind /ocp/omap_dwc3@48380000/usb@48390000
50