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.

AM5728: Linux CPSW migration

Part Number: AM5728
Other Parts Discussed in Thread: DP83869, DP83TC811

Hello everyone!

I'm migrating Linux kernel based on machine AM5728 from PSDK6 to PSDK8. Previous kernel was based on 4.19.94 and the new one is 5.10.100 (both from PSDK). I have an problem with CPSW network adapter. The previous version works fine, but the new one, where new switch is used, doesn't.

  • 4.19.94
    • bootlog
      [    1.743624] libphy: Fixed MDIO Bus: probed
      [    1.748496] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
      [    1.755507] igb: Copyright (c) 2007-2014 Intel Corporation.
      [    1.814948] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
      [    1.822643] davinci_mdio 48485000.mdio: detected phy mask fffffff7
      [    1.831334] libphy: 48485000.mdio: probed
      [    1.835407] davinci_mdio 48485000.mdio: phy[3]: device 48485000.mdio:03, driver Atheros 8031 ethernet
      [    1.845224] cpsw 48484000.ethernet: Detected MACID = 00:a0:03:f5:1f:90
      [    1.851838] cpsw 48484000.ethernet: initialized cpsw ale version 1.4
      [    1.858263] cpsw 48484000.ethernet: ALE Table size 1024
      [    1.863547] cpsw 48484000.ethernet: cpts: overflow check period 500 (jiffies)
      ...
      [    2.237033] NET: Registered protocol family 10
       
    • DTB
      #include "dra74x.dtsi"
      ...
      &mac {
      	status = "okay";
      	slaves = <1>;
      };
      
      &cpsw_emac0 {
      	phy_id = <&davinci_mdio>, <3>;
      	phy-mode = "rgmii";
      };
       
    • defconfig
      CONFIG_NET_VENDOR_TI=y
      CONFIG_TI_DAVINCI_MDIO=y
      CONFIG_TI_DAVINCI_CPDMA=y
      CONFIG_TI_CPSW_PHY_SEL=y
      CONFIG_TI_CPSW_ALE=y
      CONFIG_TI_CPSW=y
      CONFIG_TI_CPTS=y
      CONFIG_TI_CPTS_MOD=y
      # CONFIG_TLAN is not set
      # CONFIG_TI_PTP_BC is not set
      # CONFIG_TI_1PPS_DM_TIMER is not set
      # CONFIG_NET_VENDOR_VIA is not set
      # CONFIG_NET_VENDOR_WIZNET is not set
      # CONFIG_FDDI is not set
      # CONFIG_HIPPI is not set
      CONFIG_MDIO_DEVICE=y
      CONFIG_MDIO_BUS=y
      # CONFIG_MDIO_BCM_UNIMAC is not set
      CONFIG_MDIO_BITBANG=y
      # CONFIG_MDIO_BUS_MUX_GPIO is not set
      # CONFIG_MDIO_BUS_MUX_MMIOREG is not set
      # CONFIG_MDIO_GPIO is not set
      # CONFIG_MDIO_HISI_FEMAC is not set
      # CONFIG_MDIO_MSCC_MIIM is not set
      CONFIG_PHYLIB=y
      CONFIG_SWPHY=y
      
       
  • 5.10.100
    • bootlog
      [    4.773742] igb: Intel(R) Gigabit Ethernet Network Driver
      [    4.779144] igb: Copyright (c) 2007-2014 Intel Corporation.
      [    4.840820] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
      [    4.850677] davinci_mdio 48485000.mdio: phy[3]: device 48485000.mdio:03, driver Qualcomm Atheros AR8031/AR8033
      [    4.860992] cpsw-switch 48484000.switch: initialized cpsw ale version 1.4
      [    4.867797] cpsw-switch 48484000.switch: ALE Table size 1024
      [    4.873565] cpsw-switch 48484000.switch: cpts: overflow check period 500 (jiffies)
      [    4.881225] cpsw-switch 48484000.switch: CPTS: ref_clk_freq:266000000 calc_mult:4036623398 calc_shift:30 error:-1 nsec/sec
      [    4.892364] cpsw-switch 48484000.switch: Detected MACID = 00:a0:03:f5:1f:90
      [    4.900115] cpsw-switch 48484000.switch: initialized (regs 0x48484000, pool size 256) hw_ver:0019010F 1.15 (0)
      ...
      [    5.147918] NET: Registered protocol family 17
      ...
      [   13.813903] Qualcomm Atheros AR8031/AR8033 48485000.mdio:03: attached PHY driver [Qualcomm Atheros AR8031/AR8033] (mii_bus:phy_addr=48485000.mdio:03, irq=POLL)
      [   15.942596] cpsw-switch 48484000.switch eth0: Link is Up - 100Mbps/Full - flow control off
      [   15.955596] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
       
    • DTB
      #include "dra74x.dtsi"
      ...
      &davinci_mdio_sw {
      	ethphy0: ethernet-phy@3 {
      		reg = <3>;
      	};
      };
      
      &mac_sw {
      	status = "okay";
      };
      
      &cpsw_port1 {
      	phy-handle = <&ethphy0>;
      	phy-mode = "rgmii";
      	ti,dual-emac-pvid = <1>;
      };
      
      &cpsw_port2 {
      	status = "disabled";
      };
       
    • defconfig
      CONFIG_NET_VENDOR_TI=y
      CONFIG_TI_DAVINCI_MDIO=y
      # CONFIG_TI_CPSW_PHY_SEL is not set
      CONFIG_TI_CPSW=y
      CONFIG_TI_CPSW_SWITCHDEV=y
      CONFIG_TI_CPTS=y
      # CONFIG_TLAN is not set
      # CONFIG_NET_VENDOR_VIA is not set
      # CONFIG_NET_VENDOR_WIZNET is not set
      CONFIG_NET_VENDOR_XILINX=y
      # CONFIG_XILINX_AXI_EMAC is not set
      # CONFIG_XILINX_LL_TEMAC is not set
      # CONFIG_FDDI is not set
      # CONFIG_HIPPI is not set
      CONFIG_PHYLIB=y
      CONFIG_SWPHY=y
      # CONFIG_LED_TRIGGER_PHY is not set
      CONFIG_FIXED_PHY=y
      
      #
      # MII PHY device drivers
      #
      # CONFIG_AMD_PHY is not set
      # CONFIG_ADIN_PHY is not set
      # CONFIG_AQUANTIA_PHY is not set
      # CONFIG_AX88796B_PHY is not set
      # CONFIG_BROADCOM_PHY is not set
      # CONFIG_BCM54140_PHY is not set
      # CONFIG_BCM7XXX_PHY is not set
      # CONFIG_BCM84881_PHY is not set
      # CONFIG_BCM87XX_PHY is not set
      # CONFIG_CICADA_PHY is not set
      # CONFIG_CORTINA_PHY is not set
      # CONFIG_DAVICOM_PHY is not set
      # CONFIG_ICPLUS_PHY is not set
      # CONFIG_LXT_PHY is not set
      # CONFIG_INTEL_XWAY_PHY is not set
      # CONFIG_LSI_ET1011C_PHY is not set
      CONFIG_MARVELL_PHY=y
      # CONFIG_MARVELL_10G_PHY is not set
      CONFIG_MICREL_PHY=y
      # CONFIG_MICROCHIP_PHY is not set
      # CONFIG_MICROCHIP_T1_PHY is not set
      # CONFIG_MICROSEMI_PHY is not set
      # CONFIG_NATIONAL_PHY is not set
      CONFIG_AT803X_PHY=y
      # CONFIG_QSEMI_PHY is not set
      # CONFIG_REALTEK_PHY is not set
      # CONFIG_RENESAS_PHY is not set
      # CONFIG_ROCKCHIP_PHY is not set
      CONFIG_SMSC_PHY=y
      # CONFIG_STE10XP is not set
      # CONFIG_TERANETICS_PHY is not set
      # CONFIG_DP83822_PHY is not set
      # CONFIG_DP83TC811_PHY is not set
      CONFIG_DP83848_PHY=y
      # CONFIG_DP83867_PHY is not set
      # CONFIG_DP83869_PHY is not set
      # CONFIG_VITESSE_PHY is not set
      # CONFIG_XILINX_GMII2RGMII is not set
      CONFIG_MDIO_DEVICE=y
      CONFIG_MDIO_BUS=y
      CONFIG_OF_MDIO=y
      CONFIG_MDIO_DEVRES=y
      CONFIG_MDIO_BITBANG=y
      # CONFIG_MDIO_BCM_UNIMAC is not set
      # CONFIG_MDIO_GPIO is not set
      # CONFIG_MDIO_HISI_FEMAC is not set
      # CONFIG_MDIO_MVUSB is not set
      # CONFIG_MDIO_MSCC_MIIM is not set
      # CONFIG_MDIO_IPQ4019 is not set
      # CONFIG_MDIO_IPQ8064 is not set
      
      #
      # MDIO Multiplexers
      #
      # CONFIG_MDIO_BUS_MUX_GPIO is not set
      # CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
      # CONFIG_MDIO_BUS_MUX_MMIOREG is not set
       

