Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394958 > unrolled thread

[PATCH 2/3] net-next: mediatek: add fixed-phy support

Started byJohn Crispin <john@phrozen.org>
First post2016-05-05 11:30 +0200
Last post2016-05-05 14:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] net-next: mediatek: add fixed-phy support John Crispin <john@phrozen.org> - 2016-05-05 11:30 +0200
    Re: [PATCH 2/3] net-next: mediatek: add fixed-phy support Andrew Lunn <andrew@lunn.ch> - 2016-05-05 14:10 +0200

#1394958 — [PATCH 2/3] net-next: mediatek: add fixed-phy support

FromJohn Crispin <john@phrozen.org>
Date2016-05-05 11:30 +0200
Subject[PATCH 2/3] net-next: mediatek: add fixed-phy support
Message-ID<rvnLB-5Kz-33@gated-at.bofh.it>
The MT7623 SoC has a builtin gigabit switch. If we want to use it, GMAC1
needs to be configured using a fixed link speed and flow control settings.
The easiest way to do this is to used the fixed-phy driver, allowing us to
reuse the existing mdio polling code to setup the MAC.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 093073c..d397bec 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -219,6 +219,9 @@ static int mtk_phy_connect(struct mtk_mac *mac)
 	u32 val, ge_mode;
 
 	np = of_parse_phandle(mac->of_node, "phy-handle", 0);
+	if (!np && of_phy_is_fixed_link(mac->of_node))
+		if (!of_phy_register_fixed_link(mac->of_node))
+			np = of_node_get(mac->of_node);
 	if (!np)
 		return -ENODEV;
 
-- 
1.7.10.4

[toc] | [next] | [standalone]


#1395062

FromAndrew Lunn <andrew@lunn.ch>
Date2016-05-05 14:10 +0200
Message-ID<rvqgq-89w-21@gated-at.bofh.it>
In reply to#1394958
On Thu, May 05, 2016 at 11:17:35AM +0200, John Crispin wrote:
> The MT7623 SoC has a builtin gigabit switch. If we want to use it, GMAC1
> needs to be configured using a fixed link speed and flow control settings.
> The easiest way to do this is to used the fixed-phy driver, allowing us to
> reuse the existing mdio polling code to setup the MAC.
> 
> Signed-off-by: John Crispin <john@phrozen.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Looks good.

      Andrew

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web