This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am3354 rmii2配置问题



目前板子上有两个网口用的都是RMII模式,rmii1正常 rmii2一直ping不同!

RMII2中有个管脚U16 GPMC_A9 mode3有两种定义MMC2_DAT7 or RMII2_CRS_DV

我在dts里面通过下面的方式配置RMII2_CRS_DV功能:

AM33XX_IOPAD(0x864, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /*gpmc_a9.rmii2_crs*/ 
AM33XX_IOPAD(0x1320, 0x01)

目前up的时候错误提示如下:

# ifconfig eth1 up
[ 1209.381317] net eth1: initializing cpsw version 1.12 (0)
[ 1209.460090] libphy: PHY 4a101000.mdio:00 not found
[ 1209.465179] net eth1: phy "4a101000.mdio:00" not found on slave 1, err -19
[ 1209.528253] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
#

ping的时候网络也一直ping不同。

求高手指点,对于RMII2_CRS_DV这个引脚还需要配置什么东西,还需要从什么方面查找问题?

  • 请查看一下设备树里dual_emac是否使能?
    software-dl.ti.com/.../CPSW.html
  • /* Ethernet */
    &mac {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;
    status = "okay";
    dual_emac;
    };

    &davinci_mdio {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&davinci_mdio_default>;
    pinctrl-1 = <&davinci_mdio_sleep>;
    status = "okay";
    };

    &cpsw_emac0 {
    phy_id = <&davinci_mdio>,<1>;
    dual_emac_res_vlan = <2>;
    phy-mode = "rmii";
    reset-gpio = <&gpio0 2 GPIO_ACTIVE_LOW>;
    status = "okay";
    };

    &cpsw_emac1 {
    phy_id = <&davinci_mdio>,<0>;
    dual_emac_res_vlan = <3>;
    phy-mode = "rmii";
    reset-gpio = <&gpio2 1 GPIO_ACTIVE_LOW>;
    status = "okay";
    };

    &phy_sel {
    rmii-clock-ext;
    status = "okay";
    };


    按照这个配置! 结果还是提示下面错误

    [ 1209.381317] net eth1: initializing cpsw version 1.12 (0)
    [ 1209.460090] libphy: PHY 4a101000.mdio:00 not found
    [ 1209.465179] net eth1: phy "4a101000.mdio:00" not found on slave 1, err -19
    [ 1209.528253] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
  • 先把rmii1 disable掉,看rmii2单网口是否能ping通?
  • 试过了,情况是一样的!我在u-boot里面配置了一下,也没有ping通! 但是用这个U-boot加载内核时,内核中可以找到phy了,但是还是依然ping不通!!!!
  • 现在PHY已经可以正常的认出来了,但还是ping不通!已经可以看到下面的的信息了
    [ 9.864622] net eth1: initializing cpsw version 1.12 (0)
    [ 10.092649] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
    [ 13.207054] cpsw 4a100000.ethernet eth1: Link is Up - 100Mbps/Full - flow control off
    [ 13.216178] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

    问一下第三行的
    100Mbps/Full - flow control off 对着吗为什么是off。
    我另一个正常的网卡出来的是
    cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
  • 这个看上去link不稳定,请检查一下PHY那块的电路。对于flow control off的问题,可以参考下面的帖子。
    e2e.ti.com/.../739429
  • Ok! 问题解决。分享一下,
    PHY找不到的问题是因为我们的核心板和客户的地板上,lan8720指定PHY—addr的引脚(REER/PHYAD0 -> RMMI2_RXER)核心板做了上拉,底板做了下来,导致lan8720不能通过该引脚获取到phy地址,所以出现libphy: PHY 4a101000.mdio:00 not found。
    另外后面ping不同的问题完全是因为自己粗心,不小心把一个引脚的定义改错了,导致后面一直ping不同!