The code of the driver (fec_main.c) suggestes that this problem might have been solved for i.MX28. However, with respect to i.MX6 the driver is messy, because it refers to FEC0, while i.MX6 has FEC1 and FEC2. Which one corresponds to that FEC0 from i.MX28? What is the order of probing FECs in i.MX28?
I may have been able to "move the problem elsewhere" by guessing this contents of the device tree:
&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet1>;
phy-mode = "rmii";
phy-handle = <ðphy0>;
status = "okay";
fsl,mii-exclusive;
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@0 {
// compatible = "smsc,lan8720";
// device_type = "ethernet-phy";
reg = <0>;
};
// ethphy1: ethernet-phy@1 {
// compatible = "smsc,lan8720";
// device_type = "ethernet-phy";
// reg = <1>;
// };
};
};
&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2>, <&pinctrl_enet2_mdio>;
phy-mode = "rmii";
phy-handle = <ðphy1>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
// ethphy0: ethernet-phy@0 {
// compatible = "smsc,lan8720";
// device_type = "ethernet-phy";
// reg = <0>;
// };
ethphy1: ethernet-phy@1 {
// compatible = "smsc,lan8720";
// device_type = "ethernet-phy";
reg = <1>;
};
};
};
Then, the startup sequence looks like what I would expect:
1) FEC2 gets probed, and its clocks initialized.
2) MDIO bus gets initialized and probed, but looks only for PHY1.
3) FEC1 gets probed, and its clocks initialized.
4) MDIO bus looks for PHY0.
The new problem is that FEC1 is unable to use the MDIO bus. Previously the read ID of (inactive) PHY0 was 0xffffffff (default state of MDIO), now it is 0x00000000 (no access to MDIO).
If I try to define MDIO pins in pinctrl-0 of FEC1, kernel detects a conflict with the already assigned MDIO pins of FEC2.
Best regards,
Adam