]> bbs.cooldavid.org Git - jme.git/commitdiff
phyext testing phyextest
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Fri, 27 May 2011 07:44:10 +0000 (15:44 +0800)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Fri, 27 May 2011 07:44:10 +0000 (15:44 +0800)
jme.c

diff --git a/jme.c b/jme.c
index aeedfe209c19f0b4176fea330dd703daa718defe..6020ecf7a5895c58bbeae5921df6e0d2c18473cb 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -137,7 +137,7 @@ jme_phyext_memcpy(struct jme_adapter *jme, u32 *p, int reg_nr)
        int i;
        u16 *p16 = (u16 *)p;
 
-       for (i = 0 ; i < reg_nr ; ++i)
+       for (i = 0; i < reg_nr; ++i)
                p16[i] = jme_phyext_read(jme, i);
 }
 
@@ -1798,21 +1798,6 @@ jme_recal_phy(struct jme_adapter *jme)
        jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, miictl1000);
 }
 
-static inline void
-jme_set_phyparm(struct jme_adapter *jme, u32 val)
-{
-       u32 comm0, comm1;
-
-       comm0 = jme_phyext_read(jme, JME_PHYEXT_COMM0);
-       comm1 = jme_phyext_read(jme, JME_PHYEXT_COMM1);
-       comm0 &= ~(0xE000u);
-       comm0 |= ((val << 13) & 0xE000u);
-       comm1 &= ~(0x0001u);
-       comm1 |= ((val >> 3) & 0x0001u);
-       jme_phyext_write(jme, JME_PHYEXT_COMM0, comm0);
-       jme_phyext_write(jme, JME_PHYEXT_COMM1, comm1);
-}
-
 static inline void
 jme_refill_phyparm(struct jme_adapter *jme)
 {
@@ -1821,17 +1806,22 @@ jme_refill_phyparm(struct jme_adapter *jme)
             (jme->chip_sub_rev == 0 ||
              jme->chip_sub_rev == 1 ||
              jme->chip_sub_rev == 3))) {
-               jme_set_phyparm(jme, 0x8);
+               jme_phyext_write(jme, JME_PHYEXT_COMM0, 0x008Au);
+               jme_phyext_write(jme, JME_PHYEXT_COMM1, 0x4109u);
        } else if (jme->chip_main_rev == 3 &&
                   (jme->chip_sub_rev == 1 ||
                    jme->chip_sub_rev == 2)) {
-               jme_set_phyparm(jme, 0x7);
+               jme_phyext_write(jme, JME_PHYEXT_COMM0, 0xE088u);
+//             jme_phyext_write(jme, JME_PHYEXT_COMM1, 0x4108u);
        } else if (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260 &&
                   jme->chip_main_rev == 2) {
-               if (jme->chip_sub_rev == 0)
-                       jme_set_phyparm(jme, 0x3);
-               else if (jme->chip_sub_rev == 2)
-                       jme_set_phyparm(jme, 0x2);
+               if (jme->chip_sub_rev == 0) {
+                       jme_phyext_write(jme, JME_PHYEXT_COMM0, 0x608Au);
+//                     jme_phyext_write(jme, JME_PHYEXT_COMM1, 0x4108u);
+               } else if (jme->chip_sub_rev == 2) {
+                       jme_phyext_write(jme, JME_PHYEXT_COMM0, 0x408Au);
+//                     jme_phyext_write(jme, JME_PHYEXT_COMM1, 0x4108u);
+               }
        }
 }