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 01E1CC6379F for ; Tue, 21 Feb 2023 07:35:42 +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:MIME-Version:References:In-Reply-To: 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=eCh9W72nx4j9rfONZ72faiZVKEaq55U3nzihHR09+2M=; b=f7ERfpQFCf/IH+ eX47akwCWCagMtrDCI5/P56ODkpAJq43+8WrawdMWE4ZTTF8MRdj8KdpAe9GJisM/Plb/ZlVzdP07 4xEPoSpFrvYliGonbx7DKEffxn4gHSr1czlJiPPuXcBJFYLABFbHXzK8w2ygD2oKIKGnB5TyVmD66 rL36PlT42w3N5As3xZ14a2zGEEf6d85x0T82MGBEcAQvlwjwK3s9XdfjtBSer2TCY9Vr8nu3f04LE Nd3dJOYoI1PfKYLFlyCNclbvQ2lLLynMpcu0yJaBXE5ftxl0+cfzzkL0Irn2UqI3pcqZeK70U8Y9+ i2rB7FtjIgvTNxwaE8cQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUNAQ-006uaR-NG; Tue, 21 Feb 2023 07:34:26 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUNAM-006uYp-Pg for linux-arm-kernel@lists.infradead.org; Tue, 21 Feb 2023 07:34:24 +0000 Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id F178220002; Tue, 21 Feb 2023 07:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1676964855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ofPSoPH7VZ0FWxUqGEHa/UVsnt2dfr9s7ihBxoDcPic=; b=o7ndZ8vt0FQt1JKGfPvfP5kJdnULXs4WoDpkJ+6l0SDk1zp/RBR2YosPQ4kHr+StQlfoAQ 35fm0WUjJEkKKEvgoTQuHqok2wN2S53+y8kxrqGJr8nYBHZbSjBSVwdKPtnJqI+/rMj0B8 ii/F1/k+nz0GgHQ4Zz/g+x07zLx9phS5M4RVc0ldhnVOxZ3kWSNuB2lD5kxjyh3cEk747r K2kKFj2du1t+0gksWZh2G3nW77jlRhEYeT/PRx7qcu+X8JX93NdLfj9DfSuI4fdcIunEOx TlDXNrpkhgEd/GwLgQdKhqM6QEux51KXWUojVC/8pyIOLVjopZzxJCnrkwtQ8Q== Date: Tue, 21 Feb 2023 08:34:12 +0100 From: Maxime Chevallier To: Andrew Lunn Cc: Vladimir Oltean , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Ioana Ciornei Subject: Re: [PATCH net-next] net: pcs: tse: port to pcs-lynx Message-ID: <20230221083412.5e11db13@pc-7.home> In-Reply-To: References: <20230210190949.1115836-1-maxime.chevallier@bootlin.com> <20230210190949.1115836-1-maxime.chevallier@bootlin.com> <20230210193159.qmbtvwtx6kqagvxy@skbuf> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230220_233423_012768_F0BBF262 X-CRM114-Status: GOOD ( 22.78 ) 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 Hi Vlad, Andrew, On Fri, 10 Feb 2023 21:02:39 +0100 Andrew Lunn wrote: > On Fri, Feb 10, 2023 at 09:31:59PM +0200, Vladimir Oltean wrote: > > On Fri, Feb 10, 2023 at 08:09:49PM +0100, Maxime Chevallier wrote: > > > When submitting the initial driver for the Altera TSE PCS, > > > Russell King noted that the register layout for the TSE PCS is > > > very similar to the Lynx PCS. The main difference being that TSE > > > PCS's register space is memory-mapped, whereas Lynx's is exposed > > > over MDIO. > > > > > > Convert the TSE PCS to reuse the whole logic from Lynx, by > > > allowing the creation of a dummy MDIO bus, and a dummy MDIO > > > device located at address 0 on that bus. The MAC driver that uses > > > this PCS must provide callbacks to read/write the MMIO. > > > > > > Also convert the Altera TSE MAC driver to this new way of using > > > the TSE PCS. > > > > > > Signed-off-by: Maxime Chevallier > > > --- > > > drivers/net/ethernet/altera/altera_tse.h | 2 +- > > > drivers/net/ethernet/altera/altera_tse_main.c | 50 ++++- > > > drivers/net/pcs/Kconfig | 4 + > > > drivers/net/pcs/pcs-altera-tse.c | 194 > > > +++++++----------- include/linux/pcs-altera-tse.h > > > | 22 +- 5 files changed, 142 insertions(+), 130 deletions(-) > > > > The glue layer is larger than the duplicated PCS code? :( > > I was wondering if the glue could actually be made generic. The kernel > has a number of reasonably generic MMIO device drivers, which are just > given an address range and assume a logical mapping. > > Could this be made into a generic MDIO MMIO bus driver, which just > gets configured with a base address, and maybe a stride between > registers? That would be ideal, I'll spin a new series prorotyping this, indeed that can be interesting for other devices. Thanks for the review, Maxime > Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel