Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp302356rdb; Sat, 16 Dec 2023 08:46:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAUaKbloK2+g1PEp6Q1gyNfUFjBVtuRsAtzHXCLBC4GEICeZnCT+grOXbQn3WiRKcYBi8v X-Received: by 2002:a50:8d5e:0:b0:551:e5fb:c079 with SMTP id t30-20020a508d5e000000b00551e5fbc079mr6204848edt.42.1702745213970; Sat, 16 Dec 2023 08:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702745213; cv=none; d=google.com; s=arc-20160816; b=Zw2lS6MY2goOYV3zz9O9/K8MXFhCOaj+R9KU3pW7oB8Po5bDF9n5xxuE2uxBts4GM+ GgvNwz5+D6nlQADC4W7cvBJWFaE3C0qur95TrJJE69hrhsLk9o4/CymvqQL36UzUz4My 1APf0NSUTak/D4J5JzUAq2l99TcuYX8X/uSBlhlEpDOxUZdd1B4cPBccoEnZm0PZ4Iw2 bQ98C4Pu9GDd4GexOCYaMgBBtjBQ7J4VdD4QMwzvAG8ZwF/J0L9D6hEx6JusULCp+S/j jRTBwMIltuV02DvXcLQr62t/4PYAaOcw1wPSGdJ2PoSvtO1J9/caaDc8x4TbMlku3z3n 0BOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6J11fscbEWXi5PX4jfQdLlfFWK8+/piBgfKVLqJg8Ik=; fh=oG7bweP8IWaFLtRAWiiDNwM/Uy9ksCy4A8hSxbvLJdk=; b=sn3a0ze65oH2AthhaCrZnO0TycSbittfG7IX1RZaMVvz4+e/l2tmcdtTNVN/uD0KP1 muS9tMeZ/OcBwERIIA989dDpTxw42LxnD9yKqjOoLgj4A/O+Lca5WbD/VTSgDch9VwEY rf04N+kccZ4CJjV9w1jQzVIN6rRI2+f2fco3EwrYPa6u/nrHkXaUrStp7nmMQsk9pGUQ di3sMNwLzbNP3VZ0ahXVZBO2wJn9AyTp36G2skVE7gkYj4SX/Xas+TABOfewWQOwY4q9 FyT1XMJReQu5wOFFjZvEcId4TCX5xQ4GqMKEHBttzc7/vIeFHGuG7pCs+2zQPC8blQid Jvqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ig4ekl2q; spf=pass (google.com: domain of linux-kernel+bounces-2283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v29-20020a50a45d000000b00552fccb8ad0si719521edb.524.2023.12.16.08.46.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:46:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ig4ekl2q; spf=pass (google.com: domain of linux-kernel+bounces-2283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B02201F23D3C for ; Sat, 16 Dec 2023 16:46:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04E313067D; Sat, 16 Dec 2023 16:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Ig4ekl2q" X-Original-To: linux-kernel@vger.kernel.org Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18DE331599; Sat, 16 Dec 2023 16:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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=6J11fscbEWXi5PX4jfQdLlfFWK8+/piBgfKVLqJg8Ik=; b=Ig4ekl2qBEfEFncaQF1mhEZ82Q 3ka07tPwQqffUtZ9ekd7rAMAjRN4x1QlklEEDxsAY4E5LnI7im3yqtxuTEvYRlJj1rkLvEM/mnRZ/ Axr8XWiMDIzaQavibI/qU9nQ4eQL/WOi4qX1Lndg71ZDXjwYnNdHRc3HpYSEeJMJMN50=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rEXo8-0036oV-OC; Sat, 16 Dec 2023 17:46:32 +0100 Date: Sat, 16 Dec 2023 17:46:32 +0100 From: Andrew Lunn To: Dimitri Fedrau Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stefan Eichenberger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: marvell-88q2xxx: add driver for the Marvell 88Q2220 PHY Message-ID: <74d4b8f9-700e-45bc-af59-95a40a777b00@lunn.ch> References: <20231215213102.35994-1-dima.fedrau@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231215213102.35994-1-dima.fedrau@gmail.com> > +static int mv88q222x_config_aneg_gbit(struct phy_device *phydev) > +{ > + int ret; > + > + /* send_s detection threshold, slave and master */ > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, 0x8032, 0x2020); > + if (ret < 0) > + return ret; > + > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, 0x8031, 0xa28); > + if (ret < 0) > + return ret; > + > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, 0x8031, 0xc28); > + if (ret < 0) > + return ret; Same register with two different values? There are a lot of magic values here. Does the datasheet names these registers? Does it define the bits? Adding #defines would be good. > +static int mv88q222x_config_aneg_preinit(struct phy_device *phydev) > +{ > + int ret, val, i; > + > + /* Enable txdac */ > + ret = phy_write_mmd(phydev, MDIO_MMD_PCS, 0x8033, 0x6801); > + if (ret < 0) > + return ret; > + > + /* Disable ANEG */ > + ret = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_T1_CTRL, 0x0); > + if (ret < 0) > + return ret; > + > + /* Set IEEE power down */ > + ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, 0x840); 0x800 is MDIO_CTRL1_LPOWER. What is the other? It seems like a speed selection bit? Andrew