Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp270229qtg; Fri, 31 Mar 2023 01:01:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bjobEeKW266Ym6w/Lt94oPPuwPpYJ6csoKlRVuZ1vt+4VQJdQhrbz0eQXJ2G875YcutPzc X-Received: by 2002:a17:903:41c6:b0:1a2:1a52:14b5 with SMTP id u6-20020a17090341c600b001a21a5214b5mr5297787ple.3.1680249706724; Fri, 31 Mar 2023 01:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680249706; cv=none; d=google.com; s=arc-20160816; b=A3ots9eGOg+ooTWhp8BrzTxtSFrywhsr68sFDc245tQZcQl7nCzLqtQVM/dok1TOLB MGScKJHpV4rZXAccmtsqo8FIHMeJXbv3oLuedhLVTc+SW0BuOMSsaWbJwQW8yG8JB4nr AK8lvtscxifdScnrxLbDX053JGwz0Q2jWkFqmaxrCn3aB/KOQKkOmIWkACpZpRhPik4j xL0/blPUpUmHejbeX1OqhUc5rEE7UZuyoIc7RLhwqldOx28xgi9tEoSJo/g9YblUv4Q1 y64Z5scUUJdDiy2OxiH4H10Aq1X5wLaeFKX+ugAD1XJnKVJsQqMUN+PYX4nTOkV3YO+Q QtJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9HMl4MEjvqaPIdUJu0K+33CaechDV7nVjN2BnBU1dnU=; b=grQh9c2Yot5OWj9hUPotSxGLV1GIECp7p6nyAZF/Qkm1hviiEJ0FhE5rxZbd3ma9om 1lFegjiWIMJksbUsDVgY2V9vRs8gjNAmYWBkYRqJtKwshtRUNdte2w+059wnCFL0+/kW fEDeiYG3/4EuTAwRpfbZV3YVrGfCRBofuzteYFZgATJWWW8o1t23ogm4qwhWl+1N8aUX uSAPkv+/dxqr/9IUzXC/KRnG1jGj0KEcSV3DVolISdnad7CnULkFB+PsvJWUjXhwGQyh gUo6ATyyyyjhvnVXzXc3/5eyYo/zA/zdJWUoKYax8OvYaMFJQGPurlljFmwcY0idcydE 7G6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=wE1BrfRB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf4-20020a170902b90400b001a05bb13953si1560517plb.422.2023.03.31.01.01.15; Fri, 31 Mar 2023 01:01:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=wE1BrfRB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230412AbjCaH5b (ORCPT + 99 others); Fri, 31 Mar 2023 03:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbjCaH5a (ORCPT ); Fri, 31 Mar 2023 03:57:30 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D828E; Fri, 31 Mar 2023 00:57:27 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230331065110.604516-3-s-vadapalli@ti.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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!