* [PATCH net-next 1/5] dt-bindings: net: Move realtek,rtl9301-switch to net
2025-02-09 23:47 [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Chris Packham
@ 2025-02-09 23:47 ` Chris Packham
2025-02-09 23:47 ` [PATCH net-next 2/5] dt-bindings: net: Add switch ports and interrupts to RTL9300 Chris Packham
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2025-02-09 23:47 UTC (permalink / raw)
To: lee, robh, krzk+dt, conor+dt, andrew+netdev, davem, edumazet,
kuba, pabeni, tsbogend
Cc: linux-kernel, netdev, linux-mips, devicetree, Chris Packham
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 <chris.packham@alliedtelesis.co.nz>
---
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
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 2/5] dt-bindings: net: Add switch ports and interrupts to RTL9300
2025-02-09 23:47 [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Chris Packham
2025-02-09 23:47 ` [PATCH net-next 1/5] dt-bindings: net: Move realtek,rtl9301-switch to net Chris Packham
@ 2025-02-09 23:47 ` Chris Packham
2025-02-09 23:47 ` [PATCH net-next 3/5] dt-bindings: net: Add Realtek MDIO controller Chris Packham
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2025-02-09 23:47 UTC (permalink / raw)
To: lee, robh, krzk+dt, conor+dt, andrew+netdev, davem, edumazet,
kuba, pabeni, tsbogend
Cc: linux-kernel, netdev, linux-mips, devicetree, Chris Packham
Add bindings for the ethernet-switch and interrupt properties for the
RTL9300.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
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>;
+ };
+ };
};
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 3/5] dt-bindings: net: Add Realtek MDIO controller
2025-02-09 23:47 [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Chris Packham
2025-02-09 23:47 ` [PATCH net-next 1/5] dt-bindings: net: Move realtek,rtl9301-switch to net Chris Packham
2025-02-09 23:47 ` [PATCH net-next 2/5] dt-bindings: net: Add switch ports and interrupts to RTL9300 Chris Packham
@ 2025-02-09 23:47 ` Chris Packham
2025-02-09 23:47 ` [PATCH net-next 4/5] mips: dts: realtek: Add switch interrupts Chris Packham
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2025-02-09 23:47 UTC (permalink / raw)
To: lee, robh, krzk+dt, conor+dt, andrew+netdev, davem, edumazet,
kuba, pabeni, tsbogend
Cc: linux-kernel, netdev, linux-mips, devicetree, Chris Packham
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 <chris.packham@alliedtelesis.co.nz>
---
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 <chris.packham@alliedtelesis.co.nz>
+
+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>;
};
};
};
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 4/5] mips: dts: realtek: Add switch interrupts
2025-02-09 23:47 [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Chris Packham
` (2 preceding siblings ...)
2025-02-09 23:47 ` [PATCH net-next 3/5] dt-bindings: net: Add Realtek MDIO controller Chris Packham
@ 2025-02-09 23:47 ` Chris Packham
2025-02-09 23:47 ` [PATCH net-next 5/5] mips: dts: cameo-rtl9302c: Add switch block Chris Packham
2025-02-14 21:45 ` [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Jakub Kicinski
5 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2025-02-09 23:47 UTC (permalink / raw)
To: lee, robh, krzk+dt, conor+dt, andrew+netdev, davem, edumazet,
kuba, pabeni, tsbogend
Cc: linux-kernel, netdev, linux-mips, devicetree, Chris Packham
Add interrupts for the rtl9301-switch.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
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>;
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 5/5] mips: dts: cameo-rtl9302c: Add switch block
2025-02-09 23:47 [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Chris Packham
` (3 preceding siblings ...)
2025-02-09 23:47 ` [PATCH net-next 4/5] mips: dts: realtek: Add switch interrupts Chris Packham
@ 2025-02-09 23:47 ` Chris Packham
2025-02-14 21:45 ` [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Jakub Kicinski
5 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2025-02-09 23:47 UTC (permalink / raw)
To: lee, robh, krzk+dt, conor+dt, andrew+netdev, davem, edumazet,
kuba, pabeni, tsbogend
Cc: linux-kernel, netdev, linux-mips, devicetree, Chris Packham
Add the switch port and phys to the cameo-rtl9302c-2x-rtl8224-2xge
board.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
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";
+ };
+ };
+};
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch
2025-02-09 23:47 [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Chris Packham
` (4 preceding siblings ...)
2025-02-09 23:47 ` [PATCH net-next 5/5] mips: dts: cameo-rtl9302c: Add switch block Chris Packham
@ 2025-02-14 21:45 ` Jakub Kicinski
2025-02-18 14:55 ` Jakub Kicinski
5 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2025-02-14 21:45 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt
Cc: Chris Packham, lee, andrew+netdev, davem, edumazet, pabeni,
tsbogend, linux-kernel, netdev, linux-mips, devicetree
On Mon, 10 Feb 2025 12:47:46 +1300 Chris Packham wrote:
> dt-bindings: net: Move realtek,rtl9301-switch to net
> dt-bindings: net: Add switch ports and interrupts to RTL9300
> dt-bindings: net: Add Realtek MDIO controller
AFAIU we're waiting for a review from DT maintainers on this one,
is this series on your radar?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch
2025-02-14 21:45 ` [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch Jakub Kicinski
@ 2025-02-18 14:55 ` Jakub Kicinski
2025-02-18 19:43 ` Chris Packham
0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2025-02-18 14:55 UTC (permalink / raw)
To: Chris Packham
Cc: robh, krzk+dt, conor+dt, lee, andrew+netdev, davem, edumazet,
pabeni, tsbogend, linux-kernel, netdev, linux-mips, devicetree
On Fri, 14 Feb 2025 13:45:28 -0800 Jakub Kicinski wrote:
> On Mon, 10 Feb 2025 12:47:46 +1300 Chris Packham wrote:
> > dt-bindings: net: Move realtek,rtl9301-switch to net
> > dt-bindings: net: Add switch ports and interrupts to RTL9300
> > dt-bindings: net: Add Realtek MDIO controller
>
> AFAIU we're waiting for a review from DT maintainers on this one,
> is this series on your radar?
Not sure why we're getting no reviews here.
Chris, could you repost? Maybe we'll get this back into people's review
queues that way..
--
pw-bot: defer
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/5] dt-bindings: net: realtek,rtl9301-switch
2025-02-18 14:55 ` Jakub Kicinski
@ 2025-02-18 19:43 ` Chris Packham
0 siblings, 0 replies; 9+ messages in thread
From: Chris Packham @ 2025-02-18 19:43 UTC (permalink / raw)
To: Jakub Kicinski
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
lee@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, tsbogend@alpha.franken.de,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-mips@vger.kernel.org, devicetree@vger.kernel.org
Hi Jakub,
On 19/02/2025 03:55, Jakub Kicinski wrote:
> On Fri, 14 Feb 2025 13:45:28 -0800 Jakub Kicinski wrote:
>> On Mon, 10 Feb 2025 12:47:46 +1300 Chris Packham wrote:
>>> dt-bindings: net: Move realtek,rtl9301-switch to net
>>> dt-bindings: net: Add switch ports and interrupts to RTL9300
>>> dt-bindings: net: Add Realtek MDIO controller
>> AFAIU we're waiting for a review from DT maintainers on this one,
>> is this series on your radar?
> Not sure why we're getting no reviews here.
> Chris, could you repost? Maybe we'll get this back into people's review
> queues that way..
I know there have been some issues with gmail rejecting stuff coming
from our domain. I wasn't sure if it was that or if I'd just exhausted
the DT maintainers. Possibly both.
I'll send out the series again with a RESEND tag.
^ permalink raw reply [flat|nested] 9+ messages in thread