Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp588020rdb; Thu, 30 Nov 2023 12:35:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFzLo7FdW3kCYpeJmU0CKY+baLd4fjIqOTb0T5PIQogb45khOC2GD3FTbWHp6fw+qK8El9 X-Received: by 2002:a05:6358:998f:b0:168:cfea:2d41 with SMTP id j15-20020a056358998f00b00168cfea2d41mr24636168rwb.14.1701376511377; Thu, 30 Nov 2023 12:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701376511; cv=none; d=google.com; s=arc-20160816; b=v2P6QQDWeOkBVgTewgexvYUs4tMUD4xszNw4brn9VfUYoZ0jzIqo9dOS6ZqlLdrs4k fsrSEVq7kYPF1AzKTxwz8DnL+O939l60w4xsFFWTMqwgz5pWiYb8RYF9MYNYR2xqBscS Dn0d8e90XCsCLRUIvuAUb/FEXuG0JCAxtOX95ycjn7TuXCFO48dXB6K7Ifgg76myM0X5 KOCwDE1uXaazJdqwQy8s8Y+ZXY6NKuUxJkylkxPu6OeHpvU03dkgaEBNcgorA3mgKih7 BFbsCQz13uusp8fHp7+PGnL9Acl2KqeJb7AJroirw3zSC9+i/MR8DoJ8ZUou9qGgAjDg 11zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=IzQ3On710hTv4xHUxSRSe52ROEYKFUSjwFd+FRw9ZWo=; fh=qJjCGZx71KYvIF0dtHFaCi4OADD/2A/t/V1sVm6NhGE=; b=oQwTJykSASBUQrW1ZnqDOczJohZ4STidZfY93Bhq/SXhPkdGVnkJG4yLOENpWhhjyS 2diwzEuiN1O04TDuiG1kibovhZfmx8hPUuv4IBL079f/xOYVwqftrcB9TImbvrC4Mnyv +XzRXg39xxyz8ikNc3toVnKJ++dFbncUPRgTbOp23E5kfUWSWAxOZugQ/kf1dpACYwq8 FmUaJb/tp/3Fx3XsD+577m0YRHdqd+ai9whwAHLkc6YjUqFFqm3l6HsZWXhTKfW7KLTD +5dCfVLiqDUO5tSLgS2cB4sZUytZB2LVc8DSZMuu82yv3v5YBUmrhgoPNijBYBYjp4La 70lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZDiYNDVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id a21-20020a656415000000b005be007363a9si2083357pgv.730.2023.11.30.12.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:35:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZDiYNDVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id F17EA80DF994; Thu, 30 Nov 2023 12:35:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376345AbjK3Uer (ORCPT + 99 others); Thu, 30 Nov 2023 15:34:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346798AbjK3Ueq (ORCPT ); Thu, 30 Nov 2023 15:34:46 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB2A1703; Thu, 30 Nov 2023 12:34:50 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4FFB8240006; Thu, 30 Nov 2023 20:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701376488; 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=IzQ3On710hTv4xHUxSRSe52ROEYKFUSjwFd+FRw9ZWo=; b=ZDiYNDVjFXSdd+LTZVKANyqlnEkTWiTR8yc/VLuFsekCuu17tQQuKYpOMDajW5APgyyZgn K/c4zgpvDVG+cc2AUL7Bo/kTCLhhz+QBP1BknOrBANFqUrIU9nnWBdMTcyHg44TN4JAuCU 1L+grucTiVpIrmCYvcsvxcBaFj0opmJp6PWECQ0NsgXWyKBlp2eMcWvfnj2uuYgatUS1wI bQIhD6vcX0DlHmnQNKoXgzm4ogPNiRCBhbtPqU5k2scwA3MTTyGvgf8E3jSLWwnf9uqbiM aHV/8bpcShrEg/vqzSLYKYmJ4+jHTjP5zGv3rKUmt7UINkA+DanGsptTm8CfSw== Date: Thu, 30 Nov 2023 21:34:41 +0100 From: Maxime Chevallier To: Serge Semin Cc: Andrew Lunn , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tomer Maimon , davem@davemloft.net, avifishman70@gmail.com, venture@google.com, openbmc@lists.ozlabs.org, robh+dt@kernel.org, tali.perry1@gmail.com, mcoquelin.stm32@gmail.com, edumazet@google.com, joabreu@synopsys.com, joel@jms.id.au, krzysztof.kozlowski+dt@linaro.org, peppe.cavallaro@st.com, j.neuschaefer@gmx.net, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, benjaminfair@google.com Subject: Re: [Linux-stm32] [PATCH v1 2/2] net: stmmac: Add NPCM support Message-ID: <20231130213441.032a661c@device.home> In-Reply-To: References: <20231121151733.2015384-1-tmaimon77@gmail.com> <20231121151733.2015384-3-tmaimon77@gmail.com> <6aeb28f5-04c2-4723-9da2-d168025c307c@lunn.ch> <9ad42fef-b210-496a-aafc-eb2a7416c4df@lunn.ch> <25d0c091-3dce-4d62-a112-c82106809c65@lunn.ch> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 30 Nov 2023 12:35:09 -0800 (PST) Hello, On Thu, 30 Nov 2023 22:59:32 +0300 Serge Semin wrote: > On Thu, Nov 30, 2023 at 06:26:13PM +0100, Andrew Lunn wrote: > > > I will check with the xpcs maintainer how can we add indirect access > > > to the xpcs module. > > > > https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c#L449 > > > > It creates a regmap for the memory range. On top of that it creates an > > MDIO bus. You can then access the PCS in the normal way. > > Actually Synopsys DW XPCS can be synthesized with two types of the CSR > interfaces: > 1. MDIO: device looks as a normal MDIO device. This option is currently > supported by the STMMAC MDIO driver. > 2. MCI/APB3: device MMD CSRs are directly (all CSRs are visible) or > indirectly (paged-base access) accessible over the system memory bus. > > In addition to the above XPCS device can be equipped with separate > clock sources (at least to feed the MCI or APB3 interface) and may > have dedicated IRQ line to signal various events like link > establishing, failures, etc. From that perspective XPCS in both cases > looks as a normal platform device for which would be better to have a > special DT-node defined with all those resources supplied. Then the > XPCS DT-node could be passed to the DW MAC DT-node via the already > standardized "pcs-handle" DT-property. To my understanding, this should work, there's another PCS that works this way : https://elixir.bootlin.com/linux/v6.7-rc3/source/drivers/net/pcs/pcs-rzn1-miic.c Are you still able to use the mdio-regmap glue that Andrew mentioned, to avoid the duplication between the mdio and mmio register accesses ? Maxime