I have a LS1012A rdb alike board from forlinx, , it have two AR8031, one for RGMIII and another for SGMII interface, I add switch button to SGMII AR8031 reset pin, so i can control it work or not, then i change pfe_eth.c and fsl-ls2012a-rdb.dts accroding to
https://community.nxp.com/t5/Layerscape-Knowledge-Base/Packet-Forwarding-Engine-PFE-Ethernet-Ports-S...
I reset SGMII AR8031 by switch button and boot up system with two ethernet interface,
root@OpenWrt:/# ifconfig
br-lan Link encap:Ethernet HWaddr 76:0C:45:6A:F6:95
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fd7f:8300:7042::1/60 Scope:Global
inet6 addr: fe80::740c:45ff:fe6a:f695/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:4801 (4.6 KiB)
eth0 Link encap:Ethernet HWaddr 76:0C:45:6A:F6:95
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:4801 (4.6 KiB)
eth1 Link encap:Ethernet HWaddr 62:71:65:C8:FA:CE
inet addr:192.168.3.99 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::6071:65ff:fec8:face/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:42 errors:0 dropped:0 overruns:0 frame:0
TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:56025 (54.7 KiB) TX bytes:23426 (22.8 KiB)
after setup its ip addr, it fail to ping the gateway
root@OpenWrt:/# ifconfig eth1 192.168.3.119
root@OpenWrt:/# ping 192.168.3.1
PING 192.168.3.1 (192.168.3.1): 56 data bytes
not response from gateway
we fint the the cause related to uboot, it come from forlinx without source code, it only support two ethernet, so uboot will fail to support single FPE ethernet port,
SCSI: Net: PFE class pe firmware
PFE tmu pe firmware
pfe_configure_serdes 0
Could not get PHY for PFE_MDIO: addr 1
phy_connect failed
No ethernet found.
but if we let uboot work without reset SGMII AR8031, so it will boot successfully with two ethernet port successfully
SCSI: Net: PFE class pe firmware
PFE tmu pe firmware
pfe_configure_serdes 0
eth0: pfe_eth0, eth1: pfe_eth1
Hit any key to stop autoboot: 0
=>
the i reset SGMII AR8031 to let openwrt work with
single PFE ethernet port condition
=> pfe stop
Stopping PFE...
=> ...
and continue boot openwrt system, now the network now work correctly
root@OpenWrt:/# ifconfig eth1 192.168.3.119
root@OpenWrt:/# ping 192.168.3.1
PING 192.168.3.1 (192.168.3.1): 56 data bytes
64 bytes from 192.168.3.1: seq=0 ttl=64 time=8.740 ms
64 bytes from 192.168.3.1: seq=1 ttl=64 time=1.730 ms
64 bytes from 192.168.3.1: seq=2 ttl=64 time=2.287 ms
so what can we do to fix this issue? any suggestion is welcome, thanks
thanks for your so quick answer, its very helpful, i will contract forlinx to change it and verify it, thanks again
You could download LSDK 20.04
In u-boot source code, please modify board/freescale/ls1012ardb/eth.c as the following.
In LSDK environment, u-boot source code is in packages/firmware/u-boot.
switch (srds_s1) {
case 0x3508:
// if (!priv->gemac_port) {
/* MAC1 */
// pfe_set_phy_address_mode(priv->gemac_port,
// CONFIG_PFE_EMAC1_PHY_ADDR,
// PHY_INTERFACE_MODE_SGMII);
// } else {
/* MAC2 */
pfe_set_phy_address_mode(priv->gemac_port,
CONFIG_PFE_EMAC2_PHY_ADDR,
PHY_INTERFACE_MODE_RGMII_ID);
// }
break;
Then in LSDK build environment rebuild u-boot to generate ATF(firmware) image.
$ rm -rf build/firmware/u-boot/
$ flex-builder -c atf -m ls1012ardb -b qspi
$ flex-builder -i mkfw -m ls1012ardb -b qspi
You will get the following result in u-boot.
=> mdio list
PFE_MDIO:
1 - RealTek RTL8211F <--> pfe_eth1
=>
In recent released LSDK or OpenWrt, if you want to use only RGMII IF with PFE Ethernet port, you just need to remove "pfe_mac0"(SGMII) definition in the dts file.