Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750954AbdHRJ6g (ORCPT ); Fri, 18 Aug 2017 05:58:36 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34369 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbdHRJ6e (ORCPT ); Fri, 18 Aug 2017 05:58:34 -0400 Subject: Re: [PATCH] net: stmmac: socfgpa: Ensure emac bit set in sys manager for MII/GMII/SGMII. To: Stephan Gatzka , peppe.cavallaro@st.com, alexandre.torgue@st.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1503039314-575-1-git-send-email-stephan.gatzka@gmail.com> From: Sergei Shtylyov Message-ID: <55cc4f69-95a4-65e9-234d-880bfcf1fed0@cogentembedded.com> Date: Fri, 18 Aug 2017 12:58:30 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1503039314-575-1-git-send-email-stephan.gatzka@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1215 Lines: 33 Hello! On 8/18/2017 9:55 AM, Stephan Gatzka wrote: > When using MII/GMII/SGMII in the Altera SoC, the phy needs to be > wired through the FPGA. To ensure correct behavior, the appropriate > bit in the System Manager FPGA Interface Group register needs to be > set. > > Signed-off-by: Stephan Gatzka > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c > index 17d4bba..d7c231b 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c > @@ -269,7 +269,10 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) > ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift); > ctrl |= val << reg_shift; > > - if (dwmac->f2h_ptp_ref_clk) { > + if ((dwmac->f2h_ptp_ref_clk) || > + (phymode == PHY_INTERFACE_MODE_MII) || > + (phymode == PHY_INTERFACE_MODE_GMII) || > + (phymode == PHY_INTERFACE_MODE_SGMII)) { Inner parens not needed at all (especially the first pair). [...] MBR, Sergei