Hi,
For the 2nd ethernet interface on our custom board, we use AR8033 as pin to pin instead of KSZ phy on the verdin development board. Our device tree is as follows.
imx8mp-verdin.dtsi:
/* Verdin ETH_1 (On-module PHY) */
&eqos {
phy-handle = <ðphy0>;
phy-mode = "rgmii-id";
phy-supply = <®_module_eth1phy>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqos>;
snps,force_thresh_dma_mode;
snps,mtl-rx-config = <&mtl_rx_setup>;
snps,mtl-tx-config = <&mtl_tx_setup>;
mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@7 {
compatible = "ethernet-phy-ieee802.3-c22";
eee-broken-100tx;
eee-broken-1000t;
interrupt-parent = <&gpio1>;
interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
micrel,led-mode = <0>;
reg = <7>;
};
};
mtl_rx_setup: rx-queues-config {
snps,rx-queues-to-use = <5>;
snps,rx-sched-sp;
queue0 {
snps,dcb-algorithm;
snps,priority = <0x1>;
snps,map-to-dma-channel = <0>;
};
queue1 {
snps,dcb-algorithm;
snps,priority = <0x2>;
snps,map-to-dma-channel = <1>;
};
queue2 {
snps,dcb-algorithm;
snps,priority = <0x4>;
snps,map-to-dma-channel = <2>;
};
queue3 {
snps,dcb-algorithm;
snps,priority = <0x8>;
snps,map-to-dma-channel = <3>;
};
queue4 {
snps,dcb-algorithm;
snps,priority = <0xf0>;
snps,map-to-dma-channel = <4>;
};
};
mtl_tx_setup: tx-queues-config {
snps,tx-queues-to-use = <5>;
snps,tx-sched-sp;
queue0 {
snps,dcb-algorithm;
snps,priority = <0x1>;
};
queue1 {
snps,dcb-algorithm;
snps,priority = <0x2>;
};
queue2 {
snps,dcb-algorithm;
snps,priority = <0x4>;
};
queue3 {
snps,dcb-algorithm;
snps,priority = <0x8>;
};
queue4 {
snps,dcb-algorithm;
snps,priority = <0xf0>;
};
};
};
/* Verdin ETH_2_RGMII */
&fec {
fsl,magic-packet;
phy-handle = <ðphy1>;
phy-supply = <®_module_eth1phy>;
phy-mode = "rgmii-id";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec>;
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@7 {
reg = <0x07>;
compatible = "ethernet-phy-id004d.d074","ethernet-phy-ieee802.3-c22";
qca,clk-out-frequency = <125000000>;
qca,clk-out-strength = <AR803X_STRENGTH_FULL>;
qca,keep-pll-enabled;
at803x,eee-disabled;
at803x,vddio-1p8v;
at803x,led-act-blind-workaround;
vddio-supply = <®_1p8v>;
};
};
};
In addition, at803x.c driver for at8033 is enabled with defconfig.
In response to the “mdio list” command in uboot I get the following result.
Verdin iMX8MP # mdio list
FEC1:
7 - Generic PHY ↔ ethernet@30be0000
ethernet@30bf0000:
After a ping attempt I get the following result.
ping 192.168.10.11
ethernet@30bf0000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110Using ethernet@30be0000 device
Abort
ping failed; host 192.168.10.11 is not alive
Verdin iMX8MP # ping 192.168.10.11
Using ethernet@30be0000 device
Abort
ping failed; host 192.168.10.11 is not alive
Verdin iMX8MP # ping 192.168.10.11
Using ethernet@30be0000 device
Abort
ping failed; host 192.168.10.11 is not alive
Verdin iMX8MP # ping 192.168.10.11
Using ethernet@30be0000 device
Abort
ping failed; host 192.168.10.11 is not alive
Verdin iMX8MP # ping 192.168.10.11
Using ethernet@30be0000 device
Abort
ping failed; host 192.168.10.11 is not alive
**Verdin iMX8MP # mdio list**
**FEC1:**
**7 - Generic PHY <--> ethernet@30be0000**
**ethernet@30bf0000:**
**7 - Micrel ksz9131 <--> ethernet@30bf0000**
When I read the 7th address with mdio read over the ethernet@30bf0000 bus, I can communicate with the on board phy by reading the correct information. But for AR8033, when I read the 7th address over FEC1 bus, I cannot read the correct information (PHY ID). All registers are 0x0000 or 0xFFFF.
When I branch to the kernel, I get the following output and the result I obtained with ifconfig is also shared below. It works when the eth1 cable is plugged in. However, the eth0 I added can’t ping at all, even though it gets ip and is always on.
[ 6.997453] Qualcomm Atheros AR8031/AR8033 30be0000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=30be0000.ethernet-1:00, irq=POLL)
[ 7.014054] fec 30be0000.ethernet eth0: Link is Up - Unknown/Full - flow control rx/tx
[ 7.018926] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-0:07] driver [Microchip KSZ9131 Gigabit PHY] (irq=88)
ifconfig result:
root@verdin-imx8mp-14871170:~# ifconfig
**eth0 Link encap:Ethernet HWaddr 00:14:2D:F2:EA:82**
** inet addr:169.254.28.147 Bcast:169.254.255.255 Mask:255.255.0.0**
** inet6 addr: fe80::214:2dff:fef2:ea82/64 Scope:Link**
** UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1**
** RX packets:0 errors:0 dropped:0 overruns:0 frame:0**
** TX packets:44 errors:0 dropped:0 overruns:0 carrier:0**
** collisions:0 txqueuelen:1000**
** RX bytes:0 (0.0 B) TX bytes:8360 (8.1 KiB)**
**eth1 Link encap:Ethernet HWaddr 00:14:2D:E2:EA:82**
** UP BROADCAST MULTICAST MTU:1500 Metric:1**
** RX packets:0 errors:0 dropped:0 overruns:0 frame:0**
** TX packets:0 errors:0 dropped:0 overruns:0 carrier:0**
** collisions:0 txqueuelen:1000**
** RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)**
** Interrupt:54**
**lo Link encap:Local Loopback**
** inet addr:127.0.0.1 Mask:255.0.0.0**
** inet6 addr: ::1/128 Scope:Host**
** UP LOOPBACK RUNNING MTU:65536 Metric:1**
** RX packets:106 errors:0 dropped:0 overruns:0 frame:0**
** TX packets:106 errors:0 dropped:0 overruns:0 carrier:0**
** collisions:0 txqueuelen:1000**
** RX bytes:8722 (8.5 KiB) TX bytes:8722 (8.5 KiB)**
**usb0 Link encap:Ethernet HWaddr D2:B7:82:AC:18:C5**
** UP BROADCAST MULTICAST MTU:1500 Metric:1**
** RX packets:0 errors:0 dropped:0 overruns:0 frame:0**
** TX packets:0 errors:0 dropped:0 overruns:0 carrier:0**
** collisions:0 txqueuelen:1000**
** RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)**
Finally, there is this output during boot, but the opposite happens when you branch into the kernel, is it normal?
Net: eth1: ethernet@30be0000, eth0: ethernet@30bf0000 [PRIME]
Normal Boot
We have been trying to solve this problem for a long time. Can you help me?