Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4038639iog; Tue, 28 Jun 2022 07:50:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXuaCzqiKlECUsNBxF68yXC13V1ymHtbQEpTlln744iL3TKmFqOTypmadv2I3d/vBmZ3Bo X-Received: by 2002:aa7:c84a:0:b0:437:bc9c:af63 with SMTP id g10-20020aa7c84a000000b00437bc9caf63mr2073600edt.370.1656427845196; Tue, 28 Jun 2022 07:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656427845; cv=none; d=google.com; s=arc-20160816; b=z7k63evXtGsr/fF915VBoNCN8SdTiX0CsK/v2xUGAKYKjb2AyzZay/wbIbW1KdNM82 MR5kWDYtoRs7JtpDXj1WCuhURjaOmbOQXg5lVRatGmDgXyOTuj3/AMRw4xkLkfmFC+ji Hc4Fj3UvMJnhSCoJ+VfvuIP29sD4ES9XpkqnKALfgdxk46OTQar9Kz0vJj0NwQHUwF92 nLviyIhhu4JrPj1DhmoXT9wLHFRUx9KdPg0EsQszAsRfOYvzNpp+Jf0vHANnKrP7JMcu vRWQEewz+R01SXTRIBSGTCy2uaWwlcXb/qtRNSBUvI8GYsg0g6YqBvN/O33eCQ+IB9dO FYug== 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=7pHTbqwaXaGFRCw7vMsZqLcpFUBsqDmJuAosMkAmWD0=; b=y9Ry/9CotH+Z4Ex6JuWqPPiVxhmXf3il3OJB0vF+F6hONrmKllAt/awulP/YRGGh4M ElGwsxLR0E61zpjxO2xuu0bV6uNjbBLm6qOnrHyYSIRSdTvv6IjS5LqGJIVTkqea0slV xBQ1GP8s4Kn2I6a+alDhUbb/+uXl8eAisQQX+3INw12UBCN9zfvceluVxD7gUBqW0LdX kstLASYHlPs7OIWxFvcwxQu6QkBj+uuA4uRu2WBvABr8Vk1ja9XjlSZuQJ29caVWNcpH fGeglqiD/ZZS5P2xmVA0dkWsxkr5jg06B9ONRS1fogLimX1g6lXshNefc1q038/3oxQ7 k0Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bRHWXWlS; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s16-20020a056402521000b004356fa406aesi20113655edd.37.2022.06.28.07.50.18; Tue, 28 Jun 2022 07:50:45 -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=pass header.i=@lunn.ch header.s=20171124 header.b=bRHWXWlS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346513AbiF1Oqu (ORCPT + 99 others); Tue, 28 Jun 2022 10:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346214AbiF1Oqq (ORCPT ); Tue, 28 Jun 2022 10:46:46 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59B52E9E2; Tue, 28 Jun 2022 07:46:44 -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=7pHTbqwaXaGFRCw7vMsZqLcpFUBsqDmJuAosMkAmWD0=; b=bRHWXWlSE3wMVf7UeDn4OnRTQt zoWrl09nNqQM8atnUITqNjK3zrN07UdVqqzMNTgSa1Ha/9WDOVgAYs1fyfzs+ZbIL4QFERh4gmjqY 7R127QQv6utP1BeRvqQixqPTyPw2pz5GG8Yj60Ju/qS3Cou/5962e0N/xmqt37WmZSs8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1o6CU5-008a55-Ia; Tue, 28 Jun 2022 16:46:33 +0200 Date: Tue, 28 Jun 2022 16:46:33 +0200 From: Andrew Lunn To: Frank Cc: Peter Geis , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , yinghong.zhang@motor-comm.com, fei.zhang@motor-comm.com, hua.sun@motor-comm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy Message-ID: References: <20220628104245.35-1-Frank.Sae@motor-comm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220628104245.35-1-Frank.Sae@motor-comm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 > --- a/drivers/net/phy/motorcomm.c > +++ b/drivers/net/phy/motorcomm.c > @@ -1,15 +1,115 @@ > // SPDX-License-Identifier: GPL-2.0+ > /* > - * Driver for Motorcomm PHYs > + * motorcomm.c: Motorcomm 8511/8521 PHY driver. Generally you don't include a files name in the file, because it can get renamed and nobody updates it. > * > * Author: Peter Geis > + * Author: Frank > */ > > #include > #include > #include > +#include The includes are currently sorted, please keep it so. > > #define PHY_ID_YT8511 0x0000010a > +#define PHY_ID_YT8521 0x0000011A > + > +/* YT8521 Register Overview > + * UTP Register space | FIBER Register space > + * ------------------------------------------------------------ > + * | UTP MII | FIBER MII | > + * | UTP MMD | | > + * | UTP Extended | FIBER Extended | > + * ------------------------------------------------------------ > + * | Common Extended | > + * ------------------------------------------------------------ > + */ > + > +/* 0x10 ~ 0x15 , 0x1E and 0x1F are common MII registers of yt phy */ > + > +/* Specific Function Control Register */ > +#define YTPHY_SPECIFIC_FUNCTION_CONTROL_REG 0x10 > + > +/* 2b00 Manual MDI configuration > + * 2b01 Manual MDIX configuration > + * 2b10 Reserved > + * 2b11 Enable automatic crossover for all modes *default* > + > +/* 2b00 10 Mbps > + * 2b01 100 Mbps > + * 2b10 1000 Mbps > + * 2b11 Reserved > + > +/* 8 working modes: > + * 3b000 UTP_TO_RGMII *default* > + * 3b001 FIBER_TO_RGMII > + * 3b010 UTP_FIBER_TO_RGMII > + * 3b011 UTP_TO_SGMII > + * 3b100 SGPHY_TO_RGMAC > + * 3b101 SGMAC_TO_RGPHY > + * 3b110 UTP_TO_FIBER_AUTO > + * 3b111 UTP_TO_FIBER_FORCE I don't think this notation is used anywhere else in the kernel. It also took me a little while to figure it out. It would probably be better to just add comments next to the #define. Andrew