summaryrefslogtreecommitdiffstats
path: root/dts/Bindings/net/dsa/ocelot.txt
blob: 7a271d070b72430d69ab4261a417d672a33402fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Microchip Ocelot switch driver family
=====================================

Felix
-----

Currently the switches supported by the felix driver are:

- VSC9959 (Felix)
- VSC9953 (Seville)

The VSC9959 switch is found in the NXP LS1028A. It is a PCI device, part of the
larger ENETC root complex. As a result, the ethernet-switch node is a sub-node
of the PCIe root complex node and its "reg" property conforms to the parent
node bindings:

* reg: Specifies PCIe Device Number and Function Number of the endpoint device,
  in this case for the Ethernet L2Switch it is PF5 (of device 0, bus 0).

It does not require a "compatible" string.

The interrupt line is used to signal availability of PTP TX timestamps and for
TSN frame preemption.

For the external switch ports, depending on board configuration, "phy-mode" and
"phy-handle" are populated by board specific device tree instances. Ports 4 and
5 are fixed as internal ports in the NXP LS1028A instantiation.

The CPU port property ("ethernet") configures the feature called "NPI port" in
the Ocelot hardware core. The CPU port in Ocelot is a set of queues, which are
connected, in the Node Processor Interface (NPI) mode, to an Ethernet port.
By default, in fsl-ls1028a.dtsi, the NPI port is assigned to the internal
2.5Gbps port@4, but can be moved to the 1Gbps port@5, depending on the specific
use case.  Moving the NPI port to an external switch port is hardware possible,
but there is no platform support for the Linux system on the LS1028A chip to
operate as an entire slave DSA chip.  NPI functionality (and therefore DSA
tagging) is supported on a single port at a time.

Any port can be disabled (and in fsl-ls1028a.dtsi, they are indeed all disabled
by default, and should be enabled on a per-board basis). But if any external
switch port is enabled at all, the ENETC PF2 (enetc_port2) should be enabled as
well, regardless of whether it is configured as the DSA master or not. This is
because the Felix PHYLINK implementation accesses the MAC PCS registers, which
in hardware truly belong to the ENETC port #2 and not to Felix.

Supported PHY interface types (appropriate SerDes protocol setting changes are
needed in the RCW binary):

* phy_mode = "internal": on ports 4 and 5
* phy_mode = "sgmii": on ports 0, 1, 2, 3
* phy_mode = "qsgmii": on ports 0, 1, 2, 3
* phy_mode = "usxgmii": on ports 0, 1, 2, 3
* phy_mode = "2500base-x": on ports 0, 1, 2, 3

For the rest of the device tree binding definitions, which are standard DSA and
PCI, refer to the following documents:

Documentation/devicetree/bindings/net/dsa/dsa.txt
Documentation/devicetree/bindings/pci/pci.txt

Example:

&soc {
	pcie@1f0000000 { /* Integrated Endpoint Root Complex */
		ethernet-switch@0,5 {
			reg = <0x000500 0 0 0 0>;
			/* IEP INT_B */
			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;

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

				/* External ports */
				port@0 {
					reg = <0>;
					label = "swp0";
				};

				port@1 {
					reg = <1>;
					label = "swp1";
				};

				port@2 {
					reg = <2>;
					label = "swp2";
				};

				port@3 {
					reg = <3>;
					label = "swp3";
				};

				/* Tagging CPU port */
				port@4 {
					reg = <4>;
					ethernet = <&enetc_port2>;
					phy-mode = "internal";

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

				/* Non-tagging CPU port */
				port@5 {
					reg = <5>;
					phy-mode = "internal";
					status = "disabled";

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

The VSC9953 switch is found inside NXP T1040. It is a platform device with the
following required properties:

- compatible:
	Must be "mscc,vsc9953-switch".

Supported PHY interface types (appropriate SerDes protocol setting changes are
needed in the RCW binary):

* phy_mode = "internal": on ports 8 and 9
* phy_mode = "sgmii": on ports 0, 1, 2, 3, 4, 5, 6, 7
* phy_mode = "qsgmii": on ports 0, 1, 2, 3, 4, 5, 6, 7

Example:

&soc {
	ethernet-switch@800000 {
		#address-cells = <0x1>;
		#size-cells = <0x0>;
		compatible = "mscc,vsc9953-switch";
		little-endian;
		reg = <0x800000 0x290000>;

		ports {
			#address-cells = <0x1>;
			#size-cells = <0x0>;

			port@0 {
				reg = <0x0>;
				label = "swp0";
			};

			port@1 {
				reg = <0x1>;
				label = "swp1";
			};

			port@2 {
				reg = <0x2>;
				label = "swp2";
			};

			port@3 {
				reg = <0x3>;
				label = "swp3";
			};

			port@4 {
				reg = <0x4>;
				label = "swp4";
			};

			port@5 {
				reg = <0x5>;
				label = "swp5";
			};

			port@6 {
				reg = <0x6>;
				label = "swp6";
			};

			port@7 {
				reg = <0x7>;
				label = "swp7";
			};

			port@8 {
				reg = <0x8>;
				phy-mode = "internal";
				ethernet = <&enet0>;

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

			port@9 {
				reg = <0x9>;
				phy-mode = "internal";
				status = "disabled";

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