Lines Matching +full:rmii +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
44 u32 mode = 0; in cpsw_gmii_sel_am3352() local
47 reg = readl(priv->gmii_sel); in cpsw_gmii_sel_am3352()
51 mode = AM33XX_GMII_SEL_MODE_RMII; in cpsw_gmii_sel_am3352()
55 mode = AM33XX_GMII_SEL_MODE_RGMII; in cpsw_gmii_sel_am3352()
61 mode = AM33XX_GMII_SEL_MODE_RGMII; in cpsw_gmii_sel_am3352()
66 dev_warn(priv->dev, in cpsw_gmii_sel_am3352()
67 "Unsupported PHY mode: \"%s\". Defaulting to MII.\n", in cpsw_gmii_sel_am3352()
71 mode = AM33XX_GMII_SEL_MODE_MII; in cpsw_gmii_sel_am3352()
77 mode <<= slave * 2; in cpsw_gmii_sel_am3352()
79 if (priv->rmii_clock_external) { in cpsw_gmii_sel_am3352()
81 mode |= AM33XX_GMII_SEL_RMII1_IO_CLK_EN; in cpsw_gmii_sel_am3352()
83 mode |= AM33XX_GMII_SEL_RMII2_IO_CLK_EN; in cpsw_gmii_sel_am3352()
88 mode |= AM33XX_GMII_SEL_RGMII1_IDMODE; in cpsw_gmii_sel_am3352()
90 mode |= AM33XX_GMII_SEL_RGMII2_IDMODE; in cpsw_gmii_sel_am3352()
94 reg |= mode; in cpsw_gmii_sel_am3352()
96 writel(reg, priv->gmii_sel); in cpsw_gmii_sel_am3352()
104 u32 mode = 0; in cpsw_gmii_sel_dra7xx() local
106 reg = readl(priv->gmii_sel); in cpsw_gmii_sel_dra7xx()
110 mode = AM33XX_GMII_SEL_MODE_RMII; in cpsw_gmii_sel_dra7xx()
117 mode = AM33XX_GMII_SEL_MODE_RGMII; in cpsw_gmii_sel_dra7xx()
121 dev_warn(priv->dev, in cpsw_gmii_sel_dra7xx()
122 "Unsupported PHY mode: \"%s\". Defaulting to MII.\n", in cpsw_gmii_sel_dra7xx()
126 mode = AM33XX_GMII_SEL_MODE_MII; in cpsw_gmii_sel_dra7xx()
136 mode <<= 4; 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()
147 reg |= mode; 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()
169 dev_err(dev, "Phy mode driver DT not found\n"); 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",