summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1994-10-12 11:19:36 +0000
committerse <se@FreeBSD.org>1994-10-12 11:19:36 +0000
commit2c2e442f7bc05200583b5f97af503eceaa447515 (patch)
tree2aafc6dafe6be1624ac2cce7132c7e3968b3b8a3 /sys/pci
parent7c668b04127aad1be9efaeb4dd98749d1baa8086 (diff)
downloadFreeBSD-src-2c2e442f7bc05200583b5f97af503eceaa447515.zip
FreeBSD-src-2c2e442f7bc05200583b5f97af503eceaa447515.tar.gz
Submitted by: Matt Thomas <thomas@lkg.dec.com>
Preliminary FAST Ethernet support added (DEC21140).
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/README.de18
-rw-r--r--sys/pci/if_de.c50
2 files changed, 45 insertions, 23 deletions
diff --git a/sys/pci/README.de b/sys/pci/README.de
index 633c96a..8d3351c 100644
--- a/sys/pci/README.de
+++ b/sys/pci/README.de
@@ -1,4 +1,4 @@
-$Id: README.de,v 1.1 1994/10/01 20:16:42 wollman Exp $
+$Id: README.de,v 1.2 1994/10/11 18:33:07 thomas Exp $
----------------
@@ -14,7 +14,7 @@ using a eariler pass chip, you may encounter undetected transmit
corruptions. This driver also requires that DC21040-AA use a serial
Ethernet address ROM as described in the DC21040 specification.
-The DEC DE425 ESIA NIC based on the DC21040-AA is not support at
+The DEC DE425 EISA NIC based on the DC21040-AA is not support at
this time. A future update will include support for it.
The driver includes full support for both BPF and IP Multicast.
@@ -25,7 +25,9 @@ switch the driver to the correct port.
ifconfig de0 -altphys 10baseT/UTP port
This driver requires the NCR 53C810 PCI SCSI package to be installed.
-This can be obtained from FTP.Uni-Koeln.DE:~ftp/packages/FreeBSD.
+This can be obtained from FTP.Uni-Koeln.DE:~ftp/packages/FreeBSD/PCI-SCSI.
+Make sure the date of the NCR 53C810 PCI SCSI package is later than
+October 10th, 1994.
[All paths are relative to the top of sys source area, usually
/usr/src/sys.]
@@ -39,7 +41,6 @@ directories:
You will need to apply the following patches:
pat.files.i386 --> i386/conf/files.i386
- pat.pci --> i386/pci/pci.c, i386/pci/pci_config.c
After that is done you will need to edit your config file (in
i386/conf) and lines similar to:
@@ -47,14 +48,17 @@ i386/conf) and lines similar to:
controller pci0
device de0
+The PCI support code will automatically determine and enable the
+correct IRQ.
+
Now you are ready to rebuild your kernel, reboot, and see if the
driver can configure your board. When the system boots, you will
hopefully something close to:
- on pci0:7 <digital dc21040 ethernet> int a irq 9 as de0
- memory size=0x1000 virtual=0xf25e9000 physical=0xc0001000
+ de0 <digital dc21040 ethernet> int a irq 9 on pci0:7
+ reg20: virtual=0xf290a000 physical=0xc0001000
de0: enabling Thinwire/AUI port
- de0: DC21040 pass 2.3 (TULIP) ethernet address 08:00:2b:e2:1e:09
+ de0: DC21040 [10Mb/s] pass 2.3 ethernet address 08:00:2b:e2:1e:09
bpf: de0 attached
in the startup log. If so, the board configured properly and
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index 2aeebfa..8f088ac 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -21,9 +21,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_de.c,v 1.5 1994/10/01 16:10:24 thomas Exp $
+ * $Id: if_de.c,v 1.6 1994/10/11 18:20:10 thomas Exp $
*
* $Log: if_de.c,v $
+ * Revision 1.6 1994/10/11 18:20:10 thomas
+ * new pci interface
+ * new 100mb/s prelim support
+ *
* Revision 1.5 1994/10/01 16:10:24 thomas
* Modifications for FreeBSD 2.0
*
@@ -195,7 +199,14 @@ typedef struct {
#ifndef IFF_ALTPHYS
#define IFF_ALTPHYS IFF_LINK0 /* In case it isn't defined */
#endif
+typedef enum { TULIP_DC21040, TULIP_DC21140 } tulip_chipid_t;
+const char *tulip_chipdescs[] = {
+ "DC21040 [10Mb/s]",
+ "DC21140 [100Mb/s]",
+};
+
tulip_softc_t *tulips[NDE];
+tulip_chipid_t tulip_chipids[NDE];
unsigned tulip_intrs[NDE];
#define tulip_if tulip_ac.ac_if
@@ -309,7 +320,6 @@ tulip_init(
int unit)
{
tulip_softc_t *sc = tulips[unit];
- /* XXX unsigned new_cmdmode; */
if (sc->tulip_if.if_flags & IFF_UP) {
sc->tulip_if.if_flags |= IFF_RUNNING;
@@ -694,7 +704,7 @@ tulip_intr(
tulip_uint32_t csr;
unsigned spins = 0;
- /* XXX tulip_intrs[unit]++; */
+ tulip_intrs[sc->tulip_unit]++;
while ((csr = *sc->tulip_csrs.csr_status) & (TULIP_STS_NORMALINTR|TULIP_STS_ABNRMLINTR)) {
*sc->tulip_csrs.csr_status = csr & sc->tulip_intrmask;
@@ -704,7 +714,7 @@ tulip_intr(
if ((csr & TULIP_STS_ERRORMASK) == TULIP_STS_ERR_PARITY) {
TULIP_RESET(sc);
tulip_init(sc->tulip_unit);
- return (1);
+ return 1;
}
}
if (csr & TULIP_STS_RXINTR)
@@ -721,7 +731,7 @@ tulip_intr(
}
if (spins > sc->tulip_high_intrspins)
sc->tulip_high_intrspins = spins;
- return (1);
+ return 1;
}
/*
@@ -1006,8 +1016,9 @@ tulip_attach(
ifp->if_addrlen = 6;
ifp->if_hdrlen = 14;
- printf("%s%d: DC21040 pass %d.%d (TULIP) ethernet address %s\n",
+ printf("%s%d: %s pass %d.%d ethernet address %s\n",
sc->tulip_name, sc->tulip_unit,
+ tulip_chipdescs[tulip_chipids[sc->tulip_unit]],
(sc->tulip_revinfo & 0xF0) >> 4,
sc->tulip_revinfo & 0x0F,
ether_sprintf(sc->tulip_hwaddr));
@@ -1104,12 +1115,20 @@ tulip_pci_probe(
pcidi_t device_id)
{
int idx;
- if (device_id != 0x00021011ul)
- return (NULL);
- for (idx = 0; idx < NDE; idx++)
- if (tulips[idx] == NULL)
- return ("digital dc21040 ethernet");
- return (NULL);
+ for (idx = 0; idx < NDE; idx++) {
+ if (tulips[idx] == NULL) {
+ if (device_id == 0x00021011ul) {
+ tulip_chipids[idx] = TULIP_DC21040;
+ return "digital dc21040 ethernet";
+ }
+ if (device_id == 0x00091011ul) {
+ tulip_chipids[idx] = TULIP_DC21140;
+ return "digital dc21140 fast ethernet";
+ }
+ return NULL;
+ }
+ }
+ return NULL;
}
static void
@@ -1118,10 +1137,8 @@ tulip_pci_attach(
int unit)
{
tulip_softc_t *sc;
- int retval, idx /* XXX , revinfo, */;
- /* XXX signed int csr; */
+ int retval, idx;
vm_offset_t va_csrs, pa_csrs;
- /* XXX int result;*/
tulip_desc_t *rxdescs, *txdescs;
sc = (tulip_softc_t *) malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
@@ -1175,8 +1192,9 @@ tulip_pci_attach(
for (idx = 0; idx < 32; idx++)
printf("%02x", sc->tulip_rombuf[idx]);
printf("\n");
- printf("%s%d: DC21040 %d.%d ethernet address %s\n",
+ printf("%s%d: %s %d.%d ethernet address %s\n",
sc->tulip_name, sc->tulip_unit,
+ tulip_chipdescs[tulip_chipids[sc->tulip_unit]],
(sc->tulip_revinfo & 0xF0) >> 4, sc->tulip_revinfo & 0x0F,
"unknown");
} else {
OpenPOWER on IntegriCloud