Add support for the ADMtek AN983 and AN985.

This commit is contained in:
thorpej 2000-10-03 04:32:00 +00:00
parent 0b86bc5a1c
commit 7edd5d54bc
4 changed files with 70 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tulip.c,v 1.72 2000/10/01 23:32:43 thorpej Exp $ */
/* $NetBSD: tulip.c,v 1.73 2000/10/03 04:32:00 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -244,6 +244,8 @@ tlp_attach(sc, enaddr)
break;
case TULIP_CHIP_AL981:
case TULIP_CHIP_AN983:
case TULIP_CHIP_AN985:
sc->sc_filter_setup = tlp_al981_filter_setup;
break;
@ -1872,6 +1874,8 @@ tlp_init(sc)
}
case TULIP_CHIP_AL981:
case TULIP_CHIP_AN983:
case TULIP_CHIP_AN985:
{
u_int32_t reg;
u_int8_t *enaddr = LLADDR(ifp->if_sadl);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tulipreg.h,v 1.22 2000/08/25 08:03:10 jeffs Exp $ */
/* $NetBSD: tulipreg.h,v 1.23 2000/10/03 04:32:00 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -106,6 +106,10 @@
* but luckily, there are all AL981-specific registers,
* so this is easy to deal with.
*
* - ADMtek AN983 and AN985
*
* Similar to the ADMtek AL981, but with a few differences.
*
* - Xircom X3201-3
*
* CardBus 21143 clone, with a few differences:
@ -1464,6 +1468,15 @@ struct tulip_desc {
#define ADM_100CTR_ANC 0x1000 /* autoneg completed */
#define ADM_100CTR_DISRER 0x2000 /* disable Rx error counter */
/* Operation Mode Register (AN983) */
#define CSR_ADM983_OPMODE 0xfc
#define ADM983_OPMODE_SPEED 0x80000000 /* 1 == 100, 0 == 10 */
#define ADM983_OPMODE_FD 0x40000000 /* 1 == fd, 0 == hd */
#define ADM983_OPMODE_LINK 0x20000000 /* 1 == link, 0 == no link */
#define ADM983_OPMODE_EERLOD 0x04000000 /* reload from EEPROM */
#define ADM983_OPMODE_SingleChip 0x00000007 /* single-chip mode */
#define ADM983_OPMODE_MacOnly 0x00000004 /* MAC-only mode */
/*
* Xircom X3201-3 registers
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: tulipvar.h,v 1.37 2000/08/03 03:07:30 castor Exp $ */
/* $NetBSD: tulipvar.h,v 1.38 2000/10/03 04:32:01 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -143,9 +143,11 @@ typedef enum {
TULIP_CHIP_DM9102 = 18, /* Davicom DM9102 */
TULIP_CHIP_DM9102A = 19, /* Davicom DM9102A */
TULIP_CHIP_AL981 = 20, /* ADMtek AL981 */
TULIP_CHIP_AX88140 = 21, /* ASIX AX88140 */
TULIP_CHIP_AX88141 = 22, /* ASIX AX88141 */
TULIP_CHIP_X3201_3 = 23, /* Xircom X3201-3 */
TULIP_CHIP_AN983 = 21, /* ADMtek AN983 */
TULIP_CHIP_AN985 = 22, /* ADMtek AN985 */
TULIP_CHIP_AX88140 = 23, /* ASIX AX88140 */
TULIP_CHIP_AX88141 = 24, /* ASIX AX88141 */
TULIP_CHIP_X3201_3 = 25, /* Xircom X3201-3 */
} tulip_chip_t;
#define TULIP_CHIP_NAMES \
@ -171,6 +173,8 @@ typedef enum {
"Davicom DM9102", \
"Davicom DM9102A", \
"ADMtek AL981", \
"ADMtek AN983", \
"ADMtek AN985", \
"ASIX AX88140", \
"ASIX AX88141", \
"Xircom X3201-3", \

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tlp_pci.c,v 1.46 2000/08/03 03:07:31 castor Exp $ */
/* $NetBSD: if_tlp_pci.c,v 1.47 2000/10/03 04:32:02 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -183,6 +183,9 @@ const struct tulip_pci_product {
{ PCI_VENDOR_ADMTEK, PCI_PRODUCT_ADMTEK_AL981,
TULIP_CHIP_AL981 },
{ PCI_VENDOR_ADMTEK, PCI_PRODUCT_ADMTEK_AN985,
TULIP_CHIP_AN985 },
#if 0
{ PCI_VENDOR_ASIX, PCI_PRODUCT_ASIX_AX88140A,
TULIP_CHIP_AX88140 },
@ -416,6 +419,27 @@ tlp_pci_attach(parent, self, aux)
sc->sc_regshift = 2;
break;
case TULIP_CHIP_AN985:
/*
* The AN983 and AN985 are very similar, and are
* differentiated by a "signature" register that
* is like, but not identical, to a PCI ID register.
*/
reg = pci_conf_read(pc, pa->pa_tag, 0x80);
switch (reg) {
case 0x09811317:
sc->sc_chip = TULIP_CHIP_AN985;
break;
case 0x09851317:
sc->sc_chip = TULIP_CHIP_AN983;
break;
default:
/* Unknown -- use default. */
}
break;
case TULIP_CHIP_AX88140:
if (sc->sc_rev >= 0x10)
sc->sc_chip = TULIP_CHIP_AX88141;
@ -832,6 +856,24 @@ tlp_pci_attach(parent, self, aux)
sc->sc_mediasw = &tlp_al981_mediasw;
break;
case TULIP_CHIP_AN983:
case TULIP_CHIP_AN985:
/*
* The ADMtek AN985's Ethernet address is located
* at offset 8 of its EEPROM.
*/
memcpy(enaddr, &sc->sc_srom[8], ETHER_ADDR_LEN);
/*
* The ADMtek AN985 can be configured in Single-Chip
* mode or MAC-only mode. Single-Chip uses the built-in
* PHY, MAC-only has an external PHY (usually HomePNA).
* The selection is based on an EEPROM setting, and both
* PHYs are accessed via MII attached to SIO.
*/
sc->sc_mediasw = &tlp_sio_mii_mediasw;
break;
case TULIP_CHIP_DM9102:
case TULIP_CHIP_DM9102A:
/*