From patchwork Mon Mar 25 15:34:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13602446 X-Patchwork-Delegate: kuba@kernel.org Received: from wflow2-smtp.messagingengine.com (wflow2-smtp.messagingengine.com [64.147.123.137]) (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 EB4683AC0F; Mon, 25 Mar 2024 15:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.137 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711380979; cv=none; b=NR0ji+QPaWyY3Hr9xhWru72YeLwmnq+yWY9IrS5RV07tFbavwndo0fXs9+jXaKrNgoNWYhS4d6QdYKPtVbdflYCZiUp/3ebob2ei3Hycr0x+JJLVoY1JXRE1LRPx5LqxMAeSC3tWBK9QbniItOMyVY5I/0cO9FQ9puG8DD/FP5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711380979; c=relaxed/simple; bh=czsYT6nP1jOrx7YKGC+AmhOiGcxfIDI8xZQ1Ul2mc4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SqLfTxia7U3dhWCzPXnf9b0b2175oqsr5MHe1bGuX7g93GSSVrxRu6WBNYMIDaOijeM6Mg8idz8O6vxPSfnXmyF9vBnPGdOKmwKHLntBgM8Vgtpj5eLUTiiCV47GAtq+ZvrYawY4XkHuRdF+6ZHEXcbyyd5LFvZh8PkyDYKjjTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=J3duFqIG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=k+1SUIRU; arc=none smtp.client-ip=64.147.123.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="J3duFqIG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="k+1SUIRU" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailflow.west.internal (Postfix) with ESMTP id 6864D2CC051F; Mon, 25 Mar 2024 11:36:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 25 Mar 2024 11:36:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1711380973; x=1711384573; bh=LIJeOCVIC2JRS263l49Ix0rSEeRfAGpNTjKYs7zmiho=; b= J3duFqIG3Yo8tPp35OUBKYBbh3UE6HwQbHP9ndfRBIBa8r1LPsjREKhL0Njrb9fI 8jNKOH6+FgVmk8hicoYvky0A/z9NDpnwGwzTpPJqlprVL0rjr7j6l0uECur6mJX+ 2AEu8/Ed2XFZ1P43qq5DKaCk1d0cTHF383ucH6OZc6SKa45p2+sSHAmsECOWF3Ts sNr9eq6/x/O5f4zsSKYV4vwuUgAou9vpTAE3Z34kQCZgFOP0EQJfBbD6zIrs/pJv PYlSfoXSVxNqKuhMnFbbFw0wHdZA6y++Ed91qxWrxjxohmHvTX0Ra3XkYEA7cIu9 N7L0IgOw7mpzWHDGBk9TdQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711380973; x= 1711384573; bh=LIJeOCVIC2JRS263l49Ix0rSEeRfAGpNTjKYs7zmiho=; b=k +1SUIRUr6ARO+zIKBJdupoCnOpCOgDsvxpPEdu6YfAkgFEzU7PADDmC06S0gUVGz Tj5KEo32KDBrtEtq1qziMBV2R8iIXMxMV58nKaI5sjqzWT+q7aLnAFQkVTwuUmuR OMrftIzRH7gfGToL0MYkqoZURtiKrLNkT+pgea7FUQCbKxnpXF1fpJdtDWPzQDzJ wUrqZevEMIUd5AvRIY0UhMUR1XQb6h4sQuYxs6NJUAGLNsSoo+e3bKlv6jReACJ0 uOzBr/pOF2y4SrwCSIAo4HeyMCP5vXqZLV2cA6FEA+Uc53VosoJ3gP+K/82Q48d6 tmCPC9D8dy9eYW2z+mQpg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudduuddgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihhk lhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhouggvrhhluhhnugdorhgvnh gvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrghtthgvrhhnpeehiefgueev uedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffleefgeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnihhklhgrshdrshhouggv rhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgv X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Mar 2024 11:36:10 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Claudiu Beznea , Yoshihiro Shimoda , Biju Das , netdev@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Rob Herring Subject: [net-next,v4 1/2] dt-bindings: net: renesas,etheravb: Add optional MDIO bus node Date: Mon, 25 Mar 2024 16:34:50 +0100 Message-ID: <20240325153451.2366083-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240325153451.2366083-1-niklas.soderlund+renesas@ragnatech.se> References: <20240325153451.2366083-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The Renesas Ethernet AVB bindings do not allow the MDIO bus to be described. This has not been needed as only a single PHY is supported and no MDIO bus properties have been needed. Add an optional mdio node to the binding which allows the MDIO bus to be described and allow bus properties to be set. Signed-off-by: Niklas Söderlund Reviewed-by: Sergey Shtylyov Reviewed-by: Rob Herring --- * Changes since v3 - Marked the '#address-cells' and '#size-cells' properties as depricated as well as making them optional. * Changes since v2 - Mark the PHY pattern as deprecated and add a comment that new bindings should describe the PHY inside the MDIO node. --- .../devicetree/bindings/net/renesas,etheravb.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml index de7ba7f345a9..21a92f179093 100644 --- a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml +++ b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml @@ -88,10 +88,16 @@ properties: '#address-cells': description: Number of address cells for the MDIO bus. const: 1 + deprecated: true '#size-cells': description: Number of size cells on the MDIO bus. const: 0 + deprecated: true + + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false renesas,no-ether-link: type: boolean @@ -110,9 +116,13 @@ properties: tx-internal-delay-ps: enum: [0, 2000] +# In older bindings there where no mdio child-node to describe the MDIO bus +# and the PHY. To not fail older bindings accept any node with an address. New +# users should describe the PHY inside the mdio child-node. patternProperties: "@[0-9a-f]$": type: object + deprecated: true required: - compatible @@ -123,8 +133,6 @@ required: - resets - phy-mode - phy-handle - - '#address-cells' - - '#size-cells' allOf: - $ref: ethernet-controller.yaml# From patchwork Mon Mar 25 15:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13602447 X-Patchwork-Delegate: kuba@kernel.org Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) (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 772725A7B4; Mon, 25 Mar 2024 15:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711380984; cv=none; b=gIbLGd5K8IzOdUlwNaCBntdFRdk6WOGIwZOOdjMD9p28CJioaGd0VmpVJOdcCM0StA9uiv6suhe/bfszDg2PoPk0/SCRcMOaH9KLr9e/Acoxw326vfRz/CzsBhOgvl0rpshjXvt+AzYSHHwecyD/g6mq3Q5ulzjJqjiiSKv10sk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711380984; c=relaxed/simple; bh=CD1EKNWLbg+QFbDHSkiLwzqYMPbislio616T47FV/P4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ONruKJcDWiZh65p6vk4yhtqAIQB1sJ/n7SNn7n0y3vJbApRn/AFJxaploo4qngXnMWq+onZV8EvrOOJrceHVWPGXXnULLjCLCVymi0rObgmTWH9oV2cXf6m+aUPElMwZmjsS4j0ZwTL/ptIjWgl3oOF/RF03DETgQTgRSIm37dY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=F5Zc1C7s; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Xj3y+Fbp; arc=none smtp.client-ip=64.147.123.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="F5Zc1C7s"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Xj3y+Fbp" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 6CA172B00209; Mon, 25 Mar 2024 11:36:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 25 Mar 2024 11:36:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1711380978; x=1711384578; bh=GIG/lFWiLB83BgBBgfX7/0UFdEVrY4t44xseZoGSkC4=; b= F5Zc1C7sjfRsXJMIBgfXEMHR4LY3XxFRSOLxq+/8E+YWPBiyuxCjOgRiRiLN9Lqy PZsBm1uRmb3ouUoKn/Cu+khBg+dsZjC4rzje30ayQjYqQpsmlYfLeMIsZ59N2rIX H5wYmarm5HyZbTu53sqvpD2jTUg7nOoBMEd3wWuoTsAuzksPF3IvscvgPd9zs1/L 5QaNmen1o4wrHUU26JRf9ctapp/Q0FxWIR8bmjrJpxgemTPX3wOwXyNoq3BW//nM QX+v2d4LO+MynUbllWY1ACB4MMFjk/rnAONpA8oSheUASSAJKSmPLefQPLN6zynE ToOGdtyIJfJ9VMthSJUmqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711380978; x= 1711384578; bh=GIG/lFWiLB83BgBBgfX7/0UFdEVrY4t44xseZoGSkC4=; b=X j3y+FbpmMZ351KhF7h/fUTGLJ5s9Yf+z94N5PDC6aklAdRRYoXOhGJrIeQgFvvko 2gahCcrtYiDxAN3G70fMPe4dSVu/UIQg978GPh6W7HKFxo5BjTGAUn86joWuiNDI xVRqRHRXJDGH5MF54t02b5L6a4loNytZIamUoXQ/MWepdCm+l4TCptxSb+RxtFSP i7hG3roR6oGSy4H1IvqM/fp15sYwFQUaMWXeJ6lYHqrPLJM7U8rAyc6y4/zpZfAk yGLbwSqx/8iiTu5uo4nFlm+XSWEEc5YqFWZoHcSi+pRRs/rfb5MUfIArN2YbS/SP hsv6fC6LM18moixpEXHHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudduuddgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihhk lhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhouggvrhhluhhnugdorhgvnh gvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrghtthgvrhhnpeehiefgueev uedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffleefgeenucevlhhushhtvg hrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehnihhklhgrshdrshhouggv rhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgv X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Mar 2024 11:36:16 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Claudiu Beznea , Yoshihiro Shimoda , Biju Das , netdev@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Andrew Lunn Subject: [net-next,v4 2/2] ravb: Add support for an optional MDIO mode Date: Mon, 25 Mar 2024 16:34:51 +0100 Message-ID: <20240325153451.2366083-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240325153451.2366083-1-niklas.soderlund+renesas@ragnatech.se> References: <20240325153451.2366083-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The driver used the DT node of the device itself when registering the MDIO bus. While this works, it creates a problem: it forces any MDIO bus properties to also be set on the devices DT node. This mixes the properties of two distinctly different things and is confusing. This change adds support for an optional mdio node to be defined as a child to the device DT node. The child node can then be used to describe MDIO bus properties that the MDIO core can act on when registering the bus. If no mdio child node is found the driver fallback to the old behavior and register the MDIO bus using the device DT node. This change is backward compatible with old bindings in use. Signed-off-by: Niklas Söderlund Reviewed-by: Sergey Shtylyov Reviewed-by: Andrew Lunn --- * Changes since v3 - None * Changes since v2 - Use DT node instead of OF ode in commit message. - Update punctuation in commit message. - Simplify the node selection in the driver. --- drivers/net/ethernet/renesas/ravb_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index d1be030c8848..9a397f9b4c0c 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2564,6 +2564,7 @@ static int ravb_mdio_init(struct ravb_private *priv) { struct platform_device *pdev = priv->pdev; struct device *dev = &pdev->dev; + struct device_node *mdio_node; struct phy_device *phydev; struct device_node *pn; int error; @@ -2583,7 +2584,13 @@ static int ravb_mdio_init(struct ravb_private *priv) pdev->name, pdev->id); /* Register MDIO bus */ - error = of_mdiobus_register(priv->mii_bus, dev->of_node); + mdio_node = of_get_child_by_name(dev->of_node, "mdio"); + if (!mdio_node) { + /* backwards compatibility for DT lacking mdio subnode */ + mdio_node = of_node_get(dev->of_node); + } + error = of_mdiobus_register(priv->mii_bus, mdio_node); + of_node_put(mdio_node); if (error) goto out_free_bus;