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.

PHY issues in uboot of Custom K2L board

Hi ,expert

I am now trying to get uboot working on our custom k2l board. Here's issue:

By running via CCS I got uboot up and entered main loop. However it seems network is not up though no error message appears during the starting process.

We are using a different PHY(88E1543M) with that of EVM board(88E1514). In baremetal mode I got NDK running well with 88E1543M without changing any single line.

After debugging uboot for some time I found the return code of  keystone2_emac_initialize() is fine but keystone2_eth_open_close() is not good(they are both in board_eth_init() func , board_k2l.c). after dig a little bit further I found keystone_get_link_status() function is not good either.

Do you have any ideas of how to change uboot code on a different Phy chip?

Thanks,

striker

  • Hi,

    After debugging uboot for some time I found the return code of keystone2_emac_initialize() is fine but keystone2_eth_open_close() is not good(they are both in board_eth_init() func , board_k2l.c). after dig a little bit further I found keystone_get_link_status() function is not good either.


    Please check the following driver file.
    u-boot/drivers/net/keystone_net.c

    1) Undefine the "CONFIG_ETH_PHY_MARVEL_88E1111" in "u-boot/include/configs/ks2_evm.h" file.

    2) Enable the debug in EMAC driver file "keystone_net.c"
    emac_dbg = 1 ;
  • Stalin,

    I am very glad to tell you that  I got network working  after undefine "CONFIG_ETH_PHY_MARVEL_88E1111". But there's additional code modified as below, otherwise it will still fail:

    In func gen_get_link_speed(),Keystone_net.c , the code still calls the keystone2_eth_phy_read() function which is not right I suppose. So I copied the original gen_get_link_speed()  as well as davinci_eth_phy_write() and davinci_eth_phy_read() from davinci_emac.c . To avoid naming confusion I added static keyword in all three functions. And that solved my issue.

    Thanks a lot for your help,

    striker

  • Hi Striker,
    Sounds good.
    I'm glad that you able to solve the problem.
    Thanks for your update with your add-on solution.
    I hope it could help other customers too.
  • Thanks Stalin,

    Now I face the simiar issue in the kernel . 

    here's error log:

    [15159.653404] mdio_bus 26200f00.mdio: cannot get PHY at address 0
    [15159.659352] mdio_bus 26200f00.mdio: cannot get PHY at address 1
     
    after my  digging into the code I found that get_phy_id returns EIO(-5 ) error.
    I am not quite aware of porting linux,so your suggestions will be very helpful . Do you have any ideas about it?
    Thanks,
    striker
     
     
  • Have you tried to modify the "k2l-net.dtsi" file "arch/arm/boot/dts/" for ethernet?
  • Yes, can you give me more hint about the device tree file. I am not sure which part I should modify because I am using 88e1545 but I can't find this type in marvell.c .

    Besides, what's usual reason why I can't read the phy id from address 0 ?

    Thanks,

    striker