summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1998-12-04 21:48:12 +0000
committerwpaul <wpaul@FreeBSD.org>1998-12-04 21:48:12 +0000
commit1a73567f510df76c93eab140ec11303a6913006d (patch)
tree2449bd8b98efb80a8da5192965badba8b5f91b11
parent4f36a36aa4df35f0ff3a275b941e1bbeeae304e1 (diff)
downloadFreeBSD-src-1a73567f510df76c93eab140ec11303a6913006d.zip
FreeBSD-src-1a73567f510df76c93eab140ec11303a6913006d.tar.gz
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.
-rw-r--r--sys/pci/if_mx.c15
-rw-r--r--sys/pci/if_mxreg.h8
2 files changed, 15 insertions, 8 deletions
diff --git a/sys/pci/if_mx.c b/sys/pci/if_mx.c
index a1938f0..6ea96aa 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;
diff --git a/sys/pci/if_mxreg.h b/sys/pci/if_mxreg.h
index 80e0f19..8a6d0a8 100644
--- a/sys/pci/if_mxreg.h
+++ b/sys/pci/if_mxreg.h
@@ -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_mxreg.h,v 1.11 1998/12/01 15:55:20 wpaul Exp $
+ * $Id: if_mxreg.h,v 1.12 1998/12/04 21:34:33 wpaul Exp $
*/
/*
@@ -66,7 +66,8 @@
#define MX_MAGIC_98715 0x0B3C0000
#define MX_MAGIC_98725 0x0B3C0000
-#define MX_REVISION_98713 0x10
+#define MX_REVISION_98713 0x00
+#define MX_REVISION_98713A 0x10
#define MX_REVISION_98715 0x20
#define MX_REVISION_98725 0x30
@@ -80,7 +81,8 @@
* numbers we write into CSR16.
*/
#define MX_TYPE_98713 0x1
-#define MX_TYPE_987x5 0x2
+#define MX_TYPE_98713A 0x2
+#define MX_TYPE_987x5 0x3
/*
* Bus control bits.
OpenPOWER on IntegriCloud