Commit 1abee69a authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'net-dsa-initial-support-for-maxlinear-mxl862xx-switches'

Daniel Golle says:

====================
net: dsa: initial support for MaxLinear MxL862xx switches

This series adds very basic DSA support for the MaxLinear MxL86252
(5x 2500Base-T PHYs) and MxL86282 (8x 2500Base-T PHYs) switches.
In addition to the 2.5G TP ports both switches also come with two
SerDes interfaces which can be used either to connect external PHYs
or SFP cages, or as CPU port when using the switch with this DSA driver.

MxL862xx integrates a firmware running on an embedded processor (based on
Zephyr RTOS). Host interaction uses a simple netlink-like API transported
over MDIO/MMD.

This series includes only what's needed to pass traffic between user
ports and the CPU port: relayed MDIO to internal PHYs, basic port
enable/disable, and CPU-port special tagging.

The SerDes interface of the CPU port is automatically configured by the
switch after reset using a board-specific configuration stored together
with the firmware in the flash chip attached to the switch, so no action
is needed from the driver to setup the interface mode of the CPU port.

Also MAC settings of the PHY ports are automatically configured, which
means the driver works fine with phylink_mac_ops being all no-op stubs.

Multiple follow up series will bring support for setting up the other
SerDes PCS interface (ie. not used for the CPU port), bridge, VLAN, ...
offloading, and support for using an 802.1Q-based special tag instead of
the proprietary 8-byte tag.
====================

Link: https://patch.msgid.link/cover.1770433307.git.daniel@makrotopia.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents ccb32726 23794bec
Loading
Loading
Loading
Loading
+161 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/dsa/maxlinear,mxl862xx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MaxLinear MxL862xx Ethernet Switch Family

maintainers:
  - Daniel Golle <daniel@makrotopia.org>

description:
  The MaxLinear MxL862xx switch family are multi-port Ethernet switches with
  integrated 2.5GE PHYs. The MxL86252 has five PHY ports and the MxL86282
  has eight PHY ports. Both models come with two 10 Gigabit/s SerDes
  interfaces to be used to connect external PHYs or SFP cages, or as CPU
  port.

allOf:
  - $ref: dsa.yaml#/$defs/ethernet-ports

properties:
  compatible:
    enum:
      - maxlinear,mxl86252
      - maxlinear,mxl86282

  reg:
    maxItems: 1
    description: MDIO address of the switch

  mdio:
    $ref: /schemas/net/mdio.yaml#
    unevaluatedProperties: false

required:
  - compatible
  - mdio
  - reg

unevaluatedProperties: false

examples:
  - |
    mdio {
        #address-cells = <1>;
        #size-cells = <0>;

        switch@0 {
            compatible = "maxlinear,mxl86282";
            reg = <0>;

            ethernet-ports {
                #address-cells = <1>;
                #size-cells = <0>;

                /* Microcontroller port */
                port@0 {
                    reg = <0>;
                    status = "disabled";
                };

                port@1 {
                    reg = <1>;
                    phy-handle = <&phy0>;
                    phy-mode = "internal";
                };

                port@2 {
                    reg = <2>;
                    phy-handle = <&phy1>;
                    phy-mode = "internal";
                };

                port@3 {
                    reg = <3>;
                    phy-handle = <&phy2>;
                    phy-mode = "internal";
                };

                port@4 {
                    reg = <4>;
                    phy-handle = <&phy3>;
                    phy-mode = "internal";
                };

                port@5 {
                    reg = <5>;
                    phy-handle = <&phy4>;
                    phy-mode = "internal";
                };

                port@6 {
                    reg = <6>;
                    phy-handle = <&phy5>;
                    phy-mode = "internal";
                };

                port@7 {
                    reg = <7>;
                    phy-handle = <&phy6>;
                    phy-mode = "internal";
                };

                port@8 {
                    reg = <8>;
                    phy-handle = <&phy7>;
                    phy-mode = "internal";
                };

                port@9 {
                    reg = <9>;
                    label = "cpu";
                    ethernet = <&gmac0>;
                    phy-mode = "usxgmii";

                    fixed-link {
                        speed = <10000>;
                        full-duplex;
                    };
                };
            };

            mdio {
                #address-cells = <1>;
                #size-cells = <0>;

                phy0: ethernet-phy@0 {
                    reg = <0>;
                };

                phy1: ethernet-phy@1 {
                    reg = <1>;
                };

                phy2: ethernet-phy@2 {
                    reg = <2>;
                };

                phy3: ethernet-phy@3 {
                    reg = <3>;
                };

                phy4: ethernet-phy@4 {
                    reg = <4>;
                };

                phy5: ethernet-phy@5 {
                    reg = <5>;
                };

                phy6: ethernet-phy@6 {
                    reg = <6>;
                };

                phy7: ethernet-phy@7 {
                    reg = <7>;
                };
            };
        };
    };
+8 −0
Original line number Diff line number Diff line
@@ -15626,6 +15626,14 @@ S: Supported
F:	drivers/net/phy/mxl-86110.c
F:	drivers/net/phy/mxl-gpy.c
MAXLINEAR MXL862XX SWITCH DRIVER
M:	Daniel Golle <daniel@makrotopia.org>
L:	netdev@vger.kernel.org
S:	Maintained
F:	Documentation/devicetree/bindings/net/dsa/maxlinear,mxl862xx.yaml
F:	drivers/net/dsa/mxl862xx/
F:	net/dsa/tag_mxl862xx.c
MCAN DEVICE DRIVER
M:	Markus Schneider-Pargmann <msp@baylibre.com>
L:	linux-can@vger.kernel.org
+2 −0
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ source "drivers/net/dsa/microchip/Kconfig"

source "drivers/net/dsa/mv88e6xxx/Kconfig"

source "drivers/net/dsa/mxl862xx/Kconfig"

source "drivers/net/dsa/ocelot/Kconfig"

source "drivers/net/dsa/qca/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ obj-y += hirschmann/
obj-y				+= lantiq/
obj-y				+= microchip/
obj-y				+= mv88e6xxx/
obj-y				+= mxl862xx/
obj-y				+= ocelot/
obj-y				+= qca/
obj-y				+= realtek/
+12 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
config NET_DSA_MXL862
	tristate "MaxLinear MxL862xx"
	depends on NET_DSA
	select MAXLINEAR_GPHY
	select NET_DSA_TAG_MXL_862XX
	help
	  This enables support for the MaxLinear MxL862xx switch family.
	  These switches have two 10GE SerDes interfaces, one typically
	  used as CPU port.
	   - MxL86282 has eight 2.5 Gigabit PHYs
	   - MxL86252 has five 2.5 Gigabit PHYs
Loading