[PATCH v2 5/5] doc: add bind/unbind command documentation

Patrice CHOTARD patrice.chotard at st.com
Thu Apr 30 10:50:36 CEST 2020


On 4/29/20 8:04 PM, Simon Glass wrote:
> Hi Patrice,
>
> On Wed, 29 Apr 2020 at 06:20, Patrice Chotard <patrice.chotard at st.com> wrote:
>> Add documentation in doc/drivel-model for the bind/unbind command.
>> Part of this documentation is extracted from original patch commit
>> message:
>> commit 49c752c93a78 ("cmd: Add bind/unbind commands to bind a device to a driver from the command line")
>>
>> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
>> ---
>>
>> Changes in v2: None
>>
>>  doc/driver-model/bind.rst  | 32 ++++++++++++++++++++++++++++++++
>>  doc/driver-model/index.rst |  1 +
>>  2 files changed, 33 insertions(+)
>>  create mode 100644 doc/driver-model/bind.rst
>>
>> diff --git a/doc/driver-model/bind.rst b/doc/driver-model/bind.rst
>> new file mode 100644
>> index 0000000000..df6b5f143b
>> --- /dev/null
>> +++ b/doc/driver-model/bind.rst
>> @@ -0,0 +1,32 @@
>> +.. SPDX-License-Identifier: GPL-2.0+
>> +.. sectionauthor:: Patrice Chotard <patrice.chotard at st.com>
>> +
>> +Binding/unbiding a driver
> unbinding
>
>> +=========================
>> +
>> +This documents aims to describe the bind and unbind commands.
> document
>
>> +
>> +For debug purpose, it should be useful to bind or unbind a driver from
> For debugging
>
>> +the U-boot command line.
>> +
>> +The unbind command calls the remove device driver callback and unbind the
>> +device from its driver.
>> +
>> +The bind command binds a device to its driver.
>> +
>> +In some cases it can be useful to be able to bind a device to a driver from
>> +the command line.
>> +The obvious example is for versatile devices such as USB gadget.
>> +Another use case is when the devices are not yet ready at startup and
>> +require some setup before the drivers are bound (ex: FPGA which bitsream is
>> +fetched from a mass storage or ethernet)
>> +
>> +usage example:
>> +
>> +bind usb_dev_generic 0 usb_ether
>> +unbind usb_dev_generic 0 usb_ether
> can you mention what the two parameters are and how to find them?

I will fix typos and update the documentation with these informations.

Thanks

Patrice

>
>> +or
>> +unbind eth 1
>> +
>> +bind /ocp/omap_dwc3 at 48380000/usb at 48390000 usb_ether
>> +unbind /ocp/omap_dwc3 at 48380000/usb at 48390000
>> diff --git a/doc/driver-model/index.rst b/doc/driver-model/index.rst
>> index b9df221627..37ef3721df 100644
>> --- a/doc/driver-model/index.rst
>> +++ b/doc/driver-model/index.rst
>> @@ -6,6 +6,7 @@ Driver Model
>>  .. toctree::
>>     :maxdepth: 2
>>
>> +   bind
>>     debugging
>>     design
>>     ethernet
>> --
>> 2.17.1
>>
> Regards,
> Simon


More information about the U-Boot mailing list