Skip to content

Commit e9cabfd

Browse files
Biao Huangmbgg
authored andcommitted
arm64: dts: mt2712: add ethernet device node
This patch add device node for mt2712 ethernet. Signed-off-by: Biao Huang <[email protected]> Signed-off-by: Matthias Brugger <[email protected]>
1 parent 9f88722 commit e9cabfd

File tree

2 files changed

+139
-0
lines changed

2 files changed

+139
-0
lines changed

arch/arm64/boot/dts/mediatek/mt2712-evb.dts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,81 @@
105105
proc-supply = <&cpus_fixed_vproc1>;
106106
};
107107

108+
&eth {
109+
phy-mode ="rgmii-rxid";
110+
phy-handle = <&ethernet_phy0>;
111+
mediatek,tx-delay-ps = <1530>;
112+
snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>;
113+
pinctrl-names = "default", "sleep";
114+
pinctrl-0 = <&eth_default>;
115+
pinctrl-1 = <&eth_sleep>;
116+
status = "okay";
117+
118+
mdio {
119+
compatible = "snps,dwmac-mdio";
120+
#address-cells = <1>;
121+
#size-cells = <0>;
122+
ethernet_phy0: ethernet-phy@5 {
123+
compatible = "ethernet-phy-id0243.0d90";
124+
reg = <0x5>;
125+
};
126+
};
127+
};
128+
108129
&pio {
130+
eth_default: eth_default {
131+
tx_pins {
132+
pinmux = <MT2712_PIN_71_GBE_TXD3__FUNC_GBE_TXD3>,
133+
<MT2712_PIN_72_GBE_TXD2__FUNC_GBE_TXD2>,
134+
<MT2712_PIN_73_GBE_TXD1__FUNC_GBE_TXD1>,
135+
<MT2712_PIN_74_GBE_TXD0__FUNC_GBE_TXD0>,
136+
<MT2712_PIN_75_GBE_TXC__FUNC_GBE_TXC>,
137+
<MT2712_PIN_76_GBE_TXEN__FUNC_GBE_TXEN>;
138+
drive-strength = <MTK_DRIVE_8mA>;
139+
};
140+
rx_pins {
141+
pinmux = <MT2712_PIN_78_GBE_RXD3__FUNC_GBE_RXD3>,
142+
<MT2712_PIN_79_GBE_RXD2__FUNC_GBE_RXD2>,
143+
<MT2712_PIN_80_GBE_RXD1__FUNC_GBE_RXD1>,
144+
<MT2712_PIN_81_GBE_RXD0__FUNC_GBE_RXD0>,
145+
<MT2712_PIN_82_GBE_RXDV__FUNC_GBE_RXDV>,
146+
<MT2712_PIN_84_GBE_RXC__FUNC_GBE_RXC>;
147+
input-enable;
148+
};
149+
mdio_pins {
150+
pinmux = <MT2712_PIN_85_GBE_MDC__FUNC_GBE_MDC>,
151+
<MT2712_PIN_86_GBE_MDIO__FUNC_GBE_MDIO>;
152+
drive-strength = <MTK_DRIVE_8mA>;
153+
input-enable;
154+
};
155+
};
156+
157+
eth_sleep: eth_sleep {
158+
tx_pins {
159+
pinmux = <MT2712_PIN_71_GBE_TXD3__FUNC_GPIO71>,
160+
<MT2712_PIN_72_GBE_TXD2__FUNC_GPIO72>,
161+
<MT2712_PIN_73_GBE_TXD1__FUNC_GPIO73>,
162+
<MT2712_PIN_74_GBE_TXD0__FUNC_GPIO74>,
163+
<MT2712_PIN_75_GBE_TXC__FUNC_GPIO75>,
164+
<MT2712_PIN_76_GBE_TXEN__FUNC_GPIO76>;
165+
};
166+
rx_pins {
167+
pinmux = <MT2712_PIN_78_GBE_RXD3__FUNC_GPIO78>,
168+
<MT2712_PIN_79_GBE_RXD2__FUNC_GPIO79>,
169+
<MT2712_PIN_80_GBE_RXD1__FUNC_GPIO80>,
170+
<MT2712_PIN_81_GBE_RXD0__FUNC_GPIO81>,
171+
<MT2712_PIN_82_GBE_RXDV__FUNC_GPIO82>,
172+
<MT2712_PIN_84_GBE_RXC__FUNC_GPIO84>;
173+
input-disable;
174+
};
175+
mdio_pins {
176+
pinmux = <MT2712_PIN_85_GBE_MDC__FUNC_GPIO85>,
177+
<MT2712_PIN_86_GBE_MDIO__FUNC_GPIO86>;
178+
input-disable;
179+
bias-disable;
180+
};
181+
};
182+
109183
usb0_id_pins_float: usb0_iddig {
110184
pins_iddig {
111185
pinmux = <MT2712_PIN_12_IDDIG_P0__FUNC_IDDIG_A>;

arch/arm64/boot/dts/mediatek/mt2712e.dtsi

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,71 @@
638638
status = "disabled";
639639
};
640640

641+
stmmac_axi_setup: stmmac-axi-config {
642+
snps,wr_osr_lmt = <0x7>;
643+
snps,rd_osr_lmt = <0x7>;
644+
snps,blen = <0 0 0 0 16 8 4>;
645+
};
646+
647+
mtl_rx_setup: rx-queues-config {
648+
snps,rx-queues-to-use = <1>;
649+
snps,rx-sched-sp;
650+
queue0 {
651+
snps,dcb-algorithm;
652+
snps,map-to-dma-channel = <0x0>;
653+
snps,priority = <0x0>;
654+
};
655+
};
656+
657+
mtl_tx_setup: tx-queues-config {
658+
snps,tx-queues-to-use = <3>;
659+
snps,tx-sched-wrr;
660+
queue0 {
661+
snps,weight = <0x10>;
662+
snps,dcb-algorithm;
663+
snps,priority = <0x0>;
664+
};
665+
queue1 {
666+
snps,weight = <0x11>;
667+
snps,dcb-algorithm;
668+
snps,priority = <0x1>;
669+
};
670+
queue2 {
671+
snps,weight = <0x12>;
672+
snps,dcb-algorithm;
673+
snps,priority = <0x2>;
674+
};
675+
};
676+
677+
eth: ethernet@1101c000 {
678+
compatible = "mediatek,mt2712-gmac";
679+
reg = <0 0x1101c000 0 0x1300>;
680+
interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_LOW>;
681+
interrupt-names = "macirq";
682+
mac-address = [00 55 7b b5 7d f7];
683+
clock-names = "axi",
684+
"apb",
685+
"mac_main",
686+
"ptp_ref";
687+
clocks = <&pericfg CLK_PERI_GMAC>,
688+
<&pericfg CLK_PERI_GMAC_PCLK>,
689+
<&topckgen CLK_TOP_ETHER_125M_SEL>,
690+
<&topckgen CLK_TOP_ETHER_50M_SEL>;
691+
assigned-clocks = <&topckgen CLK_TOP_ETHER_125M_SEL>,
692+
<&topckgen CLK_TOP_ETHER_50M_SEL>;
693+
assigned-clock-parents = <&topckgen CLK_TOP_ETHERPLL_125M>,
694+
<&topckgen CLK_TOP_APLL1_D3>;
695+
power-domains = <&scpsys MT2712_POWER_DOMAIN_AUDIO>;
696+
mediatek,pericfg = <&pericfg>;
697+
snps,axi-config = <&stmmac_axi_setup>;
698+
snps,mtl-rx-config = <&mtl_rx_setup>;
699+
snps,mtl-tx-config = <&mtl_tx_setup>;
700+
snps,txpbl = <1>;
701+
snps,rxpbl = <1>;
702+
clk_csr = <0>;
703+
status = "disabled";
704+
};
705+
641706
mmc0: mmc@11230000 {
642707
compatible = "mediatek,mt2712-mmc";
643708
reg = <0 0x11230000 0 0x1000>;

0 commit comments

Comments
 (0)