imx6dq 升级android6.0后,千兆网不可用

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6dq 升级android6.0后,千兆网不可用

11,847 Views
chenw
Contributor II

dear all

imx6dq with ar8035,in android4.3,Gigabit Ethernet is working well ;

but now we upgrade to android6.0,and kernel4.1.15;

Gigabit Ethernet is not  working ,and ping  failed ,do you have idea to solve the problem?

0 Kudos
17 Replies

976 Views
yacheng_zhang
Contributor I

你好,请问下,你解决了吗

0 Kudos

11,650 Views
chenw
Contributor II
root@sabresd_6dq:/ # ethtool -s eth0 autoneg off speed 1000 duplex full
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ # ethtool -s eth0 autoneg on speed 1000 duplex full
root@sabresd_6dq:/ # [  530.185139] fec 2188000.ethernet eth0: Link is Down
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ # [  533.185393] fec 2188000.ethernet eth0: Link is Up - 1Gbp                                                                                                 s/Full - flow control rx/tx
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ #
root@sabresd_6dq:/ # iperf3 -c 172.16.101.82
Connecting to host 172.16.101.82, port 5201
[  4] local 172.16.101.11 port 43319 connected to 172.16.101.82 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  35.9 MBytes   301 Mbits/sec
[  4]   1.00-2.00   sec  19.3 MBytes   162 Mbits/sec
[  4]   2.00-3.00   sec  26.8 MBytes   225 Mbits/sec
[  4]   3.00-4.00   sec  18.3 MBytes   154 Mbits/sec
[  4]   4.00-5.02   sec  32.8 MBytes   271 Mbits/sec
[  4]   5.02-6.00   sec  28.9 MBytes   246 Mbits/sec
[  4]   6.00-7.00   sec  41.2 MBytes   346 Mbits/sec
[  4]   7.00-8.00   sec  35.5 MBytes   298 Mbits/sec
[  4]   8.00-9.00   sec  13.9 MBytes   116 Mbits/sec
[  4]   9.00-10.00  sec  29.3 MBytes   247 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec   282 MBytes   236 Mbits/sec                  sender
[  4]   0.00-10.00  sec   281 MBytes   236 Mbits/sec                  receiver
iperf Done.
请问autoneg 参数的设置,on 和off,对phy会有什么动作吗,在千兆网不正常的情况下,设置这个参数后,on 或者 off,然后测试,会有一定几率速度可以正常起来
0 Kudos

11,650 Views
weidong_sun
NXP TechSupport
NXP TechSupport

这是通信双方自动协商的配置,PHY里面有这个寄存器配置。

关于详细的解释,你可以参考这个:

https://www.rootopen.com/article/5cc55deed590e21a4eb73dcb 

Weidong

0 Kudos

11,651 Views
chenw
Contributor II

感谢回复

在千兆网速度起来的情况下,插拔一下网线或者关机重启,速度就掉下去了,请问拔-插网线后,adb shell状态下,有没有什么指令可以复位PHY?或者什么指令直接写PHY的某个寄存器,然后就100%可以恢复正常?

目前千兆网速度低是常态,重复尝试以下动作多次,有时候速度会起来,成功概率不大

(有三种操作都遇到恢复正常的情况:1、拔掉网线-接入;2、autoneg off后重启;3、autoneg off后 on

0 Kudos

11,651 Views
weidong_sun
NXP TechSupport
NXP TechSupport

自动协商的方式,它必须要保证通信双方数据正确性,然后才会跑约定好的速率。不过,你可以固定配置它跑千兆,这个不需要在寄存器级去配置,网络命令就可以配置固定10M/100M/1000M,您可以网上查一下相关资料。 不过,配置为固定1000M模式,会不会在网络环境不好的情况下,产生数据丢包,这都不好说的。

所以,你可以测试一下,但是仍然建议您自动协商模式比较好。

Weidong

0 Kudos

11,651 Views
chenw
Contributor II

感谢回复!

目前的情况看,自动协商autoneg on的情况下,才能正常识别网线;

我们有以下四种场景,有碰到千兆网可以概率性的恢复速度:

1、自协商off后机器重启;

2、拔插网线;

3、自协商off后直接on;

4、ifconfig eth0 down后ifconfig eth0 up

但是概率较低,请问是否有办法进一步分析?

(在千兆网速度起来的情况下,插拔一下网线或者关机重启,速度就掉下去了)

0 Kudos

11,651 Views
weidong_sun
NXP TechSupport
NXP TechSupport

这种情况,很难判断是哪里引起的,不过,您可以这样测试一下:

1. 换一下带有屏蔽层的质量更好一些的网线。

2. 找一个板子,换成AR8031,看看网速情况。

Weidong

0 Kudos

11,651 Views
chenw
Contributor II

您好

ethtool -s eth0 speed 100 duplex full,测试iperf3正常

ethtool -s eth0 speed 1000 duplex full,测试iperf3就不行了

0 Kudos

11,651 Views
chenw
Contributor II

您好,

网线换了没有效果,请问是否可以通过增加打印信息来debug查看哪里的问题?

换成AR8031,对我们来说,没有必要,因为android4.3是好的,是android6.0出现的异常

0 Kudos

11,651 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Chen,

  硬件上,AR8031和AR8035是完全兼容的, Linux BSP和android BSP中都支持对AR8035的初始化配置,因此基本不需要特别的移植工作,就可以跑起来。

  另外,android6.0已经是很旧的版本了。对于I.MX6Q/D/DL/QP,目前最新的版本是Android9.0.0_2.2.0,所以既然您的产品要升级,您最好升级到最近的版本。

   另外,调试网络的时候,您需要注意几个地方:

1. PHY地址和BSP里配置要一致,一般在dts里。

2. 硬件上看看时钟是否有,RESET脚是否拉高。

3. 在AR8035的fix函数里加上信息,在fec_main.c里看看是否正确读取ID

这样类似的调试,先保证底层工作正常,MAC找到PHY,并正确配置PHY,这个必须要保证正确。

Have a nice day!

B.R,

Weidong

0 Kudos

11,651 Views
chenw
Contributor II

add more info

升级android6后:

百兆网络是正常的,千兆网不可用

0 Kudos

11,651 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Chen Wei,

(1)AR8035是支持的: arch/arm/mach-imx/mach-imx6q.c中。

#define PHY_ID_AR8035 0x004dd072

static void __init imx6q_enet_phy_init(void)
{
    if (IS_BUILTIN(CONFIG_PHYLIB)) {
        phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
                ksz9021rn_phy_fixup);
        phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
                ksz9031rn_phy_fixup);
        phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
                ar8031_phy_fixup);
        phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
                ar8035_phy_fixup);
    }
}

