Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci add a hack to allow mapping the video memory por...



details:   https://anonhg.NetBSD.org/src/rev/9a0e3ab6b647
branches:  trunk
changeset: 762596:9a0e3ab6b647
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Feb 24 03:37:02 2011 +0000

description:
add a hack to allow mapping the video memory portions of a mach64's aperture
with BUS_SPACE_MAP_PREFETCHABLE
This probably needs to go in its own function to avoid more clutter when adding
more hacks.
tested on macppc

diffstat:

 sys/dev/pci/pci.c |  24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 455ce672dbe6 -r 9a0e3ab6b647 sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Thu Feb 24 02:55:18 2011 +0000
+++ b/sys/dev/pci/pci.c Thu Feb 24 03:37:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.c,v 1.132 2011/02/10 12:37:58 jmcneill Exp $       */
+/*     $NetBSD: pci.c,v 1.133 2011/02/24 03:37:02 macallan Exp $       */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.132 2011/02/10 12:37:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.133 2011/02/24 03:37:02 macallan Exp $");
 
 #include "opt_pci.h"
 
@@ -315,6 +315,26 @@
                        if (pci_mapreg_info(pc, tag, bar, type,
                            &r->r_offset, &r->r_size, &r->r_flags) != 0)
                                break;
+                       if ((PCI_VENDOR(id) == PCI_VENDOR_ATI) && (bar == 0x10)
+                           && (r->r_size = 0x1000000)) {
+                               struct pci_range *nr;
+                               /*
+                                * this has to be a mach64
+                                * split things up so each half-aperture can
+                                * be mapped PREFETCHABLE except the last page
+                                * which may contain registers
+                                */
+                               r->r_size = 0x7ff000;
+                               r->r_flags = BUS_SPACE_MAP_LINEAR |
+                                            BUS_SPACE_MAP_PREFETCHABLE;
+                               nr = &sc->PCI_SC_DEVICESC(device,
+                                   function).c_range[i++];
+                               nr->r_offset = r->r_offset + 0x800000;
+                               nr->r_size = 0x7ff000;
+                               nr->r_flags = BUS_SPACE_MAP_LINEAR |
+                                             BUS_SPACE_MAP_PREFETCHABLE;
+                       }
+                       
                }
        }
 



Home | Main Index | Thread Index | Old Index