AnsweredAssumed Answered

P1010 eTSEC1/2/3 SGMII mode configure

Question asked by ye zy on Aug 30, 2018
Latest reply on Sep 11, 2018 by ye zy

Hi  all:

   I have a question to ask you for advice.I'll be configure P1010 eTSEC1 and eTSEC2 and eTSEC3 to sgmii mode,eTSEC1 is worked ok ,but eTSEC2 and eTSEC3 is not work ,Please help me look at it,and dts file all follows:

   

ethernet@b0000 {
      #address-cells = <1>;
      #size-cells = <1>;
      device_type = "network";
      model = "eTSEC";
      compatible = "fsl,etsec2";
      fsl,num_rx_queues = <0x8>;
      fsl,num_tx_queues = <0x8>;
      fsl,magic-packet;
      local-mac-address = [ 00 00 00 00 00 00 ];
      ranges;

      queue-group@b0000 {
            #address-cells = <1>;
            #size-cells = <1>;
            reg = <0xb0000 0x1000>;
            interrupts = <29 2 0 0 30 2 0 0 34 2 0 0>;
      };
};
enet0: ethernet@b0000 {
      fsl,pmc-handle = <&etsec1_clk>;
      queue-group@b0000 {
            fsl,rx-bit-map = <0xff>;
            fsl,tx-bit-map = <0xff>;
      };
};

ethernet@b1000 {
      #address-cells = <1>;
      #size-cells = <1>;
      device_type = "network";
      model = "eTSEC";
      compatible = "fsl,etsec2";
      fsl,num_rx_queues = <0x8>;
      fsl,num_tx_queues = <0x8>;
      fsl,magic-packet;
      local-mac-address = [ 00 00 00 00 00 00 ];
      ranges;

      queue-group@b1000 {
            #address-cells = <1>;
            #size-cells = <1>;
            reg = <0xb1000 0x1000>;
         i   nterrupts = <35 2 0 0 36 2 0 0 40 2 0 0>;
      };
};
enet1: ethernet@b1000 {
      fsl,pmc-handle = <&etsec2_clk>;         
      queue-group@b1000 {
            fsl,rx-bit-map = <0xff>;
            fsl,tx-bit-map = <0xff>;
      };
};

ethernet@b2000 {
      #address-cells = <1>;
      #size-cells = <1>;
      device_type = "network";
      model = "eTSEC";
      compatible = "fsl,etsec2";
      fsl,num_rx_queues = <0x8>;
      fsl,num_tx_queues = <0x8>;
      fsl,magic-packet;
      local-mac-address = [ 00 00 00 00 00 00 ];
      ranges;

      queue-group@b2000 {
            #address-cells = <1>;
            #size-cells = <1>;
            reg = <0xb2000 0x1000>;
            interrupts = <31 2 0 0 32 2 0 0 33 2 0 0>;
      };
};
enet2: ethernet@b2000 {
      fsl,pmc-handle = <&etsec3_clk>;

      queue-group@b2000 {
            fsl,rx-bit-map = <0xff>;
            fsl,tx-bit-map = <0xff>;
      };
};
global-utilities@e0000 {
         compatible = "fsl,p1010-guts";
         reg = <0xe0000 0x1000>;
         fsl,has-rstcr;
};

 

mdio@24000 {

      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "fsl,etsec2-tbi";
      reg = <0x24000 0x1000 0xb0030 0x4>;
     

       phy0: ethernet-phy@1 {
      reg = <0x1>;
      device_type = "ethernet-phy";
      };
      phy1: ethernet-phy@2 {
      reg = <0x2>;
      device_type = "ethernet-phy";
      };
      phy2: ethernet-phy@3 {
      reg = <0x3>;
      device_type = "ethernet-phy";
      };
      tbi0: tbi-phy@1f {
      reg = <0x1f>;
      device_type = "tbi-phy";
      };
};

mdio@25000 {

      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "fsl,etsec2-tbi";
      reg = <0x25000 0x1000 0xb1030 0x4>;
     

       tbi1: tbi-phy@1f {
      reg = <0x1f>;
      device_type = "tbi-phy";
      };
};

mdio@26000 {

      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "fsl,etsec2-tbi";
      reg = <0x26000 0x1000 0xb2030 0x4>;
     

       tbi2: tbi-phy@1f {
      reg = <0x1f>;
      device_type = "tbi-phy";
       };
};

enet0: ethernet@b0000 {
      phy-handle = <&phy0>;
      tbi-handle = <&tbi0>;
      phy-connection-type = "sgmii";
};

enet1: ethernet@b1000 {
      phy-handle = <&phy1>;
      tbi-handle = <&tbi1>;
      phy-connection-type = "sgmii";
};

enet2: ethernet@b2000 {
      phy-handle = <&phy2>;
      tbi-handle = <&tbi2>;#
      phy-connection-type = "sgmii";
};

 

After dts file configuration is completed, i boot  my device,and kernel is printed as follows:

 

libphy: Fixed MDIO Bus: probed
libphy: Freescale PowerQUICC MII Bus: probed
libphy: Freescale PowerQUICC MII Bus: probed
libphy: Freescale PowerQUICC MII Bus: probed
fsl-gianfar ethernet.1: enabled errata workarounds, flags: 0x4
fsl-gianfar ethernet.1 eth0: mac: 00:0f:1f:10:10:00
fsl-gianfar ethernet.1 eth0: Running with NAPI enabled
fsl-gianfar ethernet.1 eth0: RX BD ring size for Q[0]: 256
fsl-gianfar ethernet.1 eth0: TX BD ring size for Q[0]: 256
fsl-gianfar ethernet.2: enabled errata workarounds, flags: 0x4
fsl-gianfar ethernet.2 eth1: mac: 00:0f:1f:10:10:01
fsl-gianfar ethernet.2 eth1: Running with NAPI enabled
fsl-gianfar ethernet.2 eth1: RX BD ring size for Q[0]: 256
fsl-gianfar ethernet.2 eth1: TX BD ring size for Q[0]: 256
fsl-gianfar ethernet.3: enabled errata workarounds, flags: 0x4
fsl-gianfar ethernet.3 eth2: mac: 00:0f:1f:10:10:02
fsl-gianfar ethernet.3 eth2: Running with NAPI enabled
fsl-gianfar ethernet.3 eth2: RX BD ring size for Q[0]: 256
fsl-gianfar ethernet.3 eth2: TX BD ring size for Q[0]: 256

....(Ignore other module printing)
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

....(Ignore other module printing)
libphy: mdio@ffe24000:01 - Link is Up - 1000/Full
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

....(Ignore other module printing)

 

Why is it that only eth0 information is printed here, without eth 1 and eth 2 information, and normally eth0/1/2 should be printed at the same time?

 

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0F:1F:10:10:00
inet addr:192.168.2.5 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55 errors:0 dropped:0 overruns:0 frame:0
TX packets:410 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8266 (8.0 KiB) TX bytes:22420 (21.8 KiB)
Base address:0x6000

#

 

After the kernel is started, the ifconfig command shows that only eth0 is available and worked ok. Under normal circumstances, eth0/1/2 should be all displayed. At present, the kernel source code has not been modified, only the device tree has been configured,d#oes kernel need to modify configuration or code? Please help me guide, this problem has been annoying me for a month, thank you!

Outcomes