• Home
  • Raw
  • Download

Lines Matching refs:mac

76 	struct ingenic_mac *mac = plat_dat->bsp_priv;  in ingenic_mac_init()  local
79 if (mac->soc_info->set_mode) { in ingenic_mac_init()
80 ret = mac->soc_info->set_mode(plat_dat); in ingenic_mac_init()
90 struct ingenic_mac *mac = plat_dat->bsp_priv; in jz4775_mac_set_mode() local
97 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_MII\n"); in jz4775_mac_set_mode()
103 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_GMII\n"); in jz4775_mac_set_mode()
109 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in jz4775_mac_set_mode()
118 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n"); in jz4775_mac_set_mode()
122 dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface); in jz4775_mac_set_mode()
127 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in jz4775_mac_set_mode()
132 struct ingenic_mac *mac = plat_dat->bsp_priv; in x1000_mac_set_mode() local
136 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x1000_mac_set_mode()
140 dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface); in x1000_mac_set_mode()
145 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, 0); in x1000_mac_set_mode()
150 struct ingenic_mac *mac = plat_dat->bsp_priv; in x1600_mac_set_mode() local
156 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x1600_mac_set_mode()
160 dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface); in x1600_mac_set_mode()
165 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in x1600_mac_set_mode()
170 struct ingenic_mac *mac = plat_dat->bsp_priv; in x1830_mac_set_mode() local
177 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x1830_mac_set_mode()
181 dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface); in x1830_mac_set_mode()
186 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in x1830_mac_set_mode()
191 struct ingenic_mac *mac = plat_dat->bsp_priv; in x2000_mac_set_mode() local
199 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RMII\n"); in x2000_mac_set_mode()
208 if (mac->tx_delay == 0) in x2000_mac_set_mode()
212 FIELD_PREP(MACPHYC_TX_DELAY_MASK, (mac->tx_delay + 9750) / 19500 - 1); in x2000_mac_set_mode()
214 if (mac->rx_delay == 0) in x2000_mac_set_mode()
218 FIELD_PREP(MACPHYC_RX_DELAY_MASK, (mac->rx_delay + 9750) / 19500 - 1); in x2000_mac_set_mode()
220 dev_dbg(mac->dev, "MAC PHY Control Register: PHY_INTERFACE_MODE_RGMII\n"); in x2000_mac_set_mode()
224 dev_err(mac->dev, "Unsupported interface %d", plat_dat->interface); in x2000_mac_set_mode()
229 return regmap_update_bits(mac->regmap, 0, mac->soc_info->mask, val); in x2000_mac_set_mode()
236 struct ingenic_mac *mac; in ingenic_mac_probe() local
245 plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac); in ingenic_mac_probe()
249 mac = devm_kzalloc(&pdev->dev, sizeof(*mac), GFP_KERNEL); in ingenic_mac_probe()
250 if (!mac) { in ingenic_mac_probe()
263 mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg"); in ingenic_mac_probe()
264 if (IS_ERR(mac->regmap)) { in ingenic_mac_probe()
266 ret = PTR_ERR(mac->regmap); in ingenic_mac_probe()
273 mac->tx_delay = tx_delay_ps * 1000; in ingenic_mac_probe()
284 mac->rx_delay = rx_delay_ps * 1000; in ingenic_mac_probe()
292 mac->soc_info = data; in ingenic_mac_probe()
293 mac->dev = &pdev->dev; in ingenic_mac_probe()
295 plat_dat->bsp_priv = mac; in ingenic_mac_probe()