-/* $OpenBSD: pci.c,v 1.127 2023/04/13 15:36:28 miod Exp $ */
+/* $OpenBSD: pci.c,v 1.128 2024/03/18 21:20:46 kettenis Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
{
pci_chipset_tag_t pc = pa->pa_pc;
pcitag_t tag = pa->pa_tag;
- pcireg_t bhlc, blr, type, bir;
- pcireg_t addr, mask;
+ pcireg_t bhlc, blr, bir, csr;
+ pcireg_t addr, mask, type;
bus_addr_t base, limit;
bus_size_t size;
int reg, reg_start, reg_end, reg_rom;
default:
return (0);
}
-
+
+ csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
for (reg = reg_start; reg < reg_end; reg += 4) {
if (!pci_mapreg_probe(pc, tag, reg, &type))
continue;
#endif
if (pa->pa_memex && extent_alloc_region(pa->pa_memex,
base, size, EX_NOWAIT)) {
- printf("%d:%d:%d: mem address conflict 0x%lx/0x%lx\n",
- bus, dev, func, base, size);
+ if (csr & PCI_COMMAND_MEM_ENABLE) {
+ printf("%d:%d:%d: mem address conflict"
+ " 0x%lx/0x%lx\n", bus, dev, func,
+ base, size);
+ }
pci_conf_write(pc, tag, reg, 0);
if (type & PCI_MAPREG_MEM_TYPE_64BIT)
pci_conf_write(pc, tag, reg + 4, 0);
case PCI_MAPREG_TYPE_IO:
if (pa->pa_ioex && extent_alloc_region(pa->pa_ioex,
base, size, EX_NOWAIT)) {
- printf("%d:%d:%d: io address conflict 0x%lx/0x%lx\n",
- bus, dev, func, base, size);
+ if (csr & PCI_COMMAND_IO_ENABLE) {
+ printf("%d:%d:%d: io address conflict"
+ " 0x%lx/0x%lx\n", bus, dev, func,
+ base, size);
+ }
pci_conf_write(pc, tag, reg, 0);
}
break;
base, size, EX_NOWAIT) &&
pa->pa_memex && extent_alloc_region(pa->pa_memex,
base, size, EX_NOWAIT)) {
- printf("%d:%d:%d: rom address conflict 0x%lx/0x%lx\n",
- bus, dev, func, base, size);
+ if (addr & PCI_ROM_ENABLE) {
+ printf("%d:%d:%d: rom address conflict"
+ " 0x%lx/0x%lx\n", bus, dev, func,
+ base, size);
+ }
pci_conf_write(pc, tag, PCI_ROM_REG, 0);
}
}