Commit 19d96017 authored by Guo-Fu Tseng's avatar Guo-Fu Tseng Committed by David S. Miller

jme: Extract main and sub chip revision

Get the main and sub chip revision for later workaround use.
Signed-off-by: default avatarGuo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent afc6151a
...@@ -2731,6 +2731,8 @@ jme_check_hw_ver(struct jme_adapter *jme) ...@@ -2731,6 +2731,8 @@ jme_check_hw_ver(struct jme_adapter *jme)
jme->fpgaver = (chipmode & CM_FPGAVER_MASK) >> CM_FPGAVER_SHIFT; jme->fpgaver = (chipmode & CM_FPGAVER_MASK) >> CM_FPGAVER_SHIFT;
jme->chiprev = (chipmode & CM_CHIPREV_MASK) >> CM_CHIPREV_SHIFT; jme->chiprev = (chipmode & CM_CHIPREV_MASK) >> CM_CHIPREV_SHIFT;
jme->chip_main_rev = jme->chiprev & 0xF;
jme->chip_sub_rev = (jme->chiprev >> 4) & 0xF;
} }
static const struct net_device_ops jme_netdev_ops = { static const struct net_device_ops jme_netdev_ops = {
...@@ -2937,7 +2939,7 @@ jme_init_one(struct pci_dev *pdev, ...@@ -2937,7 +2939,7 @@ jme_init_one(struct pci_dev *pdev,
jme_clear_pm(jme); jme_clear_pm(jme);
jme_set_phyfifoa(jme); jme_set_phyfifoa(jme);
pci_read_config_byte(pdev, PCI_REVISION_ID, &jme->rev); pci_read_config_byte(pdev, PCI_REVISION_ID, &jme->pcirev);
if (!jme->fpgaver) if (!jme->fpgaver)
jme_phy_init(jme); jme_phy_init(jme);
jme_phy_off(jme); jme_phy_off(jme);
...@@ -2964,14 +2966,14 @@ jme_init_one(struct pci_dev *pdev, ...@@ -2964,14 +2966,14 @@ jme_init_one(struct pci_dev *pdev,
goto err_out_unmap; goto err_out_unmap;
} }
netif_info(jme, probe, jme->dev, "%s%s ver:%x rev:%x macaddr:%pM\n", netif_info(jme, probe, jme->dev, "%s%s chiprev:%x pcirev:%x macaddr:%pM\n",
(jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ? (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ?
"JMC250 Gigabit Ethernet" : "JMC250 Gigabit Ethernet" :
(jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ? (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ?
"JMC260 Fast Ethernet" : "Unknown", "JMC260 Fast Ethernet" : "Unknown",
(jme->fpgaver != 0) ? " (FPGA)" : "", (jme->fpgaver != 0) ? " (FPGA)" : "",
(jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev,
jme->rev, netdev->dev_addr); jme->pcirev, netdev->dev_addr);
return 0; return 0;
......
...@@ -411,8 +411,10 @@ struct jme_adapter { ...@@ -411,8 +411,10 @@ struct jme_adapter {
u32 rx_ring_mask; u32 rx_ring_mask;
u8 mrrs; u8 mrrs;
unsigned int fpgaver; unsigned int fpgaver;
unsigned int chiprev; u8 chiprev;
u8 rev; u8 chip_main_rev;
u8 chip_sub_rev;
u8 pcirev;
u32 msg_enable; u32 msg_enable;
struct ethtool_cmd old_ecmd; struct ethtool_cmd old_ecmd;
unsigned int old_mtu; unsigned int old_mtu;
...@@ -1184,7 +1186,7 @@ enum jme_phy_reg17_vals { ...@@ -1184,7 +1186,7 @@ enum jme_phy_reg17_vals {
/* /*
* Workaround * Workaround
*/ */
static inline int is_buggy250(unsigned short device, unsigned int chiprev) static inline int is_buggy250(unsigned short device, u8 chiprev)
{ {
return device == PCI_DEVICE_ID_JMICRON_JMC250 && chiprev == 0x11; return device == PCI_DEVICE_ID_JMICRON_JMC250 && chiprev == 0x11;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment