Hi,
I`m new about SRIO IP. And I`m trying to build our wrapper to cover TI SRIO API in user side.
My environment is
- 66k2H12 evm
- CCS 6.2.0
- pdk 4.0.2
I have a few question about LLD and SRIO operation.
1. Is it possible to check error status in non-blocking socket?
I wrote the read function such like this:
Srio_DrvBuffer srio_buf; S32 startTime; U8 compCode; if(gBSP_SRIO_Initialized != 1) return CMN_RESULT_ERR_NOTINIT; /* Program the DIO Destination Information. */ gBSP_SRIO_Addrinfo_Write.dio.rapidIOLSB = (U32)remote_addr; if(data_len > BSP_SRIO_MAX_MTU) { data_len = BSP_SRIO_MAX_MTU; } /* Writeback the contents of the cache. */ CACHE_wbL1d (pBuff, data_len, CACHE_FENCE_WAIT); srio_buf = (Srio_DrvBuffer)l2_global_address((U32)pBuff); System_printf("Debug(Core %d): Read DIO Data Transfer - Src 0x%p Dst 0x%p\n", gCorenum, srio_buf, remote_addr); if(Srio_sockSend_DIO(gBSP_SRIO_Socket_Data, srio_buf, data_len, &gBSP_SRIO_Addrinfo_Read) < 0) { System_printf ("Error: Unable to send payload over DIO socket\n"); return -1; } /* Read the completion code filled by the ISR */ compCode = 0xFF; if (Srio_getSockOpt(gBSP_SRIO_Socket_Data, Srio_Opt_DIO_READ_SOCK_COMP_CODE, &compCode, sizeof(U8)) < 0) { System_printf ("Error: Unable to read the completion code in socket\n"); return -1; } if(compCode != 0x0) { System_printf ("Error: read the completion code in socket is not complete\n"); srioDioLsuBadTransfers++; return -1; }
But when I use this function, the lsu_icsr(interrupt condition status register) register shows the error in srcID0. But when I check the completionCode, It displays with no error. In this case, completion check process is useless? how can I check the error status in non-blocking socket?
2. When is the exact timing to occur LSU interrupt in read case(the case of sending NREAD send)?
- In description of Rx operation in data sheet, the interrupt is occured until the IP is ready to receive next packet. In official SRIO specification, Read operation is completed when the slave sends the "response" message with payload. So Is the LSU interrupt is occurred in NREAD packet send timing? or Response packet receiving timing?
3. How to register doorbell interrupt during device initialization?
- My purpose is to capture dio interrupt and doorbell interrupt. So In my case, if I execute write operation, when the write operation is finished, then dio interrupt is occured. And after finishing operation, it occurs doorbell interrupt by doorbell auro-generation. I use cpIntc and eventCombiner to register interrupt handler in BIOS side. So My process is such like this:
1) CSL_SRIO_SetDoorbellRoute(hSrio, 0); // to capture doorbell interrupt in corepac0(INTDST16)
2)
for (i = 0; i < 16; i++)
{
CSL_SRIO_RouteDoorbellInterrupts(hSrio, 0, i, 0);
CSL_SRIO_RouteDoorbellInterrupts(hSrio, 1, i, 0);
CSL_SRIO_RouteDoorbellInterrupts(hSrio, 2, i, 0);
CSL_SRIO_RouteDoorbellInterrupts(hSrio, 3, i, 0);
} // to capture the doorbell register of whole range in corepac0(INTDST16)
3)/* Disable Interrupt Pacing for INTDST0 */
CSL_SRIO_DisableInterruptPacing (hSrioCSL, 0);
4) /* Route LSU0 ICR0 to INTDST0 */
CSL_SRIO_RouteLSUInterrupts (hSrioCSL, 0, 0);
5) /* Route LSU0 ICR1 to INTDST0 */
CSL_SRIO_RouteLSUInterrupts (hSrioCSL, 1, 0);
6) /* Route LSU0 ICR2 to INTDST0 */
CSL_SRIO_RouteLSUInterrupts (hSrioCSL, 2, 0);
7) /* Map the System Interrupt i.e. the Interrupt Destination 0 interrupt to the DIO ISR Handler. */
CpIntc_dispatchPlug(CSL_CIC0_SRIO_INTDST0, BSP_SRIO_Dio_Isr, (UArg)hDrvManagedSrioDrv, TRUE);
8) /* SRIO DIO: Configuration is for CPINTC0. We map system interrupt 112 to Host Interrupt 8. */
CpIntc_mapSysIntToHostInt(0, CSL_CIC0_SRIO_INTDST0, 8);
9) /* SRIO DIO: Enable the Host Interrupt. */
CpIntc_enableHostInt(0, 8);
10) /* Enable the System Interrupt */
CpIntc_enableSysInt(0, CSL_CIC0_SRIO_INTDST0);
11) /* SRIO DIO: Get the event id associated with the host interrupt & Plug the CPINTC Dispatcher. */
eventId = CpIntc_getEventId(8);
EventCombiner_dispatchPlug (eventId, CpIntc_dispatch, 8, TRUE);
12) /* Plug the DoorBell Dispatcher. */
EventCombiner_dispatchPlug (20, (CpIntc_FuncPtr)DoorBellIsr, 8, TRUE);
EventCombiner_enableEvent(20);
Is it right procedure to register dio/doorbell interrupt? Cause, when I test it on internal loopback example(dioLoopbackExample), doorbell interrupt is not occurred during (read/write)operation. But when i forcely send doorbell packet, Interrupt is occurred. How can I configure the doorbell interrupt?
Sorry for awful question because of my english writing.
Thanks in advance.
Best regards.
Chanseok