Heinrich Schuchardt | 0475fd4 | 2023-06-16 17:11:49 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame^] | 3 | .. index:: |
| 4 | single: unbind (command) |
| 5 | |
Heinrich Schuchardt | 0475fd4 | 2023-06-16 17:11:49 +0200 | [diff] [blame] | 6 | unbind command |
| 7 | ============== |
| 8 | |
| 9 | Synopsis |
| 10 | -------- |
| 11 | |
| 12 | :: |
| 13 | |
| 14 | unbind <node path> |
| 15 | unbind <class> <index> |
| 16 | unbind <class> <index> <driver> |
| 17 | |
| 18 | Description |
| 19 | ----------- |
| 20 | |
| 21 | The unbind command is used to unbind a device from a driver. This makes the |
| 22 | device unavailable in U-Boot. |
| 23 | |
| 24 | node path |
| 25 | path of the device's device-tree node |
| 26 | |
| 27 | class |
| 28 | device class name |
| 29 | |
| 30 | index |
| 31 | index of the device in the device class |
| 32 | |
| 33 | driver |
| 34 | device driver name |
| 35 | |
| 36 | Example |
| 37 | ------- |
| 38 | |
| 39 | Given a system with a real time clock device with device path */pl031@9010000* |
| 40 | and using driver rtc-pl031 unbinding and binding of the device is demonstrated |
| 41 | using the three alternative unbind syntaxes. |
| 42 | |
| 43 | .. code-block:: |
| 44 | |
| 45 | => dm tree |
| 46 | Class Index Probed Driver Name |
| 47 | ----------------------------------------------------------- |
| 48 | root 0 [ + ] root_driver root_driver |
| 49 | ... |
| 50 | rtc 0 [ ] rtc-pl031 |-- pl031@9010000 |
| 51 | ... |
| 52 | => fdt addr $fdtcontroladdr |
| 53 | Working FDT set to 7ed7fdb0 |
| 54 | => fdt print |
| 55 | / { |
| 56 | interrupt-parent = <0x00008003>; |
| 57 | model = "linux,dummy-virt"; |
| 58 | #size-cells = <0x00000002>; |
| 59 | #address-cells = <0x00000002>; |
| 60 | compatible = "linux,dummy-virt"; |
| 61 | ... |
| 62 | pl031@9010000 { |
| 63 | clock-names = "apb_pclk"; |
| 64 | clocks = <0x00008000>; |
| 65 | interrupts = <0x00000000 0x00000002 0x00000004>; |
| 66 | reg = <0x00000000 0x09010000 0x00000000 0x00001000>; |
| 67 | compatible = "arm,pl031", "arm,primecell"; |
| 68 | }; |
| 69 | ... |
| 70 | } |
| 71 | => unbind /pl031@9010000 |
| 72 | => dm tree |
| 73 | Class Index Probed Driver Name |
| 74 | ----------------------------------------------------------- |
| 75 | root 0 [ + ] root_driver root_driver |
| 76 | ... |
| 77 | => unbind /pl031@9010000 |
| 78 | Cannot find a device with path /pl031@9010000 |
| 79 | => bind /pl031@9010000 rtc-pl031 |
| 80 | => dm tree |
| 81 | Class Index Probed Driver Name |
| 82 | ----------------------------------------------------------- |
| 83 | root 0 [ + ] root_driver root_driver |
| 84 | ... |
| 85 | rtc 0 [ ] rtc-pl031 |-- pl031@9010000 |
| 86 | => unbind rtc 0 |
| 87 | => bind /pl031@9010000 rtc-pl031 |
| 88 | => unbind rtc 0 rtc-pl031 |
| 89 | |
| 90 | Configuration |
| 91 | ------------- |
| 92 | |
| 93 | The unbind command is only available if CONFIG_CMD_BIND=y. |
| 94 | |
| 95 | Return code |
| 96 | ----------- |
| 97 | |
| 98 | The return code $? is 0 (true) on success and 1 (false) on failure. |