Gianfar Ethernet Device Driver used in MPC8641D-HPCN

Ashish Khetan curieux.khetan at gmail.com
Wed Apr 9 05:10:40 EDT 2014


Hi,
I Have MPC8641D-HPCN based custom designed board and After some changes the
Linux 3.14 is now booting on my board. we are using same phy device ie
vitesse vsc8244. The Difference between my board and the original board is
in only PHY interrupt ie

Our custom Designed Board               MPC8641D-HPCN original board
eTSEC0(mac)----> phy0 ---- irq0               eTSEC0(mac)----> phy0 ----
irq10
eTSEC1(mac)----> phy1 ---- irq1               eTSEC1(mac)----> phy1 ----
irq10
eTSEC2(mac)----> phy2 ---- irq2               eTSEC2(mac)----> phy2 ----
irq10
eTSEC3(mac)----> phy3 ---- irq3               eTSEC3(mac)----> phy3 ----
irq10

After Booting Linux the first Ethernet device is only eTSEC0 is working
means at booting time it detects all 4 ports and initialize all ports. The
following IP addresses are assigned to each port:

interface    Board IP                       Host IP
eth0   ----   192.168.10.2               192.168.10.1
eth1   ----   192.168.20.2               192.168.20.1
eth2   ----   192.168.30.2               192.168.30.1
eth3   ----   192.168.40.2               192.168.40.1

when i Tried to ping from board to host (ie ping 192.168.10.1) through eth0
its pinging. but when i tried to ping from other ports ie eth1, eth2 & eth3
its not pinging and prints "destination host not reachable". Also I tried
to ping from pc(ie host) to board same result was printing.

Then I started debugging, I put a printk function inside Gianfar.c file and
gfar_clean_rx_ring() for printing packet sequence and packet size. I
started pinging each port from pc (ie host) and its printing on each
reception as:
For eth0
[   94.966113] Packet 1 size 60
[   95.965588] Packet 2 size 120
[   97.980729] Packet 3 size 180
[   98.980705] Packet 4 size 240
[   99.998872] Packet 5 size 300

and same for other interfaces too.

Here is the device tree snap-shot for ethernet which I am using with this
kernel (hope may be helpful):

enet0: ethernet at 24000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        cell-index = <0>;
                        device_type = "network";
                        model = "TSEC";
                        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>;
                        tbi-handle = <&tbi0>;
                        phy-handle = <&phy0>;
                        phy-connection-type = "rgmii-id";

                        mdio at 520 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                compatible = "fsl,gianfar-mdio";
                                reg = <0x520 0x20>;

                                phy0: ethernet-phy at 0 {
                                        interrupt-parent = <&mpic>;
                                        interrupts = <0 1>;
                                        reg = <0>;
                                        device_type = "ethernet-phy";
                                };
                                phy1: ethernet-phy at 1 {
                                        interrupt-parent = <&mpic>;
                                        interrupts = <1 1>;
                                        reg = <1>;
                                        device_type = "ethernet-phy";
                                };
                                phy2: ethernet-phy at 2 {
                                        interrupt-parent = <&mpic>;
                                        interrupts = <2 1>;
                                        reg = <2>;
                                        device_type = "ethernet-phy";
                                };
                                phy3: ethernet-phy at 3 {
                                        interrupt-parent = <&mpic>;
                                        interrupts = <3 1>;
                                        reg = <3>;
                                        device_type = "ethernet-phy";
                                };
                                tbi0: tbi-phy at 11 {
                                        reg = <0x11>;
                                        device_type = "tbi-phy";
                                };
                        };
                };
                enet1: ethernet at 25000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        cell-index = <1>;
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
                        reg = <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>;
                        tbi-handle = <&tbi1>;
                        phy-handle = <&phy1>;
                        phy-connection-type = "rgmii-id";

                        mdio at 520 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                compatible = "fsl,gianfar-tbi";
                                reg = <0x520 0x20>;

                                tbi1: tbi-phy at 11 {
                                        reg = <0x11>;
                                        device_type = "tbi-phy";
                                };
                        };
                };


Is this happening because of phy interrupt or something else?  Please
through some light on this. how to make it working? how to disable phy
interrupt? Does phy interrupt matters for gianfar interrupt or polling mode?

Please give some pointer/anything to help more understanding of ethernet
driver.

Thanks And Regards

A$hi$h
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140409/dd861812/attachment.html 


More information about the Kernelnewbies mailing list