Lines Matching +full:mac +full:- +full:mode
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
13 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_id()
16 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_id()
20 dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n", in stmmac_get_id()
28 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_dev_id()
31 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_dev_id()
40 struct mac_device_info *mac = priv->hw; in stmmac_dwmac_mode_quirk() local
42 if (priv->chain_mode) { in stmmac_dwmac_mode_quirk()
43 dev_info(priv->device, "Chain mode enabled\n"); in stmmac_dwmac_mode_quirk()
44 priv->mode = STMMAC_CHAIN_MODE; in stmmac_dwmac_mode_quirk()
45 mac->mode = &chain_mode_ops; in stmmac_dwmac_mode_quirk()
47 dev_info(priv->device, "Ring mode enabled\n"); in stmmac_dwmac_mode_quirk()
48 priv->mode = STMMAC_RING_MODE; in stmmac_dwmac_mode_quirk()
49 mac->mode = &ring_mode_ops; in stmmac_dwmac_mode_quirk()
55 struct mac_device_info *mac = priv->hw; in stmmac_dwmac1_quirks() local
57 if (priv->plat->enh_desc) { in stmmac_dwmac1_quirks()
58 dev_info(priv->device, "Enhanced/Alternate descriptors\n"); in stmmac_dwmac1_quirks()
61 if (priv->synopsys_id >= DWMAC_CORE_3_50) { in stmmac_dwmac1_quirks()
62 dev_info(priv->device, "Enabled extended descriptors\n"); in stmmac_dwmac1_quirks()
63 priv->extend_desc = 1; in stmmac_dwmac1_quirks()
65 dev_warn(priv->device, "Extended descriptors not supported\n"); in stmmac_dwmac1_quirks()
68 mac->desc = &enh_desc_ops; in stmmac_dwmac1_quirks()
70 dev_info(priv->device, "Normal descriptors\n"); in stmmac_dwmac1_quirks()
71 mac->desc = &ndesc_ops; in stmmac_dwmac1_quirks()
86 priv->hw->xlgmac = true; in stmmac_dwxlgmac_quirks()
92 struct plat_stmmacenet_data *plat = priv ? priv->plat : NULL; in stmmac_reset()
95 return -EINVAL; in stmmac_reset()
97 if (plat && plat->fix_soc_reset) in stmmac_reset()
98 return plat->fix_soc_reset(plat, ioaddr); in stmmac_reset()
112 const void *mac; member
114 const void *mode; member
132 .mac = &dwmac100_ops,
134 .mode = NULL,
150 .mac = &dwmac1000_ops,
152 .mode = NULL,
168 .mac = &dwmac4_ops,
170 .mode = NULL,
186 .mac = &dwmac410_ops,
188 .mode = &dwmac4_ring_mode_ops,
204 .mac = &dwmac410_ops,
206 .mode = &dwmac4_ring_mode_ops,
222 .mac = &dwmac510_ops,
224 .mode = &dwmac4_ring_mode_ops,
241 .mac = &dwxgmac210_ops,
243 .mode = NULL,
260 .mac = &dwxlgmac2_ops,
262 .mode = NULL,
272 bool needs_xgmac = priv->plat->has_xgmac; in stmmac_hwif_init()
273 bool needs_gmac4 = priv->plat->has_gmac4; in stmmac_hwif_init()
274 bool needs_gmac = priv->plat->has_gmac; in stmmac_hwif_init()
276 struct mac_device_info *mac; in stmmac_hwif_init() local
292 priv->synopsys_id = id; in stmmac_hwif_init()
295 priv->ptpaddr = priv->ioaddr + in stmmac_hwif_init()
297 priv->mmcaddr = priv->ioaddr + in stmmac_hwif_init()
301 if (priv->plat->setup) { in stmmac_hwif_init()
302 mac = priv->plat->setup(priv); in stmmac_hwif_init()
305 mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL); in stmmac_hwif_init()
308 if (!mac) in stmmac_hwif_init()
309 return -ENOMEM; in stmmac_hwif_init()
312 for (i = ARRAY_SIZE(stmmac_hw) - 1; i >= 0; i--) { in stmmac_hwif_init()
315 if (needs_gmac ^ entry->gmac) in stmmac_hwif_init()
317 if (needs_gmac4 ^ entry->gmac4) in stmmac_hwif_init()
319 if (needs_xgmac ^ entry->xgmac) in stmmac_hwif_init()
322 if (priv->synopsys_id < entry->min_id) in stmmac_hwif_init()
324 if (needs_xgmac && (dev_id ^ entry->dev_id)) in stmmac_hwif_init()
328 mac->desc = mac->desc ? : entry->desc; in stmmac_hwif_init()
329 mac->dma = mac->dma ? : entry->dma; in stmmac_hwif_init()
330 mac->mac = mac->mac ? : entry->mac; in stmmac_hwif_init()
331 mac->ptp = mac->ptp ? : entry->hwtimestamp; in stmmac_hwif_init()
332 mac->mode = mac->mode ? : entry->mode; in stmmac_hwif_init()
333 mac->tc = mac->tc ? : entry->tc; in stmmac_hwif_init()
334 mac->mmc = mac->mmc ? : entry->mmc; in stmmac_hwif_init()
336 priv->hw = mac; in stmmac_hwif_init()
337 priv->ptpaddr = priv->ioaddr + entry->regs.ptp_off; in stmmac_hwif_init()
338 priv->mmcaddr = priv->ioaddr + entry->regs.mmc_off; in stmmac_hwif_init()
342 ret = entry->setup(priv); in stmmac_hwif_init()
348 priv->hwif_quirks = entry->quirks; in stmmac_hwif_init()
352 dev_err(priv->device, "Failed to find HW IF (id=0x%x, gmac=%d/%d)\n", in stmmac_hwif_init()
354 return -EINVAL; in stmmac_hwif_init()