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?
你好,请问下,你解决了吗
这是通信双方自动协商的配置,PHY里面有这个寄存器配置。
关于详细的解释,你可以参考这个:
https://www.rootopen.com/article/5cc55deed590e21a4eb73dcb
Weidong
感谢回复
在千兆网速度起来的情况下,插拔一下网线或者关机重启,速度就掉下去了,请问拔-插网线后,adb shell状态下,有没有什么指令可以复位PHY?或者什么指令直接写PHY的某个寄存器,然后就100%可以恢复正常?
目前千兆网速度低是常态,重复尝试以下动作多次,有时候速度会起来,成功概率不大
(有三种操作都遇到恢复正常的情况:1、拔掉网线-接入;2、autoneg off后重启;3、autoneg off后 on )
自动协商的方式,它必须要保证通信双方数据正确性,然后才会跑约定好的速率。不过,你可以固定配置它跑千兆,这个不需要在寄存器级去配置,网络命令就可以配置固定10M/100M/1000M,您可以网上查一下相关资料。 不过,配置为固定1000M模式,会不会在网络环境不好的情况下,产生数据丢包,这都不好说的。
所以,你可以测试一下,但是仍然建议您自动协商模式比较好。
Weidong
感谢回复!
目前的情况看,自动协商autoneg on的情况下,才能正常识别网线;
我们有以下四种场景,有碰到千兆网可以概率性的恢复速度:
1、自协商off后机器重启;
2、拔插网线;
3、自协商off后直接on;
4、ifconfig eth0 down后ifconfig eth0 up
但是概率较低,请问是否有办法进一步分析?
(在千兆网速度起来的情况下,插拔一下网线或者关机重启,速度就掉下去了)
这种情况,很难判断是哪里引起的,不过,您可以这样测试一下:
1. 换一下带有屏蔽层的质量更好一些的网线。
2. 找一个板子,换成AR8031,看看网速情况。
Weidong
您好
ethtool -s eth0 speed 100 duplex full,测试iperf3正常
ethtool -s eth0 speed 1000 duplex full,测试iperf3就不行了
您好,
网线换了没有效果,请问是否可以通过增加打印信息来debug查看哪里的问题?
换成AR8031,对我们来说,没有必要,因为android4.3是好的,是android6.0出现的异常
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
add more info
升级android6后:
百兆网络是正常的,千兆网不可用
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备份一下,再用附件的替换它。
伟东
dear sun,
感谢回复
您提供的文件,和我目前使用的代码是一样的,请知悉
有没有可能是dts里面的参数,需要修改,或者特殊配置?
Hello Chen Wei,
dts里的配置不需要修改,和EVK的AR8031的方式是一样的。只要是rgmii模式配置了、PHY地址正确,就可以。
上面也就看到AR8035的ID初始化配置了,这能保证fec driver找到PHY,并用MDIO对它进行配置。
另外,I.MX6Q系列的MAC有一个硬件限制,就是速度达不到1000MHz,最大是400Mbps,这个在勘误表里已经有了说明,所以你再看看是不是这个问题。
伟东
您好,上面是今天的测试数据,请帮忙看看,可以怎么优化改善?
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 #
dear sun,
感谢回复!
目前我找到了相关的dts文件,这个文件2014年到现在,是没有修改过的
是否可以帮忙提供一下,android6的以太网相关的文件路径?
请问fec_main.c,是包括了AR8053驱动么?
(我对比了android4.3和android6的代码,差异较大)