Confusion about Ethernet redeclarations in imx8mp-verdin.dtsi

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

Did you like my answer?

:+1: :-1:


Good afternoon,

The confusion you’re experiencing stems from the way device tree source (DTS) files are structured and how they are compiled into a device tree blob (DTB). Let’s break down your questions:

1. Aliases in Device Trees:

Aliases in device trees are used to provide a consistent naming scheme across different parts of the device tree. They don’t change the actual hardware configuration but provide a way to reference devices more easily.

2. Swapping Aliases:

In the imx8mp.dtsi file, the aliases ethernet0 and ethernet1 are initially set to &fec and &eqos respectively. However, in the imx8mp-verdin.dtsi file, these aliases are swapped. This means that ethernet0 now points to &eqos and ethernet1 points to &fec.

3. Why the Swap?

The swap in aliases is likely done to match the specific hardware configuration of the Verdin iMX8MP SoM. The Verdin module might have different pin assignments or hardware configurations that necessitate this change. By swapping the aliases, the device tree ensures that the correct Ethernet controller is used for the appropriate physical interface.

4. Effect on Compiled Device Tree:

When the device tree is compiled, the aliases are resolved to their respective hardware nodes. The actual hardware configuration (register addresses, pinctrl settings, etc.) defined in the DTS files will be used in the final DTB. The swap in aliases ensures that the correct hardware settings are applied to the correct Ethernet controller.

5. Yocto and Device Trees:

In Yocto, the device tree files are compiled as part of the build process. The build system takes the various DTS files, applies any patches or overlays, and compiles them into a DTB file. The aliases in the DTS files are resolved during this compilation process.

6. PTP 1588 on Verdin iMX8MP:

For PTP 1588 support, you need to ensure that the Ethernet controller and PHY support hardware timestamping. The eqos (Ethernet Quality of Service) controller on the iMX8MP typically supports PTP 1588. You will need to enable the appropriate settings in the device tree and ensure that the kernel has the necessary drivers and configurations enabled.

Summary:

  • The swap in aliases is done to

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

Ethernet Switch Interface.