Patrice Chotard | a9ada90 | 2020-07-28 09:13:35 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
Patrice Chotard | 90e8278 | 2021-01-04 17:00:56 +0100 | [diff] [blame] | 2 | .. sectionauthor:: Patrice Chotard <patrice.chotard@foss.st.com> |
Patrice Chotard | a9ada90 | 2020-07-28 09:13:35 +0200 | [diff] [blame] | 3 | |
| 4 | Binding/unbinding a driver |
| 5 | ========================== |
| 6 | |
| 7 | This document aims to describe the bind and unbind commands. |
| 8 | |
| 9 | For debugging purpose, it should be useful to bind or unbind a driver from |
| 10 | the U-boot command line. |
| 11 | |
| 12 | The unbind command calls the remove device driver callback and unbind the |
| 13 | device from its driver. |
| 14 | |
| 15 | The bind command binds a device to its driver. |
| 16 | |
| 17 | In some cases it can be useful to be able to bind a device to a driver from |
| 18 | the command line. |
| 19 | The obvious example is for versatile devices such as USB gadget. |
| 20 | Another use case is when the devices are not yet ready at startup and |
| 21 | require some setup before the drivers are bound (ex: FPGA which bitsream is |
| 22 | fetched from a mass storage or ethernet) |
| 23 | |
| 24 | usage: |
| 25 | |
| 26 | bind <node path> <driver> |
| 27 | bind <class> <index> <driver> |
| 28 | |
| 29 | unbind <node path> |
| 30 | unbind <class> <index> |
| 31 | unbind <class> <index> <driver> |
| 32 | |
| 33 | Where: |
| 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 | |
| 41 | example: |
| 42 | |
| 43 | bind usb_dev_generic 0 usb_ether |
| 44 | unbind usb_dev_generic 0 usb_ether |
| 45 | or |
| 46 | unbind eth 1 |
| 47 | |
| 48 | bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether |
| 49 | unbind /ocp/omap_dwc3@48380000/usb@48390000 |