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: Ethernet in U-boot

Other Parts Discussed in Thread: DM8107

HI,

I am using the latest EZSDK, 5_05_02_00 for DM8168 board. I want to know, whether it is possible to test Ethernet in U-boot level. I want to do NFS boot to Launch Linux. Since I am using the PHY device LSI_ET1011C. I am seeing there is no driver available in the U-boot source. And also I want to use EMAC2 for my Ethernet PHY device. If so, is there any customization needs to be done in the source code level.

Thanks in advance.

Regards,

Salih

  • Hi Salih,

    Muhammad Salih said:
    I want to know, whether it is possible to test Ethernet in U-boot level. I want to do NFS boot to Launch Linux.

    You can use Ethernet in u-boot. You can even boot from Ethernet (load u-boot.bin), same as NAND/SPI/NOR or MMC/SD card. You can boot from Ethernet and then flash NAND/SPI from it:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_UBOOT_User_Guide#TI816X_2

    Regarding NFS, see:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_UBOOT_User_Guide#U-Boot_Network_configuration

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_UBOOT_User_Guide#Environment_Settings_for_NFS_Filesystem

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_User_Guide#Boot_over_Network_.28Ethernet.29

    Muhammad Salih said:
    Since I am using the PHY device LSI_ET1011C. I am seeing there is no driver available in the U-boot source.

    The Ethernet u-boot driver is generic. And DM816x u-boot support LSI ET1011C by default (as this is the TI EVM PHY):

    http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#Introduction

    http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#PHY_driver_support_in_UBOOT

    Muhammad Salih said:
    And also I want to use EMAC2 for my Ethernet PHY device. If so, is there any customization needs to be done in the source code level.

    http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#CPSW_EMAC_1_bringup_in_uboot

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/372597/1311525.aspx#1311525

    BR
    Pavel

  • Hi Pavel,

    Thanks for your inputs. But if I want to use EMAC 1, what are the changes needs to be done in the source code. Since I am using my customized platform, I have to do some power down sequence by toggling certain GPIOs. As for me, it is working fine in the Linux level. But I want it now U-boot level. And also, in the link they have mentioned some CPSW EMAC data structure. I am not seeing any such data structure in my board file hence it is present in TI8148 board file. Please help me out how to enable this and make it works.

    Thanks in advance.

    Regards,

    Salih

  • Salih,

    Muhammad Salih said:
    And also, in the link they have mentioned some CPSW EMAC data structure. I am not seeing any such data structure in my board file hence it is present in TI8148 board file.

    Yes, you are right, seems that CPSW driver is used in DM814x, DM813x, DM8127, DM811x and DM8107 devices, but not in DM816x. DM816x EMAC HW is different.

    Can you try with replacing the EMAC0 address to EMAC1, like the below e2e thread state:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/237498/831982.aspx#831982

    u-boot-omap3/arch/arm/include/asm/arch-ti81xx/emac_defs.h

    #ifdef CONFIG_TI81XX
    -#define EMAC_BASE_ADDR            (0x4A100000)
    -#define EMAC_WRAPPER_BASE_ADDR        (0x4A100900)
    +#define EMAC_BASE_ADDR            (0x4A120000)
    +#define EMAC_WRAPPER_BASE_ADDR        (0x4A120900)

    If this does not work, we can go further and change the RAM addr also (from EMAC0 to EMAC1):

    #ifdef CONFIG_TI81XX
    -#define EMAC_BASE_ADDR            (0x4A100000)
    -#define EMAC_WRAPPER_BASE_ADDR        (0x4A100900)
    -#define EMAC_WRAPPER_RAM_ADDR        (0x4A102000)

    +#define EMAC_BASE_ADDR            (0x4A120000)
    +#define EMAC_WRAPPER_BASE_ADDR        (0x4A120900)
    +#define EMAC_WRAPPER_RAM_ADDR        (0x4A122000)


    The EMAC1 addresses I take from DM816x datasheet, Table 3-28. L4 High-Speed Peripheral Memory Map and section 9.6.1 EMAC Peripheral Register Descriptions

    Regards,
    Pavel

  • Hi Pavel,

    I have changed the Base addresses from EMAC1 to EMAC2 as like you said previously. Still, I couldn't able get the PHY ID of my device.

    Please help me out to fix this issue.

    Thanks in advance.

    Regards,

    Salih

  • HI,

    Any updates on this. I am awaiting for your valuable response.

    Thanks in advance.
    Regards,
    Salih
  • Hi,

    Did I miss anything in it to configure EMAC2 or what might be the reason for this issue?. Please help me out to fix this issue.

    Thanks in advance.
    Regards,
    Salih
  • Salih,

    Muhammad Salih said:
    I have changed the Base addresses from EMAC1 to EMAC2 as like you said previously. Still, I couldn't able get the PHY ID of my device.

    What exactly you mean when you state you can not get the PHY ID? Do you mean your ethernet PHY is not detected? Can you provide a u-boot console log.

    What about EMAC1, are you able to get the PHY ID? Can you provide a u-boot console log.

    BR
    Pavel

  • Hi,

    I meant the Ethernet PHY is not detected. In EMAC1 also I couldn't able to get the PHY ID. Since my customized hardware design is made to connect the PHY device only through EMAC2 only.

    U-Boot 2010.06-svn587 (Dec 17 2014 - 17:41:37)

    DRAM:  1 GiB
    MMC:   OMAP SD/MMC: 0
    Using default environment

    Net:
    <ethaddr> not set. Reading from E-fuse
    Detected MACID:d0:ff:50:91:c1:28
    davinci_eth_phy_detect(), ALIVE = 0x00000000
    DaVinci EMAC
    Hit any key to stop autoboot:  0
    reading u-boot.bin

    187464 bytes read
    ## Starting application at 0x80800000 ...


    U-Boot 2010.06-svn587 (Dec 17 2014 - 17:42:41)

    TI8168-GP rev 2.1

    ARM clk: 987MHz
    DDR clk: 675MHz

    I2C:   ready
    DRAM:  1 GiB
    NAND:  HW ECC BCH8 Selected
    128 MiB
    MMC:   OMAP SD/MMC: 0
    Net:  Detected MACID:d0:ff:50:97:a6:1c
    davinci_eth_phy_detect(), ALIVE = 0x00000000
    DaVinci EMAC
    Hit any key to stop autoboot:  0
    iW-G12M-U-Boot >
    iW-G12M-U-Boot >

    The above is boot log from my U-boot console.

    Thanks in advance.

    Regards,

    Salih

  • Salih,

    Let me check with our EMAC experts what else is needed to enable EMAC1 in u-boot. I will come back to you when I have something.

    BR
    Pavel
  • Hi,

    I have found the issue and currently the PHY ID is detecting for me. The changes are below:

    -        #define EMAC_MDIO_PHY_NUM           1
    +       #define EMAC_MDIO_PHY_NUM           3

    File: "drivers/net/davinci_emac.c"

    function: davinci_eth_phy_detect (void)

    phy_act_state = readl(&adap_mdio->ALIVE) & EMAC_MDIO_PHY_MASK

    In the above MDIO register, I was getting the value 0x8, since EMAC_MDIO_PHY_NUM value is 1 and its keep on checking the device in 1-bit.  For me, the device was detecting in 3-bit. Why the source is checking only 1-bit in the MDIO Alive register?.

    Now, the PHY ID is detecting but I couldn't able to ping to the network. I am not seeing any driver for the my chip.

    Please suggest any solution to do further.

    Thanks in advance.

    Regards,
    Salih

  • Salih,

    Muhammad Salih said:
    Why the source is checking only 1-bit in the MDIO Alive register?

    This is because we can use only one EMAC (EMAC0 or EMAC1) in u-boot. We can use two EMACs in linux kernel where we have TCP/IP stack. And EMAC0 PHY is at 0x1 in the DM816x EVM, see the below e2e thread for more info:

    Muhammad Salih said:
    Now, the PHY ID is detecting but I couldn't able to ping to the network. I am not seeing any driver for the my chip.

    Not able to ping in u-boot or linux kernel? Can you provide console log. As I previously state, DM816x EVM has LSI ET1011C, thus it should work (if everything is fine from the HW side) by the default 816x code base.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/258752

  • Hi,

    Pinging is not happening only in U-boot, but happening in Linux. I have attached my U-boot and Linux console logs.

    /cfs-file/__key/communityserver-discussions-components-files/791/4265.3286.log.txt

    /cfs-file/__key/communityserver-discussions-components-files/791/5518.log_5F00_linux.txt

    Thanks in advance.

    Regards,
    Salih