[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support for MII ICS1892 [patch]



Hi again,

thanks to Theo's hint I completed the support for the ICS1892. It is working
very nice here now.
The patch modifies icsphy.c which supported the ICS1890 only before. To
make sure my code doesn't break the ICS1890 support (I'm sure it
doesn't, but... well, you know) it needs to be tested with it. I don't have
a card with the ICS1890, so I need someone to test it.
The patch is against revision 1.6, last changed before OpenBSD 2.8, so any
system between 2.8-release and 2.9-current is ok.

If this test succeeds it should be ready for a commit.

Greetings

Henning


-- 
* Henning Brauer, hostmaster@bsws.de, http://www.bsws.de *
* Roedingsmarkt 14, 20459 Hamburg, Germany               *
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)
--- mii.orig/miidevs	Tue May 29 19:31:21 2001
+++ mii/miidevs	Wed May 30 19:30:19 2001
@@ -115,6 +115,7 @@
 
 /* Integrated Circuit Systems PHYs */
 model xxICS 1890		0x0002 ICS1890 10/100 media interface
+model xxICS 1892               0x0003 ICS1892 10/100 media interface
 
 /* Intel PHYs */
 model xxINTEL I82553		0x0000 i82553 10/100 media interface
--- mii.orig/icsphy.c	Tue May 29 19:31:21 2001
+++ mii/icsphy.c	Wed May 30 14:35:46 2001
@@ -69,6 +69,7 @@
 
 /*
  * driver for Integrated Circuit Systems' ICS1890 ethernet 10/100 PHY
+ * and its successor ICS1892
  * datasheet from www.icst.com
  */
 
@@ -115,6 +116,10 @@
 	if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
 	    MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1890)
 		return (10);
+   
+        if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
+	    MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1892)
+		return (10);
 
 	return (0);
 }
@@ -128,8 +133,15 @@
 	struct mii_attach_args *ma = aux;
 	struct mii_data *mii = ma->mii_data;
 
-	printf(": %s, rev. %d\n", MII_STR_xxICS_1890,
-	    MII_REV(ma->mii_id2));
+        if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
+	    MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1890)
+	       	printf(": %s, rev. %d\n", MII_STR_xxICS_1890,
+	          MII_REV(ma->mii_id2));
+
+        if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxICS &&
+	    MII_MODEL(ma->mii_id2) == MII_MODEL_xxICS_1892)
+	       	printf(": %s, rev. %d\n", MII_STR_xxICS_1892,
+	          MII_REV(ma->mii_id2));
 
 	sc->mii_inst = mii->mii_instance;
 	sc->mii_phy = ma->mii_phyno;
@@ -266,4 +278,11 @@
 
 	mii_phy_reset(sc);
 	PHY_WRITE(sc, MII_ICSPHY_ECR2, ECR2_10TPROT|ECR2_Q10T);
+   
+	/*
+	 * XXX the ICS1892 doesn't set the BMCR properly after
+	 * XXX reset, which breaks autonegotiation.
+	 */
+	PHY_WRITE(sc, MII_BMCR, BMCR_S100|BMCR_AUTOEN|BMCR_FDX);
+
 }