Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1216833pxb; Tue, 17 Aug 2021 06:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDIv7VuDZdGJMMq14TzWcIr2jxwOhUwNAa0K8F8v1You5tOI8Y4XWy0bHRPCEMlz+lCNOf X-Received: by 2002:a05:6402:4311:: with SMTP id m17mr4203663edc.374.1629207540506; Tue, 17 Aug 2021 06:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629207540; cv=none; d=google.com; s=arc-20160816; b=PLStLYwHTbambSS031GAaJBVdXm3NbSIEAJQo0WvWotyZDDCaw/qHBf9KstsVsLbbr BnmKkgu7+DT7AZYlT8RaJ8Gb7h0ZTtGiuAOZlskqtpIFmksxEJJt+LSCTC7U8PNpflqP mfrwq95tVZRHy5YkF4SOVg9IZKV8eGCXghCSFZt79yovbOz0Ragk2aiCS1n+yQxecEk7 niC08Mt+vBCPaV/L67hA412R/GTLyc3JShaxka38fP6eLeAEB/zmMRLXJLVZQhyN9/N7 qLDyz4DoaHSQT5ZWrAEb/kJLTqAWQGP8xCZRCS9QH++jZNsIChddInT+rPFax2eOQOLa NoSQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QUTwg1PYJ25ImTEHy3FkL3CVzBJV7BWBWBKF/Rs2oz0=; b=bPi/UmditNFM4OXrw4ZdE/f9d5DvdvvRfVgfeLWMe8PmOEmoCJeMsCBRNC+kbInObG A43ZF3PzDnxLuKLdB+SIrz7NELD7TIXPx148uXoUCuVcjLwQ+vW3ONXomTungEsqrc8H JSlIy0jSg9+Yjb7S4cpW40UA+yrRCz8MP2sRnQ9nTghk0mwzwYhkkshrrGAKvMFBPOKK 07atR272un3Y1Kaow0B6n8u6EcRbUvYGvlODMkEtFrgFK7M0O0KOVvlW3Z4I9OPfS0/S Bgm6GAMku0BHE07O0z9svnWXy6pTladtms6Jd+X1DqoSmH9yjQK7sSscUFzXaW3a33JI REAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bIvYiBJo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si2363536edp.316.2021.08.17.06.38.35; Tue, 17 Aug 2021 06:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bIvYiBJo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237601AbhHQNeG (ORCPT + 99 others); Tue, 17 Aug 2021 09:34:06 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:54010 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbhHQNeB (ORCPT ); Tue, 17 Aug 2021 09:34:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding: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=QUTwg1PYJ25ImTEHy3FkL3CVzBJV7BWBWBKF/Rs2oz0=; b=bI vYiBJoFc/Gu8qwH2Jmdd3bsepBoxpVN1tvw7m21aWmRpola4ahlPxou3edeUIWeQRcLzLAS9dfRe2 rCaqFzto/uPQy1m9vFgJLMo8q4Fj0W2PU+sAmya2+HeZEBTl4Yu+UfUVDNVyD/tcAK49k1ly0POoZ iyHow95+DTot91U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mFzDT-000Zqm-Da; Tue, 17 Aug 2021 15:33:19 +0200 Date: Tue, 17 Aug 2021 15:33:19 +0200 From: Andrew Lunn To: Jie Luo Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH] net: phy: add qca8081 ethernet phy driver Message-ID: References: <20210816113440.22290-1-luoj@codeaurora.org> <6856a839-0fa0-1240-47cd-ae8536294bcd@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6856a839-0fa0-1240-47cd-ae8536294bcd@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 17, 2021 at 09:10:44PM +0800, Jie Luo wrote: > > On 8/16/2021 9:56 PM, Andrew Lunn wrote: > > On Mon, Aug 16, 2021 at 07:34:40PM +0800, Luo Jie wrote: > > > qca8081 is industry’s lowest cost and power 1-port 2.5G/1G Ethernet PHY > > > chip, which implements SGMII/SGMII+ for interface to SoC. > > Hi Luo > > > > No Marketing claims in the commit message please. Even if it is > > correct now, it will soon be wrong with newer generations of > > devices. > > > > And what is SGMII+? Please reference a document. Is it actually > > 2500BaseX? > > Hi Andrew, > > thanks for the comments, will remove the claims in the next patch. > > SGMII+ is for 2500BaseX, which is same as SGMII, but the clock frequency of > SGMII+ is 2.5 times SGMII. 25000BaseX is not SGMII over clocked at 2.5GHz. If it is using 2500BaseX then call it 2500BaseX, because 2500BaseX is well defined in the standards, and SGMII overclocked to 2.5G is not standardised. > > A lot of these registers look the same as the at803x. So i'm thinking > > you should merge these two drivers. There is a lot of code which is > > identical, or very similar, which you can share. > > Hi Andrew, > > qca8081 supports IEEE1588 feature, the IEEE1588 code may be submitted in the > near future, > > so it may be a good idea to keep it out from at803x code. Please merge it. A lot of the code is the same, and a lot of the new code you are adding will go away once you use the helpers. And probably you can improve the features of the older PHYs at the same time, where features are the same between them. > > > +static int qca808x_phy_ms_seed_enable(struct phy_device *phydev, bool enable) > > > +{ > > > + u16 seed_enable = 0; > > > + > > > + if (enable) > > > + seed_enable = QCA808X_MASTER_SLAVE_SEED_ENABLE; > > > + > > > + return qca808x_debug_reg_modify(phydev, QCA808X_PHY_DEBUG_LOCAL_SEED, > > > + QCA808X_MASTER_SLAVE_SEED_ENABLE, seed_enable); > > > +} > > This is interesting. I've not seen any other PHY does this. is there > > documentation? Is the datasheet available? > > this piece of code is for configuring the random seed to a lower value to > make the PHY linked > > as the SLAVE mode for fixing some IOT issue, for master/slave > auto-negotiation, please refer to > > https://www.ieee802.org/3/an/public/jul04/lynskey_2_0704.pdf. And what happens when this device is used in an Ethernet switch? A next generation of a qca8k? Take a look at genphy_setup_master_slave(). Use MASTER_SLAVE_CFG_MASTER_PREFERRED or MASTER_SLAVE_CFG_SLAVE_PREFERRED to decide how to bias the master/slave decision. Andrew