Lines Matching +full:dwmac +full:- +full:4

1 // SPDX-License-Identifier: GPL-2.0+
3 * StarFive DWMAC platform driver
35 struct starfive_dwmac *dwmac = plat_dat->bsp_priv; in starfive_dwmac_set_mode() local
41 switch (plat_dat->mac_interface) { in starfive_dwmac_set_mode()
54 dev_err(dwmac->dev, "unsupported interface %d\n", in starfive_dwmac_set_mode()
55 plat_dat->mac_interface); in starfive_dwmac_set_mode()
56 return -EINVAL; in starfive_dwmac_set_mode()
59 regmap = syscon_regmap_lookup_by_phandle_args(dwmac->dev->of_node, in starfive_dwmac_set_mode()
63 return dev_err_probe(dwmac->dev, PTR_ERR(regmap), "getting the regmap failed\n"); in starfive_dwmac_set_mode()
70 return dev_err_probe(dwmac->dev, err, "error setting phy mode\n"); in starfive_dwmac_set_mode()
72 if (dwmac->data) { in starfive_dwmac_set_mode()
74 dwmac->data->gtxclk_dlychain); in starfive_dwmac_set_mode()
76 return dev_err_probe(dwmac->dev, err, in starfive_dwmac_set_mode()
87 struct starfive_dwmac *dwmac; in starfive_dwmac_probe() local
93 return dev_err_probe(&pdev->dev, err, in starfive_dwmac_probe()
98 return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat), in starfive_dwmac_probe()
101 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); in starfive_dwmac_probe()
102 if (!dwmac) in starfive_dwmac_probe()
103 return -ENOMEM; in starfive_dwmac_probe()
105 dwmac->data = device_get_match_data(&pdev->dev); in starfive_dwmac_probe()
107 plat_dat->clk_tx_i = devm_clk_get_enabled(&pdev->dev, "tx"); in starfive_dwmac_probe()
108 if (IS_ERR(plat_dat->clk_tx_i)) in starfive_dwmac_probe()
109 return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat->clk_tx_i), in starfive_dwmac_probe()
112 clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx"); in starfive_dwmac_probe()
114 return dev_err_probe(&pdev->dev, PTR_ERR(clk_gtx), in starfive_dwmac_probe()
123 if (!device_property_read_bool(&pdev->dev, "starfive,tx-use-rgmii-clk")) in starfive_dwmac_probe()
124 plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate; in starfive_dwmac_probe()
126 dwmac->dev = &pdev->dev; in starfive_dwmac_probe()
127 plat_dat->flags |= STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP; in starfive_dwmac_probe()
128 plat_dat->bsp_priv = dwmac; in starfive_dwmac_probe()
129 plat_dat->dma_cfg->dche = true; in starfive_dwmac_probe()
135 return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); in starfive_dwmac_probe()
139 .gtxclk_dlychain = 4,
143 { .compatible = "starfive,jh7100-dwmac", .data = &jh7100_data },
144 { .compatible = "starfive,jh7110-dwmac" },
153 .name = "starfive-dwmac",
161 MODULE_DESCRIPTION("StarFive DWMAC platform driver");