Article View: linux.kernel.netdev
Article #19154Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
From: Simon Horman
Date: Thu, 19 Nov 2026 13:23
Date: Thu, 19 Nov 2026 13:23
54 lines
11066 bytes
11066 bytes
On Fri, Nov 13, 2026 at 05:02:32PM +0200, Claudiu Manoil wrote: > ENETCv4 has special internal links when connected to the on-chip NETC > switch via internal switch ports, called pseudo-MAC links. These > pseudo-MACs are proprietary, they don't implement any standard IEEE > interface (like MII), and can be modeled as fixed links with the link > speed determined at boot time by the Port PCR[PSPEED] register > configuration. > > We also need to be able to probe the ENETCv4 Ports featuring pseudo-MACs > as pure PCI devices, i.e. without any "ethernet" DT node representation. > The typical use case for this consists in a board with NETC connected > via PCI to another host which probes the ENETC. Note that in this > scenario, the pseudo-MAC ENETCs are connected internally to a NETC > switch that is not owned by Linux. > > Since such a port has no "ethernet" DT node, its fixed link has to be > synthesized at probe time. Build the fixed-link subnode directly in C > with an of_changeset: of_changeset_create_node() adds a "fixed-link" > node onto the port's own OF node, and of_changeset_add_prop_*() populate > its "speed" and "full-duplex" properties. The changeset is applied with > of_changeset_apply(), so the fixed-link node is spliced onto the ENETC > netdev's fwnode exactly as if it had come from static DT, and phylink > picks it up through dev_fwnode(). > > The operating speed written into the node is read from PCR[PSPEED] at > probe time and mapped to a phylink-supported value, so the fixed link > reflects the actual boot-time configuration, as long as it's a phylink > supported value. Otherwise, PCR[PSPEED] will be updated to the closest > rounded down supported value. > > The pseudo-MAC path is selected when the port has no OF node, or when it > only has the empty PCI-synthesized node (OF_DYNAMIC), which carries no > fixed-link description. Ports described by static DT take the regular > of_get_phy_mode() path instead. > > Building the fixed-link node requires the of_changeset API, which is only > available with CONFIG_OF_DYNAMIC, so select it. As OF_DYNAMIC itself > depends on OF, make NXP_ENETC4 depend on OF as well, rather than force > OF_DYNAMIC on without the core OF code being built. > > The changeset is reverted and destroyed on teardown and on the probe > error unwind. The node-less pseudo-MAC path has a runtime dependency on > CONFIG_PCI_DYNAMIC_OF_NODES: that is what makes the PCI core synthesize > the per-function OF node (of_pci_make_dev_node()) that the fixed-link > node is attached onto. This is intentionally not a hard Kconfig > dependency, since the ENETC4 driver also serves regular ports described > by static DT; when PCI_DYNAMIC_OF_NODES is absent the PCI function has no > of_node and the pseudo-MAC probe path fails gracefully with a clear > -ENODEV error. > > Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261119132332.GV860048@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367021-linux-kernel-netdev=dewy.ruReferences:
<cover.1794581338.git.claudiu.manoil@nxp.com> <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367021-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node Date: Thu, 19 Nov 2026 13:23:32 +0000 Organization: Usenet Network Message-ID: <20261119132332.GV860048@horms.kernel.org> References: <cover.1794581338.git.claudiu.manoil@nxp.com> <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2881036"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:8ZGe43OLgqqjKOqYl/2Mkr07pbA= sha256:7rCpowf8crix2sUPFjWVI98BxkkEYTHXl9JmdlowObs= sha1:GypUMMsGVJGvJgrIUpwVflMZJB4= sha256:G4mMoFjLcS7kSegPGkIZqJUchJeG4PxW0zursx+DCxc= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5AF84115647; Thu, 19 Nov 2026 16:24:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J72Ri2nmlfha; Thu, 19 Nov 2026 16:23:59 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-367021-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id BE58811562B; Thu, 19 Nov 2026 16:23:49 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0FA581459D9; Thu, 19 Nov 2026 13:23:46 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795094624; b=QlePHSX7PuexB1TJNtYyZObjua8iB1uxq+KTbamxVubyriOp5zkbZhSDLjO+HqakZjX3 KkXRzbJQo3tzR0RDK2kTCReY0acVw8kXNDnTIDoumkJdOz0ZfmdWeWn7P5dt6KpiUa7Ct +t/QjqVMcn3+e180SS5A9I+AFj2yT3RnQT/1GN508New/on/jst2CZ/uEhfbjfsw3eVG5 6JVfsrDI/m5LGP6N9L1gqrUghXUTalEyWy/vEYnp1JLu/PyRSZug1JRV2RwYXFJ0ZZttD osItppx9e9m8+hLXytG6sWbwL6uq6AvQFPbRszOAd3QnsbBlXwMdCtxNpzfTt/GeZBA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795094624; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=EdJiYgwYCIOqRCeOsRL6qc7Qjf5vSU6CS4yY2L/Kemo=; b=EM5p3LMgm0TfjqFH0xo0WPw0SJStbB4/9h5TZOKc8GUvQWEWFpkOJQ6TxdAQEWdVMCGN QMsfQQjhv5KepnfUgnCRbcdOAHyw9edYv9dhixpvACTBOplSI16VjK50+HKXM4j502jIB 811bBOEuNtZ4VpFD/F3aHTEdeTWGipleEpTSmsILQHjPl3YAAItwv8rYMDueBQVlzqlGk eZwD/YN85iT1sWEk6vPQzsuc+S6LviLuOYE7apBJ8ODZ1JtRJQHzY3Q8RRMSxfmAPTA2H //0CGoMhwYi1xXgVCqjmhQAOTedSSiGVlaJNnN+ZX1/dlnIqazkempKOh0wlXL3tDiQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h22m5vpa; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05FC3606A337; Thu, 19 Nov 2026 13:23:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h22m5vpa X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795094618; b=DmTQ1e4tY3QQpdbS/fQJ93jofpzo4PkRiLoHdJrMd9P9cdU/GF2AHtbYuy3O5/EuRDMe vbtNoP37onqpqljjevTOtrp1PAH2HD2JXlVLhBkz5KlS2Ehgt7XalPwhDMid6QWYlEBEy 2cvueoU2Bxh0lNuGScy5eAtde/F047oKqSVX/WfmEiE/QCzaG6hJ2UuCrY+vrJiOd2Lh0 OW+I4fqJnLm8KSi8PoMRhtMW1nsYYZMdQHev7lWcTy6KWda4/ydj7aYGJ3NXaCPv31Lln AvJvN83U7mHAaMHaFqsrYKPuOBxb7B+eE3C4YW3Qfl+rMvx5MO1a3siFLLmuNxeoSug== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795094618; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=EdJiYgwYCIOqRCeOsRL6qc7Qjf5vSU6CS4yY2L/Kemo=; b=g56cUoLCi3308aqxiht3IoCwlMoyaepEmG+64bIEKq+n6910EEVTegOhwbJjjBLcTDzU sH35K7Gs9ABOy3cARKozRdFoO9HG6oUW+3tnjfupP6c4SXeCnWAwrIPijONEDniEJuC70 qivnXMZwwqMoe6qxRxUo5NBm52OpJ797VI6kgNRY0J/iqMrH6Uij12zLDcokWPK4qL8/1 ggrU6o6k9gnHZ6tQio74+r41eUCuFSfTdJgzxS+cRT3Jclh8CT8ugFiN20fGWHR5hT50S S7jFWQA0/kuYKWGoKAwhNyRwGugc8c271NSGDi4CdlnA9nWKF0stZLnM9rOoGnVXs9A== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h22m5vpa; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 245B1606A32C; Thu, 19 Nov 2026 13:23:37 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F7D1F000C5; Thu, 19 Nov 2026 13:23:34 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795094617; bh=EdJiYgwYCIOqRCeOsRL6qc7Qjf5vSU6CS4yY2L/Kemo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=h22m5vpaAFhpWYESjdJo5TWWbFQiBb2MHNRttY1A8wadKyUu5XELL11MRmkvzXU7m ESWUBRIhDgi12YRQF4aFSUYEEb2/VvU8laltr/ejve/QiJNhEQYeehvGZLDScKCDGy oYBbEw6K+a0SRbRzcaIURCP6nW0xFF36tKVwPE1EJ3keavP+LpxI+3dwEgTOfsT6G8 fy8hloUmXkDqzg0sLAnq2r+1W2QWqyFNbHSBSifQku9A7FZWh+JDTYF/dvH2Lyhwdy 5AtvvTI+1m6UBVvUkXl+OQPjnCEt6XAoM+4empaQkgu5vZRT/3vAqarX9PdQ7OT13G Dw9DKxO8OIJ9w== X-Cc: netdev@vger.kernel.org, s32@nxp.com, Vladimir Oltean <vladimir.oltean@nxp.com>, Wei Fang <wei.fang@nxp.com>, Clark Wang <xiaoning.wang@nxp.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@kernel.org>, Russell King <linux@armlinux.org.uk>, imx@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com>