xavier nx 平台 EQOS LAN端口连接异常问题调试3

free-jdx 2021-07-09 15:23:33 4852
1. 前言

承接上篇
https://www.ebaina.com/articles/140000012769

2. pe_test.sh支持USB2.0 & USB3.0测试

目前,在pe_test.sh中启用USB2.0检查,如下所示

test_and_check_init "usb storage" "lsusb -t" "Mass Storage, Driver=usb-storage, 480M"

如果您想使用USB 3.0,启用以下代码
并注释掉USB2.0检查

test_and_check_init "usb storage" "lsusb -t ; sleep 1" "Mass Storage, Driver=usb-storage, 5000M"

只要插入u盘并重启设备就可以了

如果eth0连接正确,USB卡插入
将自动重新启动并重复测试
如果eth0没有连接,可以通过它不重启来确定

3. 查看测试

可以拔下u盘停止测试
然后查看/root/pe_log/目录下的日志文件大小

注意:XAVIER NX DEVELOPER KIT环境是没有RTC电池,
所以logfilename datetime是不正确的

4. dump PHY

当非工作情况下,可以调试phy的diff值

已经做了mii在CustomBoard,而不是XavierEVK
似乎MII -tool没有一个功能dump MII寄存器与RAW值

# mii-tool -v eth0
eth0: negotiated 1000baseT-FD flow-control, link ok
  product info: vendor 00:07:32, model 17 rev 6
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

也尝试了ethtool -d
但EQOS驱动程序(由NVIDIA)没有实现get_regs()在eqos_ethtool_ops
所以我不能转储

# ethtool -d eth0
Cannot get register dump: Operation not supported

相反,设置了CONFIG_DEBUGFS_OBJ=y并从sysfs dump
连接正常

# cat /sys/kernel/debug/2490000.eqos/BCM_REGS

BroadCom Phy Regs
Control(0x0)                        : 0x1040
Status(0x1)                         : 0x79ad
Id1 (0x2)                           : 0x1c
Id2 (0x3)                           : 0xc916
Auto Neg Advertisement(0x4)         : 0xde1
Auto Neg Link Partner Ability(0x5)  : 0xc5e1
Auto Neg Expansion(0x6)             : 0x6f
Auto Neg Next Page(0x7)             : 0x2001
1000 Base-T Control(0x9)            : 0x200
1000 Base-T Status(0xa)             : 0x800
IEEE Extended Status(0xf)           : 0x2000
Extended Control(0x10)              : 0x0
Extended Status(0x11)               : 0x0
Rx Error Count(0x12)                : 0x0
False Carrier Sense Count(0x13)     : 0x0
Rx Not Ok Count(0x14)               : 0x0
10BASE-T(0x18, Shadow 001)          : 0xffff
Power/Mii Ctrl(0x18, Shadow 010)    : 0x0
Misc Test (0x18, Shadow 100)        : 0xffff
Misc Ctrl(0x18, Shadow 111)         : 0xffff
Int Status(0x1a)                    : 0xffff
Int Mask(0x1b)                      : 0xffff
Pkt Count(expansion reg 0xf00)      : 0xffff
EEE advertisement(C45, Dev7, 0x3C)  : 0xffff
EEE resolution (C45, Dev7, 0x803E)  : 0xffff
LPI Mode Counter(C45, Dev7, 0x803F) : 0xffff
ev7, 0x803F) : 0xffff

PHY_AN未被升起且无法连接

# cat /sys/kernel/debug/2490000.eqos/BCM_REGS

BroadCom Phy Regs
Control(0x0)                        : 0x1040
Status(0x1)                         : 0x79ad
Id1 (0x2)                           : 0x1c
Id2 (0x3)                           : 0xc916
Auto Neg Advertisement(0x4)         : 0xde1
Auto Neg Link Partner Ability(0x5)  : 0xc5e1
Auto Neg Expansion(0x6)             : 0x6d
Auto Neg Next Page(0x7)             : 0x2001
1000 Base-T Control(0x9)            : 0x200
1000 Base-T Status(0xa)             : 0x800
IEEE Extended Status(0xf)           : 0x2000
Extended Control(0x10)              : 0x0
Extended Status(0x11)               : 0x0
Rx Error Count(0x12)                : 0x0
False Carrier Sense Count(0x13)     : 0x0
Rx Not Ok Count(0x14)               : 0x0
10BASE-T(0x18, Shadow 001)          : 0xffff
Power/Mii Ctrl(0x18, Shadow 010)    : 0x0
Misc Test (0x18, Shadow 100)        : 0xffff
Misc Ctrl(0x18, Shadow 111)         : 0xffff
Int Status(0x1a)                    : 0xffff
Int Mask(0x1b)                      : 0xffff
Pkt Count(expansion reg 0xf00)      : 0xffff
EEE advertisement(C45, Dev7, 0x3C)  : 0xffff
EEE resolution (C45, Dev7, 0x803E)  : 0xffff
LPI Mode Counter(C45, Dev7, 0x803F) : 0xffff
ev7, 0x803F) : 0xffff
omal: Auto Neg Expansion(0x6)             : 0x6f
err:   Auto Neg Expansion(0x6)             : 0x6d

