AnsweredAssumed Answered

dts for  P2041 connect to ethernet switch?

Question asked by jun cai on Mar 9, 2017
Latest reply on May 2, 2017 by jun cai

I have a custom board with Marvell 88E6097 ethernet switch which is connected directly to freescale P2041 processor.

 

 

p2041-sgmii

I use the kernel source from  The Linux Kernel Archives , for debug, I only use eth0 in the dts like this:

        fman@400000 {
            ethernet@e0000 {
                /* phy-handle = <&phy_sgmii_4>; */
                phy-connection-type = "sgmii";
                sgmii-autoneg-disable = <1>;
                sgmii-fixed-link = <1>;
            };
            /* ethernet@e2000 { */
                /* phy-handle = <&phy_sgmii_5>; */
                /* phy-connection-type = "sgmii"; */
            /* }; */
    };

 

     dsa@0 {
        compatible = "marvell,dsa";
        #address-cells = <2>;
        #size-cells = <0>;

 

        interrupts = <10>;
        dsa,ethernet = <&enet0>;
        dsa,mii-bus = <&mdio0>;

 

        switch@0 {
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <4 0>;    /* MDIO address 16, switch 0 in tree */

 

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

 

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

 

            port@4 {
                reg = <8>;
                label = "cpu";
                /* phy-handle = "&phy_sgmii_4"; */
            };
        };
    };

 

check the log, I found phylib find the device, and DSA can't found the etherenet dev.

 

libphy: Fixed MDIO Bus: probed
libphy: mdio_driver_register: mv88e6085
iommu: Adding device ffe488000.port to group 21
libphy: Freescale PowerQUICC MII Bus: probed
fsl_mac ffe4e0000.ethernet: FMan dTSEC version: 0x08240101
fsl_mac ffe4e0000.ethernet: FMan MAC address: 00:04:9f:ef:05:01

 

Distributed Switch Architecture driver version 0.1
junote dsa_of_probe device tree done
junote dsa_of_probe net device node = ethernet done
junote not find dev

 

 

 

use log to check the blocking position, I found the function of_find_net_device_by_node in dsa.c.

check again, I found it blocked by class_find_device in net_sysfs.c

 

so there should be some error with dts file about ethernet config. please help me to check it. thanks.

Outcomes