summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1996-09-02 21:23:06 +0000
committerse <se@FreeBSD.org>1996-09-02 21:23:06 +0000
commitd6fd1776b01fc9ff83bdc615bdc9cc7cba18861b (patch)
treeb0f732ebdc89b979374c99d62c9f54989ec6af25 /sys/dev/pci
parenta74ea45a26f38149f5e54d1f975524fbce7ab15b (diff)
downloadFreeBSD-src-d6fd1776b01fc9ff83bdc615bdc9cc7cba18861b.zip
FreeBSD-src-d6fd1776b01fc9ff83bdc615bdc9cc7cba18861b.tar.gz
Add preliminary support for the Orion PCI chip set. It is special in the
way it attaches multiple PCI buses directly to the CPU, instead of having them hanging off from PCI to PCI bridges. This code is a hack, and will be obsoleted by the planned rework of the PCI code, which will change the dealing with PCI to PCI bridges and other special devices significantly. The patch also adds a kern_devconf entry for PCI bus 0 which is assumed to be a child of cpu0. The new PCI code will make it possible to hand out the kern_devconf structure to a pci device being attached, since this is (regretably, IMHO) required by a few ISA devices. Finally there are new PCI ids for some Intel chip set devices, which had already been known to 2.1.5R, but did not make it into -current. This closes "kern/1558: PCI probe seems to have lost a device in -current".
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c73
1 files changed, 52 insertions, 21 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 6f37602..4d88c99 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pci.c,v 1.50 1996/05/18 17:32:20 se Exp $
+** $Id: pci.c,v 1.51 1996/06/09 11:58:19 asami Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@@ -77,6 +77,19 @@
**========================================================
*/
+extern struct kern_devconf kdc_cpu0;
+
+struct kern_devconf kdc_pci0 = {
+ 0, 0, 0, /* filled in by dev_attach */
+ "pci", 0, { MDDT_BUS, 0 },
+ 0, 0, 0, BUS_EXTERNALLEN,
+ &kdc_cpu0, /* parent is the CPU */
+ 0, /* no parentdata */
+ DC_BUSY, /* busses are always busy */
+ "PCI bus",
+ DC_CLS_BUS /* class */
+};
+
struct pci_devconf {
struct kern_devconf pdc_kdc;
struct pci_info pdc_pi;
@@ -140,6 +153,10 @@ pci_mfdev (int bus, int device);
unsigned pci_max_burst_len = 3; /* 2=16Byte, 3=32Byte, 4=64Byte, ... */
unsigned pci_mechanism = 0;
unsigned pci_maxdevice = 0;
+unsigned pciroots = 0; /* XXX pcisupport.c increments this
+ * for the Orion host to PCI bridge
+ * UGLY hack ... :( Will be changed :)
+ */
static struct pcibus* pcibus;
/*--------------------------------------------------------
@@ -151,15 +168,7 @@ static struct pcibus* pcibus;
static int pci_conf_count;
static int pci_info_done;
-static struct pcicb pcibus0 = {
- NULL, NULL, NULL,
- { 0 },
- 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, /* real allocation */
- 0, 0xFFFF, /* iobase/limit */
- 0x2000000, 0xFFFFFFFFu, /* nonprefetch membase/limit */
- 0x2000000, 0xFFFFFFFFu /* prefetch membase/limit */
-};
+static int pcibusmax;
static struct pcicb *pcicb;
/*-----------------------------------------------------------------
@@ -339,7 +348,7 @@ pci_bridge_config (void)
/*
** Get the lowest available bus number.
*/
- pcicb->pcicb_bus = ++pcibus0.pcicb_subordinate;
+ pcicb->pcicb_bus = ++pcibusmax;
/*
** and configure the bridge
@@ -678,6 +687,7 @@ pci_bus_config (void)
pdcp -> pdc_kdc.kdc_internalize = pci_internalize;
pdcp -> pdc_kdc.kdc_datalen = PCI_EXTERNAL_LEN;
+ pdcp -> pdc_kdc.kdc_parent = &kdc_pci0;
pdcp -> pdc_kdc.kdc_parentdata = &pdcp->pdc_pi;
pdcp -> pdc_kdc.kdc_state = DC_UNKNOWN;
pdcp -> pdc_kdc.kdc_description = name;
@@ -927,19 +937,40 @@ void pci_configure()
** hello world ..
*/
- for (pcicb = &pcibus0; pcicb != NULL;) {
- pci_bus_config ();
+ dev_attach(&kdc_pci0);
- if (pcicb->pcicb_down) {
- pcicb = pcicb->pcicb_down;
- continue;
- };
+ pciroots = 1;
+ while (pciroots--) {
- while (pcicb && !pcicb->pcicb_next)
- pcicb = pcicb->pcicb_up;
+ pcicb = malloc (sizeof (struct pcicb), M_DEVBUF, M_WAITOK);
+ if (pcicb == NULL) {
+ return;
+ }
+ bzero (pcicb, sizeof (struct pcicb));
+ pcicb->pcicb_bus = pcibusmax;
+ pcicb->pcicb_iolimit = 0xffff;
+ pcicb->pcicb_membase = 0x02000000;
+ pcicb->pcicb_p_membase = 0x02000000;
+ pcicb->pcicb_memlimit = 0xffffffff;
+ pcicb->pcicb_p_memlimit = 0xffffffff;
+
+ while (pcicb != NULL) {
+ pci_bus_config ();
+
+ if (pcibusmax < pcicb->pcicb_bus)
+ (pcibusmax = pcicb->pcicb_bus);
+
+ if (pcicb->pcicb_down) {
+ pcicb = pcicb->pcicb_down;
+ continue;
+ };
- if (pcicb)
- pcicb = pcicb->pcicb_next;
+ while (pcicb && !pcicb->pcicb_next)
+ pcicb = pcicb->pcicb_up;
+
+ if (pcicb)
+ pcicb = pcicb->pcicb_next;
+ }
}
pci_conf_count++;
}
OpenPOWER on IntegriCloud