|
@@ -1076,3 +1076,64 @@ marvel_agp_info(void)
|
|
for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; ) {
|
|
for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; ) {
|
|
struct pci_controller *h;
|
|
struct pci_controller *h;
|
|
vuip addr;
|
|
vuip addr;
|
|
|
|
+
|
|
|
|
+ if (!io7->ports[IO7_AGP_PORT].enabled)
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ h = io7->ports[IO7_AGP_PORT].hose;
|
|
|
|
+ addr = (vuip)build_conf_addr(h, 0, PCI_DEVFN(5, 0), 0);
|
|
|
|
+
|
|
|
|
+ if (*addr != 0xffffffffu) {
|
|
|
|
+ hose = h;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!hose || !hose->sg_pci)
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
|
|
+ printk("MARVEL - using hose %d as AGP\n", hose->index);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Get the csrs from the hose.
|
|
|
|
+ */
|
|
|
|
+ csrs = ((struct io7_port *)hose->sysdata)->csrs;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Allocate the info structure.
|
|
|
|
+ */
|
|
|
|
+ agp = kmalloc(sizeof(*agp), GFP_KERNEL);
|
|
|
|
+ if (!agp)
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Fill it in.
|
|
|
|
+ */
|
|
|
|
+ agp->hose = hose;
|
|
|
|
+ agp->private = NULL;
|
|
|
|
+ agp->ops = &marvel_agp_ops;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Aperture - not configured until ops.setup().
|
|
|
|
+ */
|
|
|
|
+ agp->aperture.bus_base = 0;
|
|
|
|
+ agp->aperture.size = 0;
|
|
|
|
+ agp->aperture.sysdata = NULL;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Capabilities.
|
|
|
|
+ *
|
|
|
|
+ * NOTE: IO7 reports through AGP_STAT that it can support a read queue
|
|
|
|
+ * depth of 17 (rq = 0x10). It actually only supports a depth of
|
|
|
|
+ * 16 (rq = 0xf).
|
|
|
|
+ */
|
|
|
|
+ agp->capability.lw = csrs->AGP_STAT.csr;
|
|
|
|
+ agp->capability.bits.rq = 0xf;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Mode.
|
|
|
|
+ */
|
|
|
|
+ agp->mode.lw = csrs->AGP_CMD.csr;
|
|
|
|
+
|
|
|
|
+ return agp;
|
|
|
|
+}
|