在dts里添加接在pcie上的rtl8111网卡的子节点,并使其与连接在mdio总线上的mv88e6390网卡连接
时间: 2024-03-05 13:47:54 浏览: 186
Linux下 PCIe转网卡驱动 RTL8111芯片
好的,您的问题是如何在dts中添加接在pcie上的rtl8111网卡的子节点,并使其与连接在mdio总线上的mv88e6390网卡连接。
首先,在dts中添加pcie节点:
```
pcie@<base_address> {
compatible = "pci-host-ecam-generic";
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
ranges;
reg = <0x00000000 0x00000000 0x00000000 <base_address> 0x00000000 0x00010000>;
// 添加RTL8111网卡子节点
rtl8111@0,0 {
compatible = "rtl8111";
reg = <0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000 0x00000000>;
};
};
```
然后,添加mdio节点:
```
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "mdio-bus";
// 添加MV88E6390网卡子节点
mv88e6390@0 {
compatible = "marvell,mv88e6390";
reg = <0x0>;
mdio-mux {
#address-cells = <1>;
#size-cells = <0>;
// 建立RTL8111和MV88E6390之间的连接
rtl8111_mdio_mux: mdio-mux@0 {
compatible = "mdio-mux";
#address-cells = <1>;
#size-cells = <0>;
mux-reg = <0x0>;
mux-val = <0x0>;
mux-mask = <0x1f>;
mdio0: mdio@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "smi";
reg = <0x0>;
phy0: ethernet-phy@0 {
reg = <0x0>;
};
};
mdio1: mdio@1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "smi";
reg = <0x1>;
phy1: ethernet-phy@1 {
reg = <0x1>;
};
};
};
};
};
};
```
最后,需要在设备树中将RTL8111网卡与MV88E6390网卡连接起来:
```
&rtl8111 {
mdio-mux = <&rtl8111_mdio_mux>;
};
```
这样就完成了RTL8111网卡和MV88E6390网卡的连接。
阅读全文