Apparently BRIDGE mode allows BAT registers, so re-enable that code.
Change the pegasos PCI_NETBSD_CONFIGURE arguments around to wire up mem space into the correct area, and move the io regs a little to make it work properly. Just avoid the secondary PCI entirely. Change the list of things that we fiddle with in pci_conf_hook. Map mem on the fwohci, avoid display cards, avoid IO on the auvia. Change some printf's to aprint_* Yank a call to genppc_pci_indirect_make_tag and change it to the bus-independant pci call instead. (in pci_conf_hook)
This commit is contained in:
parent
a2a7fac20f
commit
7636840ee2
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pegasospci.c,v 1.12 2008/01/17 23:42:58 garbled Exp $ */
|
||||
/* $NetBSD: pegasospci.c,v 1.13 2008/01/28 18:24:21 garbled Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pegasospci.c,v 1.12 2008/01/17 23:42:58 garbled Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pegasospci.c,v 1.13 2008/01/28 18:24:21 garbled Exp $");
|
||||
|
||||
#include "opt_pci.h"
|
||||
|
||||
|
@ -214,16 +214,18 @@ pegasospci_attach(struct device *parent, struct device *self, void *aux)
|
|||
genofw_setup_pciintr_map((void *)pc, pbi, pc->pc_node);
|
||||
|
||||
#ifdef PCI_NETBSD_CONFIGURE
|
||||
ioext = extent_create("pciio", 0x00008000, 0x0000ffff, M_DEVBUF,
|
||||
NULL, 0, EX_NOWAIT);
|
||||
memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF,
|
||||
NULL, 0, EX_NOWAIT);
|
||||
if (isprim) {
|
||||
ioext = extent_create("pciio", 0x00001400, 0x0000ffff,
|
||||
M_DEVBUF, NULL, 0, EX_NOWAIT);
|
||||
memext = extent_create("pcimem", sc->sc_memt.pbs_base,
|
||||
sc->sc_memt.pbs_limit-1, M_DEVBUF, NULL, 0, EX_NOWAIT);
|
||||
|
||||
if (pci_configure_bus(pc, ioext, memext, NULL, 0, CACHELINESIZE))
|
||||
printf("pci_configure_bus() failed\n");
|
||||
if (pci_configure_bus(pc, ioext, memext, NULL, 0, CACHELINESIZE))
|
||||
printf("pci_configure_bus() failed\n");
|
||||
|
||||
extent_destroy(ioext);
|
||||
extent_destroy(memext);
|
||||
extent_destroy(ioext);
|
||||
extent_destroy(memext);
|
||||
}
|
||||
#endif /* PCI_NETBSD_CONFIGURE */
|
||||
|
||||
memset(&pba, 0, sizeof(pba));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: oea_machdep.c,v 1.38 2008/01/09 21:09:21 garbled Exp $ */
|
||||
/* $NetBSD: oea_machdep.c,v 1.39 2008/01/28 18:24:21 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Matt Thomas
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.38 2008/01/09 21:09:21 garbled Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.39 2008/01/28 18:24:21 garbled Exp $");
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
#include "opt_ddb.h"
|
||||
|
@ -413,7 +413,7 @@ mpc601_ioseg_add(paddr_t pa, register_t len)
|
|||
}
|
||||
|
||||
|
||||
#if defined (PPC_OEA) && !defined (PPC_OEA64) && !defined (PPC_OEA64_BRIDGE)
|
||||
#if defined (PPC_OEA) || defined (PPC_OEA64_BRIDGE)
|
||||
void
|
||||
oea_iobat_add(paddr_t pa, register_t len)
|
||||
{
|
||||
|
@ -637,7 +637,7 @@ oea_batinit(paddr_t pa, ...)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif /* (PPC_OEA) && !(PPC_OEA64) && !(PPC_OEA64_BRIDGE) */
|
||||
#endif /* PPC_OEA || PPC_OEA64_BRIDGE */
|
||||
|
||||
void
|
||||
oea_install_extint(void (*handler)(void))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ofwoea_machdep.c,v 1.8 2008/01/17 23:42:59 garbled Exp $ */
|
||||
/* $NetBSD: ofwoea_machdep.c,v 1.9 2008/01/28 18:24:21 garbled Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.8 2008/01/17 23:42:59 garbled Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.9 2008/01/28 18:24:21 garbled Exp $");
|
||||
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
|
@ -356,7 +356,7 @@ noranges:
|
|||
void
|
||||
ofwoea_batinit(void)
|
||||
{
|
||||
#ifdef PPC_OEA
|
||||
#if defined (PPC_OEA) || defined (PPC_OEA64_BRIDGE)
|
||||
u_int16_t bitmap;
|
||||
int node, i;
|
||||
|
||||
|
@ -377,7 +377,7 @@ ofwoea_batinit(void)
|
|||
DPRINTF("Batmapped 256M at 0x%x\n", 0x10000000 * i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* OEA || BRIDGE */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pchb.c,v 1.2 2007/10/17 19:56:44 garbled Exp $ */
|
||||
/* $NetBSD: pchb.c,v 1.3 2008/01/28 18:24:21 garbled Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.2 2007/10/17 19:56:44 garbled Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.3 2008/01/28 18:24:21 garbled Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -245,8 +245,10 @@ pchbattach(struct device *parent, struct device *self, void *aux)
|
|||
#if NAGP > 0
|
||||
struct agpbus_attach_args apa;
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
volatile unsigned char *python;
|
||||
uint32_t v;
|
||||
|
||||
aprint_normal("\n");
|
||||
|
||||
/*
|
||||
* All we do is print out a description. Eventually, we
|
||||
|
@ -255,7 +257,7 @@ pchbattach(struct device *parent, struct device *self, void *aux)
|
|||
*/
|
||||
|
||||
pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
|
||||
printf("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
|
||||
aprint_normal("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
|
||||
PCI_REVISION(pa->pa_class));
|
||||
|
||||
switch (PCI_VENDOR(pa->pa_id)) {
|
||||
|
@ -264,6 +266,13 @@ pchbattach(struct device *parent, struct device *self, void *aux)
|
|||
case PCI_PRODUCT_IBM_82660:
|
||||
ibm82660_print(pa, self);
|
||||
break;
|
||||
case PCI_PRODUCT_IBM_PYTHON:
|
||||
python = mapiodev(0xfeff6000, 0x60);
|
||||
v = 0x88b78e01; /* taken from linux */
|
||||
out32rb(python+0x30, v);
|
||||
v = in32rb(python+0x30);
|
||||
aprint_debug("Reset python reg 30 to 0x%x\n", v);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PCI_VENDOR_MOT:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pci_machdep_ofw.c,v 1.8 2008/01/17 23:42:59 garbled Exp $ */
|
||||
/* $NetBSD: pci_machdep_ofw.c,v 1.9 2008/01/28 18:24:22 garbled Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_machdep_ofw.c,v 1.8 2008/01/17 23:42:59 garbled Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_machdep_ofw.c,v 1.9 2008/01/28 18:24:22 garbled Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -494,20 +494,25 @@ genofw_pci_conf_hook(pci_chipset_tag_t pct, int bus, int dev, int func,
|
|||
PCI_PRODUCT(id) == PCI_PRODUCT_VIATECH_VT82C586A_IDE)
|
||||
return 0;
|
||||
|
||||
/* we want to leave fwochi(4) without mem space */
|
||||
/* leave the audio IO alone */
|
||||
if (PCI_VENDOR(id) == PCI_VENDOR_VIATECH &&
|
||||
PCI_PRODUCT(id) == PCI_PRODUCT_VIATECH_VT6306)
|
||||
return (PCI_CONF_ALL & ~PCI_CONF_MAP_MEM);
|
||||
}
|
||||
PCI_PRODUCT(id) == PCI_PRODUCT_VIATECH_VT82C686A_AC97)
|
||||
return (PCI_CONF_ALL & ~PCI_CONF_MAP_IO);
|
||||
|
||||
}
|
||||
|
||||
tag = pci_make_tag(pct, bus, dev, func);
|
||||
class = pci_conf_read(pct, tag, PCI_CLASS_REG);
|
||||
|
||||
/* leave video cards alone */
|
||||
if (PCI_CLASS(class) == PCI_CLASS_DISPLAY)
|
||||
return 0;
|
||||
|
||||
/* NOTE, all device specific stuff must be above this line */
|
||||
/* don't do this on the primary host bridge */
|
||||
if (bus == 0 && dev == 0 && func == 0)
|
||||
return PCI_CONF_DEFAULT;
|
||||
|
||||
tag = genppc_pci_indirect_make_tag(pct, bus, dev, func);
|
||||
class = genppc_pci_indirect_conf_read(pct, tag, PCI_CLASS_REG);
|
||||
|
||||
/*
|
||||
* PCI bridges have special needs. We need to discover where they
|
||||
* came from, and wire them appropriately.
|
||||
|
|
Loading…
Reference in New Issue