From patchwork Tue Jul 28 07:13:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1337593 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.a=rsa-sha256 header.s=STMicroelectronics header.b=cepYZU85; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BG7GH3XDbz9sRN for ; Tue, 28 Jul 2020 17:14:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15E8682392; Tue, 28 Jul 2020 09:14:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="cepYZU85"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B0C782388; Tue, 28 Jul 2020 09:13:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 16D4182380 for ; Tue, 28 Jul 2020 09:13:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=patrice.chotard@st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06S7D7Yd031943; Tue, 28 Jul 2020 09:13:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=Oap1glndkAu2c7FLotn9dDpRTQIJ2f8b+M4dcrbjAy0=; b=cepYZU85dN4lOodKz3n2eAT5QhuPaj45U1uIU5h96YOrVh0bREpxgZlFcCsHfBl9GIYV AWODRUpqiMrG2vxGmPaSUIHPxX76TwK4guXsO3n7dlTfsiQ4xw1YtG3xqog0r41YwrSo V91WHYLSnqj/feXYcS885eoSnnCM/rfWSRFScv6b7WVF54brUVxEll+dsEB5TAVN1HEh ebDDS1hE3pT2ydyCpzLDC/TCRjNWjOkFNCsvKrlkJOhgv3EioRqOFg/js9wD7Am6gnZz bNkwnM3AIia8LhPZIrdTwOpb9HoJAHfafeFioTK8cAc3w1Xa9+WsV3EryCHtGK61diTM gQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 32g9v9d0d1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Jul 2020 09:13:45 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D148210002A; Tue, 28 Jul 2020 09:13:44 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C506E21E690; Tue, 28 Jul 2020 09:13:44 +0200 (CEST) Received: from localhost (10.75.127.48) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 28 Jul 2020 09:13:44 +0200 From: Patrice Chotard To: CC: Patrice CHOTARD , Patrick DELAUNAY , U-Boot STM32 , Simon Glass Subject: [PATCH v5 5/5] doc: add bind/unbind command documentation Date: Tue, 28 Jul 2020 09:13:35 +0200 Message-ID: <20200728071335.5840-6-patrice.chotard@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200728071335.5840-1-patrice.chotard@st.com> References: <20200728071335.5840-1-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG4NODE1.st.com (10.75.127.10) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-28_01:2020-07-27, 2020-07-28 signatures=0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- (no changes since v4) Changes in v4: - fix make htmldocs error "Title underline too short" Changes in v3: - fix typo - add bind/unbind parameters description and how to find them doc/driver-model/bind.rst | 49 ++++++++++++++++++++++++++++++++++++++ doc/driver-model/index.rst | 1 + 2 files changed, 50 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..e3e9cb4d3c --- /dev/null +++ b/doc/driver-model/bind.rst @@ -0,0 +1,49 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Patrice Chotard + +Binding/unbinding a driver +========================== + +This document aims to describe the bind and unbind commands. + +For debugging purpose, it should be useful to bind or unbind a driver from +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: + +bind +bind + +unbind +unbind +unbind + +Where: + - is the node's device tree path + - is one of the class available in the list given by the "dm uclass" + command or first column of "dm tree" command. + - is the index of the parent's node (second column of "dm tree" output). + - is the driver name to bind given by the "dm drivers" command or the by + the fourth column of "dm tree" output. + +example: + +bind usb_dev_generic 0 usb_ether +unbind usb_dev_generic 0 usb_ether +or +unbind eth 1 + +bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether +unbind /ocp/omap_dwc3@48380000/usb@48390000 diff --git a/doc/driver-model/index.rst b/doc/driver-model/index.rst index f17c72ce69..c9faf0a591 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