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

am437x u-boot mii能够找到两个以太网Phy

Ti的技术支持:你好!

我在调试am4372的定制板,在u-boot(版本号是2013.10)的mux.c中将以太网rmii接口的PinMux引脚配置如下:

static struct module_pin_mux henry_rmii1_pin_mux[] = {

       {OFFSET(mii1_txd1), MODE(1)},                 /* RMII1_TD1 */

       {OFFSET(mii1_txd0), MODE(1)},                 /* RMII1_TD0 */

       {OFFSET(mii1_rxd1), MODE(1) | RXACTIVE},      /* RMII1_RD1 */

       {OFFSET(mii1_rxd0), MODE(1) | RXACTIVE},      /* RMII1_RD0 */

       {OFFSET(mii1_crs), MODE(1) | RXACTIVE},        /* RMII1_CRS_DV */

       {OFFSET(mii1_txen), MODE(1)},                 /* RMII1_TXEN */

       {OFFSET(mii1_rxerr), MODE(1) | RXACTIVE},      /* RMII1_RXERR */

       {OFFSET(rmii1_refclk), MODE(0) | RXACTIVE},    /* RMII1_refclk */

       {-1},

};

MDIO引脚配置如下:

static struct module_pin_mux mdio_pin_mux[] = {

       {OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},/* MDIO_DATA */

       {OFFSET(mdio_clk), MODE(0) | PULLUP_EN},     /* MDIO_CLK */

       {-1},

};

u-boot运行起来,在u-boot中,通过mii命令,在MDIO总线上,能够扫描到两个以太网Phy,而实际只有Phy地址为3的那个以太网,命令如下所示:

在Linux系统,版本为4.19.94,将rmii的设备树配置如下:

Linux的启动日志中,也通过MDIO总线扫描到了两个Phy,日志信息如下:

     请技术支持看看这个具体是什么原因造成,为什么会扫描到Phy地址0的设备?

Shine:

图片显示不出来,请点击右下角的“使用高级编辑器编辑文本”插入图片,谢谢!

henry gore:

回复 Shine:

Ti技术支持:你好!由于图片没有上传,我重新编辑一次

我在调试am4372的定制板,在u-boot(版本号是2013.10)的mux.c中将以太网rmii接口的PinMux引脚配置如下:

static struct module_pin_mux henry_rmii1_pin_mux[] = {

       {OFFSET(mii1_txd1), MODE(1)},                 /* RMII1_TD1 */

       {OFFSET(mii1_txd0), MODE(1)},                 /* RMII1_TD0 */

       {OFFSET(mii1_rxd1), MODE(1) | RXACTIVE},      /* RMII1_RD1 */

       {OFFSET(mii1_rxd0), MODE(1) | RXACTIVE},      /* RMII1_RD0 */

       {OFFSET(mii1_crs), MODE(1) | RXACTIVE},        /* RMII1_CRS_DV */

       {OFFSET(mii1_txen), MODE(1)},                 /* RMII1_TXEN */

       {OFFSET(mii1_rxerr), MODE(1) | RXACTIVE},      /* RMII1_RXERR */

       {OFFSET(rmii1_refclk), MODE(0) | RXACTIVE},    /* RMII1_refclk */

       {-1},

};

MDIO引脚配置如下:

static struct module_pin_mux mdio_pin_mux[] = {

       {OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},/* MDIO_DATA */

       {OFFSET(mdio_clk), MODE(0) | PULLUP_EN},     /* MDIO_CLK */

       {-1},

};

u-boot运行起来,在u-boot中,通过mii命令,在MDIO总线上,能够扫描到两个以太网Phy,而实际只有Phy地址为3的那个以太网,命令如下所示:

 

在Linux系统,版本为4.19.94,将rmii的设备树配置如下:

Linux的启动日志中,也通过MDIO总线扫描到了两个Phy,日志信息如下:

请技术支持看看这个具体是什么原因造成,为什么会扫描到Phy地址0的设备?

Shine:

回复 henry gore:

请看一下下面e2e帖子的回复。
e2e.ti.com/…/3516749

henry gore:

回复 Shine:

My SDK is from ti-processor-sdk-linux-rt-am437x-evm-06.03.00.106-Linux-x86-Install.bin, the version of Linux kernel is 4.19.94.
I don't want to set cpsw in switch mode, I config the dts accroding to am437x-gp-evm.dts, the PHY address is set to 3 by hardware.

It is abnormal, when set the phy address to 0, it is able to ping the target of my PC, but a lot of packets are lost; when set
the phy address to 3, it is also able to ping the target of my PC, a lot of packets are also lost.

Shine:

回复 henry gore:

请看一下下面e2e帖子的回复。
e2e.ti.com/…/3516749

建议用下面wiki网站上的方法ethtool -S eth0看一下网口的状态来判断是什么错误。
processors.wiki.ti.com/…/5x_CPSW

henry gore:

回复 Shine:

