summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-10-25 10:23:41 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-10-25 10:23:41 +0000
commitfc1d8bf76e01e29c9ee27e2760dbec01b58ffa60 (patch)
tree00b24de5b49cb509740e5c455e42c3461647dbc8 /sys/dev/pci
parentca6d1d0920d1d7b95c0513b6ffcdbd8611f144a6 (diff)
Make mapping the "I/O Space" BAR optional. POWER9 systems don't support
"I/O Space" on their PCIe host bridges and for most (all) Radeon variants there is an alternative method to access the relevant registers. ok jsg@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/radeon/radeon_kms.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c
index 92a6aaa0b6d..eafc166ec9a 100644
--- a/sys/dev/pci/drm/radeon/radeon_kms.c
+++ b/sys/dev/pci/drm/radeon/radeon_kms.c
@@ -568,17 +568,14 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux)
}
#endif
- for (i = PCI_MAPREG_START; i < PCI_MAPREG_END ; i+= 4) {
+ for (i = PCI_MAPREG_START; i < PCI_MAPREG_END; i += 4) {
type = pci_mapreg_type(pa->pa_pc, pa->pa_tag, i);
- if (PCI_MAPREG_TYPE(type) != PCI_MAPREG_TYPE_IO)
- continue;
- if (pci_mapreg_map(pa, i, type, 0, NULL,
- &rdev->rio_mem, NULL, &rdev->rio_mem_size, 0)) {
- printf(": can't map rio space\n");
- return;
+ if (type == PCI_MAPREG_TYPE_IO) {
+ pci_mapreg_map(pa, i, type, 0, NULL,
+ &rdev->rio_mem, NULL, &rdev->rio_mem_size, 0);
+ break;
}
-
- if (type & PCI_MAPREG_MEM_TYPE_64BIT)
+ if (type == PCI_MAPREG_MEM_TYPE_64BIT)
i += 4;
}