Cannot ping via eth0 with ls1012a processor

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

Cannot ping via eth0 with ls1012a processor

1,383 Views
kai_wu
Contributor III

Hi,

I am using the Linux 5.3 from nxp on my board (with ls1012a).  See the Figure 1 below.

pastedImage_2.png

Figure 1: Connection between ethernet switch and ls1012a

What I did:

  1. I enabled the spi-fsl-dspiksz9477_spi(compatiable with 9897), fsl-ppfe modules in menuconfig.       
  2. Turned on the dspi node in my device tree source.    
  3. In device treee source, added sub node under dspi node.

When I turned on the board, the dmesg output for dspi is shown as Figure 2.

pastedImage_31.png

Figure 2: fsl-dspi output

When the board is turned on, I can see three interfaces lo, eth0 and eth1. See figure 3.

pastedImage_12.png

Figure 3: lo, eth0,and eth1

I configured eth0 with a static ip and a proper netmask, also I set up the route table, see Figure 4. 

pastedImage_14.png

Figure 4: eth0 with static ip

But when I tried to ping an other device connected to my board directly(in the same network). It failed with +4 errors. See Figure 5.

pastedImage_20.png

Figure 5: Ping with errors

I assume the problem is a result of incorrect device tree. I modified fsl-ls1012a-rdb.dts(reference board device tree)  to be my device tree source.  Figure 6 is the pfe node. In my board, I am using dspi to control the ethernet switch(ksz9897), but in ls1012ardb, it uses mdio instead. I am not sure if I should delete the mdio node here or how to connect ethernet switch in device tree.  In the pfe node below, there is mdio sub node.

pastedImage_25.png

In dspi node, I added a sub node for the ethernet switch. see Figure 7 below.  So I am not sure where is the problem, is it between PFE and switch or between DSPI and switch. 

Does anyone know how to solve this problem? Thank you.

pastedImage_35.png

Figure 7: dspi node with switch sub node

Labels (1)
3 Replies

1,065 Views
yipingwang
NXP TechSupport
NXP TechSupport


Hello Kai Wu,

According to your description, the device node pfe_mac0 should be defined like the following.

pfe_mac0: ethernet@0 {
                compatible = "fsl,pfe-gemac-port";
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0x0>;    /* GEM_ID */
                fsl,mdio-mux-val = <0x0>;
                phy-mode = "sgmii";
                fixed-link = <1 1 10000 0 0>;
        };

Thanks,

Yiping

0 Kudos

1,065 Views
kai_wu
Contributor III

HI yipingwang

Thank you. I tried the pfe_mac0 node you gave me. 

The ping command is still not working. But the ping result changed from +4 errors to 0 received, see below.

pastedImage_5.png

                                               Figure 1: ping result: 0 received, 100% packet loss

Also there is no dmesg output for the etherenet swith node (ksz9477, which is connected to dspi).

It seems that the PFE MAC 0 is not talking to the ethernet switch at all.  All packets stopped at MAC. I assume that, in the device tree, the PFE MAC 0 is not connected to the ethernet switch logically yet or the switch on the dspi is not detected. Port 7 of this switch is connected to PFE MAC 0, see figure below, LAN1, LAN2 and LAN3 are used to plug in the etherenet cable.

                                                                 Figure 2: Ethernet switch connection

In the previous pfe_mac0 node(for ls1012a-rdb), I noticed there is a variable called phy-handle,  I am not sure if it is used to connect the switch to the PFE MAC. see figure below:

pastedImage_9.png

                                        Figure 3: pfe_mac0 node for ls1012a-rdb reference board.

Also the dmesg about pfe is shown below:

pastedImage_2.png

                                                                Figure 4: dmesg PFE output

Any help will be much appreciated,

thank you!

Kai

0 Kudos

1,065 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Kai Wu,

Please refer to L2switch design in T1040RDB.

pastedImage_1.png

8 Gigabit switch ports are external ports and are connected to external Phys

2 switch ports (2.5G) are connected to FMan ports

Internal ports connect to DPAA are defined as the following.

                        enet0: ethernet@e0000 {
                                fixed-link = <0 1 1000 0 0>;
                                phy-connection-type = "sgmii";
                                rcpm-wakeup = <&rcpm 0x80000000>;
                        };

                        enet1: ethernet@e2000 {
                                fixed-link = <1 1 1000 0 0>;
                                phy-connection-type = "sgmii";
                                rcpm-wakeup = <&rcpm 0x40000000>;
                        };

Thanks,

Yiping