imx6ul双网口(LAN8720A)

底板:B5

核心板:CM6P

CPU:MCIMX6G2CVM05AA(i.MX6UL)

uboot:u-boot2015.04

内核:linux-3.14.38


这两天调试CM6P核心板+B5底板网络不稳定的问题:

1.双网口的其中一个或是两个不停重复link up, link down

2.双网口的其中一个或是两个已经lin up上了,但是无法自动获取IP和设置固定IP都无法ping通路由器。

 核心板是以排针的形式插入底板,怎么都没想到是因为插针接触不好导致的。


在这个过程中,了解到LAN8720A在一些平台上有个bug,就是接到网络不断重复link,up,link down。其中有一种解决方法是配置DTS,让网络初始化之后reset一下,也就是配置一个GPIO,在fec节点上添加‘phy-reset-gpios=<>’

备注:因为板子遇到的问题不是这个问题,所以没有验证过能不能解决此类问题,在这里只是记录一下

双网口配置如下:

&fec1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet1>;
        phy-mode = "rmii";
        phy-handle = <ðphy0>;
        status = "okay";
};

&fec2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet2>;
        phy-mode = "rmii";
        phy-handle = <ðphy1>;
        phy-reset-gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
        phy-reset-duration = <1>;
        status = "okay";

        mdio {
                #address-cells = <1>;
                #size-cells = <0>;

                ethphy0: ethernet-phy@2 {
                        compatible = "ethernet-phy-ieee802.3-c22";
                        reg = <1>;
                };

                ethphy1: ethernet-phy@1 {
                        compatible = "ethernet-phy-ieee802.3-c22";
                        reg = <0>;
                };
        };
};

......

                pinctrl_enet1: enet1grp {
                        fsl,pins = <
                                MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN      0x1b0b0
                                MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER      0x1b0b0
                                MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
                                MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
                                MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN      0x1b0b0
                                MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
                                MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
                                MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1  0x4001b031
                        >;
                };

                pinctrl_enet2: enet2grp {
                        fsl,pins = <
                                MX6UL_PAD_GPIO1_IO07__ENET2_MDC         0x1b0b0
                                MX6UL_PAD_GPIO1_IO06__ENET2_MDIO        0x1b0b0
                                MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN      0x1b0b0
                                MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER      0x1b0b0
                                MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
                                MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
                                MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN      0x1b0b0
                                MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
                                MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
                                MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2  0x4001b031
                        //      MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00      0x80000000
                                MX6UL_PAD_SNVS_TAMPER2__GPIO5_IO02      0x70a1

                        >;
                };





你可能感兴趣的:(i.MX6)