Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci make the apple code compile again.



details:   https://anonhg.NetBSD.org/src/rev/33d8c52e02f7
branches:  trunk
changeset: 803549:33d8c52e02f7
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Nov 02 00:05:03 2014 +0000

description:
make the apple code compile again.

diffstat:

 sys/dev/pci/agp_apple.c |  27 ++++++++++++++++++---------
 sys/dev/pci/agpvar.h    |   3 ++-
 sys/dev/pci/files.agp   |   6 +++---
 3 files changed, 23 insertions(+), 13 deletions(-)

diffs (107 lines):

diff -r 620f1113a7a3 -r 33d8c52e02f7 sys/dev/pci/agp_apple.c
--- a/sys/dev/pci/agp_apple.c   Sat Nov 01 23:21:31 2014 +0000
+++ b/sys/dev/pci/agp_apple.c   Sun Nov 02 00:05:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agp_apple.c,v 1.6 2010/11/13 13:52:04 uebayasi Exp $ */
+/*     $NetBSD: agp_apple.c,v 1.7 2014/11/02 00:05:03 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_apple.c,v 1.6 2010/11/13 13:52:04 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_apple.c,v 1.7 2014/11/02 00:05:03 christos Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/malloc.h>
@@ -44,6 +44,14 @@
 
 #include <sys/bus.h>
 
+#define        APPLE_UNINORTH_GART_BASE        0x8c
+#define        APPLE_UNINORTH_GART_BASE_ADDR   0x90
+#define APPLE_UNINORTH_GART_CTRL       0x94
+#define APPLE_UNINORTH_GART_INVAL      0x00000001
+#define APPLE_UNINORTH_GART_ENABLE     0x00000100
+#define APPLE_UNINORTH_GART_2XRESET    0x00010000
+#define APPLE_UNINORTH_GART_PERFRD     0x00080000
+
 static u_int32_t agp_apple_get_aperture(struct agp_softc *);
 static int agp_apple_set_aperture(struct agp_softc *, u_int32_t);
 static int agp_apple_bind_page(struct agp_softc *, off_t, bus_addr_t);
@@ -108,18 +116,19 @@
        asc->gatt = gatt;
 
        /* Install the gatt. */
-       aprint_error("gatt: %08x %d MB\n", gatt->ag_physical, sc->as_apsize >> 20);
+       aprint_error("gatt: %08jx %ju MB\n", (uintmax_t)gatt->ag_physical,
+           (uintmax_t)(sc->as_apsize >> 20));
        pci_conf_write(pa->pa_pc, pa->pa_tag, APPLE_UNINORTH_GART_BASE,
            (gatt->ag_physical & 0xfffff000) |
            (sc->as_apsize >> 22));
 
        /* Enable the aperture. */
        pci_conf_write(pa->pa_pc, pa->pa_tag, APPLE_UNINORTH_GART_CTRL,
-           APPLE_GART_EN);
+           APPLE_UNINORTH_GART_ENABLE);
        pci_conf_write(pa->pa_pc, pa->pa_tag, APPLE_UNINORTH_GART_CTRL,
-           APPLE_GART_EN | APPLE_GART_INV);
+           APPLE_UNINORTH_GART_ENABLE | APPLE_UNINORTH_GART_INVAL);
        pci_conf_write(pa->pa_pc, pa->pa_tag, APPLE_UNINORTH_GART_CTRL,
-           APPLE_GART_EN);
+           APPLE_UNINORTH_GART_ENABLE);
        return 0;
 }
 
@@ -182,9 +191,9 @@
 {
 
        pci_conf_write(sc->as_pc, sc->as_tag, APPLE_UNINORTH_GART_CTRL,
-           APPLE_GART_EN);
+           APPLE_UNINORTH_GART_ENABLE);
        pci_conf_write(sc->as_pc, sc->as_tag, APPLE_UNINORTH_GART_CTRL,
-           APPLE_GART_EN | APPLE_GART_INV);
+           APPLE_UNINORTH_GART_ENABLE | APPLE_UNINORTH_GART_INVAL);
        pci_conf_write(sc->as_pc, sc->as_tag, APPLE_UNINORTH_GART_CTRL,
-           APPLE_GART_EN);
+           APPLE_UNINORTH_GART_ENABLE);
 }
diff -r 620f1113a7a3 -r 33d8c52e02f7 sys/dev/pci/agpvar.h
--- a/sys/dev/pci/agpvar.h      Sat Nov 01 23:21:31 2014 +0000
+++ b/sys/dev/pci/agpvar.h      Sun Nov 02 00:05:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: agpvar.h,v 1.20 2014/06/12 18:33:42 riastradh Exp $    */
+/*     $NetBSD: agpvar.h,v 1.21 2014/11/02 00:05:03 christos Exp $     */
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -187,6 +187,7 @@
 
 int agp_ali_attach(device_t, device_t, void *);
 int agp_amd_attach(device_t, device_t, void *);
+int agp_apple_attach(device_t, device_t, void *);
 int agp_i810_attach(device_t, device_t, void *);
 int agp_intel_attach(device_t, device_t, void *);
 int agp_via_attach(device_t, device_t, void *);
diff -r 620f1113a7a3 -r 33d8c52e02f7 sys/dev/pci/files.agp
--- a/sys/dev/pci/files.agp     Sat Nov 01 23:21:31 2014 +0000
+++ b/sys/dev/pci/files.agp     Sun Nov 02 00:05:03 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.agp,v 1.9 2014/11/01 21:46:46 christos Exp $
+#      $NetBSD: files.agp,v 1.10 2014/11/02 00:05:03 christos Exp $
 
 define agpbus { }
 
@@ -14,8 +14,8 @@
 define agp_amd
 file   dev/pci/agp_amd.c       agp             needs-flag
 
-#define        agp_apple
-#file  dev/pci/agp_apple.c     agp             needs-flag
+define agp_apple
+file   dev/pci/agp_apple.c     agp             needs-flag
 
 define agp_i810
 file   dev/pci/agp_i810.c      agp             needs-flag



Home | Main Index | Thread Index | Old Index