Lines Matching +full:cpsw +full:- +full:switch
1 // SPDX-License-Identifier: GPL-2.0
2 /* Texas Instruments Ethernet Switch Driver
17 #include "cpsw.h"
48 reg = readl(priv->gmii_sel); in cpsw_gmii_sel_am3352()
50 switch (phy_mode) { in cpsw_gmii_sel_am3352()
67 dev_warn(priv->dev, in cpsw_gmii_sel_am3352()
80 if (priv->rmii_clock_external) { in cpsw_gmii_sel_am3352()
97 writel(reg, priv->gmii_sel); in cpsw_gmii_sel_am3352()
107 reg = readl(priv->gmii_sel); in cpsw_gmii_sel_dra7xx()
109 switch (phy_mode) { in cpsw_gmii_sel_dra7xx()
122 dev_warn(priv->dev, in cpsw_gmii_sel_dra7xx()
131 switch (slave) { in cpsw_gmii_sel_dra7xx()
140 dev_err(priv->dev, "invalid slave number...\n"); in cpsw_gmii_sel_dra7xx()
144 if (priv->rmii_clock_external) in cpsw_gmii_sel_dra7xx()
145 dev_err(priv->dev, "RMII External clock is not supported\n"); in cpsw_gmii_sel_dra7xx()
150 writel(reg, priv->gmii_sel); in cpsw_gmii_sel_dra7xx()
157 return dev->of_node == node && in match()
158 dev->driver == &cpsw_phy_sel_driver.driver; in match()
166 node = of_parse_phandle(dev->of_node, "cpsw-phy-sel", 0); in cpsw_phy_sel()
168 node = of_get_child_by_name(dev->of_node, "cpsw-phy-sel"); in cpsw_phy_sel()
183 priv->cpsw_phy_sel(priv, phy_mode, slave); in cpsw_phy_sel()
193 .compatible = "ti,am3352-cpsw-phy-sel",
197 .compatible = "ti,dra7xx-cpsw-phy-sel",
201 .compatible = "ti,am43xx-cpsw-phy-sel",
213 of_id = of_match_node(cpsw_phy_sel_id_table, pdev->dev.of_node); in cpsw_phy_sel_probe()
215 return -EINVAL; in cpsw_phy_sel_probe()
217 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in cpsw_phy_sel_probe()
219 dev_err(&pdev->dev, "unable to alloc memory for cpsw phy sel\n"); in cpsw_phy_sel_probe()
220 return -ENOMEM; in cpsw_phy_sel_probe()
223 priv->dev = &pdev->dev; in cpsw_phy_sel_probe()
224 priv->cpsw_phy_sel = of_id->data; in cpsw_phy_sel_probe()
226 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gmii-sel"); in cpsw_phy_sel_probe()
227 priv->gmii_sel = devm_ioremap_resource(&pdev->dev, res); in cpsw_phy_sel_probe()
228 if (IS_ERR(priv->gmii_sel)) in cpsw_phy_sel_probe()
229 return PTR_ERR(priv->gmii_sel); in cpsw_phy_sel_probe()
231 if (of_find_property(pdev->dev.of_node, "rmii-clock-ext", NULL)) in cpsw_phy_sel_probe()
232 priv->rmii_clock_external = true; in cpsw_phy_sel_probe()
234 dev_set_drvdata(&pdev->dev, priv); in cpsw_phy_sel_probe()
242 .name = "cpsw-phy-sel",