Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1917671rda; Tue, 24 Oct 2023 07:14:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLc6rq8frMFZY7gimJIID8XG0ZmGJGjwaqvkBOg/Uj3SAUAsU8drVPEdajTk8m8eUC3JkM X-Received: by 2002:a17:90b:1d0e:b0:27d:73fd:4f75 with SMTP id on14-20020a17090b1d0e00b0027d73fd4f75mr8796504pjb.48.1698156849492; Tue, 24 Oct 2023 07:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698156849; cv=none; d=google.com; s=arc-20160816; b=LkyNx1hcFHGGUB3Lx3JSPy9nDYuRc1CnOTepjc9bATxY0Avw8AeQdXmwd7PSX2wE1M mEor/Ohy43AwzpqVJnMTq62uTK9nK8J3k0UypcdXErAJfrY0sv3hjO1rfqYs1ZhRPwAi WVUrs1ocY6jbIDaDAoT/dsfgOU91MoRCBx7wnrQE02CqD+Lkg8cLeIeto+w2XU+/vBbS 10mZZJQCFp+O5YmTK87Mkx4bNgaAxE8G1116g0KOsDXzBVUZj8wAfE2IoZ2dfg563mzv ZHXLc8fCNZK6g3mWsU6SEjFpXYjNpczyvSb5YCsgCIQoQPyC2wzfweyouiYcehryO759 j8ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LujRB2KkoptvHOhbGnAbkakhiZEXdCUqv3MjVD+tulI=; fh=WKrlE/FBCh6S0p0cjULsqYvUKe/UlnCemNlM2pknmQI=; b=RrYFQhLqJq825BVa562njFkG0Qz0waQ5d6P6NFH0nWxmeQUJ2NvSSuHpellOevpeit Isasko1NCKEyR0K92a5CNwd4Ul96L+NIbGLa7eG+z+nZUv/cw+tVIla95q/0jcEzvXDN 1WkXR+oD6Zp2LPOX+nlHXK8w1COkiKMu91zQc9ILlLPN2HZteblSf0Zy5f+o1EvjccdH 2E5OHxgalCqnvtDz63FXdl0lzqpjgIwopUWzvbTUytIzut15EkQ5KjpdrLqe7nlhazh+ Q+LP/z7kEy76qkV8mc6UNhhIFObScgOA+ACviX+lVnohgkcwAwA2ULJSANwHy5p+p1Yf G6cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=rWlyXo8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j11-20020a17090a31cb00b00274a22e6364si10678018pjf.92.2023.10.24.07.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 07:14:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=rWlyXo8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E584A80B1300; Tue, 24 Oct 2023 07:13:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343561AbjJXONi (ORCPT + 99 others); Tue, 24 Oct 2023 10:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343519AbjJXONg (ORCPT ); Tue, 24 Oct 2023 10:13:36 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C628BC4; Tue, 24 Oct 2023 07:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=LujRB2KkoptvHOhbGnAbkakhiZEXdCUqv3MjVD+tulI=; b=rWlyXo8GlvY1ir1QYjbv5qDoI6 KSCEVXw+uUUcokg0iCHGjSY9Clf9WajxbGl7qkrSbglTiEAbMdvK4VJcnzvFEYmDEqqStPFqcJ0mB M2zjpVs6/8QZSVY96GCTzEG8ywExi3XbbHofwRMPWy5VdwY1xYypKx5mO5x1CgG0jVCU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qvI9y-0004zL-Em; Tue, 24 Oct 2023 16:13:30 +0200 Date: Tue, 24 Oct 2023 16:13:30 +0200 From: Andrew Lunn To: Romain Gantois Cc: davem@davemloft.net, Rob Herring , Krzysztof Kozlowski , Jakub Kicinski , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko , Andy Gross , Bjorn Andersson , Konrad Dybcio , Maxime Chevallier Subject: Re: [PATCH net-next 4/5] net: ipqess: add a PSGMII calibration procedure to the IPQESS driver Message-ID: <4bde9110-c88d-4a22-8e67-e788db4673f3@lunn.ch> References: <20231023155013.512999-1-romain.gantois@bootlin.com> <20231023155013.512999-5-romain.gantois@bootlin.com> <9d447cb5-c8f9-06d2-0909-2870d57f0f7a@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d447cb5-c8f9-06d2-0909-2870d57f0f7a@bootlin.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 07:13:52 -0700 (PDT) > Yes, I'll add more detailed comments to the code in the v2. The calibration > procedure itself targets the PSGMII device, which is internal to the SoC and can > be logically accessed as a PHY device on the MDIO bus. This component is a > little opaque and has some nonstandard MII register definitions. > > The "testing" phase that follows the calibration accesses both the internal > QCA8K switch ports and the external QCA8075 PHY. For example, it puts both the > switch ports and the PHY ports in loopback before starting packet generation on > the external PHYs. This is done to verify that the PSGMII link works correctly > after being calibrated. > > So this code interacts with both internal ESS devices and external PHYs, but > mostly the former, which is why I kept everything in the MAC/switch driver. Accessing the external PHYs i would suggest go over the normal phylib API. Somebody might build a board using a different PHY, with different registers. If all you need is loopback, there is a phylib call for that. Directly accessing the internal ESS is fine, it cannot be changed, but if there are phylib helpers which do the same thing, consider using them. Andrew