Commit 134d8368 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'net-ethernet-mtk_eth_soc-various-enhancements'

Daniel Golle says:

====================
net: ethernet: mtk_eth_soc: various enhancements

This series brings a variety of fixes and enhancements for mtk_eth_soc,
adds support for the MT7981 SoC and facilitates sharing the SGMII PCS
code between mtk_eth_soc and mt7530.

The whole series has been tested on MT7622+MT7531 (BPi-R64),
MT7623+MT7530 (BPi-R2), MT7981+GPY211 (GL.iNet GL-MT3000) and
MT7986+MT7531 (BPi-R3). On the BananaPi R3 a variete of SFP modules
have been tested, all of them (some SGMII with PHY, others 2500Base-X
or 1000Base-X without PHY) are working well now, however, some of them
need manually disabling of autonegotiation for the link to come up.
====================

Link: https://lore.kernel.org/r/cover.1679230025.git.daniel@makrotopia.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 56aecc0a 5b89aeae
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
MediaTek SGMIISYS controller
============================

The MediaTek SGMIISYS controller provides various clocks to the system.

Required Properties:

- compatible: Should be:
	- "mediatek,mt7622-sgmiisys", "syscon"
	- "mediatek,mt7629-sgmiisys", "syscon"
	- "mediatek,mt7981-sgmiisys_0", "syscon"
	- "mediatek,mt7981-sgmiisys_1", "syscon"
	- "mediatek,mt7986-sgmiisys_0", "syscon"
	- "mediatek,mt7986-sgmiisys_1", "syscon"
- #clock-cells: Must be 1

The SGMIISYS controller uses the common clk binding from
Documentation/devicetree/bindings/clock/clock-bindings.txt
The available clocks are defined in dt-bindings/clock/mt*-clk.h.

Example:

sgmiisys: sgmiisys@1b128000 {
	compatible = "mediatek,mt7622-sgmiisys", "syscon";
	reg = <0 0x1b128000 0 0x1000>;
	#clock-cells = <1>;
};
+48 −5
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ properties:
      - mediatek,mt7623-eth
      - mediatek,mt7622-eth
      - mediatek,mt7629-eth
      - mediatek,mt7981-eth
      - mediatek,mt7986-eth
      - ralink,rt5350-eth

@@ -78,6 +79,11 @@ properties:
    description:
      List of phandles to wireless ethernet dispatch nodes.

  mediatek,wed-pcie:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      Phandle to the mediatek wed-pcie controller.

  dma-coherent: true

  mdio-bus:
@@ -123,6 +129,8 @@ allOf:

        mediatek,wed: false

        mediatek,wed-pcie: false

  - if:
      properties:
        compatible:
@@ -160,6 +168,8 @@ allOf:
          description:
            Phandle to the mediatek pcie-mirror controller.

        mediatek,wed-pcie: false

  - if:
      properties:
        compatible:
@@ -206,6 +216,44 @@ allOf:

        mediatek,wed: false

        mediatek,wed-pcie: false

  - if:
      properties:
        compatible:
          contains:
            const: mediatek,mt7981-eth
    then:
      properties:
        interrupts:
          minItems: 4

        clocks:
          minItems: 15
          maxItems: 15

        clock-names:
          items:
            - const: fe
            - const: gp2
            - const: gp1
            - const: wocpu0
            - const: sgmii_ck
            - const: sgmii_tx250m
            - const: sgmii_rx250m
            - const: sgmii_cdr_ref
            - const: sgmii_cdr_fb
            - const: sgmii2_tx250m
            - const: sgmii2_rx250m
            - const: sgmii2_cdr_ref
            - const: sgmii2_cdr_fb
            - const: netsys0
            - const: netsys1

        mediatek,sgmiisys:
          minItems: 2
          maxItems: 2

  - if:
      properties:
        compatible:
@@ -242,11 +290,6 @@ allOf:
          minItems: 2
          maxItems: 2

        mediatek,wed-pcie:
          $ref: /schemas/types.yaml#/definitions/phandle
          description:
            Phandle to the mediatek wed-pcie controller.

patternProperties:
  "^mac@[0-1]$":
    type: object
+55 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/pcs/mediatek,sgmiisys.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek SGMIISYS Controller

maintainers:
  - Matthias Brugger <matthias.bgg@gmail.com>

description:
  The MediaTek SGMIISYS controller provides a SGMII PCS and some clocks
  to the ethernet subsystem to which it is attached.

properties:
  compatible:
    items:
      - enum:
          - mediatek,mt7622-sgmiisys
          - mediatek,mt7629-sgmiisys
          - mediatek,mt7981-sgmiisys_0
          - mediatek,mt7981-sgmiisys_1
          - mediatek,mt7986-sgmiisys_0
          - mediatek,mt7986-sgmiisys_1
      - const: syscon

  reg:
    maxItems: 1

  '#clock-cells':
    const: 1

  mediatek,pnswap:
    description: Invert polarity of the SGMII data lanes
    type: boolean

required:
  - compatible
  - reg
  - '#clock-cells'

additionalProperties: false

examples:
  - |
    soc {
      #address-cells = <2>;
      #size-cells = <2>;
      sgmiisys: syscon@1b128000 {
        compatible = "mediatek,mt7622-sgmiisys", "syscon";
        reg = <0 0x1b128000 0 0x1000>;
        #clock-cells = <1>;
      };
    };
+8 −0
Original line number Diff line number Diff line
@@ -13042,6 +13042,14 @@ L: netdev@vger.kernel.org
S:	Maintained
F:	drivers/net/ethernet/mediatek/
MEDIATEK ETHERNET PCS DRIVER
M:	Alexander Couzens <lynxis@fe80.eu>
M:	Daniel Golle <daniel@makrotopia.org>
L:	netdev@vger.kernel.org
S:	Maintained
F:	drivers/net/pcs/pcs-mtk-lynxi.c
F:	include/linux/pcs/pcs-mtk-lynxi.h
MEDIATEK I2C CONTROLLER DRIVER
M:	Qii Wang <qii.wang@mediatek.com>
L:	linux-i2c@vger.kernel.org
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ config NET_DSA_MT7530
	tristate "MediaTek MT7530 and MT7531 Ethernet switch support"
	select NET_DSA_TAG_MTK
	select MEDIATEK_GE_PHY
	select PCS_MTK_LYNXI
	help
	  This enables support for the MediaTek MT7530 and MT7531 Ethernet
	  switch chips. Multi-chip module MT7530 in MT7621AT, MT7621DAT,
Loading