diff options
-rw-r--r-- | cmd/pci.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -71,10 +71,15 @@ static int pci_bar_show(struct udevice *dev) int prefetchable; dm_pci_read_config8(dev, PCI_HEADER_TYPE, &header_type); + header_type &= 0x7f; if (header_type == PCI_HEADER_TYPE_CARDBUS) { printf("CardBus doesn't support BARs\n"); return -ENOSYS; + } else if (header_type != PCI_HEADER_TYPE_NORMAL && + header_type != PCI_HEADER_TYPE_BRIDGE) { + printf("unknown header type\n"); + return -ENOSYS; } bar_cnt = (header_type == PCI_HEADER_TYPE_NORMAL) ? 6 : 2; |