From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E19F9C76196 for ; Fri, 31 Mar 2023 07:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W3HIsRYLdrz0VbpMgVPeK4UdorFcwMdv83s1r98mdbQ=; b=KFwdyEAflUY3O0 6h0p13Eoalmkl/QIDIN1c/pSMLGNM9Uv0vGvYHVLWYUW5I+qQME8/0yuFroPqr7iL8d/OeEFKYtM4 hOg8coVotLRf9ecy4SyTHVCNVccFv29JOSHxmTvx3WdXqDonMu9GgAdWP2ovM+P4Fw9XxjbzCTrMo j6aHCkuvA25DaWpzgVXNJO2M8ABakLxsWJIGV9sscIFwSZzktQAM76kgjtAK2tEFcPu+B+LH3beG9 ERPnyHF0ZFhgVxMX42GEy3TYXYw6H+1KP85cqBeiFHePMajhiLdBoMd4OZl2KAad4mBajoBsuokUn 2thBkzSAKlsSy9EI9VDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pi9de-006Fpu-1q; Fri, 31 Mar 2023 07:57:34 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pi9db-006Fo2-2D for linux-arm-kernel@lists.infradead.org; Fri, 31 Mar 2023 07:57:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9HMl4MEjvqaPIdUJu0K+33CaechDV7nVjN2BnBU1dnU=; b=wE1BrfRBF1zeaAPoKMHirLuiyJ E+TekPHfXivAuvDLYPjtrAw64TXnAhX6e6IrmMaswJEATHOHJ2uzarVfgm2uYheTlTWoTo2RZ+V6n 45Fc3WXmumiW0Lm0vvM//tKKRRPXq68aCv5dlpcuPQaYryHnBUg+jyxZ1lRtcp023SAU2kq8fTpNp zJ6zRt1w++N1EOGAreDAbd4mnTIQD/V9QlbZC5Z2iay26Bs8Uv9hse3bL05UXwVBbavkyvYmz8TuK W94Vbjd6S5H3cBIs8wioJxXx3U99GaWC1wuD1lo29BT7Nio1ivU2eIWESuI1eRX79X0bfM4V+o1n2 b2yp822Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56232) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pi9dP-0004E8-3a; Fri, 31 Mar 2023 08:57:19 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pi9dN-0000yO-9o; Fri, 31 Mar 2023 08:57:17 +0100 Date: Fri, 31 Mar 2023 08:57:17 +0100 From: "Russell King (Oracle)" To: Siddharth Vadapalli Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, rogerq@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, srk@ti.com Subject: Re: [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw: Enable USXGMII mode for J784S4 CPSW9G Message-ID: References: <20230331065110.604516-1-s-vadapalli@ti.com> <20230331065110.604516-3-s-vadapalli@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230331065110.604516-3-s-vadapalli@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_005731_727198_AAECE04C X-CRM114-Status: GOOD ( 17.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 31, 2023 at 12:21:10PM +0530, Siddharth Vadapalli wrote: > TI's J784S4 SoC supports USXGMII mode. Add USXGMII mode to the > extra_modes member of the J784S4 SoC data. Additionally, configure the > MAC Control register for supporting USXGMII mode. Also, for USXGMII > mode, include MAC_5000FD in the "mac_capabilities" member of struct > "phylink_config". I don't think TI "get" phylink at all... > diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c > index 4b4d06199b45..ab33e6fe5b1a 100644 > --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c > +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c > @@ -1555,6 +1555,8 @@ static void am65_cpsw_nuss_mac_link_up(struct phylink_config *config, struct phy > mac_control |= CPSW_SL_CTL_GIG; > if (interface == PHY_INTERFACE_MODE_SGMII) > mac_control |= CPSW_SL_CTL_EXT_EN; > + if (interface == PHY_INTERFACE_MODE_USXGMII) > + mac_control |= CPSW_SL_CTL_XGIG | CPSW_SL_CTL_XGMII_EN; The configuration of the interface mode should *not* happen in mac_link_up(), but should happen in e.g. mac_config(). > if (speed == SPEED_10 && phy_interface_mode_is_rgmii(interface)) > /* Can be used with in band mode only */ > mac_control |= CPSW_SL_CTL_EXT_EN; > @@ -2175,6 +2177,7 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx) > > case PHY_INTERFACE_MODE_QSGMII: > case PHY_INTERFACE_MODE_SGMII: > + case PHY_INTERFACE_MODE_USXGMII: > if (common->pdata.extra_modes & BIT(port->slave.phy_if)) { > __set_bit(port->slave.phy_if, > port->slave.phylink_config.supported_interfaces); > @@ -2182,6 +2185,9 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx) > dev_err(dev, "selected phy-mode is not supported\n"); > return -EOPNOTSUPP; > } > + /* For USXGMII mode, enable MAC_5000FD */ > + if (port->slave.phy_if == PHY_INTERFACE_MODE_USXGMII) > + port->slave.phylink_config.mac_capabilities |= MAC_5000FD; MAC capabilities should not be conditional in the interface mode. Phylink already knows the capabilities of each interface mode, and will mask the mac_capabilities accordingly. Phylink wants to know what speeds the MAC itself is capable of unbound by the interface mode. The interface modes that you already support (RGMII, RMII, QSGMII and SGMII) do not support anything faster than 1G, so only mac_capabilities up to and including 1G speeds will be permitted for those interface modes internally by phylink. So, making this conditional on USXGMII is just repeating logic that is already present internally in phylink. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel