From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 603AE2EFD88; Thu, 13 Nov 2025 13:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763039644; cv=none; b=csqKz054XdaJ2lO+X4H9wLRFzF7a1N0qMGpgU+VRXFsW8TWMPalrsPKhUUHaQk18KmzA6Z8Y+cbZkVM+jVVd2xulCcu7PzUuBEtefhgeoZdzjxKw4HXweuq1cah890ePTBecvqRhTb09PykRAdTj99P7Tvm5x4I/TTZuiaRuvb4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763039644; c=relaxed/simple; bh=WrKXaqClSXp37PlSbyDK+7ff3d4yATsoEfOX5STpTbA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IZUbD6QVihJPEyhmgo9eyZodNs4xcuedpMw2iQudcUog9gtQYssoarWbnkKForY+5ny4T+8EASEjpPtJpB3OqUbeAtRoyGqL+1XrIRosoRFRXV9R13FT67ujYunbgwYzVp/8uADvWtMAg0EaBrWK9hHTwdFyMeTpHP5eQ58h05k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=YHjNBTr9; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="YHjNBTr9" 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=JSJC20DFhx/21yu6oEjT5bRb3QA5tX9bbfhsu/ygtmU=; b=YHjNBTr9BoT9IuGmfS/LcjPVWA umQOSs07pA+8PuPSHL9ET3FzgrOM+G595aSm9RjaMSGWS00ofWWKRY3TQFZQwIiBT9CES5Swh7P0z Z7bEMM+ONwFp5DB/sDgJg76RStTs8l5NvmLDuVRYf6U44tguWJaOIDOtw3s2J49N/Rwo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1vJX96-00DrcU-OB; Thu, 13 Nov 2025 14:13:52 +0100 Date: Thu, 13 Nov 2025 14:13:52 +0100 From: Andrew Lunn To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?iso-8859-1?Q?K=F6ry?= Maincent , Marek =?iso-8859-1?Q?Beh=FAn?= , Oleksij Rempel , =?iso-8859-1?Q?Nicol=F2?= Veronese , Simon Horman , mwojtas@chromium.org, Antoine Tenart , devicetree@vger.kernel.org, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Romain Gantois , Daniel Golle , Dimitri Fedrau Subject: Re: [PATCH net-next v16 03/15] net: phy: Introduce PHY ports representation Message-ID: References: <20251113081418.180557-1-maxime.chevallier@bootlin.com> <20251113081418.180557-4-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251113081418.180557-4-maxime.chevallier@bootlin.com> On Thu, Nov 13, 2025 at 09:14:05AM +0100, Maxime Chevallier wrote: > Ethernet provides a wide variety of layer 1 protocols and standards for > data transmission. The front-facing ports of an interface have their own > complexity and configurability. > > Introduce a representation of these front-facing ports. The current code > is minimalistic and only support ports controlled by PHY devices, but > the plan is to extend that to SFP as well as raw Ethernet MACs that > don't use PHY devices. > > This minimal port representation allows describing the media and number > of pairs of a BaseT port. From that information, we can derive the > linkmodes usable on the port, which can be used to limit the > capabilities of an interface. > > For now, the port pairs and medium is derived from devicetree, defined > by the PHY driver, or populated with default values (as we assume that > all PHYs expose at least one port). > > The typical example is 100M ethernet. 100BaseT can work using only 2 > pairs on a Cat 5 cables. However, in the situation where a 10/100/1000 > capable PHY is wired to its RJ45 port through 2 pairs only, we have no > way of detecting that. The "max-speed" DT property can be used, but a > more accurate representation can be used : > > mdi { > connector-0 { > media = "BaseT"; > pairs = <2>; > }; > }; > > >From that information, we can derive the max speed reachable on the > port. > > Another benefit of having that is to avoid vendor-specific DT properties > (micrel,fiber-mode or ti,fiber-mode). > > This basic representation is meant to be expanded, by the introduction > of port ops, userspace listing of ports, and support for multi-port > devices. > > Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn Andrew