diff options
author | Jonathan Gray <jsg@jsg.id.au> | 2013-07-29 14:11:24 +1000 |
---|---|---|
committer | Jonathan Gray <jsg@jsg.id.au> | 2013-08-12 10:46:54 +1000 |
commit | 1352406bcf76c84c891f2bfb18a23f8028e4c24c (patch) | |
tree | b7d49bb255cf033f1bb7a42359ba02626e67b950 /sys/dev/pci/drm/radeon | |
parent | 3d0bb5702c40c4ec0d2e32d4fa79731d8f266117 (diff) |
handle the io bar being at 0x20 on newer devices
Diffstat (limited to 'sys/dev/pci/drm/radeon')
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 17 |
1 files changed, 11 insertions, 6 deletions
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); |