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.

SRIO drv or periphal - will it handle maintenance requests automatically?

Hello,

I am looking for information regarding what the SRIO drv will do when it receives a maintenance (Type 8) packet for a register read.  Is this implemented in the periphal or does it need to be handled from the software level?

I am using the 6678

Thanks,
Brandy

  • Hello again,

    I have read in the manual (sprugw1a) that in order for the periphal to respond to maintenance packets with any destination ID, I must set promiscious mode.  So I added these lines to my project but it is still not responding to a maintenance read request.

       

    SRIO_TLM_CONTROL        tlmCntlSymbol;   

    // Get the TLM Port Control Configuration

        CSL_SRIO_GetTLMPortControl(hSrio, 0, &tlmCntlSymbol);

        System_printf("Get tlmCntlSymbol.mtcTgtIDDis = %i, tlmCntlSymbol.mtcTgtIDDis = %i\n",tlmCntlSymbol.mtcTgtIDDis, tlmCntlSymbol.tgtIDDis);

       // Set Promiscuous mode.

        tlmCntlSymbol.tgtIDDis    = 1;

        tlmCntlSymbol.mtcTgtIDDis = 1;

        CSL_SRIO_SetTLMPortControl (hSrio, 0, &tlmCntlSymbol);

        CSL_SRIO_GetTLMPortControl(hSrio, 0, &tlmCntlSymbol);

        System_printf("Set tlmCntlSymbol.mtcTgtIDDis = %i, tlmCntlSymbol.mtcTgtIDDis = %i\n",tlmCntlSymbol.mtcTgtIDDis, tlmCntlSymbol.tgtIDDis);

    My setup is this.  DSP A is the host, it is going to enumerate the switch by searching its ports for devices.  If I can't get DSP B to respond to a read packet, then I won't be able to place it into the routing table on the switch.  Does that make sense?

    Please advise on how the SRIO periphal is going to hand incoming maintenance requests. 

    Thanks,

    Brandy

  • Hi Brandy,

    Maintenance requests are handled by the SRIO peripheral HW automatically.  The only thing to remember is that we only support single register access (4B) as the target.

    Regards,

    Travis

  • Brandy,

    Since you have the DSPs in promiscuous mode, they will respond to any incoming DESTID on the type 8 maintenance packets.  You simply need to make sure the switch is setup to uniquely route a given DESTID to only one switch port, that includes the response DESTID for your host.  Here would be an example, say you have your host 0x A connected to a switch on port 0, with port 1 of the switch connected to DSP 0xB and port 2 of the switch connected to DSP 0xC.  So first off the DSP 0xA connects with the switch and sets the switch LUT to route DESTID 0xA to port 0 for the responses.  Then it uses maintenance packets (hop count 0) to discover the switch's port 1 has port_ok asserted.  So it knows there is an attached device.  The host then temporarily assigns DESTID 0xF to the switch's LUT for port 1.  It sends a maintenance read to DESTID 0xF/SRCID 0xA to read the BASEID register.  The DSP 0xB HW responds with the 0xB.  The host can then modify the LUT for DESTID 0xB going to port 1.  It also continues exploring the other ports of the switch and discovers a port_ok on port 2 and repeats the process using 0xF as the DESTID and changing the LUT temporarily to port2.  Make sense?

    When the SRIO periphearl HW responds to a maintenance packet, it will simply reverse the DESTID and SRCID fields of the request packet.  This allows the host to correctly correlate the request to response.

    Regards,

    Travis

  • Hi Travis,

    So I did this already.  (Following this articles example: http://www.edn.com/design/systems-design/4324420/Software-considerations-around-RapidIO-designs) I am using ID 0xff, I assign it to ports around the switch and I never see a response from the second DSP.  The first DSP can go around the switch and finds even the second switch, but it never finds the other DSP.

    I think I must have something in the driver set up wrong.

    Thanks!

     

    Here is the code: Socket has hopcount zero, Socket1 has hopcount 1. 

     

                            LOG_INFO("Attempting to discover rest of network. HopCount = %i", hopCount);

     

                            for(i = 0; i < numPortsOnSwitch; i++)

                            {

                                        if(i != myPortOnSwitch)

                                        {

                                                    LOG_INFO("Looking on Port %i",i);

                                                    //Change entry for 0xFF to next port.

                                                    maintanenceWriteReg(mySrioSocket, 0x70, 0x00, 0x00, 0x00, SRIO_BROADCAST_ID, SRIO_BROADCAST_ID);

                                                    maintanenceWriteReg(mySrioSocket, 0x74, 0x00, 0x00, 0x00, i, SRIO_BROADCAST_ID);

     

                                                    if(maintanenceReadReg(mySrioSocket1, 0x010, SRIO_BROADCAST_ID ,&readResponse) <0)

                                                    {

                                                                            LOG_ERROR("Error Reading Processing Element Register for Port %i",i);

                                                    }

                                                    else

                                                    {

                                                                            LOG_INFO("Processing Element on Port %i has these features (0x%08x)",i,readResponse);

                                                                            if((readResponse & 0x10000000))

                                                                            {

                                                                                                    LOG_DEBUG("The element is a switch. Discovering Network again for HopCount %i", hopCount+1);

                                                                                                    discoverNetwork(hSrioDrv, hopCount+1, myPortOnSwitch);

                                                                            }

                                                                            if((readResponse & 0x20000000))

                                                                            {

                                                                                                    //Untested

                                                                                                    if(maintanenceReadReg(mySrioSocket1, 0x060, SRIO_BROADCAST_ID ,&readResponse) <0)

                                                                                                    {

                                                                                                                            LOG_ERROR("Error Reading Base ID Register for Port %i",i);

                                                                                                    }

                                                                                                    else

                                                                                                    {

                                                                                                                            maintanenceWriteReg(mySrioSocket, 0x70, 0x00, 0x00, 0x00, (readResponse & 0x000000FF), SRIO_BROADCAST_ID);

                                                                                                                            maintanenceWriteReg(mySrioSocket, 0x74, 0x00, 0x00, 0x00, i, SRIO_BROADCAST_ID);

                                                                                                                            LOG_DEBUG("The element is processor. Logged ID 0x%x as Port %i",(readResponse & 0x000000FF),i);

                                                                                                    }

                                                                            }

                                                                            if((readResponse & 0x40000000))

                                                                            {

                                                                                                    //Untested

                                                                                                    if(maintanenceReadReg(mySrioSocket1, 0x060, SRIO_BROADCAST_ID ,&readResponse) <0)

                                                                                                    {

                                                                                                                            LOG_ERROR("Error Reading Base ID Register for Port %i",i);

                                                                                                    }

                                                                                                    else

                                                                                                    {

                                                                                                                            maintanenceWriteReg(mySrioSocket, 0x70, 0x00, 0x00, 0x00, (readResponse & 0x000000FF), SRIO_BROADCAST_ID);

                                                                                                                            maintanenceWriteReg(mySrioSocket, 0x74, 0x00, 0x00, 0x00, i, SRIO_BROADCAST_ID);

                                                                                                                            LOG_DEBUG("The element is endpoint. Logged ID 0x%x as Port %i",(readResponse & 0x000000FF),i);

                                                                                                    }

                                                                            }

                                                                            if((readResponse & 0x80000000))

                                                                            {

     

                                                                                                    //Untested

                                                                                                    if(maintanenceReadReg(mySrioSocket1, 0x060, SRIO_BROADCAST_ID ,&readResponse) <0)

                                                                                                    {

                                                                                                                            LOG_ERROR("Error Reading Base ID Register for Port %i",i);

                                                                                                    }

                                                                                                    else

                                                                                                    {

                                                                                                                            maintanenceWriteReg(mySrioSocket, 0x70, 0x00, 0x00, 0x00, (readResponse & 0x000000FF), SRIO_BROADCAST_ID);

                                                                                                                            maintanenceWriteReg(mySrioSocket, 0x74, 0x00, 0x00, 0x00, i, SRIO_BROADCAST_ID);

                                                                                                                            LOG_DEBUG("The element is memory or bridge. Logged ID 0x%x as Port %i",(readResponse & 0x000000FF),i);

                                                                                                    }

                                                                            }

                                                    }

                                        }

                            }