Hi @embeddedsystem,
To add another ethernet port to your Apalis iMX8, you’ll need to add a fec2
node with all the configurations for your external PHY chip. Let me show you an example:
&fec1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_fec1>;
pinctrl-1 = <&pinctrl_fec1_sleep>;
fsl,magic-packet;
fsl,mii-exclusive;
phy-handle = <ðphy0>;
phy-mode = "rgmii-id";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@7 {
compatible = "ethernet-phy-ieee802.3-c22";
interrupt-parent = <&lsio_gpio1>;
interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
micrel,led-mode = <0>;
reg = <7>;
reset-assert-us = <2>;
reset-deassert-us = <2>;
reset-gpios = <&lsio_gpio1 11 GPIO_ACTIVE_LOW>;
reset-names = "phy-reset";
};
};
};
This is the fec1 node from the imx8-apalis-v1.1.dtsi. It describes the first ethernet connection port that comes with Apalis by default. Now, let’s see an example form NXP evaluation board, where they added the second ethernet port:
&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec2>;
phy-mode = "rgmii-txid";
phy-handle = <ðphy1>;
phy-supply = <®_fec2_supply>;
fsl,magic-packet;
nvmem-cells = <&fec_mac1>;
nvmem-cell-names = "mac-address";
fsl,rgmii_rxc_dly;
status = "okay";
};
This comes from imx8qm-mek.dts.
Therefore, you will need to add the fec2 node and the configurations related to your external chip. You can use the above device tree node as an example for your project.
Remember to follow the recommendation from the Apalis iMX8 datasheet:
The secondary RGMII/RMII Ethernet interface is not part of the Apalis standard. Therefore, the
signals are not compatible with other Apalis modules. Most of the signals are located on the
module edge connector pins, originally reserved as a parallel RGB LCD interface.
The secondary RGMII/RMII Ethernet interface needs special attention regarding the supply voltage
level. The RGMII/RMII voltage is switchable through LDO1OUT of the second PMIC PF8100. The
voltage level must be defined by software configuration. During the power-up sequence, the IO
voltage is set to 3.3V by default. All the RGMII/RMII signals are configured as GPIO inputs with
enabled pull-down resistors. If the interface is used with 1.8V IO voltage, it is crucial to configure
first the LDO1OUT voltage and then change the alternate function to RGMII/RMII. This ensures full
compatibility with 1.8V RGMII signal levels.
If the secondary Ethernet interface is used as RGMII, the output voltages are limited to 1.8V and
2.5V. For RMII and other alternate functions (e.g., GPIO) of these pins, also 3.3V logic level is
available. Please note that the ENET1_MDC and ENET1_MDIO are always set to 3.3V, independent
of the RGMII/RMII signals’ output voltage settings. This switchable I/O rail was introduced on V1.1
of the Apalis iMX8 module. The V1.0 is only able to output 3.3V. Please note that using the RGMII
interface at a 3.3V voltage level is not supported by the specification of the SoC and is not
recommended by NXP.
Let me know if you need anything else.
Best Regards,
Hiago.