Enabling second ethernet connection to a fully hardware configured switch IC

hi @KDehren,

thanky your for your answers. I am sorry, I should have tested/compiled the device tree first beforehand. Can you try this one instead? This one compiled fine for me:

/dts-v1/;

#include "imx8mp-verdin.dtsi"
#include "imx8mp-verdin-nonwifi.dtsi"
#include "imx8mp-verdin-dev.dtsi"

/ {
	model = "My Toradex Verdin iMX8M Plus on Verdin Development Board with KSZ8873";
	compatible = "mytoradex,verdin-imx8mp-nonwifi-dev-ksz8873",
		     "toradex,verdin-imx8mp-nonwifi",
		     "toradex,verdin-imx8mp",
		     "fsl,imx8mp";
};

/delete-node/ &ethphy1; // we don't need this node which describes KSZ9131RNXI available on our Verdin Dev Board

&fec {
        #address-cells = <1>;
        #size-cells = <0>;
        phy-mode = "rmii";
        /delete-property/ phy-supply; //no need; supplied directly from SOM supply
        /delete-property/ phy-handle; //Otherwise, the kernel will log shows an error message about not being able to connect to the PHY

        fixed-link {
                speed = <100>;
                full-duplex;
        };
 
        /* I took this device tree as example: https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx6qdl-skov-cpu.dtsi?h=toradex_5.15-2.2.x-imx
        This is also a relevant binding: https://git.toradex.com/cgit/linux-toradex.git/tree/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml?h=toradex_5.15-2.2.x-imx
        */
        mdio{
                #address-cells = <1>;
                #size-cells = <0>;

                ksz8873@0 {
                        compatible = "microchip,ksz8873";
                        reg = <0>;

                        /* optional: you can define interrupt signal that can be used by the switch - Pin 41 INTRN on KSZ8873RLL */
                        interrupt-parent = <&gpio4>; //this will connect to the SODIMM 189 of the module as it is done for KSZ9131 on VErdin Dev Board
                        interrupts = <18 IRQ_TYPE_LEVEL_LOW>;
                        
                        /* optional: you can define reset signal that can be used for the switch - Pin 62 RSTN on KSZ8873RLL 
                        Alternatively, you can use CTRL_RESET_MOCI# on SODIMM 258 as we do it on for our KSZ9131 
                        refer to page 24 https://docs.toradex.com/109262-verdin-family-specification.pdf to know more about power management feature of our module */
                        reset-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; //just example - modify or remove
                        
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;

                                ports@0 {
                                        reg = <0>;
                                        phy-mode = "internal";
                                        label = "lan1";
                                };

                                ports@1 {
                                        reg = <1>;
                                        phy-mode = "internal";
                                        label = "lan2";
                                };

                                ports@2 {
                                        reg = <2>;
                                        label = "cpu";
                                        ethernet = <&fec>;
                                        phy-mode = "rmii";

                                        fixed-link {
                                                speed = <100>;
                                                full-duplex;
                                        };
                                };
                        };
                };
        };
};

Your issue with TorizonCore Builder seems to be something else, I never heard of that before. Is this happening for the first time?

I think this is related to TorizonCore Builder itself. Try just to put the SOM on our carrier board if it boots. You can at least debug via UART. If it doesn’t work, try to recover your SOM with a new image and maybe try to use non-RT quarterly image (not sure if there is the problem). You can try TorizonCore Builder customisation again. Here is again the documentation, maybe you missed some steps?

Alternatively, you can compile from the source code and copy the ethernet_toradex.dtb to the board by yourself, this is what I did.

If this device tree works, I recommend writing your own device tree that replace imx8mp-verdin-dev.dtsi and probably imx8mp-verdin-nonwifi.dtsi too (unless you have wireless version of your board so you want to keep them separate). Your final .dts will have all modifications or your carrier board and include only imx8mp-verdin.dtsi.