unbind.rst 2.5 KB

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