Lines Matching refs:mac

76 	struct ingenic_mac *mac = bsp_priv;
79 if (mac->soc_info->set_mode) {
80 ret = mac->soc_info->set_mode(mac->plat_dat);
90 struct ingenic_mac *mac = plat_dat->bsp_priv;
97 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_MII\n");
103 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_GMII\n");
109 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
118 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n");
122 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
127 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
132 struct ingenic_mac *mac = plat_dat->bsp_priv;
136 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
140 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
145 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, 0);
150 struct ingenic_mac *mac = plat_dat->bsp_priv;
156 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
160 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
165 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
170 struct ingenic_mac *mac = plat_dat->bsp_priv;
177 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
181 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
186 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
191 struct ingenic_mac *mac = plat_dat->bsp_priv;
199 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
208 if (mac->tx_delay == 0)
212 FIELD_PREP(MACPHYC_TX_DELAY_MASK, (mac->tx_delay + 9750) / 19500 - 1);
214 if (mac->rx_delay == 0)
218 FIELD_PREP(MACPHYC_RX_DELAY_MASK, (mac->rx_delay + 9750) / 19500 - 1);
220 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n");
224 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
229 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
236 struct ingenic_mac *mac;
245 plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
249 mac = devm_kzalloc(&pdev->dev, sizeof(*mac), GFP_KERNEL);
250 if (!mac)
260 mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg");
261 if (IS_ERR(mac->regmap)) {
263 return PTR_ERR(mac->regmap);
269 mac->tx_delay = tx_delay_ps * 1000;
279 mac->rx_delay = rx_delay_ps * 1000;
286 mac->soc_info = data;
287 mac->dev = &pdev->dev;
288 mac->plat_dat = plat_dat;
290 plat_dat->bsp_priv = mac;
333 { .compatible = "ingenic,jz4775-mac", .data = &jz4775_soc_info },
334 { .compatible = "ingenic,x1000-mac", .data = &x1000_soc_info },
335 { .compatible = "ingenic,x1600-mac", .data = &x1600_soc_info },
336 { .compatible = "ingenic,x1830-mac", .data = &x1830_soc_info },
337 { .compatible = "ingenic,x2000-mac", .data = &x2000_soc_info },
345 .name = "ingenic-mac",