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.

AM437x difference between VLAN ID and CPDMA port selection

Hello,

i have the sitara processor ti4376. we want to use both ethernet-ports of the processor. But on one port we can just receive messages but not send. To send messages, the internal MAC of the processor needs to know, on which port the message should be send out. therefor there is a TX-Buffer Descriptor (data-sheet "spruhl7d" chapter 15.3.2.4.1.1) where i can enter in the 16 & 17 Bit of the Descriptor, on which port the message should be sent. So why do i need to specify a VLAN-ID (in the ALE-Registers) for the internal switch in the MAC of the Processor, when i can set up the correct port in the cpdma TX interface?

Thanks a lot!

best regards

Reiner

  • Hi,

    What software are you using?
  • I'm using OS Linux 4.4.1. But in my linux system everything is set up fine. I receive a Ping correctly and the preparation for a reply is working fine. But when i write the correct ping-reply to the hardware, nothing is happening. the mdio-bus and the mii-bus are working propperly.
  • Here is the wiki for the Linux Ethernet driver: processors.wiki.ti.com/.../Linux_Core_CPSW_User's_Guide Note that the CPSW must be configured in Dual Emac mode in order to use both Ethernet ports, and both interfaces should not be connected to the same subnet unless only configuring bridging, and not doing IP routing.
  • thanks!
    Now i already set up my system like in the block-diagramm in the link you sent me. I even setup the ports in the same VLAN, so that p0 shall send out every packet and not reject anyone. It also selects the correct interface on which port the message should be sent out. but still there are no packet transmitted from p0 to p2. in the cpsw_stat registers i can see, that there are received frames on the p2-port but no tx-frames.

    processors.wiki.ti.com/.../Sitara_Linux_Dual_Emac_Mode

    in this link there is the chapter Linux Driver Background -> Directed Packets. This is exactly what i want. but how can i setup this configuration with "directed packets"? the MAC shall just look into the TX-Buffer Descriptor (datasheet 15.3.2.4.1.1) and send the message to the designated port which the MAC can look up in the 16 & 17 Bit of the descriptor.
  • I will ask the Ethernet experts to help on this. They will respond directly here.
  • If you are using linux there should be no need to be setting up descriptors, vlans etc.
    Are you using a TI evm?
    The default out of box demo has dual mac enabled.
    You should be able to use ping on both interfaces provided they are up, have a connected link status, have IP addresses on two different subnets.
    Can you pass the ping command that you are using?
  • Yes right, I didn't setup anything with the descriptors, which I can see in the source "davinci_cpdma.c". I just saw that in the tx buffer descriptors, I can insert the destination port-number, so that I don't need any extra configuration with a internal VLAN. this I could read in this document (heading: "directed packets"):

    processors.wiki.ti.com/index.php/Sitara_Linux_Dual_Emac_Mode 

    the dual mac mode is enabled. in the device-tree I could set it up for emac0 "dual_emac_res_vlan = <1>;" and emac1 "dual_emac_res_vlan = <2>;"

    I'm not using a TI evm. But our linux is working fine, also the ethernet-MAC, except sending from p0 to p2 port (the other way, receiving from p2 to p0 works fine). Also the connection from p0 to p1 is working good in both ways. So I receive a correct ARP-message from p2 to p0. Linux is editing the ARP-Request correct. here is a short cutout of my ARP-Request I want to send:

    dsa_xmit: skb->data[0]=0x0
    dsa_xmit: skb->data[1]=0x50
    dsa_xmit: skb->data[2]=0x51
    dsa_xmit: skb->data[3]=0x52
    dsa_xmit: skb->data[4]=0x55
    dsa_xmit: skb->data[5]=0x56  
    dsa_xmit: skb->data[6]=0x8
    dsa_xmit: skb->data[7]=0x0
    dsa_xmit: skb->data[8]=0x6
    dsa_xmit: skb->data[9]=0xee
    dsa_xmit: skb->data[10]=0xff
    dsa_xmit: skb->data[11]=0x1b
    dsa_xmit: skb->data[12]=0x40
    dsa_xmit: skb->data[13]=0x8
    dsa_xmit: skb->data[14]=0x0
    dsa_xmit: skb->data[15]=0x1
    dsa_xmit: skb->data[16]=0x8
    dsa_xmit: skb->data[17]=0x6
    dsa_xmit: skb->data[18]=0x0
    dsa_xmit: skb->data[19]=0x1
    dsa_xmit: skb->data[20]=0x8
    dsa_xmit: skb->data[21]=0x0
    dsa_xmit: skb->data[22]=0x6
    dsa_xmit: skb->data[23]=0x4
    dsa_xmit: skb->data[24]=0x0
    dsa_xmit: skb->data[25]=0x2
    dsa_xmit: skb->data[26]=0x8
    dsa_xmit: skb->data[27]=0x0
    dsa_xmit: skb->data[28]=0x6
    dsa_xmit: skb->data[29]=0xee
    dsa_xmit: skb->data[30]=0xff
    dsa_xmit: skb->data[31]=0x1b
    dsa_xmit: skb->data[32]=0x8c
    dsa_xmit: skb->data[33]=0x50
    dsa_xmit: skb->data[34]=0x0
    dsa_xmit: skb->data[35]=0x4
    dsa_xmit: skb->data[36]=0x0
    dsa_xmit: skb->data[37]=0x50
    dsa_xmit: skb->data[38]=0x51
    dsa_xmit: skb->data[39]=0x52

    ....

    But still this message will not be send out from the p2-Port. From data[12] to data[15], we use a DSA-Tag, because after this p2-Port, a Marvell-Switch is connected. But this header shouldn't be a problem, because I also tried to send this message without the DSA-Tag, but still the counter of the CPSW-ALE didn't count up and the message weren't sent out.

  • I apologize as I am not following what you are trying to do.

    The VLAN setup in the DTS should not have to be changed.

    Based on the original post it looks like you are having trouble sending packets out of a port. You should not have to refer to any VLAN ID when sending packets or trying to direct the packets. The linux kernel will specifiy the port and the cpsw driver manages sending to that port.

    Could you post a topology and how the IP addresses are being assigned?

    How are the interfaces brought up?

  • okay, everything is working fine. It was a problem with the ip-addresses and the routing-tables of linux. I had to change the ip-address out of the range from 140.80... to 192.168...!
    Thanks a lot!