Lines Matching +full:mac +full:- +full:mode

1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
17 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_id()
20 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_id()
24 dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n", in stmmac_get_id()
32 u32 reg = readl(priv->ioaddr + id_reg); in stmmac_get_dev_id()
35 dev_info(priv->device, "Version ID not available\n"); in stmmac_get_dev_id()
44 struct mac_device_info *mac = priv->hw; in stmmac_dwmac_mode_quirk() local
46 if (priv->chain_mode) { in stmmac_dwmac_mode_quirk()
47 dev_info(priv->device, "Chain mode enabled\n"); in stmmac_dwmac_mode_quirk()
48 priv->mode = STMMAC_CHAIN_MODE; in stmmac_dwmac_mode_quirk()
49 mac->mode = &chain_mode_ops; in stmmac_dwmac_mode_quirk()
51 dev_info(priv->device, "Ring mode enabled\n"); in stmmac_dwmac_mode_quirk()
52 priv->mode = STMMAC_RING_MODE; in stmmac_dwmac_mode_quirk()
53 mac->mode = &ring_mode_ops; in stmmac_dwmac_mode_quirk()
59 struct mac_device_info *mac = priv->hw; in stmmac_dwmac1_quirks() local
61 if (priv->plat->enh_desc) { in stmmac_dwmac1_quirks()
62 dev_info(priv->device, "Enhanced/Alternate descriptors\n"); in stmmac_dwmac1_quirks()
65 if (priv->synopsys_id >= DWMAC_CORE_3_50) { in stmmac_dwmac1_quirks()
66 dev_info(priv->device, "Enabled extended descriptors\n"); in stmmac_dwmac1_quirks()
67 priv->extend_desc = 1; in stmmac_dwmac1_quirks()
69 dev_warn(priv->device, "Extended descriptors not supported\n"); in stmmac_dwmac1_quirks()
72 mac->desc = &enh_desc_ops; in stmmac_dwmac1_quirks()
74 dev_info(priv->device, "Normal descriptors\n"); in stmmac_dwmac1_quirks()
75 mac->desc = &ndesc_ops; in stmmac_dwmac1_quirks()
90 priv->hw->xlgmac = true; in stmmac_dwxlgmac_quirks()
96 struct plat_stmmacenet_data *plat = priv ? priv->plat : NULL; in stmmac_reset()
99 return -EINVAL; in stmmac_reset()
101 if (plat && plat->fix_soc_reset) in stmmac_reset()
102 return plat->fix_soc_reset(plat, ioaddr); in stmmac_reset()
116 const void *mac; member
119 const void *mode; member
138 .mac = &dwmac100_ops,
141 .mode = NULL,
157 .mac = &dwmac1000_ops,
160 .mode = NULL,
177 .mac = &dwmac4_ops,
180 .mode = NULL,
199 .mac = &dwmac410_ops,
202 .mode = &dwmac4_ring_mode_ops,
221 .mac = &dwmac410_ops,
224 .mode = &dwmac4_ring_mode_ops,
243 .mac = &dwmac510_ops,
246 .mode = &dwmac4_ring_mode_ops,
266 .mac = &dwxgmac210_ops,
269 .mode = NULL,
289 .mac = &dwxlgmac2_ops,
292 .mode = NULL,
303 bool needs_xgmac = priv->plat->has_xgmac; in stmmac_hwif_init()
304 bool needs_gmac4 = priv->plat->has_gmac4; in stmmac_hwif_init()
305 bool needs_gmac = priv->plat->has_gmac; in stmmac_hwif_init()
307 struct mac_device_info *mac; in stmmac_hwif_init() local
323 priv->synopsys_id = id; in stmmac_hwif_init()
326 priv->ptpaddr = priv->ioaddr + in stmmac_hwif_init()
328 priv->mmcaddr = priv->ioaddr + in stmmac_hwif_init()
331 priv->estaddr = priv->ioaddr + EST_GMAC4_OFFSET; in stmmac_hwif_init()
333 priv->estaddr = priv->ioaddr + EST_XGMAC_OFFSET; in stmmac_hwif_init()
336 if (priv->plat->setup) { in stmmac_hwif_init()
337 mac = priv->plat->setup(priv); in stmmac_hwif_init()
340 mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL); in stmmac_hwif_init()
343 if (!mac) in stmmac_hwif_init()
344 return -ENOMEM; in stmmac_hwif_init()
347 for (i = ARRAY_SIZE(stmmac_hw) - 1; i >= 0; i--) { in stmmac_hwif_init()
350 if (needs_gmac ^ entry->gmac) in stmmac_hwif_init()
352 if (needs_gmac4 ^ entry->gmac4) in stmmac_hwif_init()
354 if (needs_xgmac ^ entry->xgmac) in stmmac_hwif_init()
357 if (priv->synopsys_id < entry->min_id) in stmmac_hwif_init()
359 if (needs_xgmac && (dev_id ^ entry->dev_id)) in stmmac_hwif_init()
363 mac->desc = mac->desc ? : entry->desc; in stmmac_hwif_init()
364 mac->dma = mac->dma ? : entry->dma; in stmmac_hwif_init()
365 mac->mac = mac->mac ? : entry->mac; in stmmac_hwif_init()
366 mac->ptp = mac->ptp ? : entry->hwtimestamp; in stmmac_hwif_init()
367 mac->mode = mac->mode ? : entry->mode; in stmmac_hwif_init()
368 mac->tc = mac->tc ? : entry->tc; in stmmac_hwif_init()
369 mac->mmc = mac->mmc ? : entry->mmc; in stmmac_hwif_init()
370 mac->est = mac->est ? : entry->est; in stmmac_hwif_init()
372 priv->hw = mac; in stmmac_hwif_init()
373 priv->fpe_cfg.reg = entry->regs.fpe_reg; in stmmac_hwif_init()
374 priv->ptpaddr = priv->ioaddr + entry->regs.ptp_off; in stmmac_hwif_init()
375 priv->mmcaddr = priv->ioaddr + entry->regs.mmc_off; in stmmac_hwif_init()
376 memcpy(&priv->ptp_clock_ops, entry->ptp, in stmmac_hwif_init()
378 if (entry->est) in stmmac_hwif_init()
379 priv->estaddr = priv->ioaddr + entry->regs.est_off; in stmmac_hwif_init()
383 ret = entry->setup(priv); in stmmac_hwif_init()
389 priv->hwif_quirks = entry->quirks; in stmmac_hwif_init()
393 dev_err(priv->device, "Failed to find HW IF (id=0x%x, gmac=%d/%d)\n", in stmmac_hwif_init()
395 return -EINVAL; in stmmac_hwif_init()