How configure kernel to add support LAN96455 chip

Hello,

I need to add the support of the microchip switch LAN96455 using DSA buildig with yocto the image.

Could someone give me any suggestion ?.

Thank you

Best regards

Flavio Gobber

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


(1), (2), (3)

Adding Microchip LAN96455 Switch Support with DSA in Yocto

Overview

To add support for the Microchip LAN96455 switch using DSA (Distributed Switch Architecture) in your Yocto build, you’ll need to create custom layers and modify device tree configurations(1)(2).

Step-by-Step Approach

1. Create a Custom Meta Layer

First, create a custom meta layer for your switch configuration(2):

$ git init  
$ git commit -m "Initial Commit" -m "Add <meta-mylayer> from template"  

(2)

Note: For Torizon OS builds, all custom layers must be version controlled by Git(2).

2. Device Tree Configuration

Based on the DSA switch configuration example for KSZ9893(3), you’ll need to adapt the device tree for the LAN96455. Here’s the general structure you should follow:

&fec {
    phy-mode = "rgmii";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&pinctrl_fec>;
    pinctrl-1 = <&pinctrl_fec_sleep>;
    status = "okay";

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

        switch0: ksz9893@0 {
            compatible = "microchip,ksz9893";
            reg = <0>;

            dsa,member = <0 0>;

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

                port@0 {
                    reg = <0>;
                    label = "cpu";
                    ethernet = <&fec>;
                    phy-mode = "rgmii-id";
                    /* No phy-handle here for switch CPU port */
                };

                port@1 {
                    reg = <1>;
                    label = "lan1";
                };

                port@2 {
                    reg = <2>;
                    label = "lan2";
                };
            };
        };
    };
};

(3)

3. Key Configuration Points

RGMII Pin Configuration

  • Ensure your pinctrl_fec matches the RGMII signals routed between the SoC and the LAN96455(3)
  • Verify the phy-mode setting matches your hardware connection(3)

Switch CPU Port Configuration

  • Configure the CPU port with appropriate phy-mode (e.g., "rgmii-id" for internal delay)(3)
  • Set the correct ethernet reference to your FEC interface(3)

4. Layer Integration

Add your custom layer to the bblayers.conf file in your Yocto build directory(2). The structure should include your custom layer in the layers list(2).

5. Building the Image

Use the standard Yocto build process(1):

  • Export the environment setup script(1)
  • Setup your machine configuration(1)
  • Use bitbake to build the image(1)

Important Considerations

  • Compatibility String: You’ll need to determine the correct compatible string for the LAN96455. Check the Linux kernel documentation for the exact string.
  • Port Configuration: Adapt the port configuration to match the LAN96455’s specific port layout and capabilities.
  • Driver Support: Ensure the LAN96455 driver is enabled in your kernel configuration.

References

For detailed information on creating custom layers and recipes, refer to the comprehensive guides on building Reference Images with Yocto Project(1) and creating custom meta layers(2).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @flavio!

The answer from Toradex AI appears to be a good starting point. Did you make any progress?

You may need to open the menuconfig in your Yocto environment and enable the LAN96455 chip driver before building the image.

Best regards.