/*************************************************************************** * imx6 ar8031 Gigabit NIC cannot be used * imx6 either run Li Nux or Android cannot ping a direct-attached PC, but DHCP is configured to surf the internet normally. * This document documents the resolution process. * * Tony Liu, 2016-4-19, Shenzhen*/One, Ping does not pass the following attempts:1first turn off the firewall on the computer and the board. 2. Board add default gateway route adddefaultGw192.168.2.1Netmask255.255.255.0 3. Check to see if there is an ARP entry on the computer to the board. ARP-a interface:192.168.2.110---0xbInternet Address Physical Address type224.0.0.2 on-xx-5e-xx-xx- GenevaStatic224.0.0.22 on-xx-5e-xx-xx- -Static224.0.0.251 on-xx-5e-xx-xx-FB Static224.0.0.252 on-xx-5e-xx-xx-FC Static239.255.255.250 on-xx-5e-7f-ff-fa Static if not, add static ARP on Windows. Use the netsh i i showinchcommand to view the IDX number of the local connection C:\Windows\system32>netsh I i showinchIdx Met MTU status name--- ---------- ---------- ------------ ---------------------------1 - 4294967295Connected Loopback Pseudo-Interface1 One Ten theconnected Local Area Connection - - theConnected Local Area Connection2 - - theconnected VMware Network Adapter VMnet1 the - theconnected VMware Network Adapter VMnet8 using netsh-C"I i"Add neighbors the idx "Gateway IP" "Gateway Mac" command bindings for local connections. The Gateway Mac is the board's Mac. Netsh-C"I i"Add Neighbors One "192.168.2.1" "1e-ed-19-27-1a-b3"View results: interface:192.168.2.110---0xbInternet Address Physical Address type192.168.2.11e-ed- +- --1a-B3 static224.0.0.2 on-xx-5e-xx-xx- GenevaStatic224.0.0.22 on-xx-5e-xx-xx- -Static224.0.0.251 on-xx-5e-xx-xx-FB Static224.0.0.252 on-xx-5e-xx-xx-FC Static239.255.255.250 on-xx-5e-7f-ff-fa Static Two, the board through the switch can ping the same computer. 1, the PHY of the board is ar8031, after connecting the switch, can ping the computer. Suspect that there may be a problem with the line sequence, so the use of cross-line for direct connection, nor can ping pass. 2, the switch only supports 10m/100M, check the properties of PC network card, link speed also self-negotiated to 100M, and the network on the board is also 100M, so can ping through. Preliminary analysis, directly connected to the case, the computer network card and the board PHY self-negotiation failed. 3, direct connection, force the computer's network card rate to 10M full duplex/half-duplex, the board network also becomes 10M half-duplex, stating that since the negotiation is successful, only in the 1000M state is limited. Change the computer card speed, the board serial output. PHY:1: on-Link isDown PHY:1: on-Link isUp-Ten/halfthird, code tracking1, may be incorrect PHY settings, Internet view, settings are the same, the change PHY setting does not take effect. 2, view driver kernel/driver/net/The fec.c is debugged in the drive. Since each network is disconnected, there will be output after the direct connection.
static void
Fec_restart (struct net_device *dev, int duplex) function.
add debugging, found that the board since the negotiation, the direct connection of the computer network card is 1G or since the negotiation, have not entered. /*10M or 100M*/ if(Fep->phy_dev && Fep->phy_dev->speed = =speed_100) {Val&= ~ (1<<9); } Else{val|= (1<<9); } ... ..
Explain if the conditions are not satisfied.
/*if PHY work at 1G mode, set ENET RGMII speed to 1G*/ if(Fep->phy_dev && (fep->phy_dev->supported &(Supported_1000baset_half| Supported_1000baset_full)) &&FEP->phy_interface = = Phy_interface_mode_rgmii &&FEP->phy_dev->speed = =speed_1000) {Val|= (0x1<<5);//Enable 1000M mode } /*RX FIFO threshold setting for ENET pause frame feature * Only set the parameters after ticket TKT116501 fixed. * The issue have been fixed on Rigel TO1.1 and Arik TO1.2*/ if((Cpu_is_mx6q () &&(Mx6q_revision ()>= imx_chip_revision_1_2)) | |(CPU_IS_MX6DL ()&&(Mx6dl_revision ()>=imx_chip_revision_1_1))) {Writel (Fec_enet_rsem_v, FEP->HWP +Fec_r_fifo_rsem); Writel (Fec_enet_rsfl_v, FEP->HWP +FEC_R_FIFO_RSFL); Writel (Fec_enet_raem_v, FEP->HWP +Fec_r_fifo_raem); Writel (Fec_enet_rafl_v, FEP->HWP +FEC_R_FIFO_RAFL); /*OPD*/Writel (Fec_enet_opd_v, FEP->HWP +fec_opd); } if(cpu_is_mx6q () | |cpu_is_mx6dl ()) { /*enable endian swap*/Val|= (0x1<<8); /*enable ENET Store and forward mode*/Writel (0x1<<8, FEP->HWP +FEC_X_WMRK); } Writel (Val, Fep->HWP +Fec_ecntrl); Enable Ethernet Control registerstatic int fec_enet_mii_probe (struct net_device *ndev) function: View initialization, reverse chip selection only 10m/100m support is turned on here, 1000M support is not turned on. Causes the Mac register not to be able to function 1000M.
Change Phy_basic_features to Phy_gbit_features. as shown below. /*mask with MAC supported features*/ if(cpu_is_mx6q () | |cpu_is_mx6dl ())//phy_dev->supported &= phy_basic_features;Phy_dev->supported &=Phy_gbit_features; ElsePhy_dev->supported &=phy_basic_features; Macros are defined as follows:#definePhy_basic_features (Supported_10baset_half | \Supported_10baset_full|Supported_100baset_half|Supported_100baset_full|Supported_autoneg|SUPPORTED_TP|supported_mii)#definePhy_gbit_features (Phy_basic_features | \Supported_1000baset_half|supported_1000baset_full)
IMX6 ar8031 Gigabit NIC is not available