Lines Matching +full:tx +full:- +full:use +full:- +full:rgmii +full:- +full:clk

1 // SPDX-License-Identifier: GPL-2.0+
30 struct clk *clk_tx;
40 rate = clk_get_rate(dwmac->clk_tx); in starfive_dwmac_fix_mac_speed()
53 dev_err(dwmac->dev, "invalid speed %u\n", speed); in starfive_dwmac_fix_mac_speed()
57 err = clk_set_rate(dwmac->clk_tx, rate); in starfive_dwmac_fix_mac_speed()
59 dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate); in starfive_dwmac_fix_mac_speed()
64 struct starfive_dwmac *dwmac = plat_dat->bsp_priv; in starfive_dwmac_set_mode()
70 switch (plat_dat->mac_interface) { in starfive_dwmac_set_mode()
83 dev_err(dwmac->dev, "unsupported interface %d\n", in starfive_dwmac_set_mode()
84 plat_dat->mac_interface); in starfive_dwmac_set_mode()
85 return -EINVAL; in starfive_dwmac_set_mode()
88 regmap = syscon_regmap_lookup_by_phandle_args(dwmac->dev->of_node, in starfive_dwmac_set_mode()
92 return dev_err_probe(dwmac->dev, PTR_ERR(regmap), "getting the regmap failed\n"); in starfive_dwmac_set_mode()
99 return dev_err_probe(dwmac->dev, err, "error setting phy mode\n"); in starfive_dwmac_set_mode()
101 if (dwmac->data) { in starfive_dwmac_set_mode()
103 dwmac->data->gtxclk_dlychain); in starfive_dwmac_set_mode()
105 return dev_err_probe(dwmac->dev, err, in starfive_dwmac_set_mode()
117 struct clk *clk_gtx; in starfive_dwmac_probe()
122 return dev_err_probe(&pdev->dev, err, in starfive_dwmac_probe()
127 return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat), in starfive_dwmac_probe()
130 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); in starfive_dwmac_probe()
132 return -ENOMEM; in starfive_dwmac_probe()
134 dwmac->data = device_get_match_data(&pdev->dev); in starfive_dwmac_probe()
136 dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx"); in starfive_dwmac_probe()
137 if (IS_ERR(dwmac->clk_tx)) in starfive_dwmac_probe()
138 return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx), in starfive_dwmac_probe()
139 "error getting tx clock\n"); in starfive_dwmac_probe()
141 clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx"); in starfive_dwmac_probe()
143 return dev_err_probe(&pdev->dev, PTR_ERR(clk_gtx), in starfive_dwmac_probe()
152 if (!device_property_read_bool(&pdev->dev, "starfive,tx-use-rgmii-clk")) in starfive_dwmac_probe()
153 plat_dat->fix_mac_speed = starfive_dwmac_fix_mac_speed; in starfive_dwmac_probe()
155 dwmac->dev = &pdev->dev; in starfive_dwmac_probe()
156 plat_dat->bsp_priv = dwmac; in starfive_dwmac_probe()
157 plat_dat->dma_cfg->dche = true; in starfive_dwmac_probe()
163 return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); in starfive_dwmac_probe()
171 { .compatible = "starfive,jh7100-dwmac", .data = &jh7100_data },
172 { .compatible = "starfive,jh7110-dwmac" },
181 .name = "starfive-dwmac",