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.

AM3352 Custom Board with dual ethernet

Other Parts Discussed in Thread: AM3352

Dear support,

     I am working on a custom AM3352 board with two ethernet ports. The physical for both is the LAN8710a connected in MII mode.

I build the Device Tree file occording to my HW configuration.


At the moment the first port is fine. I would like to test the second port but ifconfig does not show the eth1 device.

The /etc/network/interfaces is the same as in the EVM-SK.

The mdio messages are consistent, for instance when I connect the LAN on the second port I get the message:

[20086.501169] libphy: 4a101000.mdio:01 - Link is Up - 100/Full

What I have to do exactly to bring up the second ethernet port? In principle, have I to patch the cpsw.c or the second port should be already working? I read somewhere in this forum that the EVM-SK requires some kernel patch to work with the two ports.

I am using the sdk-linux-am335x-evm-01.00.00.00 with the kernel version 3.14.26.

Thank you in advance.

  • Hi,

    Do you have the following node in your am335x-evmsk.dts:
    &mac {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;
    dual_emac = <1>;
    };

    Also can you try the ifconfig -a command?
    Can you try adding auto eth1 in /etc/network/interfaces ?

    Best Regards,
    Yordan
  • Thank you you reply Yordan.

    Sorry, yesterday I enabled the dual_emac = <1>; but I think I put the wrong dtb in the boot partition.

    Now I can see the eth1. Unfortunately the eth1 even if visible still does not work, I can do "ifup eth1", I can assign a static IP (on a different network than eth0) but I cannot ping any host. Maybe some kernel patch is required for the LAN8710A?

    This is the ifconfig -a:

    root@am335x-evm:/# ifconfig -a
    eth0      Link encap:Ethernet  HWaddr 0A:14:03:04:05:11  
              inet addr:192.168.0.230  Bcast:0.0.0.0  Mask:255.255.255.0
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:63 errors:0 dropped:0 overruns:0 frame:0
              TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:6045 (5.9 KiB)  TX bytes:3382 (3.3 KiB)
              Interrupt:56 
    
    eth1      Link encap:Ethernet  HWaddr 0A:14:03:04:05:12  
              inet addr:192.168.1.87  Bcast:192.168.1.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:156 errors:0 dropped:0 overruns:0 frame:0
              TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:15120 (14.7 KiB)  TX bytes:4466 (4.3 KiB)
    
    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:42 errors:0 dropped:0 overruns:0 frame:0
              TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:4968 (4.8 KiB)  TX bytes:4968 (4.8 KiB)
    

    and here my /etc/network/interfaces

    # The loopback interface
    auto lo
    iface lo inet loopback
    
    # Wireless interfaces
    iface wlan0 inet dhcp
            wireless_mode managed
            wireless_essid any
            wpa-driver wext
            wpa-conf /etc/wpa_supplicant.conf
    
    iface tiwlan0 inet dhcp
            wireless_mode managed
            wireless_essid any
    
    iface atml0 inet dhcp
    
    # Wired or wireless interfaces
    auto eth0
    iface eth0 inet dhcp
            pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cmdline > /dev/null
            hwaddress ether 0A:14:03:04:05:11
    
    auto eth1
    iface eth1 inet static
            hwaddress ether 0A:14:03:04:05:12
            address 192.168.1.87
            netmask 255.255.255.0
            gateway 192.168.0.1
    
    # Ethernet/RNDIS gadget (g_ether)
    # ... or on host side, usbnet and random hwaddr
    iface usb0 inet dhcp
    
    # Bluetooth networking
    iface bnep0 inet dhcp


    For the DTS I take from evm:

    &cpsw_emac0 {
    	phy_id = <&davinci_mdio>, <0>;
    	phy-mode = "mii";
    	dual_emac_res_vlan = <1>;
    };
    
    &cpsw_emac1 {
    	phy_id = <&davinci_mdio>, <1>;
    	phy-mode = "mii";
    	dual_emac_res_vlan = <2>;
    };
    
    &mac {
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&cpsw_default>;
    	pinctrl-1 = <&cpsw_sleep>;
    	dual_emac = <1>;
    };
    
    &davinci_mdio {
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&davinci_mdio_default>;
    	pinctrl-1 = <&davinci_mdio_sleep>;
    };

    The ethtool shows:

    root@am335x-evm:/# ethtool eth1
    Settings for eth1:
            Supported ports: [ TP MII ]
            Supported link modes:   10baseT/Half 10baseT/Full 
                                    100baseT/Half 100baseT/Full 
            Supported pause frame use: Symmetric Receive-only
            Supports auto-negotiation: Yes
            Advertised link modes:  10baseT/Half 10baseT/Full 
                                    100baseT/Half 100baseT/Full 
            Advertised pause frame use: Symmetric Receive-only
            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: 1
            Transceiver: external
            Auto-negotiation: on
            Supports Wake-on: d
            Wake-on: d
            Current message level: 0x00000000 (0)
                                   
            Link detected: yes
    


    Thank you.

    Best Regards.

  • I found the problem and now the second ethernet port is working with the LAN8710A in MII mode.

    While for the eth0 interface the CRS and COL pins are not configured on the dts file, maybe because the pinmux for the first ethernet interface is already configured by the u-boot, for the second interface I need to configure these two inputs on the DTS.

    Here the overall configuration for the second port:

    0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a0.gmii2_txen   R13*/

    0x44 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a1.gmii2_rxdv V14 */

    0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a2.gmii2_txd3   U14*/

    0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a3.gmii2_txd2 T14*/

    0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a4.gmii2_txd1 R14*/

    0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a5.gmii2_txd0 V15*/

    0x58 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a6.gmii2_txclk U15*/

    0x5c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a7.gmii2_rxclk  T15*/

    0x60 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a8.gmii2_rxd3 V16*/

    0x64 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a9.gmii2_rd2 U16*/

    0x68 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a10.gmii2_rd1   T16*/

    0x6c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_a11.gmii2_rd0 V17*/

    0x70 (PIN_INPUT_PULLUP | MUX_MODE1 )    /* gpmc_wait0.gmii2_crs, INPUT_PULLUP | MODE1 T17 */

    0x74 (PIN_INPUT_PULLUP | MUX_MODE1 )    /* gpmc_wpn.gmii2_rxer, INPUT_PULLUP | MODE1 U17 */

    0x78 (PIN_INPUT_PULLUP | MUX_MODE1 )    /* gpmc_ben1.gmii2_col, INPUT_PULLUP | MODE1 U18 */

     

    Best Regards.

    Please click the Verify Answer button on this post if it answers your question.