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.

DM8168 EMAC PHY issue

Dear Pavel,

         Thanks for supporting DM8168 booting issue. Now, we are testing Davinci EMAC issue.

          I followed like udworks DM8168 EMAC.

          Net:   Detected MAC ID 

          DaVinci EMAC.

          the system is hanging (Trying DaVinci EMAC) when enter the dhcp cmd. Only solution to reset the system.

         The above messages from custom board.

          The udworks board, i am getting following messages.

          Net:   Ethernet PHY: GENERIC @ 0x01

          DaVinci EMAC.

          dhcp command is working fine after enter the dhcp command

Regards

Balaji

  • Dear Pavel,

    Program is hanging in the function of "int eth_init(bd_t *bis)" in eth.c(u-boot/net/). The function as below.

    int eth_init(bd_t *bis)
    {
    int eth_number;
    struct eth_device *old_current, *dev;

    if (!eth_current) {
    puts ("No ethernet found.\n");
    return -1;
    }

    /* Sync environment with network devices */
    eth_number = 0;
    dev = eth_devices;
    do {
    uchar env_enetaddr[6];

    if (eth_getenv_enetaddr_by_index(eth_number, env_enetaddr))
    memcpy(dev->enetaddr, env_enetaddr, 6);

    ++eth_number;
    dev = dev->next;
    } while (dev != eth_devices);

    old_current = eth_current;
    do {
    printf("CustomBoard:DHCP\r\n");
    debug("Trying %s\n", eth_current->name);

    // here eth_current->int() is hanging
    if (eth_current->init(eth_current,bis) >= 0) {
    eth_current->state = ETH_STATE_ACTIVE;

    return 0;
    }
    debug("FAIL\n");

    eth_try_another(0);
    } while (old_current != eth_current);

    return -1;

    Can you check it what could be problem ?

    Regards
    Balaji
  • Balaji,

    I have the below messages in the DM816x TI EVM:

    Net: Detected MACID:40:5f:c2:63:a2:30
    Ethernet PHY: GENERIC @ 0x01
    DaVinci EMAC

    DM816x TI EVM is using ethernet PHY LSI (ET1011C). Do you know what ethernet PHY is used in udworks board and on your custom board?

    If different, there might be need for porting, refer to the below wiki pages for details:

    processors.wiki.ti.com/.../TI81xx_PSP_Porting_Guide

    BR
    Pavel
  • Dear Pavel,

    RTL8211 phy used in udworks and SMSC 8810 used in custom boards. I cannot find any initialization (who is calling) in the program. can you mail me in details about that?

    Regards
    Balaji
  • Balaji,

    Balaji Govindarajan said:
    SMSC 8810 used in custom boards

    See the below thread:

    See also DM816x Silicon Errata, advisory 2.1.18 CPGMAC 1-Gbps Mode Does Not Work When EMAC_TXCLK is Not Running

    Balaji Govindarajan said:
    I cannot find any initialization (who is calling) in the program. can you mail me in details about that?

    I do not understand your question. Can you provide more details regarding this question: "I cannot find any initialization (who is calling) in the program. can you mail me in details about that?"

    BR
    Pavel

  • Dear Pavel,

    where the driver(phy driver) is initialized ? How to invoke it ?

    Regards
    balaji
  • Dear Pavel,

    The file name (davinci_emac.c) under u-boot\drivers\net. In this file, only defined PHY_LXT972 and PHY_DP83848 and other one is default. Nowhere called ET1011C LSI. can you mail me in details about this issue?

    I got as follows
    Net: Detected MACID:40:5f:c2:63:a2:30
    DaVinci EMAC
    but not getting the Ethernet PHY
    "Ethernet PHY: GENERIC @ 0x01"

    Regards
    Balaji
  • Balaji,

    Balaji Govindarajan said:
    The file name (davinci_emac.c) under u-boot\drivers\net. In this file, only defined PHY_LXT972 and PHY_DP83848 and other one is default. Nowhere called ET1011C LSI. can you mail me in details about this issue?

    As you can see from the u-boot message "Ethernet PHY: GENERIC @ 0x01" generic PHY driver is used in DM816x TI EVM, not ET1011C LSI specific driver.

    sprintf(phy.name, "GENERIC @ 0x%02x", active_phy_addr);
                phy.init = gen_init_phy;
                phy.is_phy_connected = gen_is_phy_connected;
                phy.get_link_speed = gen_get_link_speed;
                phy.auto_negotiate = gen_auto_negotiate;

    If there are some configuration details that are not supported by the "Generic PHY" driver, then you should use a custom PHY driver.

    Several things to check at your side:

    - check PHY address is correct

    - compare ethernet PHY datasheets

    - check HW design is correct

    BR
    Pavel

  • Dear Pavel,

    I found the problem and fixed. Now, Ethernet Phy is working.

    Regards
    Balaji
  • Balaji,

    Good to know you have fix it. Can you share what was the actual problem and how you fix it?

    BR
    Pavel
  • Dear Pavel,

    Step#1 I am using the statement of step 1 without masking because value of phy_act_state is 1 and mask with 2. So value will be always 0.
    It will not work.
    Step#2 is commented.

    static int davinci_eth_phy_detect(void)
    {
    u_int32_t phy_act_state;
    int i;

    active_phy_addr = 0xff;

    Step#1 phy_act_state = readl(&adap_mdio->ALIVE) ;// & EMAC_MDIO_PHY_MASK;
    //Step#2 phy_act_state = readl(&adap_mdio->ALIVE) & EMAC_MDIO_PHY_MASK;



    if (phy_act_state == 0)
    return(0); /* No active PHYs */

    debug_emac("davinci_eth_phy_detect(), ALIVE = 0x%08x\n", phy_act_state);

    for (i = 0; i < 32; i++) {
    if (phy_act_state & (1 << i)) {
    if (phy_act_state & ~(1 << i))
    {
    printf("Phy Value %x \r\n",i);
    return(0); /* More than one PHY */
    }
    else {
    active_phy_addr = i;
    return(1);
    }
    }
    }

    return(0); /* Just to make GCC happy */
    }

    Loaded kernel into flash. System is hanging in kernel when power on. only solution to reset the system.

    ## Booting kernel from Legacy Image at 81000000 ...
    Image Name: Linux-2.6.37
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2543292 Bytes = 2.4 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.


    Regards
    Balaji
  • Dear Pavel,

    I have loaded the file system of ubi_128_DM816X_UD_DVR in udworks board. Whether i can load the same file system or different? can you mail me for that?

    Regards
    Balaji
  • Balaji,

    Balaji Govindarajan said:
    I have loaded the file system of ubi_128_DM816X_UD_DVR in udworks board. Whether i can load the same file system or different? can you mail me for that?

    This issue is different from the initial one (EMAC PHY issue), so I would suggest you to open new e2e thread.

    BR
    Pavel