[U-Boot,v2,4/6] net: macb: add support for SGMII phy interface
diff mbox series

Message ID 20190716190436.21251-4-rfried.dev@gmail.com
State Accepted
Commit 5a1899f9fc
Delegated to: Joe Hershberger
Headers show
Series
  • Untitled series #119842
Related show

Commit Message

Ramon Fried July 16, 2019, 7:04 p.m. UTC
This patch adds support for the sgmii phy interface,
available only to DM users, dictated by current driver
design.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
v2: nothing.
 drivers/net/macb.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Joe Hershberger July 25, 2019, 6:42 p.m. UTC | #1
Hi Ramon,

https://patchwork.ozlabs.org/patch/1132906/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

Patch
diff mbox series

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index a968a4bd06..cf76270ad8 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -759,6 +759,13 @@  static int _macb_init(struct macb_device *macb, const char *name)
 			gem_writel(macb, USRIO, GEM_BIT(RGMII));
 		else
 			gem_writel(macb, USRIO, 0);
+
+		if (macb->phy_interface == PHY_INTERFACE_MODE_SGMII) {
+			unsigned int ncfgr = macb_readl(macb, NCFGR);
+
+			ncfgr |= GEM_BIT(SGMIIEN) | GEM_BIT(PCSSEL);
+			macb_writel(macb, NCFGR, ncfgr);
+		}
 #else
 #if defined(CONFIG_RGMII) || defined(CONFIG_RMII)
 		gem_writel(macb, USRIO, GEM_BIT(RGMII));