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.

AM335x MII Ethernet can't receive

Other Parts Discussed in Thread: AM3359

Hi,

In our project we design a custom board by using AM335x interface with Ethernet PHY device(IP101A) through MII interface. For hardware side, i use the AM335x BeagleBone schematic as reference to connect AM335x with Ethernet PHY.

The pin connect as folowing(AM335X<--------->IP101A)

MDIO_CLK <--------->MDC, MDIO_DATA<--------->MDIO, GMII1_TXD0<--------->TXD0, GMII1_TXD1<--------->TXD1, GMII1_TXD2<--------->TXD2, GMII1_TXD3<--------->TXD3, GMII1_TXEN<--------->TXEN, GMII1_TXCLK<--------->TX_CLK, GMII1_RXDV<--------->RX_DV, GMII1_RXD0<--------->RXD0, GMII1_RXD1<--------->RXD1, GMII1_RXD2<--------->RXD2, GMII1_RXD3<--------->RXD3, GMII1_RXCLK<--------->RX_CLK, GMII1_COL<--------->COL, GMII1_CRS<--------->CRS, GMII1_RXERR<--------->RX_ERR

We've modified 2 point in u-boot:

1、set mac mode as MII_MODE_ENABLE

2、change cpsw_slaves  .phy_id

now when ping from our board to PC we cat that our board send message successfully

then we can measure some signals at GMII1_RXDV, GMII1_RXD0, GMII1_RXD1, GMII1_RXD2, GMII1_RXD3, GMII1_RXCLK through oscilloscope

so we add some LOG in fun cpdma_process

static int cpdma_process(struct cpsw_priv *priv, struct cpdma_chan *chan,
void **buffer, int *len)
{
struct cpdma_desc *desc = chan->head;
u32 status;
char * buff_zq = *buffer;

if (!desc)
return -ENOENT;

status = desc_read(desc, hw_mode);
printf("cpdma_process 1 ,regadd:%lx status: %lx,len:%lx\n", &(desc)->hw_mode,status,len);

if (len)
*len = status & 0x7ff;

if (buffer)
*buffer = desc_read_ptr(desc, sw_buffer);
printf("cpdma_process 2 ,buffer add:%lx\n", &(desc)->sw_buffer);

if (status & CPDMA_DESC_OWNER) {
if (chan_read(chan, hdp) == NULL) {
printf("cpdma_process 3\n");
if (desc_read(desc, hw_mode) & CPDMA_DESC_OWNER)
{
printf("cpdma_process 4\n");
chan_write(chan, hdp, desc);
}
}
printf("cpdma_process 5\n");

return -EBUSY;
}
printf("cpdma_process 6\n");

chan->head = desc_read_ptr(desc, hw_next);
chan_write(chan, cp, desc);

cpdma_desc_free(priv, desc);
return 0;
}

then the ping log is :

cpdma_process 1 ,regadd:8ff796a8 status: e00005ee,len:8ff77e10
cpdma_process 2 ,buffer add:8ff796ac
cpdma_process 5

