blob: b19661b5fe2d873ea2325ae740b6743d0be16784 [file] [log] [blame]
Patrice Chotarda9ada902020-07-28 09:13:35 +02001.. SPDX-License-Identifier: GPL-2.0+
Patrice Chotard90e82782021-01-04 17:00:56 +01002.. sectionauthor:: Patrice Chotard <patrice.chotard@foss.st.com>
Patrice Chotarda9ada902020-07-28 09:13:35 +02003
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