From 1352406bcf76c84c891f2bfb18a23f8028e4c24c Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Mon, 29 Jul 2013 14:11:24 +1000 Subject: handle the io bar being at 0x20 on newer devices --- sys/dev/pci/drm/radeon/radeon_kms.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sys/dev/pci/drm/radeon') diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index ad1ac4ae662..a4fdc709d9b 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -1526,6 +1526,7 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux) const struct drm_pcidev *id_entry; int is_agp; pcireg_t type; + uint8_t iobar; #ifdef __sparc64__ extern int fbnode; @@ -1561,6 +1562,7 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux) #define RADEON_PCI_MEM 0x10 #define RADEON_PCI_IO 0x14 #define RADEON_PCI_MMIO 0x18 +#define RADEON_PCI_IO2 0x20 type = pci_mapreg_type(pa->pa_pc, pa->pa_tag, RADEON_PCI_MEM); if (PCI_MAPREG_TYPE(type) != PCI_MAPREG_TYPE_MEM || @@ -1570,12 +1572,15 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux) return; } - if (PCI_MAPREG_MEM_TYPE(type) != PCI_MAPREG_MEM_TYPE_64BIT) { - if (pci_mapreg_map(pa, RADEON_PCI_IO, PCI_MAPREG_TYPE_IO, 0, - NULL, &rdev->rio_mem, NULL, &rdev->rio_mem_size, 0)) { - printf(": can't map IO space\n"); - return; - } + if (PCI_MAPREG_MEM_TYPE(type) != PCI_MAPREG_MEM_TYPE_64BIT) + iobar = RADEON_PCI_IO; + else + iobar = RADEON_PCI_IO2; + + if (pci_mapreg_map(pa, iobar, PCI_MAPREG_TYPE_IO, 0, + NULL, &rdev->rio_mem, NULL, &rdev->rio_mem_size, 0)) { + printf(": can't map IO space\n"); + return; } type = pci_mapreg_type(pa->pa_pc, pa->pa_tag, RADEON_PCI_MMIO); -- cgit v1.2.3