Skip to content

Commit 57827e8

Browse files
ahalaneyandersson
authored andcommitted
arm64: dts: qcom: sa8540p-ride: Add ethernet nodes
Enable both the MACs found on the board. ethernet0 and ethernet1 both ultimately go to a series of on board switches which aren't managed by this processor. ethernet0 is connected to a Marvell 88EA1512 phy via RGMII. That goes to the series of switches via SGMII on the "media" side of the phy. RGMII_SGMII mode is enabled via devicetree register descriptions. The switch on the "media" side has auto-negotiation disabled, so configuration from userspace similar to: ethtool -s eth0 autoneg off speed 1000 duplex full is necessary to get traffic flowing on that interface. ethernet1 is in a mac2mac/fixed-link configuration going to the same series of switches directly via RGMII. Tested-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230501205105.2518373-3-ahalaney@redhat.com
1 parent b405d8d commit 57827e8

File tree

1 file changed

+238
-0
lines changed

1 file changed

+238
-0
lines changed

arch/arm64/boot/dts/qcom/sa8540p-ride.dts

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,184 @@
151151
};
152152
};
153153

154+
&ethernet0 {
155+
snps,mtl-rx-config = <&ethernet0_mtl_rx_setup>;
156+
snps,mtl-tx-config = <&ethernet0_mtl_tx_setup>;
157+
158+
max-speed = <1000>;
159+
phy-handle = <&rgmii_phy>;
160+
phy-mode = "rgmii-txid";
161+
162+
pinctrl-names = "default";
163+
pinctrl-0 = <&ethernet0_default>;
164+
165+
status = "okay";
166+
167+
mdio {
168+
compatible = "snps,dwmac-mdio";
169+
#address-cells = <1>;
170+
#size-cells = <0>;
171+
172+
/* Marvell 88EA1512 */
173+
rgmii_phy: phy@8 {
174+
reg = <0x8>;
175+
176+
interrupts-extended = <&tlmm 127 IRQ_TYPE_EDGE_FALLING>;
177+
178+
reset-gpios = <&pmm8540c_gpios 1 GPIO_ACTIVE_LOW>;
179+
reset-assert-us = <11000>;
180+
reset-deassert-us = <70000>;
181+
182+
device_type = "ethernet-phy";
183+
184+
/* Set to RGMII_SGMII mode and soft reset. Turn off auto-negotiation
185+
* from userspace to talk to the switch on the SGMII side of things
186+
*/
187+
marvell,reg-init =
188+
/* Set MODE[2:0] to RGMII_SGMII */
189+
<0x12 0x14 0xfff8 0x4>,
190+
/* Soft reset required after changing MODE[2:0] */
191+
<0x12 0x14 0x7fff 0x8000>;
192+
};
193+
};
194+
195+
ethernet0_mtl_rx_setup: rx-queues-config {
196+
snps,rx-queues-to-use = <1>;
197+
snps,rx-sched-sp;
198+
199+
queue0 {
200+
snps,dcb-algorithm;
201+
snps,map-to-dma-channel = <0x0>;
202+
snps,route-up;
203+
snps,priority = <0x1>;
204+
};
205+
206+
queue1 {
207+
snps,dcb-algorithm;
208+
snps,map-to-dma-channel = <0x1>;
209+
snps,route-ptp;
210+
};
211+
212+
queue2 {
213+
snps,avb-algorithm;
214+
snps,map-to-dma-channel = <0x2>;
215+
snps,route-avcp;
216+
};
217+
218+
queue3 {
219+
snps,avb-algorithm;
220+
snps,map-to-dma-channel = <0x3>;
221+
snps,priority = <0xc>;
222+
};
223+
};
224+
225+
ethernet0_mtl_tx_setup: tx-queues-config {
226+
snps,tx-queues-to-use = <1>;
227+
snps,tx-sched-sp;
228+
229+
queue0 {
230+
snps,dcb-algorithm;
231+
};
232+
233+
queue1 {
234+
snps,dcb-algorithm;
235+
};
236+
237+
queue2 {
238+
snps,avb-algorithm;
239+
snps,send_slope = <0x1000>;
240+
snps,idle_slope = <0x1000>;
241+
snps,high_credit = <0x3e800>;
242+
snps,low_credit = <0xffc18000>;
243+
};
244+
245+
queue3 {
246+
snps,avb-algorithm;
247+
snps,send_slope = <0x1000>;
248+
snps,idle_slope = <0x1000>;
249+
snps,high_credit = <0x3e800>;
250+
snps,low_credit = <0xffc18000>;
251+
};
252+
};
253+
};
254+
255+
&ethernet1 {
256+
snps,mtl-rx-config = <&ethernet1_mtl_rx_setup>;
257+
snps,mtl-tx-config = <&ethernet1_mtl_tx_setup>;
258+
259+
max-speed = <1000>;
260+
phy-mode = "rgmii-txid";
261+
262+
pinctrl-names = "default";
263+
pinctrl-0 = <&ethernet1_default>;
264+
265+
status = "okay";
266+
267+
fixed-link {
268+
speed = <1000>;
269+
full-duplex;
270+
};
271+
272+
ethernet1_mtl_rx_setup: rx-queues-config {
273+
snps,rx-queues-to-use = <1>;
274+
snps,rx-sched-sp;
275+
276+
queue0 {
277+
snps,dcb-algorithm;
278+
snps,map-to-dma-channel = <0x0>;
279+
snps,route-up;
280+
snps,priority = <0x1>;
281+
};
282+
283+
queue1 {
284+
snps,dcb-algorithm;
285+
snps,map-to-dma-channel = <0x1>;
286+
snps,route-ptp;
287+
};
288+
289+
queue2 {
290+
snps,avb-algorithm;
291+
snps,map-to-dma-channel = <0x2>;
292+
snps,route-avcp;
293+
};
294+
295+
queue3 {
296+
snps,avb-algorithm;
297+
snps,map-to-dma-channel = <0x3>;
298+
snps,priority = <0xc>;
299+
};
300+
};
301+
302+
ethernet1_mtl_tx_setup: tx-queues-config {
303+
snps,tx-queues-to-use = <1>;
304+
snps,tx-sched-sp;
305+
306+
queue0 {
307+
snps,dcb-algorithm;
308+
};
309+
310+
queue1 {
311+
snps,dcb-algorithm;
312+
};
313+
314+
queue2 {
315+
snps,avb-algorithm;
316+
snps,send_slope = <0x1000>;
317+
snps,idle_slope = <0x1000>;
318+
snps,high_credit = <0x3e800>;
319+
snps,low_credit = <0xffc18000>;
320+
};
321+
322+
queue3 {
323+
snps,avb-algorithm;
324+
snps,send_slope = <0x1000>;
325+
snps,idle_slope = <0x1000>;
326+
snps,high_credit = <0x3e800>;
327+
snps,low_credit = <0xffc18000>;
328+
};
329+
};
330+
};
331+
154332
&i2c0 {
155333
pinctrl-names = "default";
156334
pinctrl-0 = <&i2c0_default>;
@@ -316,6 +494,66 @@
316494
/* PINCTRL */
317495

318496
&tlmm {
497+
ethernet0_default: ethernet0-default-state {
498+
mdc-pins {
499+
pins = "gpio175";
500+
function = "rgmii_0";
501+
drive-strength = <16>;
502+
bias-pull-up;
503+
};
504+
505+
mdio-pins {
506+
pins = "gpio176";
507+
function = "rgmii_0";
508+
drive-strength = <16>;
509+
bias-pull-up;
510+
};
511+
512+
rgmii-tx-pins {
513+
pins = "gpio183", "gpio184", "gpio185", "gpio186", "gpio187", "gpio188";
514+
function = "rgmii_0";
515+
drive-strength = <16>;
516+
bias-pull-up;
517+
};
518+
519+
rgmii-rx-pins {
520+
pins = "gpio177", "gpio178", "gpio179", "gpio180", "gpio181", "gpio182";
521+
function = "rgmii_0";
522+
drive-strength = <16>;
523+
bias-disable;
524+
};
525+
};
526+
527+
ethernet1_default: ethernet1-default-state {
528+
mdc-pins {
529+
pins = "gpio97";
530+
function = "rgmii_1";
531+
drive-strength = <16>;
532+
bias-pull-up;
533+
};
534+
535+
mdio-pins {
536+
pins = "gpio98";
537+
function = "rgmii_1";
538+
drive-strength = <16>;
539+
bias-pull-up;
540+
};
541+
542+
rgmii-tx-pins {
543+
pins = "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110";
544+
function = "rgmii_1";
545+
drive-strength = <16>;
546+
bias-pull-up;
547+
};
548+
549+
rgmii-rx-pins {
550+
pins = "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104";
551+
function = "rgmii_1";
552+
drive-strength = <16>;
553+
bias-disable;
554+
};
555+
};
556+
319557
i2c0_default: i2c0-default-state {
320558
/* To USB7002T-I/KDXVA0 USB hub (SIP1 only) */
321559
pins = "gpio135", "gpio136";

0 commit comments

Comments
 (0)