TI中文支持网
TI专业的中文技术问题搜集分享网站

am335x +DP83848 + DP83867

项目中使用am335x 的cpsw连接一路百兆网口和一路千兆网口,芯片分别是DP83848(eth0)和DP83867(eth1),百兆网口能够正常工作,千兆网口能够link up,但是无法ping通,设备树配置如下:

&mac {

pinctrl-names = "default", "sleep";

pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = "okay";
dual_emac = <1>;
};

&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
status = "okay";
dp83867_0: ethernet-phy@3 {
reg = <3>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
ti,tx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
ti,min-output-impedance;
ti,dp83867-rxctrl-strap-quirk;
};

dp83848_0: ethernet-phy@7 { reg = <7>;
};
};

&cpsw_emac0 {
phy_id = <&davinci_mdio>, <7>;
dual_emac_res_vlan = <1>;
phy-mode = "rmii";
};

&cpsw_emac1 {
phy_id = <&davinci_mdio>, <3>;
dual_emac_res_vlan = <2>;
phy-mode = "rgmii-id";
};

内核log如下

Configuring network interfaces…

[ 10.518385] net eth0: initializing cpsw version 1.12 (0)
[ 10.687456] NS DP83848C 10/100 Mbps PHY 4a101000.mdio:07: attached PHY driver [NS DP83848C 10/100 Mbps PHY] (mii_bus:phy_addr=4a101000.mdio:07, irq=POLL)
[ 10.701969] PHY_INTERFACE_MODE_RMII
[ 10.705494] gmii_sel:reg=0xe9
[ 10.718883] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 10.724805] 8021q: adding VLAN 0 to HW filter on device eth0
[ 10.773229] net eth1: initializing cpsw version 1.12 (0)
[ 10.789765] TI DP83867 4a101000.mdio:03: attached PHY driver [TI DP83867] (mii_bus:phy_addr=4a101000.mdio:03, irq=POLL)
[ 10.801731] AM33XX_GMII_SEL_MODE_RGMII
[ 10.805508] gmii_sel:reg=0xe9
[ 10.813426] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 10.819411] 8021q: adding VLAN 0 to HW filter on device eth1

[ 12.888081] _cpsw_adjust_link:mac_control=0x20
[ 12.892601] cpsw 4a100000.ethernet eth1: Link is Up – 100Mbps/Full – flow control rx/tx
[ 12.901400] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
其中 gmii_sel为0xe9,根据数据手册寄存器,gmii_sel配置没有问题,千兆网口插入和拔出网口会正常link up和link down,但是无法ping通,请TI的各位帮忙指导下

Nancy Wang:

请完成这个链接的checklist并且将结果贴出来。
processors.wiki.ti.com/…/5x_CPSW

yongqing wang:

配置参考这个看看:e2e.ti.com/…/634038

user1794335:

回复 Nancy Wang:

回复 Nancy Wang:

