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.

AM3358 Ethernet collisions and stalls on eth0 with CPSW

Other Parts Discussed in Thread: TPS65217

(1) With Am335x MAC/PHY LAN8710A ( cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx)
connections with eth0 (ssh, nfs, etc) have short stalls. There are network collisions and when using ssh or nfs there are short periods where there is no reponse.


(2) With Am335x USB and USB ethernet host adapter (asix 2-1:1.0 eth1: link up, 100Mbps, full-duplex, lpa 0x45E1)
connections with eth1 (ssh, nfs, etc) there are no apparent stalls.

Has anyone observed this using the Am335x cpsw? Can flow control be disabled?


 


------------------------------------------------------------------------------------
                   Eth0 Am335x MAC/PHY LAN8710A

[   12.648140] net eth0: initializing cpsw version 1.12 (0)
[   12.733107] net eth0: phy found : id is : 0x7c0f1
[   12.738090] gmii_sel reg:0000003A
[   12.741561] mask:00000043 mode:00000002 rmii_clock_external:0
[   12.747593] gmii_sel reg:00000038
[   12.751063] gmii_sel reg:0000003A
[   12.754550] libphy: PHY  not found
[   12.758114] net eth0: phy  not found on slave 1
[   12.763911] net eth0: BQL enabled
[   12.773035] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ ok ] Configuring network interfaces...done.
[ ok ] Starting rpcbind daemon....
[   13.552783] nfsd: module is already loaded
[   15.813028] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   15.821474] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready


root# ethtool -S eth0
NIC statistics:
     Good Rx Frames: 19095
     Broadcast Rx Frames: 13325
     Multicast Rx Frames: 4880
     Pause Rx Frames: 0
     Rx CRC Errors: 0
     Rx Align/Code Errors: 0
     Oversize Rx Frames: 0
     Rx Jabbers: 0
     Undersize (Short) Rx Frames: 0
     Rx Fragments: 0
     Rx Octets: 2068293
     Good Tx Frames: 1172
     Broadcast Tx Frames: 30
     Multicast Tx Frames: 8
     Pause Tx Frames: 0
     Deferred Tx Frames: 3
     Collisions: 89
     Single Collision Tx Frames: 1
     Multiple Collision Tx Frames: 0
     Excessive Collisions: 0
     Late Collisions: 88
     Tx Underrun: 0
     Carrier Sense Errors: 0
     Tx Octets: 846090
     Rx + Tx 64 Octet Frames: 7124
     Rx + Tx 65-127 Octet Frames: 9537
     Rx + Tx 128-255 Octet Frames: 2347
     Rx + Tx 256-511 Octet Frames: 366
     Rx + Tx 512-1023 Octet Frames: 237
     Rx + Tx 1024-Up Octet Frames: 656
     Net Octets: 3035702
     Rx Start of Frame Overruns: 0
     Rx Middle of Frame Overruns: 0
     Rx DMA Overruns: 0
     Rx DMA chan: head_enqueue: 1

     Rx DMA chan: tail_enqueue: 14268
     Rx DMA chan: pad_enqueue: 0
     Rx DMA chan: misqueued: 0
     Rx DMA chan: desc_alloc_fail: 0
     Rx DMA chan: pad_alloc_fail: 0
     Rx DMA chan: runt_receive_buf: 0
     Rx DMA chan: runt_transmit_buf: 0
     Rx DMA chan: empty_dequeue: 0
     Rx DMA chan: busy_dequeue: 14935
     Rx DMA chan: good_dequeue: 14205
     Rx DMA chan: requeue: 0
     Rx DMA chan: teardown_dequeue: 0
     Tx DMA chan: head_enqueue: 980
     Tx DMA chan: tail_enqueue: 280
     Tx DMA chan: pad_enqueue: 0
     Tx DMA chan: misqueued: 66
     Tx DMA chan: desc_alloc_fail: 0
     Tx DMA chan: pad_alloc_fail: 0
     Tx DMA chan: runt_receive_buf: 0
     Tx DMA chan: runt_transmit_buf: 23
     Tx DMA chan: empty_dequeue: 14692
     Tx DMA chan: busy_dequeue: 243
     Tx DMA chan: good_dequeue: 1260
     Tx DMA chan: requeue: 1108
     Tx DMA chan: teardown_dequeue: 0
--------------------------------------------------------------------------------------------------------------
                                   Am335x USB + Ethnernet to USB Host Adapter

