How to make Marvell switch mv88e6352 work with kernel 4.1.15 on IMX6Q ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to make Marvell switch mv88e6352 work with kernel 4.1.15 on IMX6Q ?

6,721 Views
pierrickguitter
Contributor I

So I have been trying to run the mv88e6352 switch work with my custom imx6q board with 4.1.15 linux kernel. 
In my kernel configuration, I added CONFIG_NET_DSA and CONFIG_NET_DSA_MV88E6352.
To comply with DSA needs, I complemented my device tree with the entry below:

dsa@0{

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

            dsa,ethernet = <&fec>;
            dsa,mii-bus = <&mdio>;

            switch@0 {

                           #address-cells = <1>;
                           #size-cells = <0>;
                           reg = <0 0>;

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

                           port@1 {
                                       reg = <1>;
                                       label = "swp1";
                           };
                           port@2 {
                                       reg = <2>;
                                       label = "swp2";
                           };

                           port@3 {
                                       reg = <3>;
                                       label = "swp3";
                           };

                           port@5 {
                                       reg = <5>;
                                         label = "cpu";
                           };
              };
};

and I modified my fec entry:

&fec {
            compatible = "fsl,imx6q-fec";
            pinctrl-names = "default";
            pinctrl-0 = <>;
            phy-mode = "mii"; //rgmii
            phy-reset-gpios = <>;/*phy-reset-gpios = <&gpio1 25 0>;*/

            fixed-link = <0 1 100 0 0>;
            status = "okay";

            mdio: mdio@0 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                        ethphy: ethernet-phy@0 {
                                    //reg=<0>;
                                    compatible = "fec_enet_mii_bus";
                                    status = "ok";
                        };
            };

};

However, I always obtain DSA errors ( "[0]: could not detect attached switch"), meaning that the switch was not properly registered by the mv88e6352 driver, due to the PHY itself not being ready ("ethernet supply phy not found, using dummy regulator"). The PHY in question only becomes ready at the end of my initialisation.
Thus, I built the mentionned above kernel drivers (dsa_core and mv88e6xxx_drv) dynamically, and I inserted them way after the PHY being ready. However, it won't work in module mode, as there is an inter-dependency between the 2 drivers. By a horrible modification in dsa_core, I finally obtained the instanciation of the switch (and I can trigger all my ports defined in the device tree through "ip" or "ifconfig"  commands in user space), but I have a kernel Deadlock.

So I think I have got something wrong about my PHY, that's why I am wondering if there is any reason why it is ready so late during my board's initialization.

Labels (1)
Tags (2)
0 Kudos
5 Replies

4,011 Views
AshishYadav
Contributor I

Hi Pierrick,

Is this issue is resolved or still in process  ?

Thanks 

0 Kudos

4,011 Views
wano_wei
Contributor I

I also have this issue, any update?

IMX6Q+Marvell switch mv88e6172

Linux kernel : 4.1.15

[ 3.553322] fec 2188000.ethernet eth0: MDIO read timeout
[ 3.557344] fec 2188000.ethernet eth0: [0]: could not detect attached switch
[ 3.563099] fec 2188000.ethernet eth0: [0]: couldn't create dsa switch instance (error -22)

0 Kudos

4,011 Views
igorpadykov
NXP Employee
NXP Employee

Hi pierrick

one can look at

[RFC,net-next,8/8] net: dsa: mv88e6xxx: Allow them to be proper PHY drivers - Patchwork 

also one can post this to meta-fsl-arm mailing list, so that more people could try to assist you.
https://lists.yoctoproject.org/listinfo/meta-freescale

Best regards
igor

0 Kudos

4,011 Views
pierrickguitter
Contributor I

Hi Igor,

I applied this patch, and the seven other before (they seemed to be needed). 
However, fec ethernet throw me the error "broken fixed-link specification".
It seems that the patch [RFC,net-next,2/8] net: phy: Check fixup lists in get_phy_device() - Patchwork  that I applied is in cause here.
Best Regards,
Pierrick

0 Kudos

4,011 Views
pierrickguitter
Contributor I

Erratum: I gave the wrong device tree entry for ethernet fec. Here is the good one:

&fec {
            compatible = "fsl,imx6q-fec";
            pinctrl-names = "default";
            pinctrl-0 = <>;
            phy-mode = "rgmii";
            phy-reset-gpios = <>;/*phy-reset-gpios = <&gpio1 25 0>;*/

            fixed-link = <0 1 100 0 0>;


            status = "okay";

            mdio: mdio@0 {
                        status = "okay";
            };

};

0 Kudos