Commit 243dc5fb authored by Sean Wang's avatar Sean Wang Committed by David S. Miller

net: mediatek: remove superfluous pin setup for MT7622 SoC

Remove superfluous pin setup to get out of accessing invalid I/O pin
registers because the way for pin configuring tends to be different from
various SoCs and thus it should be better being managed and controlled by
the pinctrl driver which MT7622 already can support.
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ca30e87
...@@ -1952,6 +1952,7 @@ static int mtk_hw_init(struct mtk_eth *eth) ...@@ -1952,6 +1952,7 @@ static int mtk_hw_init(struct mtk_eth *eth)
} }
regmap_write(eth->ethsys, ETHSYS_SYSCFG0, val); regmap_write(eth->ethsys, ETHSYS_SYSCFG0, val);
if (eth->pctl) {
/* Set GE2 driving and slew rate */ /* Set GE2 driving and slew rate */
regmap_write(eth->pctl, GPIO_DRV_SEL10, 0xa00); regmap_write(eth->pctl, GPIO_DRV_SEL10, 0xa00);
...@@ -1960,6 +1961,7 @@ static int mtk_hw_init(struct mtk_eth *eth) ...@@ -1960,6 +1961,7 @@ static int mtk_hw_init(struct mtk_eth *eth)
/* set GE2 TUNE */ /* set GE2 TUNE */
regmap_write(eth->pctl, GPIO_BIAS_CTRL, 0x0); regmap_write(eth->pctl, GPIO_BIAS_CTRL, 0x0);
}
/* Set linkdown as the default for each GMAC. Its own MCR would be set /* Set linkdown as the default for each GMAC. Its own MCR would be set
* up with the more appropriate value when mtk_phy_link_adjust call is * up with the more appropriate value when mtk_phy_link_adjust call is
...@@ -2538,12 +2540,14 @@ static int mtk_probe(struct platform_device *pdev) ...@@ -2538,12 +2540,14 @@ static int mtk_probe(struct platform_device *pdev)
} }
} }
if (eth->soc->required_pctl) {
eth->pctl = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, eth->pctl = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
"mediatek,pctl"); "mediatek,pctl");
if (IS_ERR(eth->pctl)) { if (IS_ERR(eth->pctl)) {
dev_err(&pdev->dev, "no pctl regmap found\n"); dev_err(&pdev->dev, "no pctl regmap found\n");
return PTR_ERR(eth->pctl); return PTR_ERR(eth->pctl);
} }
}
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
eth->irq[i] = platform_get_irq(pdev, i); eth->irq[i] = platform_get_irq(pdev, i);
...@@ -2668,17 +2672,20 @@ static int mtk_remove(struct platform_device *pdev) ...@@ -2668,17 +2672,20 @@ static int mtk_remove(struct platform_device *pdev)
static const struct mtk_soc_data mt2701_data = { static const struct mtk_soc_data mt2701_data = {
.caps = MTK_GMAC1_TRGMII, .caps = MTK_GMAC1_TRGMII,
.required_clks = MT7623_CLKS_BITMAP .required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
}; };
static const struct mtk_soc_data mt7622_data = { static const struct mtk_soc_data mt7622_data = {
.caps = MTK_DUAL_GMAC_SHARED_SGMII | MTK_GMAC1_ESW, .caps = MTK_DUAL_GMAC_SHARED_SGMII | MTK_GMAC1_ESW,
.required_clks = MT7622_CLKS_BITMAP .required_clks = MT7622_CLKS_BITMAP,
.required_pctl = false,
}; };
static const struct mtk_soc_data mt7623_data = { static const struct mtk_soc_data mt7623_data = {
.caps = MTK_GMAC1_TRGMII, .caps = MTK_GMAC1_TRGMII,
.required_clks = MT7623_CLKS_BITMAP .required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
}; };
const struct of_device_id of_mtk_match[] = { const struct of_device_id of_mtk_match[] = {
......
...@@ -573,10 +573,13 @@ struct mtk_rx_ring { ...@@ -573,10 +573,13 @@ struct mtk_rx_ring {
* @caps Flags shown the extra capability for the SoC * @caps Flags shown the extra capability for the SoC
* @required_clks Flags shown the bitmap for required clocks on * @required_clks Flags shown the bitmap for required clocks on
* the target SoC * the target SoC
* @required_pctl A bool value to show whether the SoC requires
* the extra setup for those pins used by GMAC.
*/ */
struct mtk_soc_data { struct mtk_soc_data {
u32 caps; u32 caps;
u32 required_clks; u32 required_clks;
bool required_pctl;
}; };
/* currently no SoC has more than 2 macs */ /* currently no SoC has more than 2 macs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment