xref: /freebsd/sys/contrib/device-tree/Bindings/net/pcs/snps,dw-xpcs.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
1*0e8011faSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*0e8011faSEmmanuel Vadot%YAML 1.2
3*0e8011faSEmmanuel Vadot---
4*0e8011faSEmmanuel Vadot$id: http://devicetree.org/schemas/net/pcs/snps,dw-xpcs.yaml#
5*0e8011faSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*0e8011faSEmmanuel Vadot
7*0e8011faSEmmanuel Vadottitle: Synopsys DesignWare Ethernet PCS
8*0e8011faSEmmanuel Vadot
9*0e8011faSEmmanuel Vadotmaintainers:
10*0e8011faSEmmanuel Vadot  - Serge Semin <fancer.lancer@gmail.com>
11*0e8011faSEmmanuel Vadot
12*0e8011faSEmmanuel Vadotdescription:
13*0e8011faSEmmanuel Vadot  Synopsys DesignWare Ethernet Physical Coding Sublayer provides an interface
14*0e8011faSEmmanuel Vadot  between Media Access Control and Physical Medium Attachment Sublayer through
15*0e8011faSEmmanuel Vadot  the Media Independent Interface (XGMII, USXGMII, XLGMII, GMII, etc)
16*0e8011faSEmmanuel Vadot  controlled by means of the IEEE std. Clause 45 registers set. The PCS can be
17*0e8011faSEmmanuel Vadot  optionally synthesized with a vendor-specific interface connected to
18*0e8011faSEmmanuel Vadot  Synopsys PMA (also called DesignWare Consumer/Enterprise PHY) although in
19*0e8011faSEmmanuel Vadot  general it can be used to communicate with any compatible PHY.
20*0e8011faSEmmanuel Vadot
21*0e8011faSEmmanuel Vadot  The PCS CSRs can be accessible either over the Ethernet MDIO bus or directly
22*0e8011faSEmmanuel Vadot  by means of the APB3/MCI interfaces. In the later case the XPCS can be mapped
23*0e8011faSEmmanuel Vadot  right to the system IO memory space.
24*0e8011faSEmmanuel Vadot
25*0e8011faSEmmanuel Vadotproperties:
26*0e8011faSEmmanuel Vadot  compatible:
27*0e8011faSEmmanuel Vadot    oneOf:
28*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with none or unknown PMA
29*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs
30*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen1 3G PMA
31*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen1-3g
32*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen2 3G PMA
33*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen2-3g
34*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen2 6G PMA
35*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen2-6g
36*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen4 3G PMA
37*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen4-3g
38*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen4 6G PMA
39*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen4-6g
40*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen5 10G PMA
41*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen5-10g
42*0e8011faSEmmanuel Vadot      - description: Synopsys DesignWare XPCS with Consumer Gen5 12G PMA
43*0e8011faSEmmanuel Vadot        const: snps,dw-xpcs-gen5-12g
44*0e8011faSEmmanuel Vadot
45*0e8011faSEmmanuel Vadot  reg:
46*0e8011faSEmmanuel Vadot    items:
47*0e8011faSEmmanuel Vadot      - description:
48*0e8011faSEmmanuel Vadot          In case of the MDIO management interface this just a 5-bits ID
49*0e8011faSEmmanuel Vadot          of the MDIO bus device. If DW XPCS CSRs space is accessed over the
50*0e8011faSEmmanuel Vadot          MCI or APB3 management interfaces, then the space mapping can be
51*0e8011faSEmmanuel Vadot          either 'direct' or 'indirect'. In the former case all Clause 45
52*0e8011faSEmmanuel Vadot          registers are contiguously mapped within the address space
53*0e8011faSEmmanuel Vadot          MMD '[20:16]', Reg '[15:0]'. In the later case the space is divided
54*0e8011faSEmmanuel Vadot          to the multiple 256 register sets. There is a special viewport CSR
55*0e8011faSEmmanuel Vadot          which is responsible for the set selection. The upper part of
56*0e8011faSEmmanuel Vadot          the CSR address MMD+REG[20:8] is supposed to be written in there
57*0e8011faSEmmanuel Vadot          so the corresponding subset would be mapped to the lowest 255 CSRs.
58*0e8011faSEmmanuel Vadot
59*0e8011faSEmmanuel Vadot  reg-names:
60*0e8011faSEmmanuel Vadot    items:
61*0e8011faSEmmanuel Vadot      - enum: [ direct, indirect ]
62*0e8011faSEmmanuel Vadot
63*0e8011faSEmmanuel Vadot  reg-io-width:
64*0e8011faSEmmanuel Vadot    description:
65*0e8011faSEmmanuel Vadot      The way the CSRs are mapped to the memory is platform depended. Since
66*0e8011faSEmmanuel Vadot      each Clause 45 CSR is of 16-bits wide the access instructions must be
67*0e8011faSEmmanuel Vadot      two bytes aligned at least.
68*0e8011faSEmmanuel Vadot    default: 2
69*0e8011faSEmmanuel Vadot    enum: [ 2, 4 ]
70*0e8011faSEmmanuel Vadot
71*0e8011faSEmmanuel Vadot  interrupts:
72*0e8011faSEmmanuel Vadot    description:
73*0e8011faSEmmanuel Vadot      System interface interrupt output (sbd_intr_o) indicating Clause 73/37
74*0e8011faSEmmanuel Vadot      auto-negotiation events':' Page received, AN is completed or incompatible
75*0e8011faSEmmanuel Vadot      link partner.
76*0e8011faSEmmanuel Vadot    maxItems: 1
77*0e8011faSEmmanuel Vadot
78*0e8011faSEmmanuel Vadot  clocks:
79*0e8011faSEmmanuel Vadot    description:
80*0e8011faSEmmanuel Vadot      The MCI and APB3 interfaces are supposed to be equipped with a clock
81*0e8011faSEmmanuel Vadot      source connected to the clk_csr_i line.
82*0e8011faSEmmanuel Vadot
83*0e8011faSEmmanuel Vadot      PCS/PMA layer can be clocked by an internal reference clock source
84*0e8011faSEmmanuel Vadot      (phyN_core_refclk) or by an externally connected (phyN_pad_refclk) clock
85*0e8011faSEmmanuel Vadot      generator. Both clocks can be supplied at a time.
86*0e8011faSEmmanuel Vadot    minItems: 1
87*0e8011faSEmmanuel Vadot    maxItems: 3
88*0e8011faSEmmanuel Vadot
89*0e8011faSEmmanuel Vadot  clock-names:
90*0e8011faSEmmanuel Vadot    oneOf:
91*0e8011faSEmmanuel Vadot      - minItems: 1
92*0e8011faSEmmanuel Vadot        items: # MDIO
93*0e8011faSEmmanuel Vadot          - enum: [core, pad]
94*0e8011faSEmmanuel Vadot          - const: pad
95*0e8011faSEmmanuel Vadot      - minItems: 1
96*0e8011faSEmmanuel Vadot        items: # MCI or APB
97*0e8011faSEmmanuel Vadot          - const: csr
98*0e8011faSEmmanuel Vadot          - enum: [core, pad]
99*0e8011faSEmmanuel Vadot          - const: pad
100*0e8011faSEmmanuel Vadot
101*0e8011faSEmmanuel Vadotrequired:
102*0e8011faSEmmanuel Vadot  - compatible
103*0e8011faSEmmanuel Vadot  - reg
104*0e8011faSEmmanuel Vadot
105*0e8011faSEmmanuel VadotadditionalProperties: false
106*0e8011faSEmmanuel Vadot
107*0e8011faSEmmanuel Vadotexamples:
108*0e8011faSEmmanuel Vadot  - |
109*0e8011faSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
110*0e8011faSEmmanuel Vadot
111*0e8011faSEmmanuel Vadot    ethernet-pcs@1f05d000 {
112*0e8011faSEmmanuel Vadot      compatible = "snps,dw-xpcs";
113*0e8011faSEmmanuel Vadot      reg = <0x1f05d000 0x1000>;
114*0e8011faSEmmanuel Vadot      reg-names = "indirect";
115*0e8011faSEmmanuel Vadot
116*0e8011faSEmmanuel Vadot      reg-io-width = <4>;
117*0e8011faSEmmanuel Vadot
118*0e8011faSEmmanuel Vadot      interrupts = <79 IRQ_TYPE_LEVEL_HIGH>;
119*0e8011faSEmmanuel Vadot
120*0e8011faSEmmanuel Vadot      clocks = <&ccu_pclk>, <&ccu_core>, <&ccu_pad>;
121*0e8011faSEmmanuel Vadot      clock-names = "csr", "core", "pad";
122*0e8011faSEmmanuel Vadot    };
123*0e8011faSEmmanuel Vadot  - |
124*0e8011faSEmmanuel Vadot    mdio-bus {
125*0e8011faSEmmanuel Vadot      #address-cells = <1>;
126*0e8011faSEmmanuel Vadot      #size-cells = <0>;
127*0e8011faSEmmanuel Vadot
128*0e8011faSEmmanuel Vadot      ethernet-pcs@0 {
129*0e8011faSEmmanuel Vadot        compatible = "snps,dw-xpcs";
130*0e8011faSEmmanuel Vadot        reg = <0>;
131*0e8011faSEmmanuel Vadot
132*0e8011faSEmmanuel Vadot        clocks = <&ccu_core>, <&ccu_pad>;
133*0e8011faSEmmanuel Vadot        clock-names = "core", "pad";
134*0e8011faSEmmanuel Vadot      };
135*0e8011faSEmmanuel Vadot    };
136*0e8011faSEmmanuel Vadot...
137