Lines Matching +full:mac +full:- +full:mode
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
14 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_id()
17 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_id()
21 dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n", in stmmac_get_id()
29 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_dev_id()
32 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_dev_id()
41 struct mac_device_info *mac = priv->hw; in stmmac_dwmac_mode_quirk() local
43 if (priv->chain_mode) { in stmmac_dwmac_mode_quirk()
44 dev_info(priv->device, "Chain mode enabled\n"); in stmmac_dwmac_mode_quirk()
45 priv->mode = STMMAC_CHAIN_MODE; in stmmac_dwmac_mode_quirk()
46 mac->mode = &chain_mode_ops; in stmmac_dwmac_mode_quirk()
48 dev_info(priv->device, "Ring mode enabled\n"); in stmmac_dwmac_mode_quirk()
49 priv->mode = STMMAC_RING_MODE; in stmmac_dwmac_mode_quirk()
50 mac->mode = &ring_mode_ops; in stmmac_dwmac_mode_quirk()
56 struct mac_device_info *mac = priv->hw; in stmmac_dwmac1_quirks() local
58 if (priv->plat->enh_desc) { in stmmac_dwmac1_quirks()
59 dev_info(priv->device, "Enhanced/Alternate descriptors\n"); in stmmac_dwmac1_quirks()
62 if (priv->synopsys_id >= DWMAC_CORE_3_50) { in stmmac_dwmac1_quirks()
63 dev_info(priv->device, "Enabled extended descriptors\n"); in stmmac_dwmac1_quirks()
64 priv->extend_desc = 1; in stmmac_dwmac1_quirks()
66 dev_warn(priv->device, "Extended descriptors not supported\n"); in stmmac_dwmac1_quirks()
69 mac->desc = &enh_desc_ops; in stmmac_dwmac1_quirks()
71 dev_info(priv->device, "Normal descriptors\n"); in stmmac_dwmac1_quirks()
72 mac->desc = &ndesc_ops; in stmmac_dwmac1_quirks()
87 priv->hw->xlgmac = true; in stmmac_dwxlgmac_quirks()
93 struct plat_stmmacenet_data *plat = priv ? priv->plat : NULL; in stmmac_reset()
96 return -EINVAL; in stmmac_reset()
98 if (plat && plat->fix_soc_reset) in stmmac_reset()
99 return plat->fix_soc_reset(plat, ioaddr); in stmmac_reset()
113 const void *mac; member
115 const void *mode; member
134 .mac = &dwmac100_ops,
136 .mode = NULL,
152 .mac = &dwmac1000_ops,
154 .mode = NULL,
171 .mac = &dwmac4_ops,
173 .mode = NULL,
191 .mac = &dwmac410_ops,
193 .mode = &dwmac4_ring_mode_ops,
211 .mac = &dwmac410_ops,
213 .mode = &dwmac4_ring_mode_ops,
231 .mac = &dwmac510_ops,
233 .mode = &dwmac4_ring_mode_ops,
252 .mac = &dwxgmac210_ops,
254 .mode = NULL,
273 .mac = &dwxlgmac2_ops,
275 .mode = NULL,
286 bool needs_xgmac = priv->plat->has_xgmac; in stmmac_hwif_init()
287 bool needs_gmac4 = priv->plat->has_gmac4; in stmmac_hwif_init()
288 bool needs_gmac = priv->plat->has_gmac; in stmmac_hwif_init()
290 struct mac_device_info *mac; in stmmac_hwif_init() local
306 priv->synopsys_id = id; in stmmac_hwif_init()
309 priv->ptpaddr = priv->ioaddr + in stmmac_hwif_init()
311 priv->mmcaddr = priv->ioaddr + in stmmac_hwif_init()
314 priv->estaddr = priv->ioaddr + EST_GMAC4_OFFSET; in stmmac_hwif_init()
316 priv->estaddr = priv->ioaddr + EST_XGMAC_OFFSET; in stmmac_hwif_init()
319 if (priv->plat->setup) { in stmmac_hwif_init()
320 mac = priv->plat->setup(priv); in stmmac_hwif_init()
323 mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL); in stmmac_hwif_init()
326 if (!mac) in stmmac_hwif_init()
327 return -ENOMEM; in stmmac_hwif_init()
330 for (i = ARRAY_SIZE(stmmac_hw) - 1; i >= 0; i--) { in stmmac_hwif_init()
333 if (needs_gmac ^ entry->gmac) in stmmac_hwif_init()
335 if (needs_gmac4 ^ entry->gmac4) in stmmac_hwif_init()
337 if (needs_xgmac ^ entry->xgmac) in stmmac_hwif_init()
340 if (priv->synopsys_id < entry->min_id) in stmmac_hwif_init()
342 if (needs_xgmac && (dev_id ^ entry->dev_id)) in stmmac_hwif_init()
346 mac->desc = mac->desc ? : entry->desc; in stmmac_hwif_init()
347 mac->dma = mac->dma ? : entry->dma; in stmmac_hwif_init()
348 mac->mac = mac->mac ? : entry->mac; in stmmac_hwif_init()
349 mac->ptp = mac->ptp ? : entry->hwtimestamp; in stmmac_hwif_init()
350 mac->mode = mac->mode ? : entry->mode; in stmmac_hwif_init()
351 mac->tc = mac->tc ? : entry->tc; in stmmac_hwif_init()
352 mac->mmc = mac->mmc ? : entry->mmc; in stmmac_hwif_init()
353 mac->est = mac->est ? : entry->est; in stmmac_hwif_init()
355 priv->hw = mac; in stmmac_hwif_init()
356 priv->ptpaddr = priv->ioaddr + entry->regs.ptp_off; in stmmac_hwif_init()
357 priv->mmcaddr = priv->ioaddr + entry->regs.mmc_off; in stmmac_hwif_init()
358 if (entry->est) in stmmac_hwif_init()
359 priv->estaddr = priv->ioaddr + entry->regs.est_off; in stmmac_hwif_init()
363 ret = entry->setup(priv); in stmmac_hwif_init()
369 priv->hwif_quirks = entry->quirks; in stmmac_hwif_init()
373 dev_err(priv->device, "Failed to find HW IF (id=0x%x, gmac=%d/%d)\n", in stmmac_hwif_init()
375 return -EINVAL; in stmmac_hwif_init()