diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-05 12:25:25 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-16 19:27:43 -0600 |
commit | ff3e077bd23c37c83d01aad105e528194e33d75e (patch) | |
tree | 187c45a9cc100b90e9d3dc3cf623178e928f73c1 /common/cmd_pci.c | |
parent | aab6724c90c39e1f599d4ee6354c9f2cf553dc61 (diff) | |
download | u-boot-imx-ff3e077bd23c37c83d01aad105e528194e33d75e.zip u-boot-imx-ff3e077bd23c37c83d01aad105e528194e33d75e.tar.gz u-boot-imx-ff3e077bd23c37c83d01aad105e528194e33d75e.tar.bz2 |
dm: pci: Add a uclass for PCI
Add a uclass for PCI controllers and a generic one for PCI devices. Adjust
the 'pci' command and the existing PCI support to work with this new uclass.
Keep most of the compatibility code in a separate file so that it can be
removed one day.
TODO: Add more header file comments to the new parts of pci.h
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_pci.c')
-rw-r--r-- | common/cmd_pci.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/common/cmd_pci.c b/common/cmd_pci.c index e3a77e3..dcecef8 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -48,6 +48,7 @@ void pciinfo(int BusNum, int ShortPCIListing) unsigned char HeaderType; unsigned short VendorID; pci_dev_t dev; + int ret; if (!hose) return; @@ -74,7 +75,10 @@ void pciinfo(int BusNum, int ShortPCIListing) if (pci_skip_dev(hose, dev)) continue; - pci_read_config_word(dev, PCI_VENDOR_ID, &VendorID); + ret = pci_read_config_word(dev, PCI_VENDOR_ID, + &VendorID); + if (ret) + goto error; if ((VendorID == 0xFFFF) || (VendorID == 0x0000)) continue; @@ -91,8 +95,12 @@ void pciinfo(int BusNum, int ShortPCIListing) BusNum, Device, Function); pci_header_show(dev); } - } - } + } + } + + return; +error: + printf("Cannot read bus configuration: %d\n", ret); } |