0110 1111
0110 1101

According to RTL8211F Datasheet...
8.3.7. ANER (Auto-Negotiation Expansion Register, Address 0x06)

6.1 Page Received (RC/LH)

1: A New Page (new LCW) has been received
0: A New Page has not been received

如果CustomBoard结果不可靠
将重新构建Image以获得EVK的结果

5. 对比正常和异常的网络状态

以下为正常连接时的值

# ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.77  netmask 255.0.0.0  broadcast 10.255.255.255
...

# mii-tool -vvv eth0
Using SIOCGMIIPHY=0x8947
eth0: negotiated 1000baseT-FD flow-control, link ok
  registers for MII PHY 1: 
    1040 79ad 001c c916 0de1 cde1 006f 2801
    6001 0200 7800 0000 0000 4007 0000 2000
    0000 0000 0000 0000 0000 0000 0000 0000
    211e 0862 38ec 0002 0000 0000 0000 0000
  product info: vendor 00:07:32, model 17 rev 6
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

以下是No Link Up时的状态

# ifconfig 
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 48:b0:2d:3d:78:86  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)

# mii-tool -vvv eth0
Using SIOCGMIIPHY=0x8947
eth0: negotiated 1000baseT-FD flow-control, link ok
  registers for MII PHY 1: 
    1040 79ad 001c c916 0de1 cde1 006f 2801
    6001 0200 7800 0000 0000 0000 0000 2000
    0000 0000 0000 0000 0000 0000 0000 0000
    211e 0862 38ee 0002 0000 0000 0000 0000
  product info: vendor 00:07:32, model 17 rev 6
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
[    9.033313] zram0: detected capacity change from 0 to 1018896384
[    9.063418] Adding 995012k swap on /dev/zram0.  Priority:5 extents:1 across:995012k SS
[    9.067749] zram1: detected capacity change from 0 to 1018896384
[    9.077659] Adding 995012k swap on /dev/zram1.  Priority:5 extents:1 across:995012k SS
[    9.086607] zram2: detected capacity change from 0 to 1018896384
[    9.105434] Adding 995012k swap on /dev/zram2.  Priority:5 extents:1 across:995012k SS
[    9.117362] zram3: detected capacity change from 0 to 1018896384
[    9.138138] Adding 995012k swap on /dev/zram3.  Priority:5 extents:1 across:995012k SS
[   10.472549] tegradc 15200000.nvdisplay: blank - powerdown
[   10.472561] tegradc 15210000.nvdisplay: blank - powerdown
[   11.266847] fuse init (API version 7.26)
[   34.141767] vdd-1v8-sd: disabling
[   34.141778] vdd-1v8-cvb: disabling
[   34.141784] vdd-epb-1v0: disabling
[   34.141789] avdd-cam-2v8: disabling
[   34.141794] vdd-fan: disabling
[   34.141800] vdd_sys_en: disabling
[18130.279002] sdhci-tegra 3400000.sdhci: Tuning done, restoring the best tap value : 58
root@contec-desktop:~# mii-tool -vvv eth0
Using SIOCGMIIPHY=0x8947
eth0: negotiated 1000baseT-FD flow-control, link ok
  registers for MII PHY 1: 
    1040 79ad 001c c916 0de1 cde1 006f 2801
    6001 0200 7800 0000 0000 0000 0000 2000
    0000 0000 0000 0000 0000 0000 0000 0000
    211e 0862 38ee 0002 0000 0000 0000 0000
  product info: vendor 00:07:32, model 17 rev 6
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
root@contec-desktop:~# ifconfig 
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 48:b0:2d:3d:78:86  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 37  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 183961  bytes 11223695 (11.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 183961  bytes 11223695 (11.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rndis0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 66:2e:f9:7e:0f:91  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 66:2e:f9:7e:0f:93  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

mii-tool显示[link ok], ethtool显示[link detected: no]

# 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 Receive-only
        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 Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Link detected: no

已经通过mii-tool获得PHY dump

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
free-jdx
红包 95 收藏 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区