Debian Codegraph @

Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml

raw
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/net/dsa/nxp,sja1105.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: NXP SJA1105 Automotive Ethernet Switch Family
8
9 description:
10 The SJA1105 SPI interface requires a CS-to-CLK time (t2 in UM10944.pdf) of at
11 least one half of t_CLK. At an SPI frequency of 1MHz, this means a minimum
12 cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed
13 depends on the SPI bus master driver.
14
15 maintainers:
16 - Vladimir Oltean <[email protected]>
17
18 properties:
19 compatible:
20 enum:
21 - nxp,sja1105e
22 - nxp,sja1105t
23 - nxp,sja1105p
24 - nxp,sja1105q
25 - nxp,sja1105r
26 - nxp,sja1105s
27 - nxp,sja1110a
28 - nxp,sja1110b
29 - nxp,sja1110c
30 - nxp,sja1110d
31
32 reg:
33 maxItems: 1
34
35 reset-gpios:
36 description:
37 A GPIO connected to the active-low RST_N pin of the SJA1105. Note that
38 reset of this chip is performed via SPI and the RST_N pin must be wired
39 to satisfy the power-up sequence documented in "SJA1105PQRS Application
40 Hints" (AH1704) sec. 2.4.4. Connecting the SJA1105 RST_N pin to a GPIO is
41 therefore discouraged.
42 maxItems: 1
43
44 clocks:
45 maxItems: 1
46
47 spi-cpha: true
48 spi-cpol: true
49
50 # Optional container node for the 2 internal MDIO buses of the SJA1110
51 # (one for the internal 100base-T1 PHYs and the other for the single
52 # 100base-TX PHY). The "reg" property does not have physical significance.
53 # The PHY addresses to port correspondence is as follows: for 100base-T1,
54 # port 5 has PHY 1, port 6 has PHY 2 etc, while for 100base-TX, port 1 has
55 # PHY 1.
56 mdios:
57 type: object
58 additionalProperties: false
59
60 properties:
61 '#address-cells':
62 const: 1
63 '#size-cells':
64 const: 0
65
66 patternProperties:
67 "^mdio@[0-1]$":
68 $ref: /schemas/net/mdio.yaml#
69 unevaluatedProperties: false
70
71 properties:
72 compatible:
73 oneOf:
74 - enum:
75 - nxp,sja1110-base-t1-mdio
76 - nxp,sja1110-base-tx-mdio
77
78 reg:
79 oneOf:
80 - enum:
81 - 0
82 - 1
83
84 required:
85 - compatible
86 - reg
87
88 patternProperties:
89 "^(ethernet-)?ports$":
90 additionalProperties: true
91 patternProperties:
92 "^(ethernet-)?port@[0-9]$":
93 allOf:
94 - if:
95 properties:
96 phy-mode:
97 contains:
98 enum:
99 - rgmii
100 - rgmii-rxid
101 - rgmii-txid
102 - rgmii-id
103 then:
104 properties:
105 rx-internal-delay-ps:
106 $ref: "#/$defs/internal-delay-ps"
107 tx-internal-delay-ps:
108 $ref: "#/$defs/internal-delay-ps"
109
110 required:
111 - compatible
112 - reg
113
114 $defs:
115 internal-delay-ps:
116 description:
117 Disable tunable delay lines using 0 ps, or enable them and select
118 the phase between 1640 ps (73.8 degree shift at 1Gbps) and 2260 ps
119 (101.7 degree shift) in increments of 0.9 degrees (20 ps).
120 enum:
121 [0, 1640, 1660, 1680, 1700, 1720, 1740, 1760, 1780, 1800, 1820, 1840,
122 1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, 2060, 2080,
123 2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260]
124
125 allOf:
126 - $ref: dsa.yaml#/$defs/ethernet-ports
127 - $ref: /schemas/spi/spi-peripheral-props.yaml#
128 - if:
129 properties:
130 compatible:
131 enum:
132 - nxp,sja1105e
133 - nxp,sja1105p
134 - nxp,sja1105q
135 - nxp,sja1105r
136 - nxp,sja1105s
137 - nxp,sja1105t
138 then:
139 properties:
140 spi-cpol: false
141 required:
142 - spi-cpha
143 else:
144 properties:
145 spi-cpha: false
146
147 unevaluatedProperties: false
148
149 examples:
150 - |
151 spi {
152 #address-cells = <1>;
153 #size-cells = <0>;
154
155 ethernet-switch@1 {
156 reg = <0x1>;
157 compatible = "nxp,sja1105t";
158 spi-cpha;
159
160 ethernet-ports {
161 #address-cells = <1>;
162 #size-cells = <0>;
163
164 port@0 {
165 phy-handle = <&rgmii_phy6>;
166 phy-mode = "rgmii-id";
167 rx-internal-delay-ps = <0>;
168 tx-internal-delay-ps = <0>;
169 reg = <0>;
170 };
171
172 port@1 {
173 phy-handle = <&rgmii_phy3>;
174 phy-mode = "rgmii-id";
175 rx-internal-delay-ps = <0>;
176 tx-internal-delay-ps = <0>;
177 reg = <1>;
178 };
179
180 port@2 {
181 phy-handle = <&rgmii_phy4>;
182 phy-mode = "rgmii-id";
183 rx-internal-delay-ps = <0>;
184 tx-internal-delay-ps = <0>;
185 reg = <2>;
186 };
187
188 port@3 {
189 phy-handle = <&rgmii_phy4>;
190 phy-mode = "rgmii-id";
191 rx-internal-delay-ps = <0>;
192 tx-internal-delay-ps = <0>;
193 reg = <3>;
194 };
195
196 port@4 {
197 ethernet = <&enet2>;
198 phy-mode = "rgmii";
199 rx-internal-delay-ps = <0>;
200 tx-internal-delay-ps = <0>;
201 reg = <4>;
202
203 fixed-link {
204 speed = <1000>;
205 full-duplex;
206 };
207 };
208 };
209 };
210 };