From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 395061D1F60 for ; Fri, 6 Sep 2024 15:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725637873; cv=none; b=fy0uourTlLzv2de2nlhb/zBGQIVMieCfaTUL044gnPOwtbgh2orFzNF9tw63n0iI1yHrnw+vMTnOKGIgdcE0mSzuw2PJVOnt1LfUR6dMfqIF+f3cXdYRgHH5xrjFZgAlDgPR95bac3L99Pw7vy1tGYLFVdByZk0Zcj5QBZP1JN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725637873; c=relaxed/simple; bh=qo8O1h2lAqqv1CX/RzBNtMvvKqsJQzhgLJn7r2wlNX4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZLOF/2sLl1veqqKvYtjJLYhc+36lcCvDgQmphqWhT+elQcfKsPimn7vw58+sfKXAsEuNe0qSRA/LxdA3kGvhars+WoMXA+xULc9NdynF38zNKMXy8iO+Hv+D/NdhmA2149Y1faiyAwrHasUQI9Gv9r65ulr2GkeZBV43eMzwajg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1smbEb-0007zn-CX; Fri, 06 Sep 2024 17:50:53 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smbEZ-005ysl-Jh; Fri, 06 Sep 2024 17:50:51 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1smbEZ-00A9vb-1b; Fri, 06 Sep 2024 17:50:51 +0200 Date: Fri, 6 Sep 2024 17:50:51 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Russell King , devicetree@vger.kernel.org Subject: Re: [PATCH v1] dt-bindings: net: ethernet-phy: Add forced-master/slave properties for SPE PHYs Message-ID: References: <20240906144905.591508-1-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org On Fri, Sep 06, 2024 at 05:11:54PM +0200, Andrew Lunn wrote: > On Fri, Sep 06, 2024 at 04:49:05PM +0200, Oleksij Rempel wrote: > > Add two new properties, `forced-master` and `forced-slave`, to the > > ethernet-phy binding. These properties are intended for Single Pair > > Ethernet (1000/100/10Base-T1) PHYs, where each PHY and product may have > > a predefined link role (master or slave). Typically, these roles are set > > by hardware strap pins, but in some cases, device tree configuration is > > necessary. > > > > Signed-off-by: Oleksij Rempel > > --- > > .../devicetree/bindings/net/ethernet-phy.yaml | 22 +++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > index d9b62741a2259..af7a1eb6ceff6 100644 > > --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml > > @@ -158,6 +158,28 @@ properties: > > Mark the corresponding energy efficient ethernet mode as > > broken and request the ethernet to stop advertising it. > > > > + forced-master: > > + $ref: /schemas/types.yaml#/definitions/flag > > + description: > > + If set, forces the PHY to operate as a master. This is used in Single Pair > > + Ethernet (1000/100/10Base-T1) where each PHY and product has a predefined > > + link role (master or slave). This property is board-specific, as the role > > + is usually configured by strap pins but can be set through the device tree > > + if needed. > > + This property is mutually exclusive with 'forced-slave'; only one of them > > + should be used. > > DT reviewers tend to complain about such mutually exclusive > properties. Yes, at this point i was uncertain. > What you are effectively adding is support for the ethtool: > > ethtool -s [master-slave preferred-master|preferred-slave|forced-master|forced-slave] ack > 10Base-T1 often does not have autoneg, so preferred-master & > preferred-slave make non sense in this context, but i wounder if > somebody will want these later. An Ethernet switch is generally > preferred-master for example, but the client is preferred-slave. Good point. > Maybe make the property a string with supported values 'forced-master' > and 'forced-slave', leaving it open for the other two to be added > later. > > I've not seen the implementation yet, but i don't think there is much > driver specific here. We already have phydev->master_slave_set, it > just needs to be set from this property. Can it be done in phylib core > somewhere? Yes, this is the idea. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |