diff options
Diffstat (limited to 'drivers/net/ethernet/stmicro')
4 files changed, 23 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index e08fee880f14..65b1e56a97c9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h | |||
@@ -230,6 +230,7 @@ struct mac_device_info { | |||
230 | const struct stmmac_dma_ops *dma; | 230 | const struct stmmac_dma_ops *dma; |
231 | struct mii_regs mii; /* MII register Addresses */ | 231 | struct mii_regs mii; /* MII register Addresses */ |
232 | struct mac_link link; | 232 | struct mac_link link; |
233 | unsigned int synopsys_uid; | ||
233 | }; | 234 | }; |
234 | 235 | ||
235 | struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr); | 236 | struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index 9ba9cae5a60a..b1c48b975945 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | |||
@@ -224,10 +224,7 @@ static const struct stmmac_ops dwmac1000_ops = { | |||
224 | struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr) | 224 | struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr) |
225 | { | 225 | { |
226 | struct mac_device_info *mac; | 226 | struct mac_device_info *mac; |
227 | u32 uid = readl(ioaddr + GMAC_VERSION); | 227 | u32 hwid = readl(ioaddr + GMAC_VERSION); |
228 | |||
229 | pr_info("\tDWMAC1000 - user ID: 0x%x, Synopsys ID: 0x%x\n", | ||
230 | ((uid & 0x0000ff00) >> 8), (uid & 0x000000ff)); | ||
231 | 228 | ||
232 | mac = kzalloc(sizeof(const struct mac_device_info), GFP_KERNEL); | 229 | mac = kzalloc(sizeof(const struct mac_device_info), GFP_KERNEL); |
233 | if (!mac) | 230 | if (!mac) |
@@ -241,6 +238,7 @@ struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr) | |||
241 | mac->link.speed = GMAC_CONTROL_FES; | 238 | mac->link.speed = GMAC_CONTROL_FES; |
242 | mac->mii.addr = GMAC_MII_ADDR; | 239 | mac->mii.addr = GMAC_MII_ADDR; |
243 | mac->mii.data = GMAC_MII_DATA; | 240 | mac->mii.data = GMAC_MII_DATA; |
241 | mac->synopsys_uid = hwid; | ||
244 | 242 | ||
245 | return mac; | 243 | return mac; |
246 | } | 244 | } |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c index aacfc6eade50..138fb8dd1e87 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c | |||
@@ -188,6 +188,7 @@ struct mac_device_info *dwmac100_setup(void __iomem *ioaddr) | |||
188 | mac->link.speed = 0; | 188 | mac->link.speed = 0; |
189 | mac->mii.addr = MAC_MII_ADDR; | 189 | mac->mii.addr = MAC_MII_ADDR; |
190 | mac->mii.data = MAC_MII_DATA; | 190 | mac->mii.data = MAC_MII_DATA; |
191 | mac->synopsys_uid = 0; | ||
191 | 192 | ||
192 | return mac; | 193 | return mac; |
193 | } | 194 | } |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index caaad7b14621..eb210ca2497b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -763,6 +763,23 @@ static void stmmac_mmc_setup(struct stmmac_priv *priv) | |||
763 | memset(&priv->mmc, 0, sizeof(struct stmmac_counters)); | 763 | memset(&priv->mmc, 0, sizeof(struct stmmac_counters)); |
764 | } | 764 | } |
765 | 765 | ||
766 | static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | ||
767 | { | ||
768 | u32 hwid = priv->hw->synopsys_uid; | ||
769 | |||
770 | /* Only check valid Synopsys Id because old MAC chips | ||
771 | * have no HW registers where get the ID */ | ||
772 | if (likely(hwid)) { | ||
773 | u32 uid = ((hwid & 0x0000ff00) >> 8); | ||
774 | u32 synid = (hwid & 0x000000ff); | ||
775 | |||
776 | pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n", | ||
777 | uid, synid); | ||
778 | |||
779 | return synid; | ||
780 | } | ||
781 | return 0; | ||
782 | } | ||
766 | /** | 783 | /** |
767 | * stmmac_open - open entry point of the driver | 784 | * stmmac_open - open entry point of the driver |
768 | * @dev : pointer to the device structure. | 785 | * @dev : pointer to the device structure. |
@@ -835,7 +852,8 @@ static int stmmac_open(struct net_device *dev) | |||
835 | /* Initialize the MAC Core */ | 852 | /* Initialize the MAC Core */ |
836 | priv->hw->mac->core_init(priv->ioaddr); | 853 | priv->hw->mac->core_init(priv->ioaddr); |
837 | 854 | ||
838 | priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); | 855 | stmmac_get_synopsys_id(priv); |
856 | |||
839 | if (priv->rx_coe) | 857 | if (priv->rx_coe) |
840 | pr_info("stmmac: Rx Checksum Offload Engine supported\n"); | 858 | pr_info("stmmac: Rx Checksum Offload Engine supported\n"); |
841 | if (priv->plat->tx_coe) | 859 | if (priv->plat->tx_coe) |