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.
This commit is contained in:
Bill Paul 1998-12-04 21:48:12 +00:00
parent 03ba67cd99
commit c13be48aee
2 changed files with 15 additions and 8 deletions

View File

@ -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;

View File

@ -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.