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 eth0 PING not working in kernel 4.1.6 using AT8031 PHY

Hi Guys,


We moved from kernel 3.2 to kernel 4.1.6.

We have a custom board using a AT8031 PHY. Our 1Gbps ETH0 worked well under kernel 3.2 as well as uboot.

PING doesn't work on the new kernel.

Any suggestions will be appreciated.

Here are some logs:

root@am335x-evm:~# ifconfig
eth0      Link encap:Ethernet  HWaddr EC:24:B8:ED:E6:3F  
          inet addr:10.42.0.69  Bcast:10.42.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ee24:b8ff:feed:e63f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:208 errors:0 dropped:0 overruns:0 frame:0
          TX packets:228 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12480 (12.1 KiB)  TX bytes:15948 (15.5 KiB)
          Interrupt:166

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1360 (1.3 KiB)  TX bytes:1360 (1.3 KiB)

root@am335x-evm:~# ethtool eth0
Settings for eth0:
        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
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x00000000 (0)
                               
        Link detected: yes
root@am335x-evm:~#

Thank you very much

Regards

Louis

  • Additional logs:

    root@am335x-evm:~# tcpdump -v
    [ 125.542763] device eth0 entered promiscuous mode
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    19:01:37.073267 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    19:01:37.073343 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.42.0.69 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    19:01:38.073252 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    19:01:38.073311 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.42.0.69 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    19:01:39.077292 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    19:01:39.077324 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.42.0.69 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    19:01:40.077212 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    19:01:40.077237 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.42.0.69 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    19:01:41.077277 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    19:01:41.077341 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.42.0.69 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    19:01:42.077400 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    19:01:42.077439 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.42.0.69 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    ^C
    12 packets captured
    12 packets received by filter
    0[ 131.905210] device eth0 left promiscuous mode
    packets dropped by kernel
    root@am335x-evm:~#
  • Hi Louis,

    Could you make a test which could help to observe the all packets transmitted and received by the device.
    Make the following topology - connect the eth0 board interface to a PC. Configure the board with static IP address. Install and start on the PC 'Wireshark' program and make a capture. Ping the PC from the board. Attach the capture file please.
    Also search in the kernel log - 'dmesg' for something related to the network or attach the whole log.

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    Thank you for your message. Wiresharp on the server see no messages from the am335x custom board.

    The custom board is receiving messages from the server. See the tcpdump:

    04:29:13.337458 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:14.105827 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:14.338074 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:14.338100 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:15.110433 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:15.338534 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:15.338595 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:16.110887 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:16.338985 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:16.339016 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:17.111356 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:17.339492 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:17.339524 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:17.339557 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:17.339575 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:18.111900 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:18.339936 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:18.339963 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:19.112395 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:19.340606 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:19.340627 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28
    04:29:20.112916 ARP, Request who-has 10.42.0.69 tell 10.42.0.1, length 46
    04:29:20.341065 ARP, Request who-has 10.42.0.73 tell 10.42.0.1, length 46
    04:29:20.341128 ARP, Reply 10.42.0.73 is-at ec:24:b8:ed:e6:3f (oui Unknown), length 28

    I changed the am335x's IP to 10.42.0.73 and then pinged it from the server - you can see the Request coming from the server and the reply trying to go out.


    What does "(oui Unknown)" mean?

    There are no errors in dmesg - we've gone through that in great detail and resolved all errors.

    It looks like the transmitted data is not going out of eth0 - how is this possible and what can we look at?

    To summarise our tests/checks:

    1.) rx and tx clocks are all 125MHz

    2.) works in u-boot

    3.) works with kernel 3.2

    4.) routes is correct

    5.) correct AT8031 driver is loaded

    6.) added debug code to confirm the AT8031 registers are corrected for rgmii during init

    This is the device tree entries? Are we maybe missing something in here:

    in .dts:

    &mac {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&cpsw_default>;
        pinctrl-1 = <&cpsw_sleep>;
        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>, <0>;
        phy-mode = "rgmii";
        #phy-mode = "rgmii-txid";
    };

    in .dtsi:

            mac: ethernet@4a100000 {
                #compatible = "ti,am335x-cpsw","ti,cpsw";
                compatible = "ti,cpsw";
                ti,hwmods = "cpgmac0";
                clocks = <&cpsw_125mhz_gclk>, <&cpsw_cpts_rft_clk>;
                clock-names = "fck", "cpts";
                cpdma_channels = <8>;
                ale_entries = <1024>;
                bd_ram_size = <0x2000>;
                no_bd_ram = <0>;
                rx_descs = <64>;
                mac_control = <0x20>;
                slaves = <1>;
                active_slave = <2>;
                cpts_clock_mult = <0x80000000>;
                cpts_clock_shift = <29>;
                reg = <0x4a100000 0x800
                       0x4a101200 0x100>;
                #address-cells = <1>;
                #size-cells = <1>;
                interrupt-parent = <&intc>;
                /*
                 * c0_rx_thresh_pend
                 * c0_rx_pend
                 * c0_tx_pend
                 * c0_misc_pend
                 */
                interrupts = <40 41 42 43>;
                ranges;
                syscon = <&scm_conf>;
                status = "disabled";

                davinci_mdio: mdio@4a101000 {
                    compatible = "ti,davinci_mdio";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    ti,hwmods = "davinci_mdio";
                    bus_freq = <1000000>;
                    reg = <0x4a101000 0x100>;
                    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,am3352-cpsw-phy-sel";
                    reg= <0x44e10650 0x4>;
                    reg-names = "gmii-sel";
                };
            };

    We only have 1 eth port.

    After going through the cpsw documentation we specified the second port and a slave - not sure if this is correct.

    Thank you very much

    Any suggestions are welcome

    Regards

    Louis

  • Added info:

    Running arp on the am335x show the ip and mac of the server:

    root@am335x-evm:~# arp -n
    ? (10.42.0.1) at 44:8a:5b:d6:a4:fc [ether] on eth0

    So the am335x see the server but the ping still fails.
  • Louis,

    I successfully made ping from BeagleBone Black am335x with ti-sdk 02.00.00.00 kernel 4.1.6. The difference is in the ethernet chipset and the drivers. Therefore I suggest you to compare the AT8031 drivers in both kernel versions 3.2 and 4.1.6.

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    Thank you for the reply.

    We eventually got to the bottom of the problem. It has to do with an errata on the chip.

    Setting gmii_sel Register = 0x32 in the cpsw phy sel code resolves the issue.

    It is now working fine on kernel 4.1.13

    Kind regards

    Louis