xref: /freebsd/sys/contrib/device-tree/Bindings/phy/ti,phy-gmii-sel.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot# Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
3c66ec88fSEmmanuel Vadot%YAML 1.2
4c66ec88fSEmmanuel Vadot---
5*fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/phy/ti,phy-gmii-sel.yaml#
6*fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7c66ec88fSEmmanuel Vadot
88bab661aSEmmanuel Vadottitle: CPSW Port's Interface Mode Selection PHY
9c66ec88fSEmmanuel Vadot
10c66ec88fSEmmanuel Vadotmaintainers:
11c66ec88fSEmmanuel Vadot  - Kishon Vijay Abraham I <kishon@ti.com>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription: |
14c66ec88fSEmmanuel Vadot  TI am335x/am437x/dra7(am5)/dm814x CPSW3G Ethernet Subsystem supports
15c66ec88fSEmmanuel Vadot  two 10/100/1000 Ethernet ports with selectable G/MII, RMII, and RGMII interfaces.
16c66ec88fSEmmanuel Vadot  The interface mode is selected by configuring the MII mode selection register(s)
17c66ec88fSEmmanuel Vadot  (GMII_SEL) in the System Control Module chapter (SCM). GMII_SEL register(s) and
18c66ec88fSEmmanuel Vadot  bit fields placement in SCM are different between SoCs while fields meaning
19c66ec88fSEmmanuel Vadot  is the same.
20c66ec88fSEmmanuel Vadot                                               +--------------+
21c66ec88fSEmmanuel Vadot        +-------------------------------+      |SCM           |
22c66ec88fSEmmanuel Vadot        |                     CPSW      |      |  +---------+ |
23c66ec88fSEmmanuel Vadot        |        +--------------------------------+gmii_sel | |
24c66ec88fSEmmanuel Vadot        |        |                      |      |  +---------+ |
25c66ec88fSEmmanuel Vadot        |   +----v---+     +--------+   |      +--------------+
26c66ec88fSEmmanuel Vadot        |   |Port 1..<--+-->GMII/MII<------->
27c66ec88fSEmmanuel Vadot        |   |        |  |  |        |   |
28c66ec88fSEmmanuel Vadot        |   +--------+  |  +--------+   |
29c66ec88fSEmmanuel Vadot        |               |               |
30c66ec88fSEmmanuel Vadot        |               |  +--------+   |
31c66ec88fSEmmanuel Vadot        |               |  | RMII   <------->
32c66ec88fSEmmanuel Vadot        |               +-->        |   |
33c66ec88fSEmmanuel Vadot        |               |  +--------+   |
34c66ec88fSEmmanuel Vadot        |               |               |
35c66ec88fSEmmanuel Vadot        |               |  +--------+   |
36c66ec88fSEmmanuel Vadot        |               |  | RGMII  <------->
37c66ec88fSEmmanuel Vadot        |               +-->        |   |
38c66ec88fSEmmanuel Vadot        |                  +--------+   |
39c66ec88fSEmmanuel Vadot        +-------------------------------+
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  CPSW Port's Interface Mode Selection PHY describes MII interface mode between
42c66ec88fSEmmanuel Vadot  CPSW Port and Ethernet PHY which depends on Eth PHY and board configuration.
43c66ec88fSEmmanuel Vadot  |
44c66ec88fSEmmanuel Vadot  CPSW Port's Interface Mode Selection PHY device should defined as child device
45c66ec88fSEmmanuel Vadot  of SCM node (scm_conf) and can be attached to each CPSW port node using standard
46c66ec88fSEmmanuel Vadot  PHY bindings.
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadotproperties:
49c66ec88fSEmmanuel Vadot  compatible:
50c66ec88fSEmmanuel Vadot    enum:
51c66ec88fSEmmanuel Vadot      - ti,am3352-phy-gmii-sel
52c66ec88fSEmmanuel Vadot      - ti,dra7xx-phy-gmii-sel
53c66ec88fSEmmanuel Vadot      - ti,am43xx-phy-gmii-sel
54c66ec88fSEmmanuel Vadot      - ti,dm814-phy-gmii-sel
55c66ec88fSEmmanuel Vadot      - ti,am654-phy-gmii-sel
567ef62cebSEmmanuel Vadot      - ti,j7200-cpsw5g-phy-gmii-sel
578bab661aSEmmanuel Vadot      - ti,j721e-cpsw9g-phy-gmii-sel
58*fac71e4eSEmmanuel Vadot      - ti,j784s4-cpsw9g-phy-gmii-sel
59c66ec88fSEmmanuel Vadot
60c66ec88fSEmmanuel Vadot  reg:
615def4c47SEmmanuel Vadot    maxItems: 1
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel Vadot  '#phy-cells': true
64c66ec88fSEmmanuel Vadot
657ef62cebSEmmanuel Vadot  ti,qsgmii-main-ports:
667ef62cebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
677ef62cebSEmmanuel Vadot    description: |
688bab661aSEmmanuel Vadot      Required only for QSGMII mode. Array to select the port/s for QSGMII
698bab661aSEmmanuel Vadot      main mode. The size of the array corresponds to the number of QSGMII
708bab661aSEmmanuel Vadot      interfaces and thus, the number of distinct QSGMII main ports,
718bab661aSEmmanuel Vadot      supported by the device. If the device supports two QSGMII interfaces
728bab661aSEmmanuel Vadot      but only one QSGMII interface is desired, repeat the QSGMII main port
738bab661aSEmmanuel Vadot      value corresponding to the QSGMII interface in the array.
748bab661aSEmmanuel Vadot    minItems: 1
758bab661aSEmmanuel Vadot    maxItems: 2
767ef62cebSEmmanuel Vadot    items:
777ef62cebSEmmanuel Vadot      minimum: 1
788bab661aSEmmanuel Vadot      maximum: 8
797ef62cebSEmmanuel Vadot
80c66ec88fSEmmanuel VadotallOf:
81c66ec88fSEmmanuel Vadot  - if:
82c66ec88fSEmmanuel Vadot      properties:
83c66ec88fSEmmanuel Vadot        compatible:
84c66ec88fSEmmanuel Vadot          contains:
85c66ec88fSEmmanuel Vadot            enum:
86c66ec88fSEmmanuel Vadot              - ti,dra7xx-phy-gmii-sel
87c66ec88fSEmmanuel Vadot              - ti,dm814-phy-gmii-sel
88c66ec88fSEmmanuel Vadot              - ti,am654-phy-gmii-sel
898bab661aSEmmanuel Vadot              - ti,j7200-cpsw5g-phy-gmii-sel
908bab661aSEmmanuel Vadot              - ti,j721e-cpsw9g-phy-gmii-sel
91*fac71e4eSEmmanuel Vadot              - ti,j784s4-cpsw9g-phy-gmii-sel
92c66ec88fSEmmanuel Vadot    then:
93c66ec88fSEmmanuel Vadot      properties:
94c66ec88fSEmmanuel Vadot        '#phy-cells':
95c66ec88fSEmmanuel Vadot          const: 1
96c66ec88fSEmmanuel Vadot          description: CPSW port number (starting from 1)
977ef62cebSEmmanuel Vadot
987ef62cebSEmmanuel Vadot  - if:
998bab661aSEmmanuel Vadot      properties:
1008bab661aSEmmanuel Vadot        compatible:
1018bab661aSEmmanuel Vadot          contains:
1028bab661aSEmmanuel Vadot            enum:
1038bab661aSEmmanuel Vadot              - ti,j7200-cpsw5g-phy-gmii-sel
1048bab661aSEmmanuel Vadot    then:
1058bab661aSEmmanuel Vadot      properties:
1068bab661aSEmmanuel Vadot        ti,qsgmii-main-ports:
1078bab661aSEmmanuel Vadot          maxItems: 1
1088bab661aSEmmanuel Vadot          items:
1098bab661aSEmmanuel Vadot            minimum: 1
1108bab661aSEmmanuel Vadot            maximum: 4
1118bab661aSEmmanuel Vadot
1128bab661aSEmmanuel Vadot  - if:
1138bab661aSEmmanuel Vadot      properties:
1148bab661aSEmmanuel Vadot        compatible:
1158bab661aSEmmanuel Vadot          contains:
1168bab661aSEmmanuel Vadot            enum:
1178bab661aSEmmanuel Vadot              - ti,j721e-cpsw9g-phy-gmii-sel
118*fac71e4eSEmmanuel Vadot              - ti,j784s4-cpsw9g-phy-gmii-sel
1198bab661aSEmmanuel Vadot    then:
1208bab661aSEmmanuel Vadot      properties:
1218bab661aSEmmanuel Vadot        ti,qsgmii-main-ports:
1228bab661aSEmmanuel Vadot          minItems: 2
1238bab661aSEmmanuel Vadot          maxItems: 2
1248bab661aSEmmanuel Vadot          items:
1258bab661aSEmmanuel Vadot            minimum: 1
1268bab661aSEmmanuel Vadot            maximum: 8
1278bab661aSEmmanuel Vadot
1288bab661aSEmmanuel Vadot  - if:
1297ef62cebSEmmanuel Vadot      not:
1307ef62cebSEmmanuel Vadot        properties:
1317ef62cebSEmmanuel Vadot          compatible:
1327ef62cebSEmmanuel Vadot            contains:
1337ef62cebSEmmanuel Vadot              enum:
1347ef62cebSEmmanuel Vadot                - ti,j7200-cpsw5g-phy-gmii-sel
1358bab661aSEmmanuel Vadot                - ti,j721e-cpsw9g-phy-gmii-sel
136*fac71e4eSEmmanuel Vadot                - ti,j784s4-cpsw9g-phy-gmii-sel
1377ef62cebSEmmanuel Vadot    then:
1387ef62cebSEmmanuel Vadot      properties:
1397ef62cebSEmmanuel Vadot        ti,qsgmii-main-ports: false
1407ef62cebSEmmanuel Vadot
141c66ec88fSEmmanuel Vadot  - if:
142c66ec88fSEmmanuel Vadot      properties:
143c66ec88fSEmmanuel Vadot        compatible:
144c66ec88fSEmmanuel Vadot          contains:
145c66ec88fSEmmanuel Vadot            enum:
146c66ec88fSEmmanuel Vadot              - ti,am3352-phy-gmii-sel
147c66ec88fSEmmanuel Vadot              - ti,am43xx-phy-gmii-sel
148c66ec88fSEmmanuel Vadot    then:
149c66ec88fSEmmanuel Vadot      properties:
150c66ec88fSEmmanuel Vadot        '#phy-cells':
151c66ec88fSEmmanuel Vadot          const: 2
152c66ec88fSEmmanuel Vadot          description: |
153c66ec88fSEmmanuel Vadot            - CPSW port number (starting from 1)
154c66ec88fSEmmanuel Vadot            - RMII refclk mode
155c66ec88fSEmmanuel Vadot
156c66ec88fSEmmanuel Vadotrequired:
157c66ec88fSEmmanuel Vadot  - compatible
158c66ec88fSEmmanuel Vadot  - reg
159c66ec88fSEmmanuel Vadot  - '#phy-cells'
160c66ec88fSEmmanuel Vadot
161c66ec88fSEmmanuel VadotadditionalProperties: false
162c66ec88fSEmmanuel Vadot
163c66ec88fSEmmanuel Vadotexamples:
164c66ec88fSEmmanuel Vadot  - |
1657ef62cebSEmmanuel Vadot    phy_gmii_sel: phy@650 {
166c66ec88fSEmmanuel Vadot        compatible = "ti,am3352-phy-gmii-sel";
167c66ec88fSEmmanuel Vadot        reg = <0x650 0x4>;
168c66ec88fSEmmanuel Vadot        #phy-cells = <2>;
169c66ec88fSEmmanuel Vadot    };
170