LEDs on the ethernet device are working, but no ping.

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 00:a0:03:f5:1f:90 brd ff:ff:ff:ff:ff:ff
    inet 192.168.251.1/24 brd 192.168.251.255 scope global eth0
       valid_lft forever preferred_lft forever
3: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 02:4c:bc:85:5c:7c brd ff:ff:ff:ff:ff:ff
    
ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:A0:03:F5:1F:90  
          inet addr:192.168.251.1  Bcast:192.168.251.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:540 (540.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1008 (1008.0 B)  TX bytes:1008 (1008.0 B)

So what did I wrongly? There is some refclk error, but not sure if it's related to this problem or not.

Thanks,
Andy

  • Hi Andy,

    I assume you were testing on your board since we don't have issue with cpsw on EVM with SDK 8.x.

    Have you diff your cpsw config against am57 evm default config in SDK 8.x?

    Regards,
    Stanley

  • Hello Stanley,
    Yes, I'm testing on on my board. As I said, HW is the same, I changed only the kernel. Of course, I compared my configuration within tisdk_am57xx-evm_defconfig, similar for dtb. The main difference what I did is:
     

    +CONFIG_NET_SWITCHDEV=y
    -CONFIG_TI_CPSW_PHY_SEL=y
    +CONFIG_TI_CPSW_SWITCHDEV=y
    

    and also adopted the DTB like I wrote.

    PING 192.168.251.2 (192.168.251.2): 56 data bytes
    
    --- 192.168.251.2 ping statistics ---
    5 packets transmitted, 0 packets received, 100% packet loss
    
    ethtool -S eth0
    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: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 0
    Good Tx Frames: 15
    Broadcast Tx Frames: 15
    Multicast Tx Frames: 0
    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: 960
    Rx + Tx 64 Octet Frames: 15
    Rx + Tx 65-127 Octet Frames: 0
    Rx + Tx 128-255 Octet Frames: 0
    Rx + Tx 256-511 Octet Frames: 0
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 0
    Net Octets: 960
    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: 15
    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: 0
    Tx DMA chan 0: empty_dequeue: 15
    Tx DMA chan 0: busy_dequeue: 0
    Tx DMA chan 0: good_dequeue: 15
    Tx DMA chan 0: requeue: 0
    Tx DMA chan 0: teardown_dequeue: 0
    

    So just TX, but no RX at all... .

    Regards,
    Andy

  • Looks like, that I've found a problem. When I changed "rgmii" to "rgmii-rxid" it works. It's based on this change probably: git.ti.com/.../am57xx-beagle-x15-common.dtsi

    Regards,
    Andy