Intermittent Ethernet PHY Initialization Issue on Colibri iMX8QXP

Hello!

I’m encountering an intermittent issue on some devices using the Colibri iMX8QXP module running Torizon OS 5.7. Occasionally, when the system is restarted via software (e.g., using sudo reboot), the Ethernet interface fails to initialize during boot. The system seems unable to detect the “PHY” device in these cases (Micrel KSZ8041).

Interestingly, a hardware reset resolves the issue, and the Ethernet interface initializes correctly.

Currently, we suspect the issue could be related to one of the following:

  • Residual states in the PHY after a software restart.
  • A misconfiguration in the bootloader or device tree.

However, this issue is not consistently reproducible across all devices, making it more challenging to diagnose.

I would greatly appreciate any guidance or suggestions.

Also, find here some relevant DT sections.

/* Colibri FastEthernet */
&fec1 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&pinctrl_fec1>;
	pinctrl-1 = <&pinctrl_fec1_sleep>;
	phy-mode = "rmii";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;
	fsl,wakeup_irq = <0>;

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;

		ethphy0: ethernet-phy@2 {
			compatible = "ethernet-phy-ieee802.3-c22";
			max-speed = <100>;
			reg = <2>;
		};
	};
};
/* Colibri Ethernet: On-module 100Mbps PHY Micrel KSZ8041 */
		pinctrl_fec1: fec1grp {
			fsl,pins = <
				IMX8QXP_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0_PAD	0x000014a0 /* Use pads in 3.3V mode */
				IMX8QXP_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1_PAD	0x000014a0 /* Use pads in 3.3V mode */
				IMX8QXP_ENET0_MDC_CONN_ENET0_MDC		0x06000020
				IMX8QXP_ENET0_MDIO_CONN_ENET0_MDIO		0x06000020
				IMX8QXP_ENET0_RGMII_TX_CTL_CONN_ENET0_RGMII_TX_CTL	0x61
				IMX8QXP_ENET0_RGMII_TXC_CONN_ENET0_RCLK50M_OUT	0x06000061
				IMX8QXP_ENET0_RGMII_TXD0_CONN_ENET0_RGMII_TXD0	0x61
				IMX8QXP_ENET0_RGMII_TXD1_CONN_ENET0_RGMII_TXD1	0x61
				IMX8QXP_ENET0_RGMII_RX_CTL_CONN_ENET0_RGMII_RX_CTL	0x61
				IMX8QXP_ENET0_RGMII_RXD0_CONN_ENET0_RGMII_RXD0	0x61
				IMX8QXP_ENET0_RGMII_RXD1_CONN_ENET0_RGMII_RXD1	0x61
				IMX8QXP_ENET0_RGMII_RXD2_CONN_ENET0_RMII_RX_ER	0x61
			>;
		};

		pinctrl_fec1_sleep: fec1-sleep-grp {
			fsl,pins = <
				IMX8QXP_ENET0_MDC_LSIO_GPIO5_IO11		0x06000041
				IMX8QXP_ENET0_MDIO_LSIO_GPIO5_IO10		0x06000041
				IMX8QXP_ENET0_RGMII_TX_CTL_LSIO_GPIO4_IO30	0x41
				IMX8QXP_ENET0_RGMII_TXC_LSIO_GPIO4_IO29		0x41
				IMX8QXP_ENET0_RGMII_TXD0_LSIO_GPIO4_IO31	0x41
				IMX8QXP_ENET0_RGMII_TXD1_LSIO_GPIO5_IO00	0x41
				IMX8QXP_ENET0_RGMII_RX_CTL_LSIO_GPIO5_IO04	0x41
				IMX8QXP_ENET0_RGMII_RXD0_LSIO_GPIO5_IO05	0x41
				IMX8QXP_ENET0_RGMII_RXD1_LSIO_GPIO5_IO06	0x41
				IMX8QXP_ENET0_RGMII_RXD2_LSIO_GPIO5_IO07	0x41
			>;
		};

In addition, I’ve been evaluating the following potential improvements:

  • Hardware Reset Time Delay: Implementing a property such as phy-reset-duration = <5>; to introduce a delay for hardware reset.
  • Manual Reset Interruption via GPIO: Considering an active low GPIO-mapped manual reset implementation to add more control during reset sequences.

Thanks in advance!

1 Like

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

Thank you for reaching out with your question about the Ethernet PHY initialization issue on the Colibri iMX8QXP module running Torizon OS 5.7. Let’s explore some potential solutions to address this intermittent problem.

  1. Device Tree Configuration:

    • Double-check the device tree settings for the Ethernet PHY. Ensure that the phy-mode is set to “rmii” and that the phy-handle correctly references the PHY node. Also, verify that the reg property matches the actual address of the PHY on the MDIO bus.
    • Review the pinctrl settings to ensure they are correctly configured for both active and sleep states, as incorrect configurations can lead to initialization issues.
  2. Residual States in PHY:

    • Consider implementing a reset sequence for the PHY during the boot process. This can be achieved by adding a GPIO-controlled reset line in the device tree, if not already present, to ensure the PHY is reset during boot.
    • Check for any known issues or errata related to the Micrel KSZ8041 PHY that might affect its behavior after a software reset.
  3. Bootloader Configuration:

    • Examine the bootloader environment settings to ensure they are not interfering with Ethernet initialization. Sometimes, bootloader settings can override device tree configurations.
    • If feasible, test with different bootloader versions or configurations to determine if the issue persists.
  4. Testing and Isolation:

    • Since the issue is intermittent, try to isolate it by testing under various conditions, such as different power supply levels or environmental factors, to see if these affect the frequency of the issue.

By following these steps, you should be able to narrow down the cause of the Ethernet PHY initialization issue. If the problem continues, further investigation into the hardware and software interactions may be necessary.

I hope this helps! If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

Colibri IMX8QXP losing network and USB after flashing for the first time.

Hey @Nasser,

Can you send us what specific Colibri IMX8QXP you are using, there should be a product ID number on the module. Also, what carrier board are you using? Does this issue persist with our development boards?

-Eric

Sure,

It’s the Colibri iMX8QXP 2GB IT V1.0D With the ID: 7269726.
We’re not using a carrier board of yours, the device it’s integrated on a board developed by us.
We can provide you with the schematic section where the RJ45 connector connections integrate with the PHY below: