Hello everyone,
I’m experimenting some troubles in using the second ethernet on my custom board based on the Colibri iMX7.
My need is to boot up in DHCP mode and then, runtime, modify the ethernet configurations with static IPs.
I followed this article and I choose to use systemd-networkd service
Here is what I’m experiencing:
- I can correctly see both ETH0 and ETH1 from userspace but only ETH0 can obtain DHCP IP
- If I write config files (eth0.network and eth1.network) with static IPs, restarting the systemd-networkd service with both ethernet cable plugged in, both ETH0 and ETH1 stop sending pings. Removing ETH1 cable cause the ETH0 to work again.
- Rebooting the device after the config file definition makes both ethernet to work great with fixed IPs
- If I restart the systemd-networkd service with the only ETH0 ethernet cable linked in, the service restarts with no problems.
Here is the configuration for both ethernet devices in my custom device tree:
As a second PHY I am using a Micrel KSZ8041, already used for the FEC1.
// Ethernet 1
&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec1_1588>;
status = "okay";
phy-handle = <ðphy0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@0 {
reg = <0>;
micrel,led-mode = <1>;
};
};
};
// Ethernet 2
&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec2_1588 &pinctrl_fec2>;
clocks = <&clks IMX7D_ENET2_IPG_ROOT_CLK>,
<&clks IMX7D_ENET_AXI_ROOT_CLK>,
<&clks IMX7D_ENET2_TIME_ROOT_CLK>,
<&clks IMX7D_PLL_ENET_MAIN_50M_CLK>;
clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
assigned-clocks = <&clks IMX7D_ENET2_TIME_ROOT_SRC>,
<&clks IMX7D_ENET2_TIME_ROOT_CLK>,
<&clks IMX7D_ENET_PHY_REF_ROOT_DIV>;
assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
assigned-clock-rates = <0>, <100000000>, <50000000>;
phy-mode = "rmii";
fsl,mii-exclusive;
status = "okay";
phy-handle = <ðphy1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@1 {
reg = <1>;
micrel,led-mode = <1>;
};
};
};
In U-Boot i can see both PHY:
[upload|jGEND3Uw/Zdh2M/GSDm918SgQ5o=]
And here is the dmesg output:
[upload|x91yE3eKLu1rifO9O9KzGMBTLS0=]
I tried also to disable (through Yocto build) all connman services, without success.
I suppose that i need to better define (in u-boot or kernel) the presence of the second ethernet.
Any suggestion?
Thank you in advance for your help,
Luca