This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4377: RGMII2 RX issue

Part Number: AM4377
Other Parts Discussed in Thread: AM4372

Tool/software: Linux

Dear Sir:

         We make AM437X StarterKit EVM as reference board.

         we use SDK ti-processor-sdk-linux-am437x-evm-04.03.00.05-Linux-x86-Install.bin

         our custom board use gmii1 connected to PHY IC RTL8201F. Now it is eth0 interface, it is ok to ping PC via eth0.

         our custom board use rgmii2 connected to PHY IC RTL8211F.Now it is eth1 interface. it fail to ping PC via eth1. we check the detail info.

          we ping PC from target board. it can send ARP request to PC, PC receive the ARP Request, then reply to target board via eth1.

          but board can't get any packet. RX show no any packets.

          please help to show your advice. thank you very mcuh.

our device tree configuration as below:

am4372.dtsi

  mac: ethernet@4a100000 {
   compatible = "ti,am4372-cpsw","ti,cpsw";
   reg = <0x4a100000 0x800
          0x4a101200 0x100>;
   interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH
          GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH
          GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH
          GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
   #address-cells = <1>;
   #size-cells = <1>;
   ti,hwmods = "cpgmac0";
   clocks = <&cpsw_125mhz_gclk>, <&cpsw_cpts_rft_clk>,
     <&dpll_clksel_mac_clk>;
   clock-names = "fck", "cpts", "50mclk";
   assigned-clocks = <&dpll_clksel_mac_clk>;
   assigned-clock-rates = <50000000>;
   status = "disabled";
   cpdma_channels = <8>;
   ale_entries = <1024>;
   bd_ram_size = <0x2000>;
   mac_control = <0x20>;
   slaves = <2>;
   active_slave = <0>;
   cpts_clock_mult = <0x80000000>;
   cpts_clock_shift = <29>;
   ranges;
   syscon = <&scm_conf>;

   davinci_mdio: mdio@4a101000 {
    compatible = "ti,am4372-mdio","ti,cpsw-mdio","ti,davinci_mdio";
    reg = <0x4a101000 0x100>;
    #address-cells = <1>;
    #size-cells = <0>;
    ti,hwmods = "davinci_mdio";
    bus_freq = <1000000>;
    status = "disabled";
   };

   cpsw_emac0: slave@4a100200 {
    /* Filled in by U-Boot */
    mac-address = [ 00 00 00 00 00 00 ];
   };

   cpsw_emac1: slave@4a100300 {
    /* Filled in by U-Boot */
    mac-address = [ 00 00 00 00 00 00 ];
   };

   phy_sel: cpsw-phy-sel@44e10650 {
    compatible = "ti,am43xx-cpsw-phy-sel";
    reg= <0x44e10650 0x8>;
    reg-names = "gmii-sel";
   };
  };

