diff mbox series

[net-next,v2,08/13] dt-bindings: net: dsa: realtek-mdio: document new interface

Message ID 20211218081425.18722-9-luizluca@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2,01/13] dt-bindings: net: dsa: realtek-smi: mark unsupported switches | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: robh+dt@kernel.org devicetree@vger.kernel.org kuba@kernel.org davem@davemloft.net
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: DT bindings should be in DT schema format. See: Documentation/devicetree/bindings/writing-schema.rst
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Luiz Angelo Daros de Luca Dec. 18, 2021, 8:14 a.m. UTC
realtek-mdio is a new mdio driver for realtek switches that use
mdio (instead of SMI) interface.

Reviewed-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
 .../bindings/net/dsa/realtek-mdio.txt         | 91 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 2 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt

Comments

Florian Fainelli Dec. 19, 2021, 7:57 p.m. UTC | #1
On 12/18/2021 12:14 AM, Luiz Angelo Daros de Luca wrote:
> realtek-mdio is a new mdio driver for realtek switches that use
> mdio (instead of SMI) interface.
> 
> Reviewed-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>

New bindings should be in YAML format, see:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/dsa/qca8k.yaml

for examples. Thanks
Arınç ÜNAL Dec. 19, 2021, 9:53 p.m. UTC | #2
On 18/12/2021 11:14, Luiz Angelo Daros de Luca wrote:
> realtek-mdio is a new mdio driver for realtek switches that use
> mdio (instead of SMI) interface.
> 
> Reviewed-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
> ---
>   .../bindings/net/dsa/realtek-mdio.txt         | 91 +++++++++++++++++++
>   MAINTAINERS                                   |  2 +-
>   2 files changed, 92 insertions(+), 1 deletion(-)
>   create mode 100644 Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt b/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
> new file mode 100644
> index 000000000000..71e0a3d09aeb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
> @@ -0,0 +1,91 @@
> +Realtek MDIO-based Switches
> +==========================
> +
> +Realtek MDIO-based switches use MDIO protocol as opposed to Realtek
> +SMI-based switches. The realtek-mdio driver is an mdio driver and it must
> +be inserted inside an mdio node.
> +
> +Required properties:
> +
> +- compatible: must be exactly one of (same as realtek-smi):
> +      "realtek,rtl8365mb" (4+1 ports)
> +      "realtek,rtl8366"               (not supported yet)
> +      "realtek,rtl8366rb" (4+1 ports)
> +      "realtek,rtl8366s"  (4+1 ports) (not supported yet)
> +      "realtek,rtl8367"               (not supported yet)
> +      "realtek,rtl8367b"              (not supported yet)
> +      "realtek,rtl8368s"  (8 port)    (not supported yet)
> +      "realtek,rtl8369"               (not supported yet)
> +      "realtek,rtl8370"   (8 port)    (not supported yet)
> +
> +Required properties:
> +- reg: MDIO PHY ID to access the switch
> +
> +Optional properties:
> +- realtek,disable-leds: if the LED drivers are not used in the
> +  hardware design this will disable them so they are not turned on
> +  and wasting power.
> +
> +See net/dsa/dsa.txt for a list of additional required and optional properties
> +and subnodes of DSA switches.
> +
> +Optional properties of dsa port:
> +
> +- realtek,ext-int: defines the external interface number (0, 1, 2). By default, 1.

