Lines Matching +full:cpsw +full:- +full:switch

1 // SPDX-License-Identifier: GPL-2.0
2 /* Texas Instruments Ethernet Switch Driver
16 #include "cpsw.h"
47 reg = readl(priv->gmii_sel); in cpsw_gmii_sel_am3352()
49 switch (phy_mode) { in cpsw_gmii_sel_am3352()
66 dev_warn(priv->dev, in cpsw_gmii_sel_am3352()
79 if (priv->rmii_clock_external) { in cpsw_gmii_sel_am3352()
96 writel(reg, priv->gmii_sel); in cpsw_gmii_sel_am3352()
106 reg = readl(priv->gmii_sel); in cpsw_gmii_sel_dra7xx()
108 switch (phy_mode) { in cpsw_gmii_sel_dra7xx()
121 dev_warn(priv->dev, in cpsw_gmii_sel_dra7xx()
130 switch (slave) { in cpsw_gmii_sel_dra7xx()
139 dev_err(priv->dev, "invalid slave number...\n"); in cpsw_gmii_sel_dra7xx()
143 if (priv->rmii_clock_external) in cpsw_gmii_sel_dra7xx()
144 dev_err(priv->dev, "RMII External clock is not supported\n"); in cpsw_gmii_sel_dra7xx()
149 writel(reg, priv->gmii_sel); in cpsw_gmii_sel_dra7xx()
156 return dev->of_node == node && in match()
157 dev->driver == &cpsw_phy_sel_driver.driver; in match()
165 node = of_parse_phandle(dev->of_node, "cpsw-phy-sel", 0); in cpsw_phy_sel()
167 node = of_get_child_by_name(dev->of_node, "cpsw-phy-sel"); in cpsw_phy_sel()
182 priv->cpsw_phy_sel(priv, phy_mode, slave); in cpsw_phy_sel()
192 .compatible = "ti,am3352-cpsw-phy-sel",
196 .compatible = "ti,dra7xx-cpsw-phy-sel",
200 .compatible = "ti,am43xx-cpsw-phy-sel",
211 of_id = of_match_node(cpsw_phy_sel_id_table, pdev->dev.of_node); in cpsw_phy_sel_probe()
213 return -EINVAL; in cpsw_phy_sel_probe()
215 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in cpsw_phy_sel_probe()
217 dev_err(&pdev->dev, "unable to alloc memory for cpsw phy sel\n"); in cpsw_phy_sel_probe()
218 return -ENOMEM; in cpsw_phy_sel_probe()
221 priv->dev = &pdev->dev; in cpsw_phy_sel_probe()
222 priv->cpsw_phy_sel = of_id->data; in cpsw_phy_sel_probe()
224 priv->gmii_sel = devm_platform_ioremap_resource_byname(pdev, "gmii-sel"); in cpsw_phy_sel_probe()
225 if (IS_ERR(priv->gmii_sel)) in cpsw_phy_sel_probe()
226 return PTR_ERR(priv->gmii_sel); in cpsw_phy_sel_probe()
228 priv->rmii_clock_external = of_property_read_bool(pdev->dev.of_node, "rmii-clock-ext"); in cpsw_phy_sel_probe()
230 dev_set_drvdata(&pdev->dev, priv); in cpsw_phy_sel_probe()
238 .name = "cpsw-phy-sel",