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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DB5EC433FE for ; Wed, 26 Oct 2022 12:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NpTJ+SfJIeZ9qybUe7xergdbW3Ivpbh281vdFcvG+HI=; b=Stg2lzS6oZ0tFC o+lf6u+XNpoSgKmUbA+czm5e33XeNe0cjyLerNKuhrwL0UdzT7sSy3p31Zk9bHGEIHcL5d26bTdzE 83qOO2sUBsPr70M2kyI61jgFlw4EctqkMdkH55IlBrVQXLO4ePyu5VMg8EpB9QVhaoeu57WIC63O8 pg9GYVN/9oq7QJ1kmvXAl9oGxjhrMyvigx24T0aJEW06L8Gt3M5lCAm1IpAxtXkDSI1oD7X6HlSuV zhSYBq7xiBucB2gaYpo1hGfnbmj3FLUCzQbfcB3wHKqqbcnZ+GYTBqilARIrR212FA31gj4Nk2gBz dGg37GjYUGM3wQTth9Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onfpQ-009Gcb-9i; Wed, 26 Oct 2022 12:48:17 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onfpK-009GVA-Bk for linux-arm-kernel@lists.infradead.org; Wed, 26 Oct 2022 12:48:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8KIIctAa0VqNOSQ/2ZbNb/5Sjk32KtswvNRHKfRZHe8=; b=k4U0wbAzgdk0ibRqzdOrNyT5ks GY0QL65LsETSsuMMjMZ1mA45Y/vRqzSUSz77zT+WpXS8KmwT8mddef2EuvCro6OnzjxekiAlEro3M evU1A61xB5wh1d4nJuQWrTNwCaou0XAmMM8C3nwZyvmoE/8ZsUVZh9XmOCqmktF6A1XljPGBErHtz McVaF+xWBq25wpNctc4HENh72+4LsBtod98Ppb1lv1RApYH3seMvj6XqSbJjaHmbDkTP5/E6Lp+0a sq411EGaG5VIFNMBWJXlBpQM400dstEgepBOrlgLoeSzEPGiDCrBNAow4O0MiBVn8net0ZjukS3yC UtezbUgQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34960) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1onfp5-0005bZ-5S; Wed, 26 Oct 2022 13:47:55 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1onfp2-0000cY-Jm; Wed, 26 Oct 2022 13:47:52 +0100 Date: Wed, 26 Oct 2022 13:47:52 +0100 From: "Russell King (Oracle)" To: Maxime Chevallier Cc: Sean Anderson , davem@davemloft.net, Rob Herring , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v3 3/5] net: pcs: add new PCS driver for altera TSE PCS Message-ID: References: <20220901143543.416977-1-maxime.chevallier@bootlin.com> <20220901143543.416977-4-maxime.chevallier@bootlin.com> <68b3dfbf-9bab-2554-254e-bffd280ba97e@gmail.com> <20221026113711.2b740c7a@pc-8.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221026113711.2b740c7a@pc-8.home> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221026_054810_433030_B32C11B6 X-CRM114-Status: GOOD ( 17.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 26, 2022 at 11:37:11AM +0200, Maxime Chevallier wrote: > Hello Sean, > > On Sun, 9 Oct 2022 01:38:15 -0400 > Sean Anderson wrote: > > > > > +#define SGMII_PCS_LINK_TIMER_REG(x) (0x12 + (x)) > > > > Not used. > > Right, I'll remove that in a followup patch > > > > +#define SGMII_PCS_LINK_TIMER_1 0x13 > > > +#define SGMII_PCS_IF_MODE 0x14 > > > +#define PCS_IF_MODE_SGMII_ENA BIT(0) > > > +#define PCS_IF_MODE_USE_SGMII_AN BIT(1) > > > +#define PCS_IF_MODE_SGMI_SPEED_MASK GENMASK(3, 2) > > > +#define PCS_IF_MODE_SGMI_SPEED_10 (0 << 2) > > > +#define PCS_IF_MODE_SGMI_SPEED_100 (1 << 2) > > > +#define PCS_IF_MODE_SGMI_SPEED_1000 (2 << 2) > > > > You can use FIELD_PREP if you're so inclined. I assume SGMI is from > > the datasheet. > > Will do ! thanks :) > > > > +#define PCS_IF_MODE_SGMI_HALF_DUPLEX BIT(4) > > > +#define PCS_IF_MODE_SGMI_PHY_ANi BIT(5) The definitions up to here look very similar to pcs-lynx.c when it comes to 1000base-X and SGMII. I wonder whether regmap can help here to abstract the register access differences and then maybe code can be shared. What value is in registers 2 and 3 (the ID registers) for this PCS? On the link timer value setting, I have a patch to add a phylink helper which returns the link timer in nanoseconds. May be a good idea if we get that queued up so drivers can make use of it rather than hard-coding a register value everywhere. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel