Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1752867rda; Tue, 24 Oct 2023 02:03:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkxKQnONrpT1yoNIiuPtx+oRFEceY+9R+eLIqiFtpxVyuRR8qKS2QN5uGnP282/3c1Vgbk X-Received: by 2002:a05:6602:1481:b0:787:34d:f1ea with SMTP id a1-20020a056602148100b00787034df1eamr18723696iow.8.1698138188535; Tue, 24 Oct 2023 02:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698138188; cv=none; d=google.com; s=arc-20160816; b=ap6j80mEt5Co+LU0bqznD7a5w5bf6fdFYCqDHcmeHk7FaF+LQA+e5AvUPZGZCRUXNn unJonNs+j3n9PzBieAsXofl1K8u8rfwWCXa/D3VPz5nxbLmmoz8Nuj9W9nUXR0cut5zr OBSzcTr/B7yQnoQ9uwFCYXtjaGCnc6YK2Fj+3PLsM/hJGmnSKKqgzmKS/ortjy41gReQ VfiMulRILsCrlvoqi6NWpB95u21Uk75ngj9m5F1VNguPsRCN1kIwAQjf5CdMfnOwDOIp qqIhemuHYGKfLy7U+d1aaaD9sfa0fxUI3H24ipgPuWZnlzDYYzWdSmHwp+VtdWG/8L8U DsmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=moXvoXVL8BeanjUNuJ9YxDMbdmP0XoJ1UTP44gG4/CA=; fh=aaZnsuOZEKavFpWUX9RCNRYpW0PXKCCHL/zpU8nvab8=; b=u3aw2aQMh1Tc+6ADPqKma8JTKcF8MFZ7e3P8wy0IEmfTv8w0JKIqMxH1ltnu/WNJhI Mf33x9BbAsSXtlXtM83QMUPcNaN41zIipuAAFyOh1wugivqSUK6ijH46rLU5mInqssgc kmoOXXkNARZLyEisQ+ijEI0SH6Vvymej3VsMsa8JTyMOkOuk7ZhQcuXH4LMy4//yDtQD AjDdnBqaD39fyxt3SOU2gDxDKyEszRjxInVnbPYD3/aD2XDKTgfGTlanyi5yIAG0ASVc jSf1qo5zAmXxZz8ifI5o93+fwDZQ0ZPvq/livA2GpeEeiBpZdKzrk/PG0mP++2CV5dHT MWFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QWj0mk9S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s17-20020a656911000000b005ac0759396asi8025005pgq.634.2023.10.24.02.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 02:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QWj0mk9S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CBF6380ACFC2; Tue, 24 Oct 2023 02:03:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbjJXJC7 (ORCPT + 99 others); Tue, 24 Oct 2023 05:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232865AbjJXJC5 (ORCPT ); Tue, 24 Oct 2023 05:02:57 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07F6CAC; Tue, 24 Oct 2023 02:02:54 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6811360014; Tue, 24 Oct 2023 09:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698138173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=moXvoXVL8BeanjUNuJ9YxDMbdmP0XoJ1UTP44gG4/CA=; b=QWj0mk9S2F0YTHYn+XipNAFVia5mjtFwMXs6WlSlTZQRuWmnD7IMIKCVumCfRzOcbLKFP8 Ev+dwdtdCU5Vou1ysduGfB8wsDve7DAAPUVNM0T4ISKZ0zFWkW0vtD+ggctbRd3e0MBlDV Ifyq3r6355gUsmwddN0WQmXghNVOgTWOkxO1MNc70F5cMkQzX8aO6bIpO3bP9R/PgtRDWX em6Q72W8DqhJGTzKiVG+rL2htx6/a93cOfNOscntGTQi3Ux0xN1v4xrGQcaBULHbwKg0ie N68o2iFkPIcNaZfVQPVlDwT6NcR4XeTsS3VueGSW9WprdiXJSQfoAh1rCEcJOw== Date: Tue, 24 Oct 2023 11:03:05 +0200 (CEST) From: Romain Gantois To: Andrew Lunn cc: Romain Gantois , 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 In-Reply-To: Message-ID: <9d447cb5-c8f9-06d2-0909-2870d57f0f7a@bootlin.com> References: <20231023155013.512999-1-romain.gantois@bootlin.com> <20231023155013.512999-5-romain.gantois@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-GND-Sasl: romain.gantois@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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 24 Oct 2023 02:03:06 -0700 (PDT) Hello Andrew, On Mon, 23 Oct 2023, Andrew Lunn wrote: > On Mon, Oct 23, 2023 at 05:50:11PM +0200, Romain Gantois wrote: > > The IPQ4019 Ethernet Switch Subsystem uses a PSGMII link to communicate > > with a QCA8075 5-port PHY. This 1G link requires calibration before it can > > be used reliably. > > > > This commit introduces a calibration procedure followed by thourough > > testing of the link between each switch port and its corresponding PHY > > port. > > Could you explain the architecture in a bit more detail. > > When i see MAC code messing with a PHY, i normally say move it into > the PHY driver. But its not clear to me if you are talking about the > real PHYs here, or this is the switch end of the link, and it has some > sort of a PHY to talk to the quint PHY? 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. Thanks, Romain