aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/if_mx.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1998-12-04 21:48:12 +0000
committerBill Paul <wpaul@FreeBSD.org>1998-12-04 21:48:12 +0000
commitc13be48aee14d1b5954399b3304f841b5e746ebc (patch)
tree2aeb31b2dc90afc2284ba10ad168fcb4bbb5e945 /sys/pci/if_mx.c
parent03ba67cd999616e638f6044de4adc13664376cda (diff)
downloadsrc-c13be48aee14d1b5954399b3304f841b5e746ebc.tar.gz
src-c13be48aee14d1b5954399b3304f841b5e746ebc.zip
Put back some missing chip identification code that got lost somehow
during a trek through RCS. The Macronix 98713 and 98713A both have the same PCI device ID but different revision numbers, and we need to be able to tell one from the other. The 98715 and 98715A chips have the same device ID as the 98725 chip but different revision numbers, however we lump them into the same category except when identifying them during the PCI probe output. The main reason we need tell the chips apart is that the Macronix app notes say you have to write a special magic number into one of the registers in order to put the chip in normal operating mode. The 98713 requires one magic value, while all the others require a different one.
Notes
Notes: svn path=/head/; revision=41511
Diffstat (limited to 'sys/pci/if_mx.c')
-rw-r--r--sys/pci/if_mx.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/pci/if_mx.c b/sys/pci/if_mx.c
index a1938f058d75..6ea96aa71b96 100644
--- a/sys/pci/if_mx.c
+++ b/sys/pci/if_mx.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_mx.c,v 1.27 1998/12/01 15:55:20 wpaul Exp $
+ * $Id: if_mx.c,v 1.28 1998/12/04 21:34:33 wpaul Exp $
*/
/*
@@ -94,7 +94,7 @@
#ifndef lint
static char rcsid[] =
- "$Id: if_mx.c,v 1.27 1998/12/01 15:55:20 wpaul Exp $";
+ "$Id: if_mx.c,v 1.28 1998/12/04 21:34:33 wpaul Exp $";
#endif
/*
@@ -1240,9 +1240,11 @@ mx_probe(config_id, device_id)
((device_id >> 16) & 0xFFFF) == t->mx_did) {
/* Check the PCI revision */
rev = pci_conf_read(config_id, MX_PCI_REVID) & 0xFF;
- if (rev > MX_REVISION_98713 && rev < MX_REVISION_98715)
+ if (t->mx_did == MX_DEVICEID_98713 &&
+ rev >= MX_REVISION_98713A)
t++;
- if (rev >= MX_REVISION_98725)
+ if (t->mx_did == MX_DEVICEID_987x5 &&
+ rev >= MX_REVISION_98725)
t++;
return(t->mx_name);
}
@@ -1358,9 +1360,12 @@ mx_attach(config_id, unit)
/* Need this info to decide on a chip type. */
revision = pci_conf_read(config_id, MX_PCI_REVID) & 0x000000FF;
pci_id = pci_conf_read(config_id, MX_PCI_VENDOR_ID) & 0x0000FFFF;
+ pci_id = (pci_conf_read(config_id,MX_PCI_VENDOR_ID) >> 16) & 0x0000FFFF;
- if (pci_id == MX_DEVICEID_98713 && revision == MX_REVISION_98713)
+ if (pci_id == MX_DEVICEID_98713 && revision < MX_REVISION_98713A)
sc->mx_type = MX_TYPE_98713;
+ else if (pci_id == MX_DEVICEID_98713 && revision >= MX_REVISION_98713A)
+ sc->mx_type = MX_TYPE_98713A;
else
sc->mx_type = MX_TYPE_987x5;