这个文件是板级支持包的入口。

(2)关于100M可以工作

说明PHY已经工作了。硬件上是OK的。

(3)目前很难确认问题在哪里,但是,你试试用附件里的fec_main.c是不是可以工作。

把原来的fec_main.c备份一下,再用附件的替换它。

伟东

0 Kudos

11,651 Views
chenw
Contributor II

dear sun,

感谢回复

您提供的文件,和我目前使用的代码是一样的,请知悉

有没有可能是dts里面的参数,需要修改,或者特殊配置?

0 Kudos

11,652 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Chen Wei,

dts里的配置不需要修改,和EVK的AR8031的方式是一样的。只要是rgmii模式配置了、PHY地址正确,就可以。

上面也就看到AR8035的ID初始化配置了,这能保证fec driver找到PHY,并用MDIO对它进行配置。

另外,I.MX6Q系列的MAC有一个硬件限制,就是速度达不到1000MHz,最大是400Mbps,这个在勘误表里已经有了说明,所以你再看看是不是这个问题。

伟东

0 Kudos

11,652 Views
chenw
Contributor II

您好,上面是今天的测试数据,请帮忙看看,可以怎么优化改善?

root@sabresd_6dq:/mnt # cat /proc/cmdline
enable_wait_mode=off console=ttymxc0,115200 init=/init video=mxcfb0:dev=lcd,E-LCD,if=BGR24,bpp=16,ro=1 video=mxcfb1:dev=mipi_dsi,TRULY-WVGA,if=RGB24,bpp=16,ro=6 video=mxcfb2:dev=hdmi,1280x720M@60,if=RGB24,bpp=16 vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled no_console_suspend video=vfb ircamera=640x480 androidboot.serialno=0620a9d4ea9dbfb5
root@sabresd_6dq:/mnt # cat /proc/version
Linux version 4.1.15-g4e2736d-dirty (captain@captain-virtual-machine) (gcc version 4.9.x-google 20140827 (prerelease) (GCC) ) #44 SMP PREEMPT Fri Jun 19 09:51:13 CST 2020
root@sabresd_6dq:/mnt #

0 Kudos

11,653 Views
chenw
Contributor II
您好,
root@sabresd_6dq:/ # ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: external
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Link detected: yes
root@sabresd_6dq:/ # mount -o rw,remount /
root@sabresd_6dq:/ #
root@sabresd_6dq:/ # iperf3 -c 172.16.101.82 -R
Connecting to host 172.16.101.82, port 5201
Reverse mode, remote host 172.16.101.82 is sending
[  4] local 172.16.101.1 port 59327 connected to 172.16.101.82 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  6.74 MBytes  56.5 Mbits/sec
[  4]   1.00-2.00   sec  4.37 MBytes  36.7 Mbits/sec
[  4]   2.00-3.00   sec  4.98 MBytes  41.7 Mbits/sec
[  4]   3.00-4.00   sec  7.38 MBytes  61.9 Mbits/sec
[  4]   4.00-5.00   sec  4.43 MBytes  37.2 Mbits/sec
[  4]   5.00-6.00   sec  5.74 MBytes  48.2 Mbits/sec
[  4]   6.00-7.00   sec  4.92 MBytes  41.3 Mbits/sec
[  4]   7.00-8.00   sec  4.02 MBytes  33.7 Mbits/sec
[  4]   8.00-9.00   sec  4.01 MBytes  33.6 Mbits/sec
[  4]   9.00-10.00  sec  7.53 MBytes  63.2 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  54.2 MBytes  45.5 Mbits/sec                  sender
[  4]   0.00-10.00  sec  54.1 MBytes  45.4 Mbits/sec                  receiver
iperf Done.
0 Kudos

11,653 Views
chenw
Contributor II

dear sun,

感谢回复!

目前我找到了相关的dts文件,这个文件2014年到现在,是没有修改过的

drivers/pinctrl相关的代码,有解析dts设置的pinctrl变量;drivers/of/of_net.c里面,解析了phy-mode变量;
drivers/net/ethernet/freescale/fec_main.c里面解析了phy-reset-duration变量、phy-reset-gpios
ixmuxc括号里的配置参数,暂时还没找到使用的地方;

是否可以帮忙提供一下,android6的以太网相关的文件路径?

请问fec_main.c,是包括了AR8053驱动么?

(我对比了android4.3和android6的代码,差异较大)

0 Kudos