本文转载自:https://blog.****.net/qq_33205540/article/details/90031627
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
[*] PHY Device support and infastructure -->
[*] Drivers for Marvell PHYs
修改DTS:
&mdio {
status = "okay";
phy0: [email protected] {
compatible = "marvell,88e1510";
reg = <0>;
};
phy1: [email protected] {
compatible = "marvell,88e1510";
reg = <1>;
};
};
ð0 {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
phy-mode = "rgmii-id";
status = "okay";
phy = <&phy0>;
};
ð1 {
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配置。