From: Bin Meng Date: Thu, 20 Aug 2015 06:40:28 -0700 Subject: [U-Boot] [PATCH v2 12/12] dm: pci: Document binding of pci device drivers In-Reply-To: <1440078028-29464-1-git-send-email-bmeng.cn@gmail.com> References: <1440078028-29464-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1440078028-29464-13-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Document how pci devices are bound to device drivers. Also mention its limitation in the pre-relocation phase. Signed-off-by: Bin Meng --- Changes in v2: None doc/driver-model/pci-info.txt | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/driver-model/pci-info.txt b/doc/driver-model/pci-info.txt index cf69167..e016b98 100644 --- a/doc/driver-model/pci-info.txt +++ b/doc/driver-model/pci-info.txt @@ -34,9 +34,28 @@ under that bus. Note that this is all done on a lazy basis, as needed, so until something is touched on PCI (eg: a call to pci_find_devices()) it will not be probed. -PCI devices can appear in the device tree. If they do this serves to specify -the driver to use for the device. In this case they will be bound at -start-up. +PCI devices can appear in the flattened device tree. If they do this serves to +specify the driver to use for the device. In this case they will be bound at +first. Each PCI device node must have a compatible string list as defined by +the IEEE Std 1275-1994 PCI bus binding document v2.1. An example like below: + + pciuart0: uart at a,1 { + compatible = "pci8086,8811.00", + "pci8086,8811", + "pciclass,070002", + "pciclass,0700", + "x86-uart"; + } + +Note the last string is the desired driver name which is supposed to work with +this PCI device. + +If PCI devices are not listed in the device tree, U_BOOT_PCI_DEVICE can be used +to specify the driver to use for the device. The device tree takes precedence +over U_BOOT_PCI_DEVICE. Plese note with U_BOOT_PCI_DEVICE, only drivers with +DM_FLAG_PRE_RELOC will be bound before relocation. If neither device tree nor +U_BOOT_PCI_DEVICE is provided, the built-in driver (either pci_bridge_drv or +pci_generic_drv) will be used. Sandbox -- 1.8.2.1