linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/2] net: ftgmac100: support fixed link
@ 2022-09-07  5:44 rentao.bupt
  2022-09-07  5:44 ` [PATCH net-next v3 1/2] " rentao.bupt
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: rentao.bupt @ 2022-09-07  5:44 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Heyi Guo, Dylan Hung, Guangbin Huang, Liang He,
	Hao Chen, Rob Herring, Krzysztof Kozlowski, Joel Stanley,
	Andrew Jeffery, Tao Ren, netdev, devicetree, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Tao Ren

From: Tao Ren <rentao.bupt@gmail.com>

The patch series adds fixed link support to ftgmac100 driver.

Patch #1 adds fixed link logic into ftgmac100 driver.

Patch #2 enables mac3 controller in Elbert dts: Elbert mac3 is connected
to the onboard switch BCM53134P's IMP_RGMII port directly (no PHY
between BMC MAC and BCM53134P).

Tao Ren (2):
  net: ftgmac100: support fixed link
  ARM: dts: aspeed: elbert: Enable mac3 controller

 .../boot/dts/aspeed-bmc-facebook-elbert.dts   | 18 ++++++++++++++
 drivers/net/ethernet/faraday/ftgmac100.c      | 24 +++++++++++++++++++
 2 files changed, 42 insertions(+)

-- 
2.37.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next v3 1/2] net: ftgmac100: support fixed link
  2022-09-07  5:44 [PATCH net-next v3 0/2] net: ftgmac100: support fixed link rentao.bupt
@ 2022-09-07  5:44 ` rentao.bupt
  2022-09-07 18:43   ` Florian Fainelli
  2022-09-07  5:44 ` [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller rentao.bupt
  2022-09-15 11:00 ` [PATCH net-next v3 0/2] net: ftgmac100: support fixed link patchwork-bot+netdevbpf
  2 siblings, 1 reply; 7+ messages in thread
From: rentao.bupt @ 2022-09-07  5:44 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Heyi Guo, Dylan Hung, Guangbin Huang, Liang He,
	Hao Chen, Rob Herring, Krzysztof Kozlowski, Joel Stanley,
	Andrew Jeffery, Tao Ren, netdev, devicetree, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Tao Ren

From: Tao Ren <rentao.bupt@gmail.com>

Support fixed link in ftgmac100 driver. Fixed link is used on several
Meta OpenBMC platforms, such as Elbert (AST2620) and Wedge400 (AST2520).

Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 Changes in v3: None
 Changes in v2: None

 drivers/net/ethernet/faraday/ftgmac100.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 9277d5fb5052..da04beee5865 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1701,10 +1701,14 @@ static int ftgmac100_setup_mdio(struct net_device *netdev)
 
 static void ftgmac100_phy_disconnect(struct net_device *netdev)
 {
+	struct ftgmac100 *priv = netdev_priv(netdev);
+
 	if (!netdev->phydev)
 		return;
 
 	phy_disconnect(netdev->phydev);
+	if (of_phy_is_fixed_link(priv->dev->of_node))
+		of_phy_deregister_fixed_link(priv->dev->of_node);
 }
 
 static void ftgmac100_destroy_mdio(struct net_device *netdev)
@@ -1867,6 +1871,26 @@ static int ftgmac100_probe(struct platform_device *pdev)
 			err = -EINVAL;
 			goto err_phy_connect;
 		}
+	} else if (np && of_phy_is_fixed_link(np)) {
+		struct phy_device *phy;
+
+		err = of_phy_register_fixed_link(np);
+		if (err) {
+			dev_err(&pdev->dev, "Failed to register fixed PHY\n");
+			goto err_phy_connect;
+		}
+
+		phy = of_phy_get_and_connect(priv->netdev, np,
+					     &ftgmac100_adjust_link);
+		if (!phy) {
+			dev_err(&pdev->dev, "Failed to connect to fixed PHY\n");
+			of_phy_deregister_fixed_link(np);
+			err = -EINVAL;
+			goto err_phy_connect;
+		}
+
+		/* Display what we found */
+		phy_attached_info(phy);
 	} else if (np && of_get_property(np, "phy-handle", NULL)) {
 		struct phy_device *phy;
 
-- 
2.37.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller
  2022-09-07  5:44 [PATCH net-next v3 0/2] net: ftgmac100: support fixed link rentao.bupt
  2022-09-07  5:44 ` [PATCH net-next v3 1/2] " rentao.bupt
@ 2022-09-07  5:44 ` rentao.bupt
  2022-09-07 18:31   ` Andrew Lunn
  2022-09-07 18:44   ` Florian Fainelli
  2022-09-15 11:00 ` [PATCH net-next v3 0/2] net: ftgmac100: support fixed link patchwork-bot+netdevbpf
  2 siblings, 2 replies; 7+ messages in thread
From: rentao.bupt @ 2022-09-07  5:44 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Heyi Guo, Dylan Hung, Guangbin Huang, Liang He,
	Hao Chen, Rob Herring, Krzysztof Kozlowski, Joel Stanley,
	Andrew Jeffery, Tao Ren, netdev, devicetree, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Tao Ren

From: Tao Ren <rentao.bupt@gmail.com>

Enable mac3 controller in Elbert dts: Elbert MAC3 is connected to the
BCM53134P onboard switch's IMP_RGMII port directly (fixed link, no PHY
between BMC MAC and BCM53134P).

