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的各位帮忙指导下

22 个回复

  • 请完成这个链接的checklist并且将结果贴出来。
    processors.wiki.ti.com/.../5x_CPSW
  • 回复 Nancy Wang:

    回复 Nancy Wang:

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

    root@am335x-evm:~# ./ethtool eth1
    Settings for eth1:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 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/Half 1000baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 3
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)
    Link detected: yes
    上面是ethtools -S eth1 和ethtools eth1 命令的状态显示,麻烦帮忙指导下
  • 回复 yongqing wang:

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

    root@am335x-evm:~# ifconfig eth1
    eth1 Link encap:Ethernet HWaddr 50:8C:B1:DF:90:FA
    inet addr:192.168.1.1 Bcast:0.0.0.0 Mask:255.255.255.0
    inet6 addr: fe80::528c:b1ff:fedf:90fa/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
    collisions: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
  • 回复 Nancy Wang:

    Nancy:
    您那边还有什么其他办法吗?
  • 回复 user1794335:

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

  • 回复 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-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Speed: 10Mb/s
    Duplex: Half
    Port: MII
    PHYAD: 7
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)
    Link detected: no

    ./ethtool -S eth0
    NIC statistics:
    Good Rx Frames: 0
    Broadcast Rx Frames: 0
    Multicast Rx Frames: 0
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 0
    Good Tx Frames: 12
    Broadcast Tx Frames: 0
    Multicast Tx Frames: 12
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 984
    Rx + Tx 64 Octet Frames: 0
    Rx + Tx 65-127 Octet Frames: 12
    Rx + Tx 128-255 Octet Frames: 0
    Rx + Tx 256-511 Octet Frames: 0
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 0
    Net Octets: 984
    Rx Start of Frame Overruns: 0
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 0
    Rx DMA chan 0: head_enqueue: 1
    Rx DMA chan 0: tail_enqueue: 127
    Rx DMA chan 0: pad_enqueue: 0
    Rx DMA chan 0: misqueued: 0
    Rx DMA chan 0: desc_alloc_fail: 0
    Rx DMA chan 0: pad_alloc_fail: 0
    Rx DMA chan 0: runt_receive_buf: 0
    Rx DMA chan 0: runt_transmit_bu: 0
    Rx DMA chan 0: empty_dequeue: 0
    Rx DMA chan 0: busy_dequeue: 0
    Rx DMA chan 0: good_dequeue: 0
    Rx DMA chan 0: requeue: 0
    Rx DMA chan 0: teardown_dequeue: 0
    Tx DMA chan 0: head_enqueue: 12
    Tx DMA chan 0: tail_enqueue: 0
    Tx DMA chan 0: pad_enqueue: 0
    Tx DMA chan 0: misqueued: 0
    Tx DMA chan 0: desc_alloc_fail: 0
    Tx DMA chan 0: pad_alloc_fail: 0
    Tx DMA chan 0: runt_receive_buf: 0
    Tx DMA chan 0: runt_transmit_bu: 0
    Tx DMA chan 0: empty_dequeue: 12
    Tx DMA chan 0: busy_dequeue: 0
    Tx DMA chan 0: good_dequeue: 12
    Tx DMA chan 0: requeue: 0
    Tx DMA chan 0: teardown_dequeue: 0

    ifconfig eth0
    eth0 Link encap:Ethernet HWaddr 50:8C:B1:DF:90:F8
    inet6 addr: fe80::528c:b1ff:fedf:90f8/64 Scope:Link
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:41 errors:0 dropped:4 overruns:0 frame:0
    TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:3195 (3.1 KiB) TX bytes:516 (516.0 B)
    Interrupt:47
  • 回复 user1794335:

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