U-Boot# md 0x8ff7969c
8ff7969c: 8ff796b4 8ffecca0 000005ee e00005ee ................//receive len 0x5ee?
8ff796ac: 8ffecca0 000005ee 8ff796cc 8ffed2a0 ................
8ff796bc: 000005ee e00005ee 8ffed2a0 000005ee ................
8ff796cc: 8ff796e4 8ffed8a0 000005ee e00005ee ................
8ff796dc: 8ffed8a0 000005ee 00000000 8ffedea0 ................
8ff796ec: 000005ee e00005ee 8ffedea0 000005ee ................
8ff796fc: 00000000 8ffec6a0 0000003c d000003c ........<...<...
8ff7970c: 8ffec6a0 0000003c 8ff7972c 00000000 ....<...,.......
8ff7971c: 00000000 00000000 00000000 00000000 ................
8ff7972c: 8ff79744 00000000 00000000 00000000 D...............
8ff7973c: 00000000 00000000 00000000 00000000 ................
8ff7974c: 00000000 00000000 00000000 00000000 ................
8ff7975c: 8ff79714 8ff7969c 8ff796e4 4a100a20 ............ ..J
8ff7976c: 4a100a60 4a1008e0 8ff796fc 8ff796fc `..J...J........
8ff7977c: 4a100a00 4a100a40 00000000 8ff79790 ...J@..J........
8ff7978c: 00000031 4a100208 4a100d80 00000000 1......J...J....
U-Boot# md 0x8ffecca0 //receive zeros?
8ffecca0: 00000000 00000000 00000000 00000000 ................
8ffeccb0: 00000000 00000000 00000000 00000000 ................
8ffeccc0: 00000000 00000000 00000000 00000000 ................
8ffeccd0: 00000000 00000000 00000000 00000000 ................
8ffecce0: 00000000 00000000 00000000 00000000 ................
8ffeccf0: 00000000 00000000 00000000 00000000 ................
8ffecd00: 00000000 00000000 00000000 00000000 ................
8ffecd10: 00000000 00000000 00000000 00000000 ................
8ffecd20: 00000000 00000000 00000000 00000000 ................
8ffecd30: 00000000 00000000 00000000 00000000 ................
8ffecd40: 00000000 00000000 00000000 00000000 ................
8ffecd50: 00000000 00000000 00000000 00000000 ................
8ffecd60: 00000000 00000000 00000000 00000000 ................
8ffecd70: 00000000 00000000 00000000 00000000 ................
8ffecd80: 00000000 00000000 00000000 00000000 ................
8ffecd90: 00000000 00000000 00000000 00000000 ................

it seems the rx dma was run into a wrong state, and is out of our limit, please check that is there any points to modify? or something else

Thanks in advance,

Keldy 

  • hi,

    to checkout the problem, we are now using the EMAC BOOT, but we still have some problem.

    we changed SYSBOOT config pins to enable MII BOOT,

    then we config the BOOTP TOOL to send the expects response in 26.1.8.4.2( AM335x ARM Cortex-A8 Microprocessors (MPUs) Technical Reference Manual  )

    but the board still trys 5 BOOTP requests, It seems the am3359 does not accecpt the BOOTP reply

    here are the packet we captured:

    8611.boot request_summary.txt
    No.     Time        Source                Destination           Protocol Info
       1802 1254.000000 0.0.0.0               255.255.255.255       BOOTP    Boot Request from 00:17:ea:aa:f7:8a (TexasIns_aa:f7:8a)
    
    Frame 1802 (406 bytes on wire, 406 bytes captured)
    Ethernet II, Src: TexasIns_aa:f7:8a (00:17:ea:aa:f7:8a), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
    Internet Protocol, Src: 0.0.0.0 (0.0.0.0), Dst: 255.255.255.255 (255.255.255.255)
    User Datagram Protocol, Src Port: bootpc (68), Dst Port: bootps (67)
    Bootstrap Protocol
        Message type: Boot Request (1)
        Hardware type: Ethernet
        Hardware address length: 6
        Hops: 0
        Transaction ID: 0x00000001
        Seconds elapsed: 0
        Bootp flags: 0x0000 (Unicast)
        Client IP address: 0.0.0.0 (0.0.0.0)
        Your (client) IP address: 0.0.0.0 (0.0.0.0)
        Next server IP address: 0.0.0.0 (0.0.0.0)
        Relay agent IP address: 0.0.0.0 (0.0.0.0)
        Client MAC address: TexasIns_aa:f7:8a (00:17:ea:aa:f7:8a)
        Client hardware address padding: 00000000000000000000
        Server host name not given
        Boot file name not given
        Magic cookie: (OK)
        Option: (t=60,l=15) Vendor class identifier = "DM814x ROM v1.0"
        Option: (t=61,l=81) Client identifier
        End Option
        Padding
    
    0334.boot reply_summary.txt
    No.     Time        Source                Destination           Protocol Info
       1803 1254.000000 192.168.0.1           255.255.255.255       BOOTP    Boot Reply
    
    Frame 1803 (342 bytes on wire, 342 bytes captured)
    Ethernet II, Src: c8:9c:dc:74:10:e7 (c8:9c:dc:74:10:e7), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
    Internet Protocol, Src: 192.168.0.1 (192.168.0.1), Dst: 255.255.255.255 (255.255.255.255)
    User Datagram Protocol, Src Port: bootps (67), Dst Port: bootpc (68)
    Bootstrap Protocol
        Message type: Boot Reply (2)
        Hardware type: Ethernet
        Hardware address length: 6
        Hops: 0
        Transaction ID: 0x00000001
        Seconds elapsed: 0
        Bootp flags: 0x0000 (Unicast)
        Client IP address: 0.0.0.0 (0.0.0.0)
        Your (client) IP address: 192.168.0.126 (192.168.0.126)
        Next server IP address: 192.168.0.1 (192.168.0.1)
        Relay agent IP address: 0.0.0.0 (0.0.0.0)
        Client MAC address: TexasIns_aa:f7:8a (00:17:ea:aa:f7:8a)
        Client hardware address padding: 00000000000000000000
        Server host name not given
        Boot file name: u-boot-spl.bin
        Magic cookie: (OK)
        Option: (t=1,l=4) Subnet Mask = 255.255.255.0
        Option: (t=2,l=4) Time Offset = 0 time
        Option: (t=3,l=4) Router = 192.168.0.1
        Option: (t=17,l=22) Root Path = "C:\Program Files\dhcp"
        End Option
        Padding
    
    6406.boot request_bytes.txt
    char pkt1807[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x17, 
    0xea, 0xaa, 0xf7, 0x8a, 0x08, 0x00, 0x45, 0x00, 
    0x01, 0x88, 0x05, 0x00, 0x00, 0x00, 0x40, 0x11, 
    0x74, 0x66, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
    0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x74, 
    0x5b, 0x5e, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 
    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 
    0xea, 0xaa, 0xf7, 0x8a, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, 
    0x53, 0x63, 0x3c, 0x0f, 0x44, 0x4d, 0x38, 0x31, 
    0x34, 0x78, 0x20, 0x52, 0x4f, 0x4d, 0x20, 0x76, 
    0x31, 0x2e, 0x30, 0x3d, 0x51, 0x05, 0x01, 0x05, 
    0x01, 0x81, 0x40, 0x07, 0x02, 0x13, 0x02, 0x01, 
    0x00, 0x12, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x14, 0x21, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x15, 0x09, 0x01, 0xf9, 0xb1, 
    0x5e, 0xc2, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
    
    
    4401.boot reply_bytes.txt
    char pkt1808[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc8, 0x9c, 
    0xdc, 0x74, 0x10, 0xe7, 0x08, 0x00, 0x45, 0x00, 
    0x01, 0x48, 0x0b, 0x9a, 0x00, 0x00, 0x40, 0x11, 
    0xad, 0x62, 0xc0, 0xa8, 0x00, 0x01, 0xff, 0xff, 
    0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 
    0xc1, 0xee, 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 
    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0xc0, 0xa8, 0x00, 0x7e, 0xc0, 0xa8, 
    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 
    0xea, 0xaa, 0xf7, 0x8a, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x2d, 
    0x62, 0x6f, 0x6f, 0x74, 0x2d, 0x73, 0x70, 0x6c, 
    0x2e, 0x62, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, 
    0x53, 0x63, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 
    0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 
    0xc0, 0xa8, 0x00, 0x01, 0x11, 0x16, 0x43, 0x3a, 
    0x5c, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 
    0x20, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x5c, 0x64, 
    0x68, 0x63, 0x70, 0x00, 0xff, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
    
    

  • I have the same problem. instead I'm using rmii, and my first ethernet interface is working ok, the 2nd interface can't receive, and I'm working in linux. No interrupt occured while receiving.

  • Could any TI expert or FAE help? I have posted it for 7 days

    Best regards,

  • We have solved the problem

  • It's so amazing! I resolve this problem at the same day. Perhaps we made the same mistake.

  • I'm glad to hear you both were able to resolve the issue.

    It may be helpful to others if you share this information.  This is the purpose of the forums.

    Regards,
    Paul

  • Hi yi, I found the same problem with u, Could you please tell me how you solved this problem?

  • I have the same problem. Can you tell me how you solved it?

  • Our hardware connection error lead to problems

  • I found my problem. It was a soldering error on the board, in the path of the CRS_DV signal. 

  • I have this same problem in U-boot. Using SMSC 8740 PHY.
    Can you pleas tell me what your solution is?

    I try this in LWiP under starterware and it works fine. But in U-Boot I have the same return -BUSY and len 0x5ee. Exact same condition.

    Thanks.
  • Hello,

    I have this exact same problem in U-Boot with an MII phy.
    What was the solution to this issue?

    Thanks,
    Eldon.
  • Has anybody solved this problem? I had the same issue cpdma_process returns EBUSY.