You should introduce this with ("net: dsa: realtek: rtl8365mb: rename 
extport to extint, add "realtek,ext-int"") instead.
Arınç ÜNAL Dec. 20, 2021, 7:50 a.m. UTC | #3
On 20/12/2021 00:53, Arınç ÜNAL wrote:
> On 18/12/2021 11:14, Luiz Angelo Daros de Luca wrote:
>> realtek-mdio is a new mdio driver for realtek switches that use
>> mdio (instead of SMI) interface.
>>
>> Reviewed-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
>> ---
>>   .../bindings/net/dsa/realtek-mdio.txt         | 91 +++++++++++++++++++
>>   MAINTAINERS                                   |  2 +-
>>   2 files changed, 92 insertions(+), 1 deletion(-)
>>   create mode 100644 
>> Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt 
>> b/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
>> new file mode 100644
>> index 000000000000..71e0a3d09aeb
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
>> @@ -0,0 +1,91 @@
>> +Realtek MDIO-based Switches
>> +==========================
>> +
>> +Realtek MDIO-based switches use MDIO protocol as opposed to Realtek
>> +SMI-based switches. The realtek-mdio driver is an mdio driver and it 
>> must
>> +be inserted inside an mdio node.
>> +
>> +Required properties:
>> +
>> +- compatible: must be exactly one of (same as realtek-smi):
>> +      "realtek,rtl8365mb" (4+1 ports)
>> +      "realtek,rtl8366"               (not supported yet)
>> +      "realtek,rtl8366rb" (4+1 ports)
>> +      "realtek,rtl8366s"  (4+1 ports) (not supported yet)
>> +      "realtek,rtl8367"               (not supported yet)
>> +      "realtek,rtl8367b"              (not supported yet)
>> +      "realtek,rtl8368s"  (8 port)    (not supported yet)
>> +      "realtek,rtl8369"               (not supported yet)
>> +      "realtek,rtl8370"   (8 port)    (not supported yet)
>> +
>> +Required properties:
>> +- reg: MDIO PHY ID to access the switch
>> +
>> +Optional properties:
>> +- realtek,disable-leds: if the LED drivers are not used in the
>> +  hardware design this will disable them so they are not turned on
>> +  and wasting power.
>> +
>> +See net/dsa/dsa.txt for a list of additional required and optional 
>> properties
>> +and subnodes of DSA switches.
>> +
>> +Optional properties of dsa port:
>> +
>> +- realtek,ext-int: defines the external interface number (0, 1, 2). 
>> By default, 1.
> 
> You should introduce this with ("net: dsa: realtek: rtl8365mb: rename 
> extport to extint, add "realtek,ext-int"") instead.

Since the RTL8367S example has got to include "realtek,ext-int", you can 
add the example with ("net: dsa: realtek: rtl8365mb: add RTL8367S 
support") instead.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt b/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
new file mode 100644
index 000000000000..71e0a3d09aeb
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/dsa/realtek-mdio.txt
@@ -0,0 +1,91 @@ 
+Realtek MDIO-based Switches
+==========================
+
+Realtek MDIO-based switches use MDIO protocol as opposed to Realtek
+SMI-based switches. The realtek-mdio driver is an mdio driver and it must
+be inserted inside an mdio node.
+
+Required properties:
+
+- compatible: must be exactly one of (same as realtek-smi):
+      "realtek,rtl8365mb" (4+1 ports)
+      "realtek,rtl8366"               (not supported yet)
+      "realtek,rtl8366rb" (4+1 ports)
+      "realtek,rtl8366s"  (4+1 ports) (not supported yet)
+      "realtek,rtl8367"               (not supported yet)
+      "realtek,rtl8367b"              (not supported yet)
+      "realtek,rtl8368s"  (8 port)    (not supported yet)
+      "realtek,rtl8369"               (not supported yet)
+      "realtek,rtl8370"   (8 port)    (not supported yet)
+
+Required properties:
+- reg: MDIO PHY ID to access the switch
+
+Optional properties:
+- realtek,disable-leds: if the LED drivers are not used in the
+  hardware design this will disable them so they are not turned on
+  and wasting power.
+
+See net/dsa/dsa.txt for a list of additional required and optional properties
+and subnodes of DSA switches.
+
+Optional properties of dsa port:
+
+- realtek,ext-int: defines the external interface number (0, 1, 2). By default, 1.
+
+Examples:
+
+An example for the RTL8367S:
+
+&mdio0 {
+	switch {
+		compatible = "realtek,rtl8367s";
+		reg = <29>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;
+
+			port@0 {
+				reg = <0>;
+				label = "lan4";
+			};
+
+			port@1 {
+				reg = <1>;
+				label = "lan3";
+			};
+
+			port@2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			port@3 {
+				reg = <3>;
+				label = "lan1";
+			};
+
+			port@4 {
+				reg = <4>;
+				label = "wan";
+			};
+
+			port@7 {
+				reg = <7>;
+				ethernet = <&ethernet>;
+				phy-mode = "rgmii";
+				realtek,ext-int = <2>;
+				tx-internal-delay-ps = <2000>;
+				rx-internal-delay-ps = <0>;
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+		};
+	};
+};
+
diff --git a/MAINTAINERS b/MAINTAINERS
index a8f949b368a8..750f5c68c5fa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16152,7 +16152,7 @@  F:	sound/soc/codecs/rt*
 REALTEK RTL83xx SMI DSA ROUTER CHIPS
 M:	Linus Walleij <linus.walleij@linaro.org>
 S:	Maintained
-F:	Documentation/devicetree/bindings/net/dsa/realtek-smi.txt
+F:	Documentation/devicetree/bindings/net/dsa/realtek-*.txt
 F:	drivers/net/dsa/realtek/*
 
 REALTEK WIRELESS DRIVER (rtlwifi family)