From patchwork Sun Feb 9 23:47:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13967163 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (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 1D65318FDC5 for ; Sun, 9 Feb 2025 23:48:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144886; cv=none; b=aX03rqDysenGol84qp7oa62kPlN/jkRRIfCkpivFwlK9AN5BgHbwAq6d4VqmKNxlq6DcGoz4jy+07KudVN/h826laZtoqgdtABS0uOu7ECu62sNSbd/ATEWGHr6/lewoaBqYIEAFVNhVbpEUCnv9d2icuwgrm8HeteqleHKPX/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144886; c=relaxed/simple; bh=9ovPTmcz3r5Z+SxqJ+uSZAzBU52u2lOiu6lP7nJBR68=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D+qvHj5izHI9c3jMsqFtexZ9NtKuE4DR/mj/hmqHG9sMedA39vmd2O2uaurPJroIVBCfbcuK0WxDBNDZ62sb/teEa2ff8EakFEhj8soKUXn/aes1Nv+hNJZdMjakRX1X3er0pgctVCPrZrO0AS3PiIH+BOQTwnDQI6WckbRNoE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=UrF0Q3j6; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="UrF0Q3j6" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 9B2E02C03DE; Mon, 10 Feb 2025 12:48:01 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1739144881; bh=qtQSybJN4jzTBTh2b1fTYdZXFDPv02QDw6AL0pSDuEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UrF0Q3j6kpZoMHOiFQbo+RC8O3UiGBZmuZmdhsjySmYySbtk3XE/yFdPTGN1gq/Z5 5xqbxPnnQ1y+ZQlIVvydbTHRsZuWVnEIsuqZmwg4/8cg80H5CHHG9rf+nfaqq3MWzK AB/wYxABivBrHSebzYqrNz6LoaQ2OKISfKacUnvJx6K0vqPbAlqg9Pr81ITGYOacKL 0TkN/lO2/wZ7BgZm+3keVLLciV/Ve0FNvr6RPOvqEkuNSzYdQ6cDqrVZaZgAVFBR98 bkAYbw6yZ6s587ZycD5V3zESz7mB9Ftn/cw1BYsZkT3UI/9ZFTg4ELDRFLMK3f9slV v/elj2JkuwlsA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 10 Feb 2025 12:48:01 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 3287413ED4A; Mon, 10 Feb 2025 12:48:01 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 21E4F280789; Mon, 10 Feb 2025 12:48:01 +1300 (NZDT) From: Chris Packham To: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, tsbogend@alpha.franken.de Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Chris Packham Subject: [PATCH net-next 1/5] dt-bindings: net: Move realtek,rtl9301-switch to net Date: Mon, 10 Feb 2025 12:47:47 +1300 Message-ID: <20250209234751.460404-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> References: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=QNvLRRLL c=1 sm=1 tr=0 ts=67a93eb1 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T2h4t0Lz3GQA:10 a=gEfo2CItAAAA:8 a=58PV4f5cLMXd0nVRbvoA:9 a=3ZKOabzyN94A:10 a=sptkURWiP4Gy88Gu7hUp:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Initially realtek,rtl9301-switch was placed under mfd/ because it had some non-switch related blocks (specifically i2c and reset) but with a bit more review it has become apparent that this was wrong and the binding should live under net/. Signed-off-by: Chris Packham --- Notes: It would probably be simplest for this to come in via net-next with an ack from Lee. .../bindings/{mfd => net}/realtek,rtl9301-switch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Documentation/devicetree/bindings/{mfd => net}/realtek,rtl9301-switch.yaml (97%) diff --git a/Documentation/devicetree/bindings/mfd/realtek,rtl9301-switch.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml similarity index 97% rename from Documentation/devicetree/bindings/mfd/realtek,rtl9301-switch.yaml rename to Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml index f053303ab1e6..d0a93d5f03aa 100644 --- a/Documentation/devicetree/bindings/mfd/realtek,rtl9301-switch.yaml +++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- -$id: http://devicetree.org/schemas/mfd/realtek,rtl9301-switch.yaml# +$id: http://devicetree.org/schemas/net/realtek,rtl9301-switch.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Realtek Switch with Internal CPU From patchwork Sun Feb 9 23:47:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13967164 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (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 2661717B50A for ; Sun, 9 Feb 2025 23:48:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144889; cv=none; b=eP1hQqrmpD4z+f4HyfgE6IFnrxD4Dk7QTucUFxJ9VWOS4DNGwr4eVGgfglNJ4osp6hy1nvoAOXfMUJbzZwfLozR1hpHihPiSLsesykev5+IAd1XohlciQsD6jN1yEguS/vpDl97h68ABy5pRpilH/beFUDqWvI/1/+P0MVYLKZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144889; c=relaxed/simple; bh=RHuOaB7d+UjSjoFMhnWKkDFLOPSIwKQCOC9zA/g1HOs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tvf2tETg6ShauTSwy9J9TP6nYyTIP4eJRZsiUDNzy++z0v2jqeDh2i+6Aw9Gx5qSxjfdKP6QwpXzu3b8ZeICfLbQhn+rsW2pLN2igjByhJrHYcW+1Y1JAywDcr8nTdM7OSB1jeOmW4I0y0MKQwPiBRPyc3B0VNqWvtR52BMpb4U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=XWLopJGM; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="XWLopJGM" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id A413B2C045C; Mon, 10 Feb 2025 12:48:06 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1739144886; bh=jZNBKo8BJn+Cpmm+/0ORd6aDcui99DR/5RTy8qbveT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWLopJGMGrlJcInZzkimYEBZFSeCBIF7gWnR3iaO1eh2qXRrphl7xw9u6T6AGAc7h ekvKmNOG43sI4Y5dMDt2Z467EJ80jKL+/vE2+e+qXcvKolRW6rSpLL9+NW536JUm68 l5ji76YIXXpes0WCqMHSEbpZ0nmHTa1DKkbgvX11NH1g4vT9eJnV9x0d8uwHDuHm6V p0rNfo+QXIATmJbcI45NCtqa9CNjNLCeZktbKKmmDOSGX1rKJ4EkyJJj0WAacGuM/I eFatMxrfMoVLZqxo+k2ByCYAlb4BVfR3nu/6MsUR3F2DD0y7ZKZ9hj8DsBDfL5het9 4FWeUoRwSthtA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 10 Feb 2025 12:48:06 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 4DB3C13ED4A; Mon, 10 Feb 2025 12:48:06 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 3D028280789; Mon, 10 Feb 2025 12:48:06 +1300 (NZDT) From: Chris Packham To: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, tsbogend@alpha.franken.de Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Chris Packham Subject: [PATCH net-next 2/5] dt-bindings: net: Add switch ports and interrupts to RTL9300 Date: Mon, 10 Feb 2025 12:47:48 +1300 Message-ID: <20250209234751.460404-3-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> References: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=QNvLRRLL c=1 sm=1 tr=0 ts=67a93eb6 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T2h4t0Lz3GQA:10 a=VwQbUJbxAAAA:8 a=ONnuDqgNxj6Q2WPecnAA:9 a=3ZKOabzyN94A:10 a=o4McRIDJWpQDfD5EwD6I:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add bindings for the ethernet-switch and interrupt properties for the RTL9300. Signed-off-by: Chris Packham --- Notes: This is tecnically v7 of [1] changes from that are: - Use ethernet-switch.yaml#/$defs/ethernet-ports - Enforce "ethernet-ports" be used instead of just "ports" - Add interrupts for the switch block [1] - https://lore.kernel.org/lkml/20250204030249.1965444-2-chris.packham@alliedtelesis.co.nz/ .../bindings/net/realtek,rtl9301-switch.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml index d0a93d5f03aa..5d29647bea2d 100644 --- a/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml +++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml @@ -14,6 +14,8 @@ description: number of different peripherals are accessed through a common register block, represented here as a syscon node. +$ref: ethernet-switch.yaml#/$defs/ethernet-ports + properties: compatible: items: @@ -28,12 +30,23 @@ properties: reg: maxItems: 1 + interrupts: + maxItems: 2 + + interrupt-names: + items: + - const: switch + - const: nic + '#address-cells': const: 1 '#size-cells': const: 1 + ethernet-ports: + type: object + patternProperties: 'reboot@[0-9a-f]+$': $ref: /schemas/power/reset/syscon-reboot.yaml# @@ -44,6 +57,8 @@ patternProperties: required: - compatible - reg + - interrupts + - interrupt-names additionalProperties: false @@ -52,6 +67,9 @@ examples: ethernet-switch@1b000000 { compatible = "realtek,rtl9301-switch", "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + interrupt-parent = <&intc>; + interrupts = <23>, <24>; + interrupt-names = "switch", "nic"; #address-cells = <1>; #size-cells = <1>; @@ -110,5 +128,17 @@ examples: }; }; }; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + }; + port@1 { + reg = <1>; + }; + }; }; From patchwork Sun Feb 9 23:47:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13967165 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (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 AC2F11B0F16 for ; Sun, 9 Feb 2025 23:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144894; cv=none; b=KNR8uCtJQsSUi7Eggnt6AQI627bD2QmCJnJ6JjWbkjSagyNITfbjET4fvuzF6r9N6UsCafmBPEjUWniFYEUk5VJE/UmLWVu8B8C1f5xbgra/YK70tnScnHJ3Aw2gSI2R8q/Ob5m5HVCH4t5ODX//mRbQFjYbgQRxp7fwuvAcCjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144894; c=relaxed/simple; bh=vRCgLpcUVx0wKULsadSL0xFdXjndGNJOD53CNfruH70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CMXxuTjtxwTN8VqekRnmTan6/lwBMFva7tuV4MjyaLEKpK3NtFt9/HRhBXjT/Vjhc+AJiPrgzEZp5AJHmmvpX4wSGjd6q4oXa1V3lPSHFOFjUKxpvgTTAabWdjZBbWq3psLMAFnG9OHesQZikNNOHobUhYCv3Fue5pPFP2vWzbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=ffV6HIhR; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="ffV6HIhR" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 2E9BF2C047F; Mon, 10 Feb 2025 12:48:11 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1739144891; bh=xOKn8zxK8enZbzoMFVOYM1tSF7siyAiiWT9kTl1Kl4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ffV6HIhRnMQGuHostvhfLE2ta89z9W6K09pbkmj+IEvs5xvKMdKh1ja0xpbYaoptu 3fKIt2/Y/t71PktSQ0B6VRgsW2mp09TyfV/3Te3SJivaKkGihm53HCoF63NqhqJJGv v3wxad93oz6EeQ1TVpIVheTuYI06GCbkOpMaHFvEaCIIxEXmhgA+458qRW1zJ9Y2gd tDO4hl1acFonNwry1UTqPvCOWBAD/G4/Ub/6mggPX6+3IdWJlaNygqOM/FSG0R+CVs rwPPbxZwMClkg5XXDOnzgwX6ZUwNdentfKehEjAO/2xmxV8Nh87slYIzI5ziRU8yyQ gYtJDdXtWNF+A== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 10 Feb 2025 12:48:10 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id BD6A613ED4A; Mon, 10 Feb 2025 12:48:10 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id ABECB280789; Mon, 10 Feb 2025 12:48:10 +1300 (NZDT) From: Chris Packham To: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, tsbogend@alpha.franken.de Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Chris Packham Subject: [PATCH net-next 3/5] dt-bindings: net: Add Realtek MDIO controller Date: Mon, 10 Feb 2025 12:47:49 +1300 Message-ID: <20250209234751.460404-4-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> References: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=QNvLRRLL c=1 sm=1 tr=0 ts=67a93eba a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T2h4t0Lz3GQA:10 a=VwQbUJbxAAAA:8 a=gEfo2CItAAAA:8 a=c9Y0P7eFa9iVWmZcgD4A:9 a=3ZKOabzyN94A:10 a=sptkURWiP4Gy88Gu7hUp:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add dtschema for the MDIO controller found in the RTL9300 Ethernet switch. The controller is slightly unusual in that direct MDIO communication is not possible. We model the MDIO controller with the MDIO buses as child nodes and the PHYs as children of the buses. The mapping of switch port number to MDIO bus/addr requires the ethernet-ports sibling to provide the mapping via the phy-handle property. Signed-off-by: Chris Packham --- Notes: This is technically v7 of [1] and [2] which are combined now that rtl9301-switch.yaml under net/ the only change from those is that the $ref: in rtl9301-switch.yaml can now use a relative path I could technically do away with the reg property on the mdio-controller node. I don't currently need to use it in my driver and it looks like the register offsets are the same between the RTL9300 and RTL9310. [1] - https://lore.kernel.org/lkml/20250204030249.1965444-6-chris.packham@alliedtelesis.co.nz/ [2] - https://lore.kernel.org/lkml/20250204030249.1965444-4-chris.packham@alliedtelesis.co.nz/ .../bindings/net/realtek,rtl9301-mdio.yaml | 86 +++++++++++++++++++ .../bindings/net/realtek,rtl9301-switch.yaml | 31 +++++++ 2 files changed, 117 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml new file mode 100644 index 000000000000..02e4e33e9969 --- /dev/null +++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/realtek,rtl9301-mdio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Realtek RTL9300 MDIO Controller + +maintainers: + - Chris Packham + +properties: + compatible: + oneOf: + - items: + - enum: + - realtek,rtl9302b-mdio + - realtek,rtl9302c-mdio + - realtek,rtl9303-mdio + - const: realtek,rtl9301-mdio + - const: realtek,rtl9301-mdio + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + reg: + maxItems: 1 + +patternProperties: + '^mdio-bus@[0-3]$': + $ref: mdio.yaml# + + properties: + reg: + maxItems: 1 + + required: + - reg + + patternProperties: + '^ethernet-phy@[a-f0-9]+$': + type: object + $ref: ethernet-phy.yaml# + unevaluatedProperties: false + + unevaluatedProperties: false + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + mdio-controller@ca00 { + compatible = "realtek,rtl9301-mdio"; + reg = <0xca00 0x200>; + #address-cells = <1>; + #size-cells = <0>; + + mdio-bus@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <0>; + }; + }; + + mdio-bus@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <0>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml index 5d29647bea2d..80eabc170669 100644 --- a/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml +++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml @@ -54,6 +54,9 @@ patternProperties: 'i2c@[0-9a-f]+$': $ref: /schemas/i2c/realtek,rtl9301-i2c.yaml# + 'mdio-controller@[0-9a-f]+$': + $ref: realtek,rtl9301-mdio.yaml# + required: - compatible - reg @@ -129,15 +132,43 @@ examples: }; }; + mdio-controller@ca00 { + compatible = "realtek,rtl9301-mdio"; + reg = <0xca00 0x200>; + #address-cells = <1>; + #size-cells = <0>; + + mdio-bus@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + phy1: ethernet-phy@0 { + reg = <0>; + }; + }; + mdio-bus@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + phy2: ethernet-phy@0 { + reg = <0>; + }; + }; + }; + ethernet-ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; + phy-handle = <&phy1>; }; port@1 { reg = <1>; + phy-handle = <&phy2>; }; }; }; From patchwork Sun Feb 9 23:47:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13967166 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (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 8D9571B4154 for ; Sun, 9 Feb 2025 23:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144898; cv=none; b=ekxDqSLv6HWt58OzzmgqmmJrd+gbVKFtrs38t3Kp9BdE8TZOpgCKVQdQqCf4bLtVv5yAXVj0AnuQdrrp3VmoiLkZPsG5rrwPXn0/sbyOjptuKtkaGoSuXKe/e4b7vvpbW9qgLCATHs3IWy3oOyq3t9AHJlmAuLDehA37inyRWDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144898; c=relaxed/simple; bh=ruLYddTOT07Jf51VjD0tiKsSuUPQNuBrVQvIum8QX0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nhtdWIq29xnb5kjwJ4dQg5kZM21fGHHxJS8gTuqfJY8s6rhwgeY5Z+sST3j3kod/AwHSpS80AVTAkILvvg1c6ax+fzixmOwkGNKEX1SM0m2iCsr9Q4HZtL7NlCPKYBHqUJTY47zF3tRttZZJuW1BmFVXnk0XDx/MPIagNZCm/I0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=Nr8JU9xO; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="Nr8JU9xO" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 5A2C92C03DE; Mon, 10 Feb 2025 12:48:15 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1739144895; bh=7Hz9wEMK0CGbnko5fjaTgnXMWOgCcf1nXU3UkRtjmGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nr8JU9xOG6paHdZVK5h+K4ypmlsMtZQMmYSjARJX3emNmzQeB9nBhYtj5rzlrQFo+ OW3bvnvc8QBcV81GeYlOav8Fo6oC1R0uBIOqu+GkcXuzNWAucuMApdDL6Kb6KiPK5y TNgAKrfvRDkM6TPdssvXCBDS/oiBEfNs8URcNSaLaV24dLmp5pcmCX6HoHPXH6zX6E FoO0n+GVDkoo7QM96k0O8fwd2ifmaIpUsgaQBTPkq457I9KKRdmA5/7uIdKLWvDTd1 8aDt0sFwq9rRk2F8sGJdYCKwGWUBnkq3KOoWsVg5WTO5iWvOVGENoPIdJznicQjXx9 Phln7ykzvVePw== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 10 Feb 2025 12:48:15 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 2C6C813ED4A; Mon, 10 Feb 2025 12:48:15 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 1B8A4280789; Mon, 10 Feb 2025 12:48:15 +1300 (NZDT) From: Chris Packham To: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, tsbogend@alpha.franken.de Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Chris Packham Subject: [PATCH net-next 4/5] mips: dts: realtek: Add switch interrupts Date: Mon, 10 Feb 2025 12:47:50 +1300 Message-ID: <20250209234751.460404-5-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> References: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=QNvLRRLL c=1 sm=1 tr=0 ts=67a93ebf a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T2h4t0Lz3GQA:10 a=UJtzyOLMF9nqRlb5STYA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add interrupts for the rtl9301-switch. Signed-off-by: Chris Packham --- arch/mips/boot/dts/realtek/rtl930x.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/boot/dts/realtek/rtl930x.dtsi b/arch/mips/boot/dts/realtek/rtl930x.dtsi index 17577457d159..beb5ab41cb64 100644 --- a/arch/mips/boot/dts/realtek/rtl930x.dtsi +++ b/arch/mips/boot/dts/realtek/rtl930x.dtsi @@ -33,6 +33,9 @@ lx_clk: clock-175mhz { switch0: switch@1b000000 { compatible = "realtek,rtl9301-switch", "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + interrupt-parent = <&intc>; + interrupts = <23>, <24>; + interrupt-names = "switch", "nic"; #address-cells = <1>; #size-cells = <1>; From patchwork Sun Feb 9 23:47:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13967167 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (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 03B031B85CA for ; Sun, 9 Feb 2025 23:48:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144902; cv=none; b=GiPM96MTtlHAtOVLwjFjLdUhmz9Wdp6fNaUUhkYXhD+bQKsbAyCO1zPfGTGbhclnTOkfExg35heNv0TwNEVVJ6sy1q4BwqyNOIi0bwHJyrVWPdlo/3GkyIyZD/SXeRaOArKKkY4WcrRRx4J2zjZhzqPakJ9hgu4IQcxxa25YnFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739144902; c=relaxed/simple; bh=a6UE8wMAI9FZv9/ryS9Bcv0eROubbnj/uI47miCzcbY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EXeOlbWaQE5qH3mRf+FU9dyzaQKnBlXsYCDifuSg/N8Qjb+pGkB3arZpGx1KZv1UxhbB0KUFjt2WvgHuNi33IhMddwSFYcGGZMHoUYIqlPPfUcDZQd0QkoathK26HG6pUA2m/qxZi032VlElVxFKDipRKXOFxgQ7OTVkopW+Crw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=YZBKIMA4; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="YZBKIMA4" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id B1F3A2C03DE; Mon, 10 Feb 2025 12:48:19 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1739144899; bh=l/upjVotxSoO3Ct3ZBm+CDlsrjYDM2i5ETyqoJk0qzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YZBKIMA49aPw2Zwiy4uyVrZqabdC6EeVmEfnSsRP70m685bXQL/jEpL/X/jasdwcZ M5sLaAFvrf3A/SI/avxfbWtuzB4Sa+6HgdbqwT/QqzpbjAWORvKAiJd7EY5r8f1YfK sXabkSZtwFxNOXwNy2EJzi3mVIsvPOn8e8sRgwbOoqu32Qhtrq8oaaM4DgvQ4yv180 sNAsrpLios1m6gvUiCetrZJMSg+SGo3s/Kr3/kaxv7IQzaYqqHmKmTm3Qq7neU7QA3 QpoYSAL/xDk0o4kvgzis4CT4+ioI2IuvFh5C0zvyNRvq5cBfWMUVli7ilqGW7Pqfg9 DLTDhxqEjLbww== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 10 Feb 2025 12:48:19 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 63BF813ED4A; Mon, 10 Feb 2025 12:48:19 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 53040280789; Mon, 10 Feb 2025 12:48:19 +1300 (NZDT) From: Chris Packham To: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, tsbogend@alpha.franken.de Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Chris Packham Subject: [PATCH net-next 5/5] mips: dts: cameo-rtl9302c: Add switch block Date: Mon, 10 Feb 2025 12:47:51 +1300 Message-ID: <20250209234751.460404-6-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> References: <20250209234751.460404-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=QNvLRRLL c=1 sm=1 tr=0 ts=67a93ec3 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T2h4t0Lz3GQA:10 a=VwQbUJbxAAAA:8 a=PSQZVNSXpqiPPuIuS3oA:9 a=3ZKOabzyN94A:10 a=Ouh7WndvZ0esTx3naE_M:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add the switch port and phys to the cameo-rtl9302c-2x-rtl8224-2xge board. Signed-off-by: Chris Packham --- Notes: This is technically v7 of [1]. Differences from that are that I've omitted the MDIO busses and PHYs while I'm trying to sort out the switch bindings. I'll add these back in a follow up series. [1] - https://lore.kernel.org/lkml/20250204030249.1965444-7-chris.packham@alliedtelesis.co.nz/ .../cameo-rtl9302c-2x-rtl8224-2xge.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts b/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts index 6789bf374044..51306c104b01 100644 --- a/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts +++ b/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts @@ -71,3 +71,51 @@ partition@1180000 { }; }; }; + +&switch0 { + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + phy-mode = "usxgmii"; + }; + port@1 { + reg = <1>; + phy-mode = "usxgmii"; + }; + port@2 { + reg = <2>; + phy-mode = "usxgmii"; + }; + port@3 { + reg = <3>; + phy-mode = "usxgmii"; + }; + port@16 { + reg = <16>; + phy-mode = "usxgmii"; + }; + port@17 { + reg = <17>; + phy-mode = "usxgmii"; + }; + port@18 { + reg = <18>; + phy-mode = "usxgmii"; + }; + port@19 { + reg = <19>; + phy-mode = "usxgmii"; + }; + port@24{ + reg = <24>; + phy-mode = "10gbase-r"; + }; + port@25{ + reg = <25>; + phy-mode = "10gbase-r"; + }; + }; +};