Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265748
b: refs/heads/master
c: f0b9d78
h: refs/heads/master
v: v3
  • Loading branch information
Giuseppe CAVALLARO authored and David S. Miller committed Sep 15, 2011
1 parent 5eefac6 commit 5a33a9c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ac2905511063376ef59baae0e570bfebeea8004
refs/heads/master: f0b9d7865a95fdcb18319a678c616156be74cdfb
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/stmicro/stmmac/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ struct mac_device_info {
const struct stmmac_dma_ops *dma;
struct mii_regs mii; /* MII register Addresses */
struct mac_link link;
unsigned int synopsys_uid;
};

struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,7 @@ static const struct stmmac_ops dwmac1000_ops = {
struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr)
{
struct mac_device_info *mac;
u32 uid = readl(ioaddr + GMAC_VERSION);

pr_info("\tDWMAC1000 - user ID: 0x%x, Synopsys ID: 0x%x\n",
((uid & 0x0000ff00) >> 8), (uid & 0x000000ff));
u32 hwid = readl(ioaddr + GMAC_VERSION);

mac = kzalloc(sizeof(const struct mac_device_info), GFP_KERNEL);
if (!mac)
Expand All @@ -241,6 +238,7 @@ struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr)
mac->link.speed = GMAC_CONTROL_FES;
mac->mii.addr = GMAC_MII_ADDR;
mac->mii.data = GMAC_MII_DATA;
mac->synopsys_uid = hwid;

return mac;
}
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ struct mac_device_info *dwmac100_setup(void __iomem *ioaddr)
mac->link.speed = 0;
mac->mii.addr = MAC_MII_ADDR;
mac->mii.data = MAC_MII_DATA;
mac->synopsys_uid = 0;

return mac;
}
20 changes: 19 additions & 1 deletion trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,23 @@ static void stmmac_mmc_setup(struct stmmac_priv *priv)
memset(&priv->mmc, 0, sizeof(struct stmmac_counters));
}

static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv)
{
u32 hwid = priv->hw->synopsys_uid;

/* Only check valid Synopsys Id because old MAC chips
* have no HW registers where get the ID */
if (likely(hwid)) {
u32 uid = ((hwid & 0x0000ff00) >> 8);
u32 synid = (hwid & 0x000000ff);

pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n",
uid, synid);

return synid;
}
return 0;
}
/**
* stmmac_open - open entry point of the driver
* @dev : pointer to the device structure.
Expand Down Expand Up @@ -835,7 +852,8 @@ static int stmmac_open(struct net_device *dev)
/* Initialize the MAC Core */
priv->hw->mac->core_init(priv->ioaddr);

priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
stmmac_get_synopsys_id(priv);

if (priv->rx_coe)
pr_info("stmmac: Rx Checksum Offload Engine supported\n");
if (priv->plat->tx_coe)
Expand Down

0 comments on commit 5a33a9c

Please sign in to comment.