[ ok ] Setting kernel variables ...done.
[   12.623494] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   12.629997] asix 2-1:1.0 eth1: link down
[ ok ] Configuring network interfaces...done.
[ ok ] Starting rpcbind daemon....
[   13.415506] nfsd: module is already loaded
[   14.415667] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   14.422684] asix 2-1:1.0 eth1: link up, 100Mbps, full-duplex, lpa 0x45E1


  • Hi,

    Which Linux version are you using?

  • Hi Biser,

    The Kernel version is Linux 3.15.10 for the Beaglebone black board.

    John
  • Hi John,

    do you have BBB or a custom board with the same PHY? Could you share your DTS file or at least CPSW related part?

    Can you try 3.18.16 and 4.1.1? This should be doable with the same DTS and Linux config file.

    Regards,
    Yegor
  • Hi Yegor,

    I have both a BBB Rev C and custom board based on BBB design with the same PHY (LAN8710A).

    The DTS files are from the BBB TI distribution.

    We will try 3.18.16 and 4.1.1

    Best Regards

    John


    ------------- am335x-bone-common.dtsi----------------------------
    /*
    2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
    3 *
    4 * This program is free software; you can redistribute it and/or modify
    5 * it under the terms of the GNU General Public License version 2 as
    6 * published by the Free Software Foundation.
    7 */
    8
    9 / {
    10 model = "TI AM335x BeagleBone";
    11 compatible = "ti,am335x-bone", "ti,am33xx";
    12
    13 cpus {
    14 cpu@0 {
    15 cpu0-supply = <&dcdc2_reg>;
    16 };
    17 };
    18
    19 memory {
    20 device_type = "memory";
    21 reg = <0x80000000 0x10000000>; /* 256 MB */
    22 };
    23
    24 /*
    25 leds {
    26 pinctrl-names = "default";
    27 pinctrl-0 = <&user_leds_s0>;
    28
    29 compatible = "gpio-leds";
    30
    31 led@2 {
    32 label = "beaglebone:green:heartbeat";
    33 gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
    34 linux,default-trigger = "heartbeat";
    35 default-state = "off";
    36 };
    37
    38 led@3 {
    39 label = "beaglebone:green:mmc0";
    40 gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
    41 linux,default-trigger = "mmc0";
    42 default-state = "off";
    43 };
    44
    45 led@4 {
    46 label = "beaglebone:green:usr2";
    47 gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
    48 linux,default-trigger = "cpu0";
    49 default-state = "off";
    50 };
    51
    52 led@5 {
    53 label = "beaglebone:green:usr3";
    54 gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
    55 linux,default-trigger = "mmc1";
    56 default-state = "off";
    57 };
    58 };
    59 */
    60 vbat: fixedregulator@0 {
    61 compatible = "regulator-fixed";
    62 regulator-name = "vbat";
    63 regulator-min-microvolt = <5000000>;
    64 regulator-max-microvolt = <5000000>;
    65 regulator-boot-on;
    66 };
    67
    68 vmmcsd_fixed: fixedregulator@1 {
    69 compatible = "regulator-fixed";
    70 regulator-name = "vmmcsd_fixed";
    71 regulator-min-microvolt = <3300000>;
    72 regulator-max-microvolt = <3300000>;
    73 };
    74 };
    75
    76 &uart0 {
    77 pinctrl-names = "default";
    78 pinctrl-0 = <&uart0_pins>;
    79
    80 status = "okay";
    81 };
    82
    83 &usb {
    84 status = "okay";
    85
    86 control@44e10620 {
    87 status = "okay";
    88 };
    89
    90 usb-phy@47401300 {
    91 status = "okay";
    92 };
    93
    94 usb-phy@47401b00 {
    95 status = "okay";
    96 };
    97
    98 usb@47401000 {
    99 status = "okay";
    100 };
    101
    102 usb@47401800 {
    103 status = "okay";
    104 dr_mode = "host";
    105 };
    106
    107 dma-controller@47402000 {
    108 status = "okay";
    109 };
    110 };
    111
    112 &i2c0 {
    113 pinctrl-names = "default";
    114 pinctrl-0 = <&i2c0_pins>;
    115
    116 status = "okay";
    117 clock-frequency = <100000>;
    118 /*
    119 tps: tps@24 {
    120 reg = <0x24>;
    121 };
    122
    123 baseboard_eeprom: baseboard_eeprom@50 {
    124 compatible = "at,24c256";
    125 reg = <0x50>;
    126 }; */
    127 };
    128
    129 &i2c1 {
    130 status = "okay";
    131 pinctrl-names = "default";
    132 pinctrl-0 = <&i2c1_pins>;
    133
    134 clock-frequency = <400000>;
    135
    136 tps: tps@24 {
    137 reg = <0x24>;
    138 };
    139 eeprom: eeprom@50 {
    140 compatible = "mc,24lc32a";
    141 reg = <0x50>;
    142 };
    143 };
    144
    145
    146 &i2c2 {
    147 status = "okay";
    148 pinctrl-names = "default";
    149 pinctrl-0 = <&i2c2_pins>;
    150
    151 clock-frequency = <400000>;
    152
    153 rtc: baseboard_rtc@69 {
    154 compatible = "abracon,abx80x";
    155 reg = <0x69>;
    156 };
    157 };
    158
    159 /include/ "tps65217.dtsi"
    160
    161 &tps {
    162 ti,pmic-shutdown-controller;
    163
    164 interrupt-parent = <&intc>;
    165 interrupts = <7>; /* NNMI */
    166
    167 regulators {
    168 dcdc1_reg: regulator@0 {
    169 regulator-always-on;
    170 };
    171
    172 dcdc2_reg: regulator@1 {
    173 /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
    174 regulator-name = "vdd_mpu";
    175 regulator-min-microvolt = <925000>;
    176 regulator-max-microvolt = <1325000>;
    177 regulator-boot-on;
    178 regulator-always-on;
    179 };
    180
    181 dcdc3_reg: regulator@2 {
    182 /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
    183 regulator-name = "vdd_core";
    184 regulator-min-microvolt = <925000>;
    185 regulator-max-microvolt = <1150000>;
    186 regulator-boot-on;
    187 regulator-always-on;
    188 };
    189
    190 ldo1_reg: regulator@3 {
    191 regulator-always-on;
    192 };
    193
    194 ldo2_reg: regulator@4 {
    195 regulator-always-on;
    196 };
    197
    198 ldo3_reg: regulator@5 {
    199 regulator-always-on;
    200 };
    201
    202 ldo4_reg: regulator@6 {
    203 regulator-always-on;
    204 };
    205 };
    206
    207 };
    208
    209 &cpsw_emac0 {
    210 phy_id = <&davinci_mdio>, <0>;
    211 phy-mode = "rgmii";
    212 };
    213
    214 /*
    215 &cpsw_emac1 {
    216 phy_id = <&davinci_mdio>, <1>;
    217 phy-mode = "rgmii";
    218 };
    219 */
    220
    221 &mac {
    222 pinctrl-names = "default", "sleep";
    223 pinctrl-0 = <&cpsw_default>;
    224 pinctrl-1 = <&cpsw_sleep>;
    225
    226 };
    227
    228 &davinci_mdio {
    229 pinctrl-names = "default", "sleep";
    230 pinctrl-0 = <&davinci_mdio_default>;
    231 pinctrl-1 = <&davinci_mdio_sleep>;
    232 };
    233
    234 &mmc1 {
    235 status = "okay";
    236 bus-width = <0x4>;
    237 pinctrl-names = "default";
    238 pinctrl-0 = <&mmc1_pins>;
    239 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
    240 cd-inverted;
    241 };
    242

    ------------------- am335x-bone-common-pinmux.dtsi ---------------------------

    /*
    2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
    3 *
    4 * This program is free software; you can redistribute it and/or modify
    5 * it under the terms of the GNU General Public License version 2 as
    6 * published by the Free Software Foundation.
    7 */
    8
    cpsw_default: cpsw_default {
    70 pinctrl-single,pins = <
    71 /* Slave 1 */
    72 0x110 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxerr.mii1_rxerr */
    73 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.mii1_txen */
    74 0x118 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxdv.mii1_rxdv */
    75 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd3.mii1_txd3 */
    76 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd2.mii1_txd2 */
    77 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.mii1_txd1 */
    78 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.mii1_txd0 */
    79 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */
    80 0x130 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxclk.mii1_rxclk */
    81 0x134 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd3.mii1_rxd3 */
    82 0x138 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd2.mii1_rxd2 */
    83 0x13c (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd1.mii1_rxd1 */
    84 0x140 (PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd0.mii1_rxd0 */
    85 >;
    86 };
    87
    88 cpsw_sleep: cpsw_sleep {
    89 pinctrl-single,pins = <
    90 /* Slave 1 reset value */
    91 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    92 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    93 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    94 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    95 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    96 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    97 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    98 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    99 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    100 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    101 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    102 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    103 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    104 >;
    105 };
  • Hi Biser,

    Doesn't work.

    John