Lines Matching refs:mac

75 	struct ingenic_mac *mac = plat_dat->bsp_priv;
78 if (mac->soc_info->set_mode) {
79 ret = mac->soc_info->set_mode(plat_dat);
89 struct ingenic_mac *mac = plat_dat->bsp_priv;
96 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_MII\n");
102 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_GMII\n");
108 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
117 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n");
121 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
126 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
131 struct ingenic_mac *mac = plat_dat->bsp_priv;
135 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
139 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
144 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, 0);
149 struct ingenic_mac *mac = plat_dat->bsp_priv;
155 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
159 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
164 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
169 struct ingenic_mac *mac = plat_dat->bsp_priv;
176 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
180 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
185 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
190 struct ingenic_mac *mac = plat_dat->bsp_priv;
198 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n");
207 if (mac->tx_delay == 0)
211 FIELD_PREP(MACPHYC_TX_DELAY_MASK, (mac->tx_delay + 9750) / 19500 - 1);
213 if (mac->rx_delay == 0)
217 FIELD_PREP(MACPHYC_RX_DELAY_MASK, (mac->rx_delay + 9750) / 19500 - 1);
219 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n");
223 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface);
228 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val);
235 struct ingenic_mac *mac;
244 plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
248 mac = devm_kzalloc(&pdev->dev, sizeof(*mac), GFP_KERNEL);
249 if (!mac) {
262 mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg");
263 if (IS_ERR(mac->regmap)) {
265 ret = PTR_ERR(mac->regmap);
272 mac->tx_delay = tx_delay_ps * 1000;
283 mac->rx_delay = rx_delay_ps * 1000;
291 mac->soc_info = data;
292 mac->dev = &pdev->dev;
294 plat_dat->bsp_priv = mac;
377 { .compatible = "ingenic,jz4775-mac", .data = &jz4775_soc_info },
378 { .compatible = "ingenic,x1000-mac", .data = &x1000_soc_info },
379 { .compatible = "ingenic,x1600-mac", .data = &x1600_soc_info },
380 { .compatible = "ingenic,x1830-mac", .data = &x1830_soc_info },
381 { .compatible = "ingenic,x2000-mac", .data = &x2000_soc_info },
390 .name = "ingenic-mac",