am437x-sk-evm.dts

 cpsw_default: cpsw_default {
  pinctrl-single,pins = <
   /* Slave 1 */
   AM4372_IOPAD(0x92c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.gmii1_txclk */
   AM4372_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.gmii1_txen */
   AM4372_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.gmii1_txd0 */
   AM4372_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.gmii1_txd1 */
   AM4372_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.gmii1_txd2 */
   AM4372_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.gmii1_txd3 */
   AM4372_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.gmii1_rcclk */
   AM4372_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.gmii1_rxdv */
   AM4372_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.gmii1_rxd0 */
   AM4372_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.gmii1_rxd1 */
   AM4372_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.gmii1_rxd2 */
   AM4372_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.gmii1_rxd3 */
   AM4372_IOPAD(0x90c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_crs.gmii1_crs */
   AM4372_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.gmii1_rxer */
   AM4372_IOPAD(0x908, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_col.gmii1_col */

   /* Slave 2 */
   AM4372_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a6.rgmii2_tclk */
   AM4372_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a0.rgmii2_tctl */
   AM4372_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a5.rgmii2_td0 */
   AM4372_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a4.rgmii2_td1 */
   AM4372_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a3.rgmii2_td2 */
   AM4372_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a2.rgmii2_td3 */
   AM4372_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_a7.rgmii2_rclk */
   AM4372_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_a1.rgmii2_rtcl */
   AM4372_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_a11.rgmii2_rd0 */
   AM4372_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_a10.rgmii2_rd1 */
   AM4372_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_a9.rgmii2_rd2 */
   AM4372_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_a8.rgmii2_rd3 */
  >;
 };

 cpsw_sleep: cpsw_sleep {
  pinctrl-single,pins = <
   /* Slave 1 reset value */
   AM4372_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE7)

   /* Slave 2 reset value */
   AM4372_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7)
  >;
 };

 davinci_mdio_default: davinci_mdio_default {
  pinctrl-single,pins = <
   /* MDIO */
   AM4372_IOPAD(0x948, PIN_INPUT | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
   AM4372_IOPAD(0x94c, PIN_OUTPUT | MUX_MODE0)   /* mdio_clk.mdio_clk */
  >;
 };

 davinci_mdio_sleep: davinci_mdio_sleep {
  pinctrl-single,pins = <
   /* MDIO reset value */
   AM4372_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
   AM4372_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
  >;
 };

&mac {
 pinctrl-names = "default", "sleep";
 pinctrl-0 = <&cpsw_default>;
 pinctrl-1 = <&cpsw_sleep>;
 dual_emac = <1>;
 status = "okay";
};

&davinci_mdio {
 pinctrl-names = "default", "sleep";
 pinctrl-0 = <&davinci_mdio_default>;
 pinctrl-1 = <&davinci_mdio_sleep>;
 status = "okay";
};

&cpsw_emac0 {
 phy_id = <&davinci_mdio>, <1>;
 phy-mode = "mii";
 dual_emac_res_vlan = <1>;
};

&cpsw_emac1 {
 phy_id = <&davinci_mdio>, <4>;
 phy-mode = "rgmii";
 dual_emac_res_vlan = <2>;
};

       

Debug info as below:

root@am437x-evm:~# ifconfig    
eth0      Link encap:Ethernet  HWaddr 60:64:05:5D:3F:69 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:139

eth1      Link encap:Ethernet  HWaddr 60:64:05:5D:3F:6B 
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::6264:5ff:fe5d:3f6b%763860/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:23546 (22.9 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1%763860/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:14130 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1075424 (1.0 MiB)  TX bytes:1075424 (1.0 MiB)

root@am437x-evm:~# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 4
        Transceiver: external
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)
                              
        Link detected: yes
root@am437x-evm:~# ethtool -S eth1
NIC statistics:
     Good Rx Frames: 0
     Broadcast Rx Frames: 0
     Multicast Rx Frames: 0
     Pause Rx Frames: 0
     Rx CRC Errors: 0
     Rx Align/Code Errors: 337
     Oversize Rx Frames: 0
     Rx Jabbers: 0
     Undersize (Short) Rx Frames: 0
     Rx Fragments: 0
     Rx Octets: 0
     Good Tx Frames: 132
     Broadcast Tx Frames: 81
     Multicast Tx Frames: 51
     Pause Tx Frames: 0
     Deferred Tx Frames: 0
     Collisions: 0
     Single Collision Tx Frames: 0
     Multiple Collision Tx Frames: 0
     Excessive Collisions: 0
     Late Collisions: 0
     Tx Underrun: 0
     Carrier Sense Errors: 0
     Tx Octets: 24074
     Rx + Tx 64 Octet Frames: 59
     Rx + Tx 65-127 Octet Frames: 226
     Rx + Tx 128-255 Octet Frames: 129
     Rx + Tx 256-511 Octet Frames: 55
     Rx + Tx 512-1023 Octet Frames: 0
     Rx + Tx 1024-Up Octet Frames: 0
     Net Octets: 70621
     Rx Start of Frame Overruns: 0
     Rx Middle of Frame Overruns: 0
     Rx DMA Overruns: 0
     Rx DMA chan 0: head_enqueue: 1
     Rx DMA chan 0: tail_enqueue: 127
     Rx DMA chan 0: pad_enqueue: 0
     Rx DMA chan 0: misqueued: 0
     Rx DMA chan 0: desc_alloc_fail: 0
     Rx DMA chan 0: pad_alloc_fail: 0
     Rx DMA chan 0: runt_receive_buf: 0
     Rx DMA chan 0: runt_transmit_bu: 0
     Rx DMA chan 0: empty_dequeue: 0
     Rx DMA chan 0: busy_dequeue: 0
     Rx DMA chan 0: good_dequeue: 0
     Rx DMA chan 0: requeue: 0
     Rx DMA chan 0: teardown_dequeue: 0
     Tx DMA chan 0: head_enqueue: 132
     Tx DMA chan 0: tail_enqueue: 0
     Tx DMA chan 0: pad_enqueue: 0
     Tx DMA chan 0: misqueued: 0
     Tx DMA chan 0: desc_alloc_fail: 0
     Tx DMA chan 0: pad_alloc_fail: 0
     Tx DMA chan 0: runt_receive_buf: 0
     Tx DMA chan 0: runt_transmit_bu: 35
     Tx DMA chan 0: empty_dequeue: 132
     Tx DMA chan 0: busy_dequeue: 0
     Tx DMA chan 0: good_dequeue: 132
     Tx DMA chan 0: requeue: 0
     Tx DMA chan 0: teardown_dequeue: 0
root@am437x-evm:~#