]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: macb: add support for SGMII phy interface
authorRamon Fried <rfried.dev@gmail.com>
Tue, 16 Jul 2019 19:04:34 +0000 (22:04 +0300)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 25 Jul 2019 18:13:30 +0000 (13:13 -0500)
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>
drivers/net/macb.c

index a968a4bd0638484e7b5d9f2311599ab00b0a704a..cf76270ad82a0e22ea7fd8828b7137139c3765ef 100644 (file)
@@ -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));