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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C2D1C636CC for ; Sat, 11 Feb 2023 15:32:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbjBKPcy (ORCPT ); Sat, 11 Feb 2023 10:32:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjBKPcw (ORCPT ); Sat, 11 Feb 2023 10:32:52 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAE8A23DAC; Sat, 11 Feb 2023 07:32:51 -0800 (PST) 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=+nZCzFH2CatPkmq5OyRhXq2N8qdPXlAo2cpPPyX955k=; b=JPgz2W6RMH1r9WhCBHuWhkIIde K+o1bB+0DAySSNkTsZ57PdllSFv0vITYJ4OeaqvBim8R1pZeZxKSKbIcEItQGdFGbI60wR+vSp0QS U/an4wV/lE9Sc/Cu70sPnWno6VV1HxuiISjMCYY7mwvVLw2SUbjJ+AGnKm4ma0MMFDy8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pQrrt-004htS-GZ; Sat, 11 Feb 2023 16:32:49 +0100 Date: Sat, 11 Feb 2023 16:32:49 +0100 From: Andrew Lunn To: Vladimir Oltean Cc: Maxime Chevallier , 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: References: <20230210190949.1115836-1-maxime.chevallier@bootlin.com> <20230210190949.1115836-1-maxime.chevallier@bootlin.com> <20230210193159.qmbtvwtx6kqagvxy@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230210193159.qmbtvwtx6kqagvxy@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? :( Another option might be regmap. There are both regmap-mdio.c and regmap-mmio.c. Andrew