예제 #1
0
/*******************************************************************************
* mvSysCesaInit - Initialize the Cesa subsystem
*
* DESCRIPTION:
*
* INPUT:
*       None
* OUTPUT:
*		None
* RETURN:
*       None
*
*******************************************************************************/
MV_STATUS mvSysCesaInit(int numOfSession, int queueDepth, void *osHandle)
{
	MV_CESA_HAL_DATA halData;
	MV_UNIT_WIN_INFO addrWinMap[MAX_TARGETS + 1];
	MV_STATUS status;
	MV_U8 chan;

	status = mvCtrlAddrWinMapBuild(addrWinMap, MAX_TARGETS + 1);

	if(status == MV_OK) {
		for(chan = 0; chan < MV_CESA_CHANNELS; chan++) {
			status = mvCesaIfTdmaWinInit(chan, addrWinMap);
			
			if(status != MV_OK) {
				mvOsPrintf("Error, unable to initialize CESA windows for channel(%d)\n", chan);
				break;
			}
			halData.sramPhysBase[chan] = (MV_ULONG)mv_crypto_base_get(chan);
			halData.sramVirtBase[chan] = (MV_U8*)mv_crypto_base_get(chan);
			halData.sramOffset[chan] = 0;
		}

		if(status == MV_OK) {
		halData.ctrlModel = mvCtrlModelGet();
		halData.ctrlRev = mvCtrlRevGet();
			status = mvCesaIfHalInit (numOfSession, queueDepth, 
					osHandle, &halData);
	}
	}

	return status;
}
예제 #2
0
unsigned char*  mv_sram_usage_get(int* sram_size_ptr)
{
    int used_size = 0;

#if defined(CONFIG_MV_CESA)
    used_size = sizeof(MV_CESA_SRAM_MAP);
#endif

    if(sram_size_ptr != NULL)
        *sram_size_ptr = _8K - used_size;

    return (char *)(mv_crypto_base_get() + used_size);
}