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.

Configure EMAC for u-boot with DP83848 PHY

Hi,

    I am trying to migrate from DVSDK2 to DVSDK4 with my custom DM365 board. I already have some software running in the board with the Montavista kernel and when I use the U-boot 1.3.4 I have no problems with the ETH PHY.

The chip is the DP83848.

When I flash the u-boot2010.12-rc2 I don't see the message "PHY DP83848 detected @ 0x01" as in my previous u-boot. is not detected but I also don't have the "No ETH PHY detected!! message.

The only message I see about is the "Davinci-EMAC".

The problem is that each u-boot command which involves the ethernet (ping, tftp) causes the reboot.

I check the emac_defs.h file for the old and the new u-boot and the definitions looks the same. I have not idea about how to address this issue.

Thank you for your help.

 

 

 

 

 

 

 

  • Update: debugging the u-boot using printf i found the problem is in the function davinci_eth_phy_detect (davinci_emac.c). Unfortunately I still have no idea of the reason why the PHY is not alive.

     

     

     

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

        active_phy_addr = 0xff;

        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))
                    return(0);        /* More than one PHY */
                else {
                    active_phy_addr = i;
                    return(1);
                }
            }
        }

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

  • Solution: /include/configs/davinci_dm365evm.h

    - #define CONFIG_EMAC_MDIO_PHY_NUM    0

    + #define CONFIG_EMAC_MDIO_PHY_NUM    1

     

    Hope this might be useful to others.