Note: BMC's mdio0 controller is connected to BCM53134P's MDIO interface,
and the MDIO channel will be enabled later, when BCM53134 is added to
"bcm53xx" DSA driver.

Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
---
 Changes in v3:
  - updated comments and patch description.
 Changes in v2:
  - updated comments and patch description.
 .../boot/dts/aspeed-bmc-facebook-elbert.dts    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts
index 27b43fe099f1..8e1a1d1b282d 100644
--- a/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts
@@ -183,3 +183,21 @@ imux31: i2c@7 {
 &i2c11 {
 	status = "okay";
 };
+
+/*
+ * BMC's "mac3" controller is connected to BCM53134P's IMP_RGMII port
+ * directly (fixed link, no PHY in between).
+ * Note: BMC's "mdio0" controller is connected to BCM53134P's MDIO
+ * interface, and the MDIO channel will be enabled in dts later, when
+ * BCM53134 is added to "bcm53xx" DSA driver.
+ */
+&mac3 {
+	status = "okay";
+	phy-mode = "rgmii";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_rgmii4_default>;
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+};
-- 
2.37.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller
  2022-09-07  5:44 ` [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller rentao.bupt
@ 2022-09-07 18:31   ` Andrew Lunn
  2022-09-07 18:44   ` Florian Fainelli
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2022-09-07 18:31 UTC (permalink / raw)
  To: rentao.bupt
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Heyi Guo, Dylan Hung, Guangbin Huang, Liang He, Hao Chen,
	Rob Herring, Krzysztof Kozlowski, Joel Stanley, Andrew Jeffery,
	Tao Ren, netdev, devicetree, linux-arm-kernel, linux-aspeed,
	linux-kernel

On Tue, Sep 06, 2022 at 10:44:53PM -0700, rentao.bupt@gmail.com wrote:
> From: Tao Ren <rentao.bupt@gmail.com>
> 
> Enable mac3 controller in Elbert dts: Elbert MAC3 is connected to the
> BCM53134P onboard switch's IMP_RGMII port directly (fixed link, no PHY
> between BMC MAC and BCM53134P).
> 
> Note: BMC's mdio0 controller is connected to BCM53134P's MDIO interface,
> and the MDIO channel will be enabled later, when BCM53134 is added to
> "bcm53xx" DSA driver.
> 
> Signed-off-by: Tao Ren <rentao.bupt@gmail.com>

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

    Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v3 1/2] net: ftgmac100: support fixed link
  2022-09-07  5:44 ` [PATCH net-next v3 1/2] " rentao.bupt
@ 2022-09-07 18:43   ` Florian Fainelli
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2022-09-07 18:43 UTC (permalink / raw)
  To: rentao.bupt, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Heyi Guo, Dylan Hung,
	Guangbin Huang, Liang He, Hao Chen, Rob Herring,
	Krzysztof Kozlowski, Joel Stanley, Andrew Jeffery, Tao Ren,
	netdev, devicetree, linux-arm-kernel, linux-aspeed, linux-kernel



On 9/6/2022 10:44 PM, rentao.bupt@gmail.com wrote:
> From: Tao Ren <rentao.bupt@gmail.com>
> 
> Support fixed link in ftgmac100 driver. Fixed link is used on several
> Meta OpenBMC platforms, such as Elbert (AST2620) and Wedge400 (AST2520).
> 
> Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller
  2022-09-07  5:44 ` [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller rentao.bupt
  2022-09-07 18:31   ` Andrew Lunn
@ 2022-09-07 18:44   ` Florian Fainelli
  1 sibling, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2022-09-07 18:44 UTC (permalink / raw)
  To: rentao.bupt, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Heyi Guo, Dylan Hung,
	Guangbin Huang, Liang He, Hao Chen, Rob Herring,
	Krzysztof Kozlowski, Joel Stanley, Andrew Jeffery, Tao Ren,
	netdev, devicetree, linux-arm-kernel, linux-aspeed, linux-kernel



On 9/6/2022 10:44 PM, rentao.bupt@gmail.com wrote:
> From: Tao Ren <rentao.bupt@gmail.com>
> 
> Enable mac3 controller in Elbert dts: Elbert MAC3 is connected to the
> BCM53134P onboard switch's IMP_RGMII port directly (fixed link, no PHY
> between BMC MAC and BCM53134P).
> 
> Note: BMC's mdio0 controller is connected to BCM53134P's MDIO interface,
> and the MDIO channel will be enabled later, when BCM53134 is added to
> "bcm53xx" DSA driver.
> 
> Signed-off-by: Tao Ren <rentao.bupt@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v3 0/2] net: ftgmac100: support fixed link
  2022-09-07  5:44 [PATCH net-next v3 0/2] net: ftgmac100: support fixed link rentao.bupt
  2022-09-07  5:44 ` [PATCH net-next v3 1/2] " rentao.bupt
  2022-09-07  5:44 ` [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller rentao.bupt
@ 2022-09-15 11:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-15 11:00 UTC (permalink / raw)
  To: Tao Ren
  Cc: andrew, davem, edumazet, kuba, pabeni, guoheyi, dylan_hung,
	huangguangbin2, windhl, chenhao288, robh+dt,
	krzysztof.kozlowski+dt, joel, andrew, taoren, netdev, devicetree,
	linux-arm-kernel, linux-aspeed, linux-kernel

Hello:

This series was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  6 Sep 2022 22:44:51 -0700 you wrote:
> From: Tao Ren <rentao.bupt@gmail.com>
> 
> The patch series adds fixed link support to ftgmac100 driver.
> 
> Patch #1 adds fixed link logic into ftgmac100 driver.
> 
> Patch #2 enables mac3 controller in Elbert dts: Elbert mac3 is connected
> to the onboard switch BCM53134P's IMP_RGMII port directly (no PHY
> between BMC MAC and BCM53134P).
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/2] net: ftgmac100: support fixed link
    https://git.kernel.org/netdev/net-next/c/38561ded50d0
  - [net-next,v3,2/2] ARM: dts: aspeed: elbert: Enable mac3 controller
    https://git.kernel.org/netdev/net-next/c/ce6ce9176975

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-15 11:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07  5:44 [PATCH net-next v3 0/2] net: ftgmac100: support fixed link rentao.bupt
2022-09-07  5:44 ` [PATCH net-next v3 1/2] " rentao.bupt
2022-09-07 18:43   ` Florian Fainelli
2022-09-07  5:44 ` [PATCH net-next v3 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller rentao.bupt
2022-09-07 18:31   ` Andrew Lunn
2022-09-07 18:44   ` Florian Fainelli
2022-09-15 11:00 ` [PATCH net-next v3 0/2] net: ftgmac100: support fixed link patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).