Module Name:    src
Committed By:   christos
Date:           Sun Nov  2 00:05:03 UTC 2014

Modified Files:
        src/sys/dev/pci: agp_apple.c agpvar.h files.agp

Log Message:
make the apple code compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/agp_apple.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/agpvar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/files.agp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/agp_apple.c
diff -u src/sys/dev/pci/agp_apple.c:1.6 src/sys/dev/pci/agp_apple.c:1.7
--- src/sys/dev/pci/agp_apple.c:1.6	Sat Nov 13 08:52:04 2010
+++ src/sys/dev/pci/agp_apple.c	Sat Nov  1 20:05:03 2014
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: agp_apple.c,
 
 #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 @@ agp_apple_attach(device_t parent, device
 	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 @@ agp_apple_flush_tlb(struct agp_softc *sc
 {
 
 	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);
 }

Index: src/sys/dev/pci/agpvar.h
diff -u src/sys/dev/pci/agpvar.h:1.20 src/sys/dev/pci/agpvar.h:1.21
--- src/sys/dev/pci/agpvar.h:1.20	Thu Jun 12 14:33:42 2014
+++ src/sys/dev/pci/agpvar.h	Sat Nov  1 20:05:03 2014
@@ -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_amd64_match(const struct pci_att
 
 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 *);

Index: src/sys/dev/pci/files.agp
diff -u src/sys/dev/pci/files.agp:1.9 src/sys/dev/pci/files.agp:1.10
--- src/sys/dev/pci/files.agp:1.9	Sat Nov  1 17:46:46 2014
+++ src/sys/dev/pci/files.agp	Sat Nov  1 20:05:03 2014
@@ -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 @@ file	dev/pci/agp_ali.c	agp		needs-flag
 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

Reply via email to