summaryrefslogtreecommitdiff
path: root/cmd/pci.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-10-15 07:50:59 -0400
committerTom Rini <trini@konsulko.com>2021-10-15 07:50:59 -0400
commit2d34be0a9e12cf050de39ad95375213f48e685bd (patch)
treeeec9902ce120d15c0868a9024e2c9e4adc947132 /cmd/pci.c
parent10cd8efe1a7eacd63907ba95bd8442bc2cdce461 (diff)
parent35b2b5f04c71efb73ec0f1a01535542e4b602e15 (diff)
Merge branch '2021-10-14-assorted-updates'
- Update to LLVM-13 in CI, assorted PCI fixes and pytest in CI improvements
Diffstat (limited to 'cmd/pci.c')
-rw-r--r--cmd/pci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/pci.c b/cmd/pci.c
index cfabdc0f301..3b1863f139c 100644
--- a/cmd/pci.c
+++ b/cmd/pci.c
@@ -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;
@@ -234,7 +239,7 @@ static void pci_header_show(struct udevice *dev)
pci_class_str(class));
pci_show_regs(dev, regs_rest);
- switch (header_type & 0x03) {
+ switch (header_type & 0x7f) {
case PCI_HEADER_TYPE_NORMAL: /* "normal" PCI device */
pci_show_regs(dev, regs_normal);
break;