The following is my log when ping the local target:
[root@nud bin]# ping 192.168.1.222
PING 192.168.1.222 (192.168.1.222): 56 data bytes
64 bytes from 192.168.1.222: seq=0 ttl=128 time=0.982 ms
64 bytes from 192.168.1.222: seq=1 ttl=128 time=0.840 ms
64 bytes from 192.168.1.222: seq=3 ttl=128 time=1.002 ms
64 bytes from 192.168.1.222: seq=5 ttl=128 time=1.257 ms
64 bytes from 192.168.1.222: seq=7 ttl=128 time=0.828 ms
64 bytes from 192.168.1.222: seq=9 ttl=128 time=0.713 ms
64 bytes from 192.168.1.222: seq=11 ttl=128 time=0.917 ms
64 bytes from 192.168.1.222: seq=14 ttl=128 time=0.804 ms
^C
— 192.168.1.222 ping statistics —
16 packets transmitted, 8 packets received, 50% packet loss
round-trip min/avg/max = 0.713/0.917/1.257 ms
[root@nudt bin]# ./ethtool -S eth0
NIC statistics:Good Rx Frames: 70Broadcast Rx Frames: 21Multicast Rx Frames: 32Pause Rx Frames: 0Rx CRC Errors: 18Rx Align/Code Errors: 31Oversize Rx Frames: 0Rx Jabbers: 0Undersize (Short) Rx Frames: 0Rx Fragments: 22Rx Octets: 11644Good Tx Frames: 52Broadcast Tx Frames: 3Multicast 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: 4758Rx + Tx 64 Octet Frames: 19Rx + Tx 65-127 Octet Frames: 113Rx + Tx 128-255 Octet Frames: 12Rx + Tx 256-511 Octet Frames: 2Rx + Tx 512-1023 Octet Frames: 25Rx + Tx 1024-Up Octet Frames: 0Net Octets: 32729Rx Start of Frame Overruns: 0Rx Middle of Frame Overruns: 0Rx DMA Overruns: 0Rx DMA chan 0: head_enqueue: 1Rx DMA chan 0: tail_enqueue: 165Rx 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: 32Rx DMA chan 0: good_dequeue: 38Rx DMA chan 0: requeue: 0Rx DMA chan 0: teardown_dequeue: 0Tx DMA chan 0: head_enqueue: 50Tx DMA chan 0: tail_enqueue: 2Tx DMA chan 0: pad_enqueue: 0Tx DMA chan 0: misqueued: 2Tx 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: 9Tx DMA chan 0: empty_dequeue: 50Tx DMA chan 0: busy_dequeue: 0Tx DMA chan 0: good_dequeue: 52Tx DMA chan 0: requeue: 0Tx DMA chan 0: teardown_dequeue: 0
[root@nud bin]#

henry gore:

回复 henry gore:

[root@nud bin]# ./ethtooleth0
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 reportedLink partner advertised link modes:10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link 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
[root@nud bin]#

henry gore:

回复 henry gore:

[root@nud bin]# ./ethtool eth0 | egrep 'Speed|Duplex'Speed: 100Mb/sDuplex: Full
[root@nud bin]#
[root@nud bin]#
[root@nud bin]# ./ethtool -S eth0 | grep CRCRx CRC Errors: 57
[root@nud bin]#
[root@nud bin]#
[root@nud bin]# ./ethtool -S eth0| grep ErrorsRx CRC Errors: 57Rx Align/Code Errors: 85Carrier Sense Errors: 0
[root@nud bin]#
[root@nud bin]# ./ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:248
RX Mini:0
RX Jumbo:0
TX:248
Current hardware settings:
RX:128
RX Mini:0
RX Jumbo:0
TX:128

[root@nud bin]#

Shine:

回复 henry gore:

这些MAC statistics提示的error表示PHY没有正常工作,是板子的硬件问题如PCB layout或者是PHY的问题。这块板子是第一次跑Linux吗?

Rx CRC Errors: 57
Rx Align/Code Errors: 85

建议联系PHY厂家看看是不是PHY的问题。

henry gore:

回复 Shine:

这个板子是第一个调试。但是在u-boot下能够通过TFTP下载文件,没有发现丢包,日志如下:

probe PMIC tps65218 failed!tps65218_init failed!Not found the LCD header ICNet: <ethaddr> not set. Validating first E-fuse MACcpswHit any key to stop autoboot: 0 U-Boot# U-Boot# U-Boot# U-Boot# U-Boot# setenv ipaddr 192.168.1.100U-Boot# setenv netmask 255.255.255.0U-Boot# setenv serverip 192.168.1.222U-Boot# U-Boot# U-Boot# tftp ${loadaddr} zImagelink up on port 0, speed 100, full duplexUsing cpsw deviceTFTP from server 192.168.1.222; our IP address is 192.168.1.100Filename 'zImage'.Load address: 0x80200000Loading: ################################################################# ################################################################# ################################################################# ################################################################# ########################################## 445.3 KiB/sdoneBytes transferred = 4424192 (438200 hex)U-Boot# U-Boot# U-Boot# ping 192.168.1.222link up on port 0, speed 100, full duplexUsing cpsw devicehost 192.168.1.222 is aliveU-Boot#

赞(0)
未经允许不得转载:TI中文支持网 » am437x u-boot mii能够找到两个以太网Phy
分享到: 更多 (0)