diff options
author | Simon Glass <sjg@chromium.org> | 2015-07-06 22:47:44 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-21 23:39:38 (GMT) |
commit | aba92962498609bcfee7a2b5332aa97440179f1d (patch) | |
tree | b6f45410c865d3b0e141ef4d01c00365b9d9e6e8 /common | |
parent | e62b5266356ab99ac9296cf1b323d873e7dd6add (diff) | |
download | u-boot-fsl-qoriq-aba92962498609bcfee7a2b5332aa97440179f1d.tar.xz |
dm: pci: Add support for PCI driver matching
At present all PCI devices must be present in the device tree in order to
be used. Many or most PCI devices don't require any configuration other than
that which is done automatically by U-Boot. It is inefficent to add a node
with nothing but a compatible string in order to get a device working.
Add a mechanism whereby PCI drivers can be declared along with the device
parameters they support (vendor/device/class). When no suitable driver is
found in the device tree the list of such devices is consulted to determine
the correct driver. If this also fails, then a generic driver is used as
before.
The mechanism used is very similar to that provided by Linux and the header
file defintions are copied from Linux 4.1.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_tsi148.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/cmd_tsi148.c b/common/cmd_tsi148.c index dc488b2..ea96d0f 100644 --- a/common/cmd_tsi148.c +++ b/common/cmd_tsi148.c @@ -16,8 +16,8 @@ #include <tsi148.h> -#define PCI_VENDOR PCI_VENDOR_ID_TUNDRA -#define PCI_DEVICE PCI_DEVICE_ID_TUNDRA_TSI148 +#define LPCI_VENDOR PCI_VENDOR_ID_TUNDRA +#define LPCI_DEVICE PCI_DEVICE_ID_TUNDRA_TSI148 typedef struct _TSI148_DEV TSI148_DEV; @@ -41,7 +41,7 @@ int tsi148_init(void) pci_dev_t busdevfn; unsigned int val; - busdevfn = pci_find_device(PCI_VENDOR, PCI_DEVICE, 0); + busdevfn = pci_find_device(LPCI_VENDOR, LPCI_DEVICE, 0); if (busdevfn == -1) { puts("Tsi148: No Tundra Tsi148 found!\n"); return -1; @@ -68,7 +68,7 @@ int tsi148_init(void) /* check mapping */ debug("Tsi148: Read via mapping, PCI_ID = %08X\n", readl(&dev->uregs->pci_id)); - if (((PCI_DEVICE << 16) | PCI_VENDOR) != readl(&dev->uregs->pci_id)) { + if (((LPCI_DEVICE << 16) | LPCI_VENDOR) != readl(&dev->uregs->pci_id)) { printf("Tsi148: Cannot read PCI-ID via Mapping: %08x\n", readl(&dev->uregs->pci_id)); result = -1; |