root@am335x-evm:~# ./ethtool -S eth1
NIC statistics:Good Rx Frames: 38565Broadcast Rx Frames: 9091Multicast Rx Frames: 19520Pause Rx Frames: 0Rx CRC Errors: 0Rx Align/Code Errors: 0Oversize Rx Frames: 0Rx Jabbers: 0Undersize (Short) Rx Frames: 0Rx Fragments: 0Rx Octets: 8405990Good Tx Frames: 9970Broadcast Tx Frames: 4Multicast Tx Frames: 26Pause Tx Frames: 0Deferred Tx Frames: 0Collisions: 0Single Collision Tx Frames: 0Multiple Collision Tx Frames: 0Excessive Collisions: 0Late Collisions: 0Tx Underrun: 0Carrier Sense Errors: 0Tx Octets: 680480Rx + Tx 64 Octet Frames: 7600Rx + Tx 65-127 Octet Frames: 28925Rx + Tx 128-255 Octet Frames: 1268Rx + Tx 256-511 Octet Frames: 558Rx + Tx 512-1023 Octet Frames: 10127Rx + Tx 1024-Up Octet Frames: 57Net Octets: 9086470Rx Start of Frame Overruns: 0Rx Middle of Frame Overruns: 0Rx DMA Overruns: 0Rx DMA chan 0: head_enqueue: 1Rx DMA chan 0: tail_enqueue: 19170Rx DMA chan 0: pad_enqueue: 0Rx DMA chan 0: misqueued: 0Rx DMA chan 0: desc_alloc_fail: 0Rx DMA chan 0: pad_alloc_fail: 0Rx DMA chan 0: runt_receive_buf: 0Rx DMA chan 0: runt_transmit_bu: 0Rx DMA chan 0: empty_dequeue: 0Rx DMA chan 0: busy_dequeue: 18603Rx DMA chan 0: good_dequeue: 19043Rx DMA chan 0: requeue: 0Rx DMA chan 0: teardown_dequeue: 0Tx DMA chan 0: head_enqueue: 9970Tx DMA chan 0: tail_enqueue: 0Tx DMA chan 0: pad_enqueue: 0Tx DMA chan 0: misqueued: 0Tx DMA chan 0: desc_alloc_fail: 0Tx DMA chan 0: pad_alloc_fail: 0Tx DMA chan 0: runt_receive_buf: 0Tx DMA chan 0: runt_transmit_bu: 9911Tx DMA chan 0: empty_dequeue: 9970Tx DMA chan 0: busy_dequeue: 0Tx DMA chan 0: good_dequeue: 9970Tx DMA chan 0: requeue: 0Tx DMA chan 0: teardown_dequeue: 0

root@am335x-evm:~# ./ethtooleth1
Settings for eth1:Supported ports: [ TP MII ]Supported link modes:10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/Half 1000baseT/FullSupported pause frame use: Symmetric Receive-onlySupports auto-negotiation: YesSupported FEC modes: Not reportedAdvertised link modes:10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/Half 1000baseT/FullAdvertised pause frame use: NoAdvertised auto-negotiation: YesAdvertised FEC modes: Not reportedLink partner advertised link modes:10baseT/Half 10baseT/Full100baseT/Half 100baseT/FullLink partner advertised pause frame use: Symmetric Receive-onlyLink partner advertised auto-negotiation: YesLink partner advertised FEC modes: Not reportedSpeed: 100Mb/sDuplex: FullPort: MIIPHYAD: 3Transceiver: internalAuto-negotiation: onSupports Wake-on: dWake-on: dCurrent message level: 0x00000000 (0)Link detected: yes
上面是ethtools -S eth1 和ethtools eth1 命令的状态显示,麻烦帮忙指导下

user1794335:

回复 yongqing wang:

这个帖子已经参考过了,但是还是没有解决我的问题

user1794335:

回复 user1794335:

root@am335x-evm:~# ifconfig eth1
eth1Link encap:EthernetHWaddr 50:8C:B1:DF:90:FAinet addr:192.168.1.1Bcast:0.0.0.0Mask:255.255.255.0inet6 addr: fe80::528c:b1ff:fedf:90fa/64 Scope:LinkUP BROADCAST RUNNING MULTICASTMTU:1500Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:16 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B)TX bytes:1256 (1.2 KiB)

root@am335x-evm:~# uname -a
Linux am335x-evm 4.14.40+ #172 PREEMPT Wed Jul 31 11:40:05 CST 2019 armv7l GNU/Linux

pdk版本是ti-processor-sdk-linux-am335x-evm-05.00.00.15

user1794335:

回复 Nancy Wang:

Nancy:
您那边还有什么其他办法吗?

Nancy Wang:

回复 user1794335:

能否提供相应的eth0的输出进行比较?

user1794335:

回复 Nancy Wang:

eth0未接网线时候的状态:
./ethtool eth0
Settings for eth0:Supported ports: [ TP MII ]Supported link modes:10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supported pause frame use: Symmetric Receive-onlySupports auto-negotiation: YesSupported FEC modes: Not reportedAdvertised link modes:10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Advertised pause frame use: NoAdvertised auto-negotiation: YesAdvertised FEC modes: Not reportedSpeed: 10Mb/sDuplex: HalfPort: MIIPHYAD: 7Transceiver: internalAuto-negotiation: onSupports Wake-on: dWake-on: dCurrent message level: 0x00000000 (0)Link detected: no
./ethtool -S eth0
NIC statistics:Good Rx Frames: 0Broadcast Rx Frames: 0Multicast Rx Frames: 0Pause Rx Frames: 0Rx CRC Errors: 0Rx Align/Code Errors: 0Oversize Rx Frames: 0Rx Jabbers: 0Undersize (Short) Rx Frames: 0Rx Fragments: 0Rx Octets: 0Good Tx Frames: 12Broadcast Tx Frames: 0Multicast Tx Frames: 12Pause Tx Frames: 0Deferred Tx Frames: 0Collisions: 0Single Collision Tx Frames: 0Multiple Collision Tx Frames: 0Excessive Collisions: 0Late Collisions: 0Tx Underrun: 0Carrier Sense Errors: 0Tx Octets: 984Rx + Tx 64 Octet Frames: 0Rx + Tx 65-127 Octet Frames: 12Rx + Tx 128-255 Octet Frames: 0Rx + Tx 256-511 Octet Frames: 0Rx + Tx 512-1023 Octet Frames: 0Rx + Tx 1024-Up Octet Frames: 0Net Octets: 984Rx Start of Frame Overruns: 0Rx Middle of Frame Overruns: 0Rx DMA Overruns: 0Rx DMA chan 0: head_enqueue: 1Rx DMA chan 0: tail_enqueue: 127Rx DMA chan 0: pad_enqueue: 0Rx DMA chan 0: misqueued: 0Rx DMA chan 0: desc_alloc_fail: 0Rx DMA chan 0: pad_alloc_fail: 0Rx DMA chan 0: runt_receive_buf: 0Rx DMA chan 0: runt_transmit_bu: 0Rx DMA chan 0: empty_dequeue: 0Rx DMA chan 0: busy_dequeue: 0Rx DMA chan 0: good_dequeue: 0Rx DMA chan 0: requeue: 0Rx DMA chan 0: teardown_dequeue: 0Tx DMA chan 0: head_enqueue: 12Tx DMA chan 0: tail_enqueue: 0Tx DMA chan 0: pad_enqueue: 0Tx DMA chan 0: misqueued: 0Tx DMA chan 0: desc_alloc_fail: 0Tx DMA chan 0: pad_alloc_fail: 0Tx DMA chan 0: runt_receive_buf: 0Tx DMA chan 0: runt_transmit_bu: 0Tx DMA chan 0: empty_dequeue: 12Tx DMA chan 0: busy_dequeue: 0Tx DMA chan 0: good_dequeue: 12Tx DMA chan 0: requeue: 0Tx DMA chan 0: teardown_dequeue: 0

ifconfig eth0
eth0Link encap:EthernetHWaddr 50:8C:B1:DF:90:F8inet6 addr: fe80::528c:b1ff:fedf:90f8/64 Scope:LinkUP BROADCAST MULTICASTMTU:1500Metric:1RX packets:41 errors:0 dropped:4 overruns:0 frame:0TX packets:6 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:3195 (3.1 KiB)TX bytes:516 (516.0 B)Interrupt:47

user1794335:

回复 Nancy Wang:

千兆网口兼容百兆的网线么

Nancy Wang:

回复 user1794335:

从目前获得的信息来看没有看出来什么原因导致的,你是否有用抓包工具去获取eth1的数据包看一下或者有什么错误出现吗?
另外能不能麻烦贴出eth0连接网线的输出状态?

赞(0)
未经允许不得转载:TI中文支持网 » am335x +DP83848 + DP83867
分享到: 更多 (0)