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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A49EC388F9 for ; Fri, 23 Oct 2020 22:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E15A2168B for ; Fri, 23 Oct 2020 22:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757790AbgJWWnj (ORCPT ); Fri, 23 Oct 2020 18:43:39 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:42508 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757743AbgJWWni (ORCPT ); Fri, 23 Oct 2020 18:43:38 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kW5ma-003BbF-RQ; Sat, 24 Oct 2020 00:43:36 +0200 Date: Sat, 24 Oct 2020 00:43:36 +0200 From: Andrew Lunn To: Alexandru Ardelean Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, ardeleanalex@gmail.com Subject: Re: [PATCH v2 1/2] net: phy: adin: disable diag clock & disable standby mode in config_aneg Message-ID: <20201023224336.GF745568@lunn.ch> References: <20201022074551.11520-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201022074551.11520-1-alexandru.ardelean@analog.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 10:45:50AM +0300, Alexandru Ardelean wrote: > When the PHY powers up, the diagnostics clock isn't enabled (bit 2 in > register PHY_CTRL_1 (0x0012)). > Also, the PHY is not in standby mode, so bit 13 in PHY_CTRL_3 (0x0017) is > always set at power up. > > The standby mode and the diagnostics clock are both meant to be for the > cable diagnostics feature of the PHY (in phylib this would be equivalent to > the cable-test support), and for the frame-generator feature of the PHY. > > In standby mode, the PHY doesn't negotiate links or manage links. > > To use the cable diagnostics/test (or frame-generator), the PHY must be > first set in standby mode, so that the link operation doesn't interfere. > Then, the diagnostics clock must be enabled. > > For the cable-test feature, when the operation finishes, the PHY goes into > PHY_UP state, and the config_aneg hook is called. > > For the ADIN PHY, we need to make sure that during autonegotiation > configuration/setup the PHY is removed from standby mode and the > diagnostics clock is disabled, so that normal operation is resumed. > > This change does that by moving the set of the ADIN1300_LINKING_EN bit (2) > in the config_aneg (to disable standby mode). > Previously, this was set in the downshift setup, because the downshift > retry value and the ADIN1300_LINKING_EN are in the same register. > > And the ADIN1300_DIAG_CLK_EN bit (13) is cleared, to disable the > diagnostics clock. > > Signed-off-by: Alexandru Ardelean Reviewed-by: Andrew Lunn Andrew