CPU用的是Armada-3720,内核版本是4.14。两路网口,eth0用RGMII模式,20_18_2:0默认111, eth1用SGMII模式,20_18_2:0默认001,88e1512的phy地址只能用0、1,(0也是mdio广播地址)。

menuconfig内核配置里把以下选项勾上,

Device Drivers->
     [*]Network device support ->
          [*]Ethernet driver support ->
               [*] Marvell devices<br />
          [*] PHY Device support and infastructure -->
               [*] Drivers for Marvell PHYs

 

修改DTS:

&mdio {
                status = "okay";
                phy0: ethernet-phy@0 {
                compatible = "marvell,88e1510";
                reg = <0>;
        };
                phy1: ethernet-phy@1 {
                compatible = "marvell,88e1510";
                reg = <1>;
        };
};

&eth0 {
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii_pins>;

        phy-mode = "rgmii-id";
        status = "okay";
        phy = <&phy0>;
};


&eth1 {
        phy-mode = "sgmii";

        status = "okay";
        phy = <&phy1>;
        phys = <&a3700_comphy0 1>;  //sgmii通过serdes,和USB3.0复用
};

这里要把USB3.0禁用掉;

&usb3{
        status = "disabled";
        /* Generic PHY, providing serdes lanes */
//      phys = <&a3700_comphy0 0>;
//      phy-names = "usb";
};

另外sgmii to copper 模式协商暂停是不可靠的,所以使用此PHY时禁用暂停模式支持,这个补丁内核里已经支持,

LED0-1的显示设置成最常用的模式,16_3配置为0X1016(第三页的第16个寄存器),这个可以在drivers/net/phy/marvell.c里的MII_88E1510_PHY_LED_DEF配置。

如果觉得我的文章对你有用,请随意赞赏