From patchwork Sat Aug 12 09:17:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13351723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB352C001E0 for ; Sat, 12 Aug 2023 09:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VYr4jvPWEOKtvIogb4LN2BXu2/QaBwFKjavjvMfrEGo=; b=J2vAjijJzq+L1T BvHQ2mm30n0xrP98ykwHAHZ+Kl2gDdS1IGl4DcDAUj8ldcxRTyH31Osyj6PE91iGY+oq/h5ED4Qk7 AstcC99Bbd2oh0RsSszCSncRRa8nSHJ9O+4W8sG2ikpyG3sVzS85FDA65zL0+UKYBqmZ38k2PQkrZ mpWEVAXcPmzIm0PZxcqn1lOQOjnjLzZZqVfv4Icob4XZu6Rwi44LokpY8BV/WXur8T0Gbvj1FFm1q a6zXjGTSQBXnsl6Go8pjRrRS+ld5c9AQ/ZW+V4uUNEBhJZizw3Kf8ctqWBfXExetHnVD+0kgz09T3 PV1w7Hw/YntdLWdcusrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkV-00D0Nh-38; Sat, 12 Aug 2023 09:17:31 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkS-00D0Lv-2A; Sat, 12 Aug 2023 09:17:30 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 61E701BF206; Sat, 12 Aug 2023 09:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1691831847; 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=voAtLXmLl9r79y4j5NbdVi9awaISDF1Sa79XgocDMGs=; b=kncA3e3JiQcrxoNOJ4hUbNZOZ3oAl04PNDSloDgEq6cUb5Lz4IoUQ9aW5yKUf2sozSK2oS zCvZWVOPPWPvljoxiw2YsHG7n6yaRAV/tngrRQk8UPt89kXCuBjos1klD8u19jgy7VMBiQ yQMiIOWrMpUmDmdnkHLX10sBb3L24hCQ1vMUFQjdMMM3zn2wTGyR2EOvqsg0iRD6oFaoMI JTEvNqHIt7kqdk+TqXyd4ux+xMhZWq43eyeDutFTcDxvw+zydqUZRL8kKc9UUONIy2S4jL 6sJoaBMHMt3cJjHgB72OdUHSHcEXNKZ4g4uheAbakfY5RqOy4usqR4iiGolCYQ== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?QXLEsW4=?= =?utf-8?b?w6cgw5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno Cc: mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/4] dt-bindings: net: dsa: microchip,lan937x: add missing ethernet on example Date: Sat, 12 Aug 2023 12:17:05 +0300 Message-Id: <20230812091708.34665-2-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230812091708.34665-1-arinc.unal@arinc9.com> References: <20230812091708.34665-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230812_021728_841221_62CE1758 X-CRM114-Status: GOOD ( 10.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The port@5 node on the example is missing the ethernet property. Add it. Remove the MAC bindings on the example as they cannot be validated. Signed-off-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Rob Herring --- .../bindings/net/dsa/microchip,lan937x.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml index 8d7e878b84dc..49af4b0d5916 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml @@ -68,16 +68,6 @@ examples: - | #include - macb0 { - #address-cells = <1>; - #size-cells = <0>; - - fixed-link { - speed = <1000>; - full-duplex; - }; - }; - spi { #address-cells = <1>; #size-cells = <0>; @@ -138,6 +128,7 @@ examples: phy-mode = "rgmii"; tx-internal-delay-ps = <2000>; rx-internal-delay-ps = <2000>; + ethernet = <&macb1>; fixed-link { speed = <1000>; From patchwork Sat Aug 12 09:17:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13351724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59898C0015E for ; Sat, 12 Aug 2023 09:18:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jWRlMuzborHpbd7XXyP3EKXdKDm4rrSZjLtO9sz7Q9c=; b=IebvQQMPHHG8Rm jwxTcnN36rLiFhRXUT4dT3+GCU8Z16ifiXtXE/rFv41mMsTdgAHX+YsZdpFKdhJMk0Y420m/zlzUb osFkMcge/pUuDHA5VlpJc+D427UhO1RhxS93cMawrx2gNPcnJT11f+AHR0qwOO2mIKNjAMoXmrQ+w 1W8Pp76nA9zCUi6A7YsWNSJ8mBH/LR6hxS0O4UOsnMHM52c+W+R/hWCK4B8C+PZ5C29Ix/pXAidMC Nbg1sM4bp7n0JqVt9D31LKFYDIVGvq0ugnWwPypeGCNHS9UrNGKVDT0HZ3shu5mP6Dz6mGlYz+afx B//u+2mcSY4G0KUe27nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkc-00D0QI-3C; Sat, 12 Aug 2023 09:17:38 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qUkka-00D0Oz-2A; Sat, 12 Aug 2023 09:17:38 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9372F1BF204; Sat, 12 Aug 2023 09:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1691831854; 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=LsRwvKVYtk21gU+9mAWLQMZ2egmxY1XWYNUSUt9DxMo=; b=FwNw7L1GC8Df9y3lwueMde8imrg8OOVhGbTF/yJ67+g0C8mgismJeZHjEW3fLSi3mOzqoL NRZ/x93oZYTZVUKrYZTZJZkljv/76NiYLplgGPGW1yarpIQObKhpmDxg6bCZKtcDWtb2x2 yQc34XfD21nFUSAMKODDiLNRjbygrAE9TSyDj1ln4rxOIWF92F+IFFhcIKfpBgjrpbIUO4 31dxjC/E8cnKH/GE4TtXmPIB5ttnTxTTi0dZQ94yRCrU5ZvSsTFXQFMEox2qqLVVAILsFG ZqM40yaY1DizcfKIJSWOY/HylHGYZXjZojkpOpN7/0p1a2a6+rZCdA07FIvmLA== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?QXLEsW4=?= =?utf-8?b?w6cgw5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno Cc: mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 2/4] dt-bindings: net: dsa: document internal MDIO bus Date: Sat, 12 Aug 2023 12:17:06 +0300 Message-Id: <20230812091708.34665-3-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230812091708.34665-1-arinc.unal@arinc9.com> References: <20230812091708.34665-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230812_021736_989089_6798110A X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add the schema to document the internal MDIO bus. Adjust realtek.yaml accordingly. Signed-off-by: Arınç ÜNAL --- .../devicetree/bindings/net/dsa/dsa.yaml | 18 +++++ .../devicetree/bindings/net/dsa/realtek.yaml | 66 +++++++++---------- 2 files changed, 50 insertions(+), 34 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index ec74a660beda..03ccedbc49dc 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -31,6 +31,24 @@ properties: (single device hanging off a CPU port) must not specify this property $ref: /schemas/types.yaml#/definitions/uint32-array + mdio: + description: The internal MDIO bus of the switch + $ref: /schemas/net/mdio.yaml# + +if: + required: [ mdio ] +then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + if: + not: + required: [ ethernet ] + then: + required: + - phy-handle + additionalProperties: true $defs: diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index cfd69c2604ea..ea7db0890abc 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Realtek switches for unmanaged switches -allOf: - - $ref: dsa.yaml#/$defs/ethernet-ports - maintainers: - Linus Walleij @@ -95,37 +92,38 @@ properties: - '#address-cells' - '#interrupt-cells' - mdio: - $ref: /schemas/net/mdio.yaml# - unevaluatedProperties: false - - properties: - compatible: - const: realtek,smi-mdio - -if: - required: - - reg - -then: - $ref: /schemas/spi/spi-peripheral-props.yaml# - not: - required: - - mdc-gpios - - mdio-gpios - - mdio - - properties: - mdc-gpios: false - mdio-gpios: false - mdio: false - -else: - required: - - mdc-gpios - - mdio-gpios - - mdio - - reset-gpios +allOf: + - $ref: dsa.yaml#/$defs/ethernet-ports + - if: + required: [ mdio ] + then: + properties: + mdio: + properties: + compatible: + const: realtek,smi-mdio + + - if: + required: + - reg + then: + $ref: /schemas/spi/spi-peripheral-props.yaml# + not: + required: + - mdc-gpios + - mdio-gpios + - mdio + + properties: + mdc-gpios: false + mdio-gpios: false + mdio: false + else: + required: + - mdc-gpios + - mdio-gpios + - mdio + - reset-gpios required: - compatible From patchwork Sat Aug 12 09:17:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13351725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFEC2C0015E for ; Sat, 12 Aug 2023 09:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ksri++9fTrojZJHkVNHE6fjrNCpgYYmLviqpQqCiDiM=; b=k60nIB8/v3Uzsw DI/hMdmYoF894vavo8D1Fi+sx6LRn2LC0y73f6FHMxKStcvzmD45+m4hhq/rr/JIPzEUfwNkuHgbT Yla5l8g1E1stlIzTKJ4fme825GNarVNJYw2iz3rRGqFKUnZ5G1DY8TFnFxwmxYHF2GWfUUCUiUlJf BHhUI1HdxyhddIlFe1DQYM43sh5Fe4FXTtv+g/9POzOFraMqQIvnQInenaYvZokQyhQGoQ5231ruA iDt7R/AApE1LhyB/D7VTogL20acrcStZynEdGMSr3p6OSXQv6yIz1N4P3qxNgEL/sJkOKefniht25 Ss0PB87Slzb/tU9vJzKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkk-00D0TW-0C; Sat, 12 Aug 2023 09:17:46 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkh-00D0Rb-15; Sat, 12 Aug 2023 09:17:44 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id D08CC1BF205; Sat, 12 Aug 2023 09:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1691831861; 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=iQRZZUbt7IVfuRoJQ54M/pv8ahCw0UL7VT5FDHbc2Ms=; b=ElaC7G4IQ0Ergf+Mx/uoTMSknbXFqIxyynUVIbR42rVmhe5Hkmy9puE8OdxwImNNS8SlYl trYB2LnlpsoHsFaOaFN29RavSKI098c9UnLrP+bLh6FYvQfkPjgLHFaJ4TWTvh6GfGp5t8 VE+1C2BeetlMFODAlhC76FaxfmlLtqS6FvxyZAU5ptIuKR5GWALiU1JkuD38QjvnpJy8p6 bixusuIC9Lzyoww+rS2RebHTpkpd46J5z5qLLmcs14JHMaoJFupFm8blcF2twpJRphsllj WZ0iZd2yiSziADXz2bEQjyMz0Lq1vRxw4OyOswunTfKgTfhsNrG86pmkmQBWcA== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?QXLEsW4=?= =?utf-8?b?w6cgw5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno Cc: mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/4] dt-bindings: net: dsa: realtek: require compatible property under mdio node Date: Sat, 12 Aug 2023 12:17:07 +0300 Message-Id: <20230812091708.34665-4-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230812091708.34665-1-arinc.unal@arinc9.com> References: <20230812091708.34665-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230812_021743_512959_0221AADA X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The compatible property must be defined under the mdio node. Enforce it. Signed-off-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Reviewed-by: Linus Walleij Reviewed-by: Florian Fainelli --- Documentation/devicetree/bindings/net/dsa/realtek.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index ea7db0890abc..f600e65fc990 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -103,6 +103,9 @@ allOf: compatible: const: realtek,smi-mdio + required: + - compatible + - if: required: - reg From patchwork Sat Aug 12 09:17:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13351726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 213E2C04A94 for ; Sat, 12 Aug 2023 09:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZypdNFoBRYFEFzyUP2PLGSuQ+ZVs9OAaPmYXiHrdmo4=; b=D2JrRqNXXSCsaH CjHVaF4GAeYEAwZL2N64g6VfOcCEkP45ytXOgUpgfNK7xqbVYZUGRq0Fbwdf0qSYJmeIg+lqeIVcU iDO5gjmFnv5g/Hbj+uWCvwq/lQTSrxt+5xpPzJ8PfHjjCuyA8XGRkyfjDv9iO7eL+sJDkeiOjQhhB n0PaN/zrdqU+TKGrIM7uKniR5NqTUPiFltXUVggeYS7pQabrvXzDb/U8OiBI0gHjM4ZP7KbH8zgZ+ 1op0aHHvUkwzJcua0Fg4eeyQJsfNGjO+PP74w7E7BX+QrRmgnVLTkhkJ2PNK85dhEB2lVW5+lKn/F EebLChnvbyFMKnbVQfng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkr-00D0XH-1I; Sat, 12 Aug 2023 09:17:53 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qUkkp-00D0VP-00; Sat, 12 Aug 2023 09:17:52 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2644E1BF206; Sat, 12 Aug 2023 09:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1691831869; 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=nM1ZFvnilyS/G7EEYijFjzJbjPNmckCw5XEVt7NtpBM=; b=M4LDCttven4/mL4MjnPQuo743z5iornYXnvRxiUnGVZocjSnNA+CppF4S0xPXmg2sPM7x+ ItaVc7rMbi2HOmaNuT+HKtnYvgr+5IBEYWDh3OVmx7E//mx5oTt7DiNeSjjO9ozovrI/wz 9/GTRfOmKH7QxJTv4e4WfgFhl2DJIpHHZymY5sVN7R7F+/1uMao4IOeidWj482wAn89qJx t3taZ4B7D8UKkJc0UpFLT61rIFgi+t0/VNzZxFcoFZk9f5X27nzpEi+k8Pg4mNo0TCVI0H HZPVb9RNO7Ob51Ra1mK8fcIwU6GOoi4LeQJvpyt8NQrG0WQuXVP0hXGUlKaLrQ== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?QXLEsW4=?= =?utf-8?b?w6cgw5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno Cc: David Bauer , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 4/4] net: dsa: mt7530: register OF node for internal MDIO bus Date: Sat, 12 Aug 2023 12:17:08 +0300 Message-Id: <20230812091708.34665-5-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230812091708.34665-1-arinc.unal@arinc9.com> References: <20230812091708.34665-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230812_021751_181717_D066A007 X-CRM114-Status: GOOD ( 13.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: David Bauer The MT753x switches provide a switch-internal MDIO bus for the embedded PHYs. Register a OF sub-node on the switch OF-node for this internal MDIO bus. This allows to configure the embedded PHYs using device-tree. Signed-off-by: David Bauer Signed-off-by: Daniel Golle Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 8fbda739c1b3..9bb805de397a 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2152,10 +2152,13 @@ mt7530_setup_mdio(struct mt7530_priv *priv) { struct dsa_switch *ds = priv->ds; struct device *dev = priv->dev; + struct device_node *np, *mnp; struct mii_bus *bus; static int idx; int ret; + np = priv->dev->of_node; + bus = devm_mdiobus_alloc(dev); if (!bus) return -ENOMEM; @@ -2174,7 +2177,9 @@ mt7530_setup_mdio(struct mt7530_priv *priv) if (priv->irq) mt7530_setup_mdio_irq(priv); - ret = devm_mdiobus_register(dev, bus); + mnp = of_get_child_by_name(np, "mdio"); + ret = devm_of_mdiobus_register(dev, bus, mnp); + of_node_put(mnp); if (ret) { dev_err(dev, "failed to register MDIO bus: %d\n", ret); if (priv->irq)