From 5a1899f9fcf46cc61f095408b17952d29e76cde5 Mon Sep 17 00:00:00 2001 From: Ramon Fried Date: Tue, 16 Jul 2019 22:04:34 +0300 Subject: [PATCH] net: macb: add support for SGMII phy interface This patch adds support for the sgmii phy interface, available only to DM users, dictated by current driver design. Signed-off-by: Ramon Fried Reviewed-by: Anup Patel Tested-by: Anup Patel Acked-by: Joe Hershberger --- drivers/net/macb.c | 7 +++++++ 1 file changed, 7 insertions(+) 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)); -- 2.25.1