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.

Hyperlink loopback example fails on TCI6638 EVM

hyplnk_K2KC66BiosExampleProject

pdk_keystone2_3_00_01_12\packages\exampleProjects\hyplnk_K2KC66BiosExampleProject

have uncommented the loopback enable line in the hyplnkLLDCfg.h

#define hyplnk_EXAMPLE_LOOPBACK

The example hangs with CSL_HyperlinkSerdesGetStatus always returning PLL NOT LOCKED...

    /* SB PLL Status Poll */
    do
    {
        pllstat = CSL_HyperlinkSerdesGetStatus(baseAddr,
                                               hyplnk_EXAMPLE_MAX_LANES);
    }while(pllstat == CSL_SERDES_STATUS_PLL_NOT_LOCKED);

On closer inspection the function

CSL_IDEF_INLINE CSL_SERDES_STATUS CSL_HyperlinkSerdesGetStatus
(
 uint32_t base_addr,
 uint32_t num_lanes
)
{
    uint32_t i;
    CSL_SERDES_STATUS retval;

    /* Check PLL OK Status Bit */
    retval = (CSL_SERDES_STATUS)CSL_FEXTR(*(volatile uint32_t *)(base_addr + 0x1ff4), 28, 28);

    /* Check Lane # OK Status Bits */
    for (i=0; i < num_lanes; i++)
    {
        retval = (CSL_SERDES_STATUS)CSL_FEXTR(*(volatile uint32_t *)(base_addr + 0x1ff4), (8 + i), (8 + i));
    }   

    /* Check Lane SD Status Bits */
    for (i=0; i < num_lanes; i++)
    {
        retval = (CSL_SERDES_STATUS)CSL_FEXTR(*(volatile uint32_t *)(base_addr + 0x1ff4), (0 + i), (0 + i));
    }

    return retval;
}

that checks this seems to check 2*(num_lanes) of status bits... I found the lane # ok [0] status bit was being set, but all other checked bits were not set

the function would fail because only the very last bit checked effects the outcome of the function (is this an error?)

  • Sorry forgot to add my main point

    I have written a linux driver for hyperlink, intended for use on a future product, but after setting iloop (bit 1) in the Control Register (Base Address + 0x04), I did not get any link up, nor did the remote hyperlink registers (Base Addresses + 0x80 onwards) show any activity... and attempts to write to memory through hyperlink did nothing.

    So can anyone confirm that hyperlink loopback works on tci663x 1.1 silicon?

    Does SerDes need to be configured even for loopback testing?

  • Sorry, the issue is the PDK code doesn't support loopback test. To make the loopback work:

     C:\ti\pdk_keystone2_3_00_01_12\packages\ti\drv\hyplnk\example\common\hyplnkLLDIFace.c, function void hyplnkExampleDefSerdesSetup(),

    for(i=0; i < hyplnk_EXAMPLE_MAX_LANES; i++)
        {
            CSL_HyperlinkSerdesLaneEnable(baseAddr,
                                          i,
                                          CSL_SERDES_LOOPBACK_ENABLED,
                                          lane_rate);
        }

    Can you try?

    Regards, Eric

     

  • Thank you for the reply.

    I tried as you recommended.

    It seems to do much better now and only hangs on "About to try to read remote registers"

    If I try to pause execution here I get the following error

    C66xx_0: Trouble Halting Target CPU: (Error -1060 @ 0x0) Device is not responding to the request. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.1.232.0)

  • The issue is most likely related to the reference clock setting for Hyperlink. By default, the K2H EVM Hyperlink module uses 312.50 MHz reference clock.

    In this pdk_keystone2_3_00_01_12 release, please check if the software configured the 156.25 MHz clock instead (I believe so, at that time we don't have the SERDES configure for 312.50 MHz):

    Do you use:

    in hyplnkLLDCfg.h    #define hyplnk_EXAMPLE_REFCLK_USE_PLATCFG

    then in hyplnkPlatCfg.h  #define hyplnk_EXAMPLE_HYPLNK_REF_KHZ 156250

    If so, the code is built for 156.25 MHz clock and will not work on EVM.

    You may have two choices:

    1) Upgrade to MCSDK 3.0.2.14, where it has 312.50 Mhz clock supported, and make sure use

     #define hyplnk_EXAMPLE_HYPLNK_REF_KHZ    312500

    This release also has loopback code supported.

    2) Use the existing 3.0.1.12 release and change the clock temporarily to 156.25 through HW (each power cycle loses the changes). It is done in BMC console via a few command:

    See http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/286514.aspx?pi267198=1

    Before loading and running, you need to change the EVM use 156.25 MHz reference clock instead of default 312.50 from BMC console:

    BMC>hwdbg cmd clkreg show

    BMC>clkreg 3.6 0x03

    Then, load the code and run, loopback worked for me.

    Regards, Eric

  • Hi Eric,

    Thank you for the advice, the clock rate was indeed wrong.

    I have upgraded to the latest MCSDK and loopback is working fine.

    Many Thanks,

    Ville

  • Hi,lding:

    1.

    Does c6678 hypInk_exampleProject in the pdk_C6678_1_0_0_17  support loopback mode?

    At this post,you say that K2K EVM doesn't support loopback mode in pdk_keystone2_3_00_01_12 

    directly.What about 6678EVM in the pdk_C6678_1_0_0_17.

    2.

    I don't understand very much about the two choices by which we can support loopback mode.

    I feel the two choices are contradict.

    Why we must update to MCSDK 2.0.2.14?

    Why don't we change the value of hyplnk_EXAMPLE_HYPLNK_REF_KHZ

    to 312500?

    Another ,When you say two choices ,you should mean that choice 1 can support loopback

    mode and choice 2 can support loopback mode too.

    But,If choice 1 (update to MCSDK 2.0.2.14) can work and support ,why one need choice 2.

    I think choice 2 is complex and choice 1 is simple.No one can select complex method

    other than simple method.Don't you think?