Lines Matching refs:mac
75 struct ingenic_mac *mac = plat_dat->bsp_priv; in ingenic_mac_init() local
78 if (mac->soc_info->set_mode) { in ingenic_mac_init()
79 ret = mac->soc_info->set_mode(plat_dat); in ingenic_mac_init()
89 struct ingenic_mac *mac = plat_dat->bsp_priv; in jz4775_mac_set_mode() local
96 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_MII\n"); in jz4775_mac_set_mode()
102 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_GMII\n"); in jz4775_mac_set_mode()
108 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in jz4775_mac_set_mode()
117 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n"); in jz4775_mac_set_mode()
121 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface); in jz4775_mac_set_mode()
126 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in jz4775_mac_set_mode()
131 struct ingenic_mac *mac = plat_dat->bsp_priv; in x1000_mac_set_mode() local
135 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x1000_mac_set_mode()
139 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface); in x1000_mac_set_mode()
144 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, 0); in x1000_mac_set_mode()
149 struct ingenic_mac *mac = plat_dat->bsp_priv; in x1600_mac_set_mode() local
155 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x1600_mac_set_mode()
159 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface); in x1600_mac_set_mode()
164 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in x1600_mac_set_mode()
169 struct ingenic_mac *mac = plat_dat->bsp_priv; in x1830_mac_set_mode() local
176 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x1830_mac_set_mode()
180 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface); in x1830_mac_set_mode()
185 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in x1830_mac_set_mode()
190 struct ingenic_mac *mac = plat_dat->bsp_priv; in x2000_mac_set_mode() local
198 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x2000_mac_set_mode()
207 if (mac->tx_delay == 0) in x2000_mac_set_mode()
211 FIELD_PREP(MACPHYC_TX_DELAY_MASK, (mac->tx_delay + 9750) / 19500 - 1); in x2000_mac_set_mode()
213 if (mac->rx_delay == 0) in x2000_mac_set_mode()
217 FIELD_PREP(MACPHYC_RX_DELAY_MASK, (mac->rx_delay + 9750) / 19500 - 1); in x2000_mac_set_mode()
219 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n"); in x2000_mac_set_mode()
223 dev_err(mac->dev, "Unsupported interface %d", plat_dat->mac_interface); in x2000_mac_set_mode()
228 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in x2000_mac_set_mode()
235 struct ingenic_mac *mac; in ingenic_mac_probe() local
244 plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac); in ingenic_mac_probe()
248 mac = devm_kzalloc(&pdev->dev, sizeof(*mac), GFP_KERNEL); in ingenic_mac_probe()
249 if (!mac) { in ingenic_mac_probe()
262 mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg"); in ingenic_mac_probe()
263 if (IS_ERR(mac->regmap)) { in ingenic_mac_probe()
265 ret = PTR_ERR(mac->regmap); in ingenic_mac_probe()
272 mac->tx_delay = tx_delay_ps * 1000; in ingenic_mac_probe()
283 mac->rx_delay = rx_delay_ps * 1000; in ingenic_mac_probe()
291 mac->soc_info = data; in ingenic_mac_probe()
292 mac->dev = &pdev->dev; in ingenic_mac_probe()
294 plat_dat->bsp_priv = mac; in ingenic_mac_probe()