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.

Bug in SRIO driver?

Good day!

I'm working with TI EVM6678L board. I'm working with SRIO loopback example and I've found a bug in Srio_validateDIOBindingId() function in srio_drv.c. This is the source code of the function:

static int32_t Srio_validateDIOBindingId (uint16_t idMap, uint8_t tt)
{
    uint16_t    portIndex;
    uint16_t    brrIndex;
    uint8_t     enableStatus;
    uint8_t     maintRouting;
    uint8_t     privateStatus;
    uint16_t    counter = 1;
    uint8_t     baseID8Bit;
    uint16_t    baseID16Bit;
    uint8_t     startBRRIndex;

    /* Are we trying to validate the first idMap */
    if (idMap == 0)
    {
        /* Get the Device Identifier CSR */
        CSL_SRIO_GetDeviceIDCSR (gSRIODriverMCB.hSrio, &baseID8Bit, &baseID16Bit);

        /* 8 bit or 16 bit */
        if (tt == 0)
        {
            /* 8Bit: If we have a non-zero 8bit identifier present we are good */
            if (baseID8Bit != 0)
                return 0;
            return -1;
        }
        else
        {
            /* 16Bit: If we have a non-zero 16bit identifier present we are good */
            if (baseID16Bit != 0)
                return 0;
            return -1;                
        }
    }

    /* For all other idMaps we need to check the BRR Routing Table; so cycle through all the ports. */
    for (portIndex = 0; portIndex < 4; portIndex++)
    {
        /* For Port0; BRR Entry 0 is not used; so we skip and start from Entry 1. */
        if (portIndex == 0)
            startBRRIndex = 1;
        else
            startBRRIndex = 0;

        /* Cycle through all the BRR Entries for each port. */
        for (brrIndex = startBRRIndex; brrIndex < 4; brrIndex++)
        {
            /* Is this the entry we are looking for? */
            if (counter == idMap)
            {
                /* YES. Get the TLM Port Base Routing Information. */
                CSL_SRIO_GetTLMPortBaseRoutingInfo(gSRIODriverMCB.hSrio, portIndex,
                                                   brrIndex, &enableStatus,
                                                   &maintRouting, &privateStatus);

                /* If the BRR Entry has been enabled; then this entry can be used. */
                if (enableStatus == 1)
                    return 0;

                /* BRR Entry is not enabled; this entry cannot be used */
                return -1;
            }

            /* Increment the counter */
            counter++;
        }
    }
    /* Control comes here indicates no match was found. */
    return -1;
}



As you can see if idMap == 1(for example), then only TLM Port Base Routing Information from port 0 BRR 1 register is checked. Why so? Why are two cycles used for in this case?

  • Hi Oleg,

    It is not a bug in srio driver. 

    TI not supported the below Port and BRR entry(Refer Table 3-2 SRIO Registers in SRIO user guide):

    TLM port 0-3 base routing register 0 Control (Not supported by TI)

    TLM port 0-3 BRR 0 pattern & match (Not supported by TI)

    Thanks,

  • Hi Ganapathi!

    I've read about registers 0 note. The bug I mean is:

    if I use idMap == 1, then the check is performed ONLY for port 0, but not for other ports. The nested loop is useless. Why so? Why the check is not performed for port 1-3? TLM port 1-3 registers are useless in this case.

  • Hi Oleg,

    Port 0 only used for this example project(SRIO loopback). If you want use other port 1-3 modified the existing example project source code.

    Thanks,

  • Hi Ganapathi!

    Have you read my question? The bug I've found is in SRIO driver srio_drv.c file, not in SRIO example. My question is why Srio_validateDIOBindingId() function in srio_drv.c checks ONLY port 0, but not other ports?

  • Hi Oleg,

    The srio_drv.c file is not a part of the SRIO driver library. Srio_validateDIOBindingId() function in srio_drv.c file has to be modified and customized by application developers. 

    If the initialization sequence was a part of the SRIO driver then it would require the drivers to be rebuilt.

    Take a look at Software Design Specification (SDS): \ti\pdk_C6678_1_1_2_6\docs\SRIO_SDS.pdf

    Thanks,

  • Hi Ganapathi!

    Do you really mean that srio_drv.c file which is located at pdk_C6678_1_1_2_6\packages\ti\drv\srio\src folder is not a part of the SRIO driver library? And functions like Srio_start(), Srio_sockOpen(), etc, has to be modified and customized by application developers? Are you sure? And where is the SRIO driver library located then?

  • Hi Oleg,

    There are two types of SRIO example projects:

    1. SRIO driver library is not included on project .cfg file. This type of project directly use the SRIO driver (srio_drv.c) file. In this case, If you modify the local function in SRIO driver (srio_drv.c) file. No need rebuild the SRIO driver library. (Ex: SRIO_LoopbackTestProject)
    2. SRIO driver library is included on project .cfg file. This type of project not directly use the SRIO driver (srio_drv.c) file. In this case, If you modify the local function in SRIO driver (srio_drv.c) file. You need rebuild the SRIO driver library. (Ex: SRIO_LoopbackDioIsrexampleproject)

    Reference: Please check both project .cfg file  -  var Srio = xdc.loadPackage('ti.drv.srio');

    Refer below thread to rebuild the SRIO driver library

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/267567/935068.aspx#935068

    Thanks,

  • Hi Ganapathi!

    I don't ask you how to rebuild the SRIO driver library. Please read my question carefully. I ask you (or anybody more informed in this software): is this a bug in Srio_validateDIOBindingId() function in srio_drv.c or not?

    Please don't tell me how to rebuild library or something else, just ask my question or let another person help me!

  • Hi Oleg,

    It is not SRIO driver bug. Existing driver core supports Port 0 only. If you want use other ports(1-3) modify the existing driver source code. 

    The SRIO driver library provides a sample implementation of this feature. This implementation is sample only and application developers are recommended to modify it as deemed fit.

    How are you saying this is a driver bug? Have you got any error on running the SRIO example project?

    Thanks,

  • Hi Ganapathi!

    I've got an error in my example project which is based on SRIO example project. I've changed configuration of the Base Routing Registers (CSL_SRIO_SetTLMPortBaseRoutingPatternMatch() function parameters) in device_srio.c file and has got an error in Srio_validateDIOBindingId() function in srio_drv.c. That's why my question is about driver bug. I don't know that the existing driver core supports Port 0 only. Thanks for your help.