From 1923cf874e661b8538dd5924672bf62c082c13f1 Mon Sep 17 00:00:00 2001 From: Guo-Fu Tseng Date: Fri, 27 May 2011 15:44:10 +0800 Subject: [PATCH] phyext testing --- jme.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/jme.c b/jme.c index aeedfe2..6020ecf 100644 --- 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); + } } } -- 2.39.3