Find the answer to your Linux question:
Results 1 to 6 of 6
Hi , We have used Marvell 88E6131 8-port switch in our customized P2020 board.The switch is connected to Ethernet port of P2020 processor we have ported Kernel-3.4.3 to our board ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    24

    How to specify the ethernet switch details in Device tree (DTS) ?


    Hi ,

    We have used Marvell 88E6131 8-port switch in our customized P2020 board.The switch is connected to Ethernet port of P2020 processor

    we have ported Kernel-3.4.3 to our board and have enabled mv88e6131 driver support in kernel.

    When we port the kernel, mv88e6131 probe is not getting called and Ethernet port is not getting detected.

    Do i need to do any configuration in board dts file to initialize the Marvell switch ?

    shown below is my dts file,
    Code:
    enet0: ethernet@24000 {                         /*P2020 Connected to 88E1111 PHY GMII*/
                            #address-cells = <1>;
                            #size-cells = <1>;
                            cell-index = <0>;
                            device_type = "network";
                            model = "eTSEC";
                            compatible = "gianfar";
                            reg = <0x24000 0x1000>;
                            ranges = <0x0 0x24000 0x1000>;
                            local-mac-address = [ 00 00 00 00 00 00 ];
                            interrupts = <29 2 30 2 34 2>;
                            interrupt-parent = <&mpic>;
                            phy-handle = <&phy0>;
                            phy-connection-type = "gmii";
    
                            mdio@520 {
                                    #address-cells = <1>;
                                    #size-cells = <0>;
                                    compatible = "fsl,gianfar-mdio";
                                    reg = <0x520 0x20>;
    
                                    phy0: ethernet-phy@0 {
                                            interrupt-parent = <&mpic>;
                                            interrupts = <3 1>;
                                            reg = <0x3>;
                                    };
                                    phy1: ethernet-phy@1 {
                                            interrupt-parent = <&mpic>;
                                            interrupts = <3 1>;
                                            reg = <0x3>; /*  reg = <0x2>;*/
                                    };
                                    phy2: ethernet-phy@2 {
                                            interrupt-parent = <&mpic>;
                                            interrupts = <3 1>;
                                            reg = <0x3>; /*reg = <0x1>;*/
                                    };
                                    tbi1: tbi-phy@11 {
                                    reg = <0x11>;
                                    device_type = "tbi-phy";
                                    };
                                    tbi2: tbi-phy@12 {
                                    reg = <0x11>;
                                    device_type = "tbi-phy";
                                    };
    
                            };
                    };
     enet1: ethernet@25000 {                         /*P2020 Connected to SWITCH SGMII TSEC2*/
                            #address-cells = <1>;
                            #size-cells = <1>;
                            cell-index = <1>;
                            device_type = "network";
                            model = "eTSEC";
                            reg = <0x25000 0x1000>;
                            ranges = <0x0 0x25000 0x1000>; /*ranges = <0x0 0x25000 0x1000>;*/
                            local-mac-address = [ 00 00 00 00 00 00 ];
                            interrupts = <35 2 36 2 40 2>;
                            interrupt-parent = <&mpic>;
                            fixed-link = <1 1 1000 0 0>;
                            tbi-handle = <&tbi1>;
                            phy-handle = <&phy1>;
                            phy-connection-type = "sgmii";
    
            };
            enet2: ethernet@26000 {                         /*P2020 Connected to SWITCH SGMII TSEC3*/
                            #address-cells = <1>;
                            #size-cells = <1>;
                            cell-index = <2>;
                            device_type = "network";
                            model = "eTSEC";
                            reg = <0x26000 0x1000>;
                            ranges = <0x0 0x26000 0x1000>;
                            local-mac-address = [ 00 00 00 00 00 00 ];
                            interrupts = <31 2 32 2 33 2>;
                            interrupt-parent = <&mpic>;
                            fixed-link = <2 1 1000 0 0>;
                            tbi-handle = <&tbi2>;
                            phy-handle = <&phy2>;
                            phy-connection-type = "sgmii";
    
            };
    
            mpic: pic@40000 {
                            interrupt-controller;
                            #address-cells = <0>;
                            #interrupt-cells = <2>;
                            reg = <0x40000 0x40000>;
                            compatible = "chrp,open-pic";
                            device_type = "open-pic";
                    };



    please help me in this issue.

  2. #2
    Linux Newbie jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    173
    Vidya, I don't use this device or really know about it, but I maybe can assist in that I have some questions about your code. I'm hoping that I will ask the right questions to at least give you a hand in getting this hardware up and running.

    I noticed that you have a straight forward, yet complex structure. I do question where do you initialize it to the correct values such as device address? I don't believe this does it, but it needs to know where to look and I don't see where you have given it anything but a range. I also would double check the indirect references to other required data such as interrupt-parent.

    I don't see any other responses, so maybe I can, by ignorance lead you somewhere to check. Do you have a debugger that you can see if these are being correctly set and able to stop it at a place to see what response the device is give you if at all? It may be answering and you don't know it...

    It might also help to number these lines where you have a length of source, just so when we ask we can specify a line number to where the question is and we don't end up questioning our questions, if you know what I mean.

    I'll be gone for a couple of days, I hope you get it up and going, keep in touch.

    Jack
    Last edited by jkwilborn; 07-09-2013 at 09:17 PM. Reason: left out a needed word...

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    24
    Hi,

    Thanks for ur response,

    I am new to network related things.

    I just took an reference dts of p2020rdb board and made a device entries for our board.

    If the device range is wrong, i shouldn't able to ping the respective eTSEC's in linux. But i am able to ping all the eTSEC without issue.

    I suspect that the configuration of all eTSEC is handled by generic gianfar driver that the reason i am able to ping the device.

    I also added dsa entry in my dts to invoke the dsa probe function which in turn invoke the switch setup .

    Code:
    dsa0: dsa@0 {
                    device_type = "network";
                   /* model = "dsa";*/
                    compatible = "marvell,dsa";
                    #address-cells = <2>;
                    #size-cells = <0>;
    
                    interrupts = <10>;
                    dsa,ethernet = <&enet1>;
                    dsa,mii-bus = <&mii_bus>;
    
                    switch@0 {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            reg = <0x1 0>;   /* MDIO address 1, switch 0 in tree */
    
                            port@0 {
                                    reg = <0>;
                                    label = "front";
                            };
    
                            port@1 {
                                    reg = <1>;
                                    label = "eth1-backplane";
                            };
    
                            port@2 {
                                    reg = <2>;
                                    label = "eth2-backplane";
                            };
    
                            port@4 {
                                    reg = <4>;
                                    label = "dsp1";
                            };
    
                            port@6 {
                                    reg = <6>;
                                    label = "cpu";
                            };
                    };
    
            };
    But i got this message in linux,

    Code:
    dsa: probe of dsa.0 failed with error -22
    I'm not sure what to try next to get Linux to use MV88E6131 switch.

    Plz let me know if i need to change or edit anything in my board dts

  4. #4
    Linux Newbie jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    173
    Vidya, you really need to get a debugger running. These kind of run-time errors are a big headache and you really need to step through the code to get what's going on.

    The device seems to be returning you a -22 when it does the dsa.0 probe. This code should be in your error listing as any code that could be returned. Also ensure that you have set up the data types properly, i.e. that the bucket is signed or unsigned. As you know this could be something like 0xED for a byte unsigned. Or even larger for an unsigned 16 bit word. Since you have it compiling and up, I don't know if I can really help you now.

    If you do not have a running debug, it will be well worth you time to learn. When these occur, you can step through your code and see exactly where the problem is. Usually it's something that you have missed or forgotten about. Debuggers are really handy and sometimes difficult to get started, but believe me they are very worth wile.

    You can also put code in to handle these errors, but I strongly suggest you get a debugger set up to assist you in determining where you have a problem...

    I don't know this device, so I'm limited in my assistance. Get the information from the manufacturer along with possible error codes and data types to ensure you are reading them properly.

    Best of luck, I'm around if I can help...

    Jack

  5. #5
    Just Joined!
    Join Date
    Feb 2010
    Posts
    24
    I havnt used debugger till now. I read the linux kernel documentation on KGDB but tat wasn't enough for me to be able to use the newly built-in KGDB kernel debugger.


    Can you suggest me how to debug the kernel or if you have any document plz share.

  6. #6
    Linux Newbie jkwilborn's Avatar
    Join Date
    Nov 2012
    Posts
    173
    Sorry, I don't have much info on your device, but my guess it that you need to enable it in the assembly or compiler phases. Are you compiling your kernel? If so you may want to enable it there also just for a seemless flow.

    Are you on a mailing list for people with your device? I don't know if you have a plug computer that you are developing on or what and that may help. Most of them have mailing lists that have some pretty bright people that may assist you. My expierence is really with non Linux systems, as I am but a newbie in this area. Although I have Unix time, I can only generalize.

    Check out any mailing lists,
    read what you can from Wikipedia
    check for an IRC channel...

    All of these may assist you in getting your device working or enabling debug. Once you get comfortable on how to control a debugger and view things you will wonder how you lived without it.

    I am on this list

    Freedombox-discuss@lists.alioth.debian.org

    This is the general format, with this

    Freedombox-discuss Info Page

    as an entry, I believe. Find the one that works for you...

    Best of luck.... I'll keep my eye open...

    Jack

    P.S. bumped into this

    http://tanguy.wdscript.fr/?q=wnr854t

    Don't know if it will help, but sort of like what you are up to, no real debug. Just some mods...
    Last edited by jkwilborn; 07-22-2013 at 03:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •