diff options
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api')
19 files changed, 498 insertions, 105 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.c index a419b35..27effc7 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 16 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c index 329c318..055f515 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c @@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 510 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c index af0fda6..da82fb6 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c @@ -24,9 +24,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 367 $ +$Octasic_Revision: 374 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -183,6 +183,7 @@ UINT32 Oct6100ChipOpenDef( + /* Set the tail displacement to zero. */ f_pChipOpen->ulTailDisplacement = 0; @@ -223,6 +224,7 @@ UINT32 Oct6100ChipOpenDef( f_pChipOpen->InterruptConfig.ulFatalGeneralConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; f_pChipOpen->InterruptConfig.ulFatalMemoryConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; + f_pChipOpen->InterruptConfig.ulErrorH100Config = cOCT6100_INTERRUPT_NO_TIMEOUT; f_pChipOpen->InterruptConfig.ulErrorOverflowToneEventsConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; @@ -435,7 +437,7 @@ UINT32 Oct6100ChipOpen( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; - /* Initialize the mixer memory. */ + /* Initialize the recorder. */ ulResult = Oct6100ApiInitRecordResources( f_pApiInstance ); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; @@ -448,7 +450,7 @@ UINT32 Oct6100ChipOpen( - /*Clear all interrupts that could have occured during startup*/ + /* Clear all interrupts that could have occured during startup */ ulResult = Oct6100ApiClearInterrupts( f_pApiInstance ); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; @@ -464,8 +466,10 @@ UINT32 Oct6100ChipOpen( ) return cOCT6100_WARNING_OPEN_FUNCTIONAL_BIST_FAILED; - else - return cOCT6100_ERR_OK; + + + + return cOCT6100_ERR_OK; } @@ -1052,12 +1056,14 @@ UINT32 Oct6100ApiCheckChipConfiguration( if ( f_pChipOpen->pbyImageFile == NULL ) return cOCT6100_ERR_OPEN_IMAGE_FILE; - ulTempVar = Oct6100ApiCheckImageFileHeader(f_pChipOpen); - if (ulTempVar != cOCT6100_ERR_OK) + ulTempVar = Oct6100ApiCheckImageFileHeader( f_pChipOpen ); + if ( ulTempVar != cOCT6100_ERR_OK ) return ulTempVar; + + /* Check the acoustic echo activation flag. */ if ( f_pChipOpen->fEnableAcousticEcho != TRUE && f_pChipOpen->fEnableAcousticEcho != FALSE ) @@ -1357,6 +1363,7 @@ UINT32 Oct6100ApiCopyChipConfiguration( + pSharedInfo->ChipConfig.usTailDisplacement = (UINT16)( f_pChipOpen->ulTailDisplacement & 0xFFFF ); pSharedInfo->ChipConfig.fEnableAcousticEcho = (UINT8)( f_pChipOpen->fEnableAcousticEcho & 0xFF ); /* Resource allocation parameters. */ @@ -1472,6 +1479,7 @@ UINT32 Oct6100ApiInitializeMiscellaneousVariables( pSharedInfo->MiscVars.usCodepoint = 0; pSharedInfo->MiscVars.usCpuLsuWritePtr = 0; + /* Pouch counter not present until TLVs are read. */ pSharedInfo->DebugInfo.fPouchCounter = FALSE; pSharedInfo->DebugInfo.fIsIsrCalledField = FALSE; @@ -2029,14 +2037,13 @@ f_pApiInstance Pointer to API instance. This memory is used to keep the UINT32 Oct6100ApiCheckImageFileHeader( IN tPOCT6100_CHIP_OPEN f_pChipOpen ) { - - PUINT8 pszImageInfoStart = NULL; - UINT32 ulStrLen; + UINT32 ulStrLen; + PUINT8 pszImageVersion; ulStrLen = Oct6100ApiStrLen( (PUINT8)cOCT6100_IMAGE_START_STRING ); - pszImageInfoStart = Oct6100ApiStrStr(f_pChipOpen->pbyImageFile,(PUINT8)cOCT6100_IMAGE_START_STRING, - f_pChipOpen->pbyImageFile + ulStrLen); - if (pszImageInfoStart == NULL) + pszImageVersion = Oct6100ApiStrStr( f_pChipOpen->pbyImageFile, (PUINT8)cOCT6100_IMAGE_START_STRING, + f_pChipOpen->pbyImageFile + ulStrLen ); + if ( pszImageVersion == NULL ) return cOCT6100_ERR_OPEN_INVALID_IMAGE_FILE; return cOCT6100_ERR_OK; @@ -2062,11 +2069,16 @@ UINT32 Oct6100ApiDecodeKeyAndBist( tPOCT6100_API_CHIP_CONFIG pChipConfig; tOCT6100_WRITE_PARAMS WriteParams; tOCT6100_READ_PARAMS ReadParams; - UINT16 ausBistData[ 3 ]; + tOCT6100_READ_BURST_PARAMS ReadBurstParams; + UINT16 ausBistData[ 6 ]; UINT16 usReadData; UINT32 ulResult; BOOL fBitEqual; UINT32 i; + UINT32 ulBistIndex = 0; + UINT32 aulBistTypes[] = { + + 0 /* Memory clear */ }; /* Get local pointer to shared portion of instance. */ pSharedInfo = f_pApiInstance->pSharedInfo; @@ -2085,8 +2097,13 @@ UINT32 Oct6100ApiDecodeKeyAndBist( ReadParams.ulUserChipId = pChipConfig->ulUserChipId; + /* Set the process context and user chip ID parameters once and for all. */ + ReadBurstParams.pProcessContext = f_pApiInstance->pProcessContext; + + ReadBurstParams.ulUserChipId = pChipConfig->ulUserChipId; + /* Write key in CPU internal memory. */ - for(i=0; i<8; i++) + for( i=0; i<8; i++ ) { WriteParams.ulWriteAddress = 0x150; WriteParams.usWriteData = 0x0000; @@ -2114,7 +2131,7 @@ UINT32 Oct6100ApiDecodeKeyAndBist( } /* Write one in CPU internal memory. */ - for(i=0; i<8; i++) + for( i=0; i<8; i++ ) { WriteParams.ulWriteAddress = 0x150; if (i == 0) @@ -2154,62 +2171,65 @@ UINT32 Oct6100ApiDecodeKeyAndBist( /* Run BISTs and key decode. */ WriteParams.ulWriteAddress = 0x160; - WriteParams.usWriteData = 0x0081; - mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; - /* Wait for the key decode PC to clear. */ - ulResult = Oct6100ApiWaitForPcRegisterBit( f_pApiInstance, 0x160, 0, 0, 100000, &fBitEqual ); - if ( TRUE != fBitEqual ) - return cOCT6100_ERR_FATAL_13; + + /* Activate BIST and key decode. */ + WriteParams.usWriteData = 0x0081; - /* Read the key valid bit to make sure everything is ok. */ - ReadParams.ulReadAddress = 0x160; - ReadParams.pusReadData = &usReadData; + /* Set BIST type. */ + WriteParams.usWriteData |= aulBistTypes[ ulBistIndex ] << 4; + + mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; - mOCT6100_DRIVER_READ_API( ReadParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; + /* Wait for the key decode PC to clear. */ + ulResult = Oct6100ApiWaitForPcRegisterBit( f_pApiInstance, 0x160, 0, 0, 100000, &fBitEqual ); + if ( TRUE != fBitEqual ) + return cOCT6100_ERR_FATAL_13; - /* The channel capacity pins of the chip do not match what the firmware is expecting. */ - if ( ( usReadData & 0x4 ) == 0 ) - return cOCT6100_ERR_OPEN_INVALID_FIRMWARE_OR_CAPACITY_PINS; + /* Read the key valid bit to make sure everything is ok. */ + ReadParams.ulReadAddress = 0x160; + ReadParams.pusReadData = &usReadData; - /* Read the result of the internal memory bist. */ - ReadParams.ulReadAddress = 0x110; - ReadParams.pusReadData = &ausBistData[ 0 ]; + mOCT6100_DRIVER_READ_API( ReadParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; - mOCT6100_DRIVER_READ_API( ReadParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; + /* The channel capacity pins of the chip do not match what the firmware is expecting. */ + if ( ( usReadData & 0x4 ) == 0 ) + return cOCT6100_ERR_OPEN_INVALID_FIRMWARE_OR_CAPACITY_PINS; - ReadParams.ulReadAddress = 0x114; - ReadParams.pusReadData = &ausBistData[ 1 ]; + /* Read the result of the internal memory BIST. */ + ReadBurstParams.ulReadAddress = 0x110; + ReadBurstParams.pusReadData = ausBistData; + ReadBurstParams.ulReadLength = 6; - mOCT6100_DRIVER_READ_API( ReadParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; - - ReadParams.ulReadAddress = 0x118; - ReadParams.pusReadData = &ausBistData[ 2 ]; + mOCT6100_DRIVER_READ_BURST_API( ReadBurstParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; - mOCT6100_DRIVER_READ_API( ReadParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; + /* Check if an error was reported. */ + for ( i=0; i<6; i++ ) + { + if ( ausBistData[ i ] != 0x0000 ) + { + if ( aulBistTypes[ ulBistIndex ] == 0 ) + return cOCT6100_ERR_OPEN_INTERNAL_MEMORY_BIST; - /* Check if an error was reported. */ - if (ausBistData[0] != 0x0000 || ausBistData[1] != 0x0000 || ausBistData[2] != 0x0000) - return cOCT6100_ERR_OPEN_INTERNAL_MEMORY_BIST; + } + } + + /* Put key decoder in powerdown. */ + WriteParams.ulWriteAddress = 0x160; + WriteParams.usWriteData = 0x00AA; + + mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; - /* Put key decoder in powerdown. */ - WriteParams.ulWriteAddress = 0x160; - WriteParams.usWriteData = 0x008A; - mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; return cOCT6100_ERR_OK; } @@ -5189,6 +5209,8 @@ UINT32 Oct6100ApiInitChannels( && ( pSharedInfo->ImageInfo.usMaxNumberOfChannels < cOCT6100_MAX_ECHO_CHANNELS ) && ( pSharedInfo->ChipConfig.usMaxChannels == pSharedInfo->ImageInfo.usMaxNumberOfChannels ) ) return cOCT6100_ERR_NOT_SUPPORTED_OPEN_MAX_ECHO_CHANNELS_VALUE; + + /* Initialize the memory for all required channels. */ for( i = 0; i < f_pApiInstance->pSharedInfo->ChipConfig.usMaxChannels; i++ ) diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c index 2e57fa8..e874a81 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.c @@ -22,9 +22,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 96 $ +$Octasic_Revision: 98 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -105,6 +105,7 @@ UINT32 Oct6100ChipGetStatsDef( + return cOCT6100_ERR_OK; } @@ -216,6 +217,7 @@ UINT32 Oct6100ChipGetImageInfoDef( f_pChipImageInfo->fSinLevel = TRUE; + f_pChipImageInfo->fPerChannelPlayoutControl = FALSE; for ( i = 0; i < cOCT6100_MAX_TONE_EVENT; i++ ) @@ -290,6 +292,7 @@ UINT32 Oct6100ChipGetImageInfo( f_pChipImageInfo->ulImageType = pImageInfo->byImageType; + f_pChipImageInfo->fPerChannelPlayoutControl = pImageInfo->fPerChannelPlayoutControl; for ( i = 0; i < cOCT6100_MAX_TONE_EVENT; i++ ) @@ -358,6 +361,8 @@ UINT32 Oct6100ApiChipStatsSwInit( + + return cOCT6100_ERR_OK; } @@ -416,6 +421,8 @@ UINT32 Oct6100ChipGetStatsSer( pSharedInfo->SoftBufs.ulBufPlayoutEventBufferOverflowCnt = 0; + + } f_pChipStats->ulH100OutOfSynchCount = pSharedInfo->ErrorStats.ulH100OutOfSyncCnt; @@ -429,6 +436,8 @@ UINT32 Oct6100ChipGetStatsSer( + + f_pChipStats->ulOverflowToneEventsCount = pSharedInfo->ErrorStats.ulOverflowToneEventsCnt; f_pChipStats->ulSoftOverflowToneEventsCount = pSharedInfo->SoftBufs.ulToneEventBufferOverflowCnt; f_pChipStats->ulSoftOverflowBufferPlayoutEventsCount = pSharedInfo->SoftBufs.ulBufPlayoutEventBufferOverflowCnt; diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c index 0fe4f90..e3279c1 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c @@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 146 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c index 2b9ad20..9fbb269 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.c @@ -22,9 +22,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 66 $ +$Octasic_Revision: 74 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -37,6 +37,8 @@ $Octasic_Revision: 66 $ #include "oct6100api/oct6100_errors.h" #include "oct6100api/oct6100_apiud.h" +#include "apilib/octapi_largmath.h" + #include "oct6100api/oct6100_apiud.h" #include "oct6100api/oct6100_tlv_inst.h" #include "oct6100api/oct6100_chip_open_inst.h" @@ -49,10 +51,12 @@ $Octasic_Revision: 66 $ #include "oct6100api/oct6100_interrupts_pub.h" #include "oct6100api/oct6100_chip_open_pub.h" +#include "oct6100api/oct6100_chip_stats_pub.h" #include "oct6100api/oct6100_channel_pub.h" #include "oct6100api/oct6100_debug_pub.h" #include "oct6100_chip_open_priv.h" +#include "oct6100_chip_stats_priv.h" #include "oct6100_channel_priv.h" #include "oct6100_miscellaneous_priv.h" #include "oct6100_memory_priv.h" @@ -289,8 +293,6 @@ UINT32 Oct6100DebugSelectChannelSer( return ulResult; } pTempChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; - - /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */ } pTempChanEntry->usExtraSinTsiDependencyCnt--; @@ -352,8 +354,6 @@ UINT32 Oct6100DebugSelectChannelSer( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; } - - /* XXX: What about the silence TSI usSinSilenceEventIndex ?? */ } @@ -479,7 +479,6 @@ UINT32 Oct6100DebugGetDataSer( IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, IN OUT tPOCT6100_DEBUG_GET_DATA f_pGetData ) { - tPOCT6100_SHARED_INFO pSharedInfo; tPOCT6100_API_CHANNEL pChanEntry = NULL; tOCT6100_READ_PARAMS ReadParams; @@ -561,7 +560,8 @@ UINT32 Oct6100DebugGetDataSer( if ( ( f_pGetData->ulGetDataMode != cOCT6100_DEBUG_GET_DATA_MODE_16S_LITE ) && ( f_pGetData->ulGetDataMode != cOCT6100_DEBUG_GET_DATA_MODE_120S_LITE ) && ( f_pGetData->ulGetDataMode != cOCT6100_DEBUG_GET_DATA_MODE_16S ) - && ( f_pGetData->ulGetDataMode != cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) + && ( f_pGetData->ulGetDataMode != cOCT6100_DEBUG_GET_DATA_MODE_120S ) + && ( f_pGetData->ulGetDataMode != cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) return cOCT6100_ERR_DEBUG_GET_DATA_MODE; /* Check dump content. */ @@ -571,6 +571,11 @@ UINT32 Oct6100DebugGetDataSer( && ( f_pGetData->ulGetDataContent != cOCT6100_DEBUG_GET_DATA_CONTENT_SOUT_PCM ) ) return cOCT6100_ERR_DEBUG_GET_DATA_CONTENT; + /* The core dump mode does not support the xxx_PCM data contents. */ + if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) + && ( f_pGetData->ulGetDataContent != cOCT6100_DEBUG_GET_DATA_CONTENT_COMPLETE ) ) + return cOCT6100_ERR_DEBUG_GET_DATA_CONTENT; + /* Check if can accomodate the 120 seconds dump. */ if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S_LITE ) || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) @@ -593,8 +598,6 @@ UINT32 Oct6100DebugGetDataSer( if ( pChanEntry->byEchoOperationMode == cOCT6100_ECHO_OP_MODE_POWER_DOWN ) return cOCT6100_ERR_DEBUG_CHANNEL_IN_POWER_DOWN; - pSharedInfo->DebugInfo.fDebugDataBeingDumped = TRUE; - /* Flag the hot channel that it must stop recording. The data is being transfered. */ /* This also tells the remote client not to do anything right now. */ @@ -679,9 +682,12 @@ UINT32 Oct6100DebugGetDataSer( } + /* If the user only requested the last 16 seconds, cap the number of events. */ if ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S - || f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S_LITE ) + || f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S_LITE + || ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) + && ( pSharedInfo->DebugInfo.ulDebugEventSize != 0x100 ) ) ) { /* x events to get the last 16 seconds. */ if ( pSharedInfo->DebugInfo.usNumEvents > ( 16000 / ( pSharedInfo->DebugInfo.ulRecordedPcmEventByteSize / 8 ) ) ) @@ -757,7 +763,8 @@ UINT32 Oct6100DebugGetDataSer( /* In heavy mode, the AF log pointer is retrieved. */ if ( ( pSharedInfo->DebugInfo.usNumEvents >= 2 ) && ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S ) - || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) ) { /* The latest AF log write pointer is at the latest matrix event. */ ReadParams.ulReadAddress = pSharedInfo->DebugInfo.ulMatrixBaseAddress + ( ( pSharedInfo->DebugInfo.usChipDebugEventWritePtr & pSharedInfo->DebugInfo.usMatrixCBMask ) * 1024 ); @@ -793,6 +800,9 @@ UINT32 Oct6100DebugGetDataSer( /* Remember the data mode for later checks. Also, the user cannot change this "mode". */ pSharedInfo->DebugInfo.ulCurrentGetDataMode = f_pGetData->ulGetDataMode; + + /* Remember that we are currently dumping. */ + pSharedInfo->DebugInfo.fDebugDataBeingDumped = TRUE; } else { @@ -845,6 +855,11 @@ UINT32 Oct6100DebugGetDataSer( pSharedInfo->DebugInfo.fImageVersionCopied = FALSE; pSharedInfo->DebugInfo.fApiVersionCopied = FALSE; + /* The core dump flag has not been set yet. */ + pSharedInfo->DebugInfo.fCoreDumped = FALSE; + pSharedInfo->DebugInfo.ulLastMemoryOffset = 0; + + /* Estimate the total size of the buffer that will be returned. */ f_pGetData->ulTotalNumBytes = ulUserBufWriteIndex; @@ -853,7 +868,8 @@ UINT32 Oct6100DebugGetDataSer( { /* Add the matrix events. */ if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S ) - || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) { /* Heavy mode! Grab everything! */ f_pGetData->ulTotalNumBytes += pSharedInfo->DebugInfo.usNumEvents * pSharedInfo->DebugInfo.ulDebugChanStatsByteSize; @@ -869,7 +885,8 @@ UINT32 Oct6100DebugGetDataSer( /* If requested, add the AF log events. */ if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S ) - || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) { f_pGetData->ulTotalNumBytes += (UINT32)( ( pSharedInfo->DebugInfo.usAfLogWritePtr - pSharedInfo->DebugInfo.usLastAfLogReadPtr ) & 0xFFFF ) * 16; } @@ -882,6 +899,18 @@ UINT32 Oct6100DebugGetDataSer( /* Add the API version string. */ f_pGetData->ulTotalNumBytes += sizeof( cOCT6100_API_VERSION ); + + /* If core dumping, must add the size of the memory regions that will be returned to the user. */ + if ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) + { + /* Internal memories. */ + f_pGetData->ulTotalNumBytes += 0x300000; + + /* External memory. */ + f_pGetData->ulTotalNumBytes += ( pSharedInfo->MemoryMap.ulFreeMemBaseAddress - cOCT6100_EXTERNAL_MEM_BASE_ADDRESS ); + + + } } else /* if ( f_pGetData->ulGetDataContent != cOCT6100_DEBUG_GET_DATA_CONTENT_COMPLETE ) */ { @@ -918,7 +947,8 @@ UINT32 Oct6100DebugGetDataSer( /* Check if we are in light or heavy mode. The burst size is not the same. */ if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S ) - || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) { if ( ( f_pGetData->ulMaxBytes - ulUserBufWriteIndex ) >= pSharedInfo->DebugInfo.ulDebugChanStatsByteSize ) ulNumReads = pSharedInfo->DebugInfo.ulDebugChanStatsByteSize / 2; @@ -967,7 +997,8 @@ UINT32 Oct6100DebugGetDataSer( /* Increment index. */ if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S ) - || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) { ulUserBufWriteIndex += pSharedInfo->DebugInfo.ulDebugChanStatsByteSize; } @@ -1115,7 +1146,8 @@ UINT32 Oct6100DebugGetDataSer( /* Go for the AF events. The AF events are only copied in heavy mode. */ if ( ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_16S ) - || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_120S ) + || ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) ) { while ( pSharedInfo->DebugInfo.usLastAfLogReadPtr != pSharedInfo->DebugInfo.usAfLogWritePtr ) { @@ -1201,6 +1233,9 @@ UINT32 Oct6100DebugGetDataSer( { if ( ( f_pGetData->ulMaxBytes - ulUserBufWriteIndex ) >= 512 ) { + tOCT6100_CHIP_STATS ChipStats; + UINT32 ulTempIndex; + Oct6100UserMemCopy( &f_pGetData->pbyData[ ulUserBufWriteIndex ], pSharedInfo->ImageInfo.szVersionNumber, 512 ); /* Get PLL jitter count from external memory. */ @@ -1232,6 +1267,61 @@ UINT32 Oct6100DebugGetDataSer( f_pGetData->pbyData[ ulUserBufWriteIndex + 510 ] |= 0x80; } + + + /* Set the hardware revision number. */ + ulTempIndex = 509; + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( pSharedInfo->MiscVars.usChipRevision ) & 0xFF ); + + Oct6100ChipGetStatsDef( &ChipStats ); + ulResult = Oct6100ChipGetStatsSer( f_pApiInstance, &ChipStats ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulNumberChannels & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulNumberChannels >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( f_pApiInstance->pSharedInfo->MiscVars.ulNumActiveChannels & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( f_pApiInstance->pSharedInfo->MiscVars.ulNumActiveChannels >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulNumberTsiCncts & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulNumberTsiCncts >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulNumberConfBridges & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulNumberConfBridges >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulNumberPlayoutBuffers & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulNumberPlayoutBuffers >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulPlayoutFreeMemSize & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulPlayoutFreeMemSize >> 8 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulPlayoutFreeMemSize >> 16 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulPlayoutFreeMemSize >> 24 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulNumberPhasingTssts & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulNumberPhasingTssts >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulNumberAdpcmChannels & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulNumberAdpcmChannels >> 8 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulInternalReadTimeoutCount & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulInternalReadTimeoutCount >> 8 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulInternalReadTimeoutCount >> 16 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulInternalReadTimeoutCount >> 24 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulSdramRefreshTooLateCount & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulSdramRefreshTooLateCount >> 8 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulSdramRefreshTooLateCount >> 16 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulSdramRefreshTooLateCount >> 24 ) & 0xFF ); + + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ChipStats.ulPllJitterErrorCount & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulPllJitterErrorCount >> 8 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulPllJitterErrorCount >> 16 ) & 0xFF ); + f_pGetData->pbyData[ ulUserBufWriteIndex + ulTempIndex-- ] = (UINT8)( ( ChipStats.ulPllJitterErrorCount >> 24 ) & 0xFF ); + + ulTempIndex -= 5; + + /* Update write pointer. */ ulUserBufWriteIndex += 512; /* The version has been copied. */ @@ -1254,14 +1344,38 @@ UINT32 Oct6100DebugGetDataSer( } } } + + /* Check for the core dump content. */ + if ( pSharedInfo->DebugInfo.fApiVersionCopied == TRUE ) + { + if ( f_pGetData->ulGetDataMode == cOCT6100_DEBUG_GET_DATA_MODE_CORE_DUMP ) + { + if ( pSharedInfo->DebugInfo.fCoreDumped == FALSE ) + { + ulResult = Oct6100DebugCoreDump( f_pApiInstance, f_pGetData, &ulUserBufWriteIndex ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + } + else + { + /* Even though it was not requested, set the flag to pass through the next gate. */ + pSharedInfo->DebugInfo.fCoreDumped = TRUE; + } + } } + + /* Check if we are done! */ - if ( pSharedInfo->DebugInfo.fApiVersionCopied == TRUE ) + if ( ( pSharedInfo->DebugInfo.fApiVersionCopied == TRUE ) + && ( pSharedInfo->DebugInfo.fCoreDumped == TRUE ) + + ) { /* Done dumping. */ - /* Reset data being dumpped flag. */ + /* Reset data being dumped flag. */ pSharedInfo->DebugInfo.fDebugDataBeingDumped = FALSE; /* Reset data recording in the chip. */ @@ -1302,3 +1416,237 @@ UINT32 Oct6100DebugGetDataSer( return cOCT6100_ERR_OK; } + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Function: Oct6100DebugCoreDump + +Description: Called to generate debug core dump information. + +------------------------------------------------------------------------------- +| Argument | Description +------------------------------------------------------------------------------- +f_pApiInstance Pointer to API instance. This memory is used to keep the + present state of the chip and all its resources. + +f_pGetData Pointer to a tOCT6100_DEBUG_GET_DATA structure. + +f_pulUserBufWriteIndex User buffer write index. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +UINT32 Oct6100DebugCoreDump( + IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, + IN OUT tPOCT6100_DEBUG_GET_DATA f_pGetData, + IN OUT PUINT32 f_pulUserBufWriteIndex ) +{ + tPOCT6100_SHARED_INFO pSharedInfo; + tOCT6100_READ_BURST_PARAMS ReadBurstParams; + tOCT6100_READ_PARAMS ReadParams; + + UINT32 ulResult; + UINT32 ulNumReads; + UINT32 ulTempIndex; + + /* Get local pointer(s). */ + pSharedInfo = f_pApiInstance->pSharedInfo; + + ReadBurstParams.pProcessContext = f_pApiInstance->pProcessContext; + + ReadBurstParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId; + + ReadParams.pProcessContext = f_pApiInstance->pProcessContext; + + ReadParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId; + + /* All registers. */ + if ( pSharedInfo->DebugInfo.ulLastMemoryOffset < 0x800 ) + { + /* Here we assume cOCT6100_INTERNAL_SUPER_ARRAY_SIZE can contain all the registers. */ + /* Check if must retrieve data from the hardware. */ + if ( pSharedInfo->DebugInfo.ulLastMemoryOffset == 0 ) + { + /* Clear whole array */ + Oct6100UserMemSet( pSharedInfo->MiscVars.ausSuperArray, 0, sizeof( pSharedInfo->MiscVars.ausSuperArray ) ); + + /* Retrieve all registers data from the hardware. */ + /* Start at the CPU registers (0x100). */ + ReadParams.ulReadAddress = 0x100; + + /* As much as we can for the burst. */ + ulTempIndex = 0x100 / 2; /* Start indexing at the CPU registers (0x100) */ + ulNumReads = 0x380; /* Up to 0x800 */ + + while ( ulNumReads != 0 ) + { + /* Set pointer where to write data. */ + ReadParams.pusReadData = &pSharedInfo->MiscVars.ausSuperArray[ ulTempIndex ]; + + mOCT6100_DRIVER_READ_API( ReadParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + + /* Update indexes, temp variables, addresses. */ + ulNumReads--; + ulTempIndex++; + ReadParams.ulReadAddress += 2; + + /* Skip range 0x400 to 0x500 -- Cannot read between 0x400 & 0x500. */ + if ( ReadParams.ulReadAddress == 0x400 ) + { + ReadParams.ulReadAddress += 0x100; + ulTempIndex += 0x80; + ulNumReads -= 0x80; + } + } + } + + for ( ; pSharedInfo->DebugInfo.ulLastMemoryOffset < 0x800; pSharedInfo->DebugInfo.ulLastMemoryOffset +=2 ) + { + /* Check if enough room for this word. */ + if ( ( f_pGetData->ulMaxBytes - *f_pulUserBufWriteIndex ) < 2 ) + break; + + /* Copy data byte per byte to avoid endianess problems. */ + f_pGetData->pbyData[ *f_pulUserBufWriteIndex ] = (UINT8)( pSharedInfo->MiscVars.ausSuperArray[ ( pSharedInfo->DebugInfo.ulLastMemoryOffset / 2 ) % cOCT6100_INTERNAL_SUPER_ARRAY_SIZE ] & 0xFF ); + f_pGetData->pbyData[ *f_pulUserBufWriteIndex + 1 ] = (UINT8)( ( pSharedInfo->MiscVars.ausSuperArray[ ( pSharedInfo->DebugInfo.ulLastMemoryOffset / 2 ) % cOCT6100_INTERNAL_SUPER_ARRAY_SIZE ] >> 8 ) & 0xFF ); + + /* Update indexes. */ + *f_pulUserBufWriteIndex += 2; + } + } + + /* All internal memories */ + if ( pSharedInfo->DebugInfo.ulLastMemoryOffset < 0x300000 ) + { + ulResult = Oct6100DebugCoreDumpMemory( f_pApiInstance, f_pGetData, f_pulUserBufWriteIndex, 0x800, 0x300000 ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + + /* All external memory, up until the beginning of the free memory pool. */ + if ( pSharedInfo->DebugInfo.ulLastMemoryOffset < pSharedInfo->MemoryMap.ulFreeMemBaseAddress ) + { + /* External memory. */ + ulResult = Oct6100DebugCoreDumpMemory( f_pApiInstance, f_pGetData, f_pulUserBufWriteIndex, cOCT6100_EXTERNAL_MEM_BASE_ADDRESS, pSharedInfo->MemoryMap.ulFreeMemBaseAddress ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + + if ( pSharedInfo->DebugInfo.ulLastMemoryOffset >= pSharedInfo->MemoryMap.ulFreeMemBaseAddress ) + { + /* Done here. */ + pSharedInfo->DebugInfo.fCoreDumped = TRUE; + } + + return cOCT6100_ERR_OK; +} + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Function: Oct6100DebugCoreDumpMemory + +Description: Called to read a memory region. + +------------------------------------------------------------------------------- +| Argument | Description +------------------------------------------------------------------------------- +f_pApiInstance Pointer to API instance. This memory is used to keep the + present state of the chip and all its resources. + +f_pGetData Pointer to a tOCT6100_DEBUG_GET_DATA structure. + +f_pulUserBufWriteIndex User buffer write index. + +f_ulMemOffsetBottom Memory address, bottom. + +f_ulMemOffsetTop Memory address, top. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +UINT32 Oct6100DebugCoreDumpMemory( + IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, + IN OUT tPOCT6100_DEBUG_GET_DATA f_pGetData, + IN OUT PUINT32 f_pulUserBufWriteIndex, + IN UINT32 f_ulMemOffsetBottom, + IN UINT32 f_ulMemOffsetTop ) +{ + tPOCT6100_SHARED_INFO pSharedInfo; + tOCT6100_READ_BURST_PARAMS ReadBurstParams; + + UINT32 ulResult; + UINT32 ulNumReads; + UINT32 ulTempIndex; + + /* Get local pointer(s). */ + pSharedInfo = f_pApiInstance->pSharedInfo; + + ReadBurstParams.pProcessContext = f_pApiInstance->pProcessContext; + + ReadBurstParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId; + + /* Check if enough room for at least 1 word. */ + if ( ( f_pGetData->ulMaxBytes - *f_pulUserBufWriteIndex ) < 2 ) + return cOCT6100_ERR_OK; + + /* Make sure we are starting at the right offset.. Sometimes memory regions are not continuous. */ + if ( pSharedInfo->DebugInfo.ulLastMemoryOffset < f_ulMemOffsetBottom ) + pSharedInfo->DebugInfo.ulLastMemoryOffset = f_ulMemOffsetBottom; + + for ( ; pSharedInfo->DebugInfo.ulLastMemoryOffset < f_ulMemOffsetTop; pSharedInfo->DebugInfo.ulLastMemoryOffset +=2 ) + { + /* Check if enough room for this word. */ + if ( ( f_pGetData->ulMaxBytes - *f_pulUserBufWriteIndex ) < 2 ) + break; + + /* Check if must retrieve data from the hardware. */ + if ( ( pSharedInfo->DebugInfo.ulLastMemoryOffset / 2 ) % cOCT6100_INTERNAL_SUPER_ARRAY_SIZE == 0 ) + { + ReadBurstParams.ulReadAddress = pSharedInfo->DebugInfo.ulLastMemoryOffset; + + /* Some internal memory regions cannot be read. Check for these here. */ + if ( ( ReadBurstParams.ulReadAddress >= 0xF0000 ) + && ( ReadBurstParams.ulReadAddress < 0x100000 ) ) + { + /* Region cannot be read. */ + Oct6100UserMemSet( pSharedInfo->MiscVars.ausSuperArray, 0, cOCT6100_INTERNAL_SUPER_ARRAY_SIZE * sizeof( UINT16 ) ); + } + else + { + /* As much as we can for the burst. */ + ulTempIndex = 0x0; + ulNumReads = cOCT6100_INTERNAL_SUPER_ARRAY_SIZE; + + while ( ulNumReads != 0 ) + { + /* Set read burst size. */ + if ( ulNumReads >= pSharedInfo->ChipConfig.usMaxRwAccesses ) + ReadBurstParams.ulReadLength = pSharedInfo->ChipConfig.usMaxRwAccesses; + else + ReadBurstParams.ulReadLength = ulNumReads; + + /* Set pointer where to write data. */ + ReadBurstParams.pusReadData = &pSharedInfo->MiscVars.ausSuperArray[ ulTempIndex ]; + + mOCT6100_DRIVER_READ_BURST_API( ReadBurstParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + + /* Update indexes, temp variables, addresses. */ + ulNumReads -= ReadBurstParams.ulReadLength; + ulTempIndex += ReadBurstParams.ulReadLength; + ReadBurstParams.ulReadAddress += ReadBurstParams.ulReadLength * 2; + } + } + } + + /* Copy data byte per byte to avoid endianness problems. */ + f_pGetData->pbyData[ *f_pulUserBufWriteIndex ] = (UINT8)( pSharedInfo->MiscVars.ausSuperArray[ ( pSharedInfo->DebugInfo.ulLastMemoryOffset / 2 ) % cOCT6100_INTERNAL_SUPER_ARRAY_SIZE ] & 0xFF ); + f_pGetData->pbyData[ *f_pulUserBufWriteIndex + 1 ] = (UINT8)( ( pSharedInfo->MiscVars.ausSuperArray[ ( pSharedInfo->DebugInfo.ulLastMemoryOffset / 2 ) % cOCT6100_INTERNAL_SUPER_ARRAY_SIZE ] >> 8 ) & 0xFF ); + + /* Update indexes. */ + *f_pulUserBufWriteIndex += 2; + } + + return cOCT6100_ERR_OK; +} + + diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c index 16b93e6..ac80cc7 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_events.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 83 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c index 49de3f5..d45b5a0 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 91 $ +$Octasic_Revision: 97 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -60,6 +60,8 @@ $Octasic_Revision: 91 $ #include "oct6100_events_priv.h" #include "oct6100_interrupts_priv.h" #include "oct6100_channel_priv.h" +#include "oct6100_tsst_priv.h" +#include "oct6100_memory_priv.h" /**************************** PUBLIC FUNCTIONS *****************************/ @@ -87,6 +89,7 @@ UINT32 Oct6100InterruptConfigureDef( f_pIntrptConfig->ulErrorMemoryConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; + f_pIntrptConfig->ulErrorOverflowToneEventsConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; f_pIntrptConfig->ulErrorH100Config = cOCT6100_INTERRUPT_NO_TIMEOUT; @@ -167,6 +170,7 @@ UINT32 Oct6100InterruptServiceRoutineDef( f_pIntFlags->fErrorPllJitter = FALSE; + f_pIntFlags->fErrorOverflowToneEvents = FALSE; @@ -273,6 +277,8 @@ UINT32 Oct6100ApiIsrSwInit( pSharedInfo->IntrptManage.fAfBistFailedOnBoot = FALSE; + + /* The ISR has never been called. */ pSharedInfo->IntrptManage.fIsrCalled = FALSE; @@ -395,6 +401,7 @@ UINT32 Oct6100InterruptConfigureSer( f_pIntrptConfig->ulErrorMemoryConfig != cOCT6100_INTERRUPT_NO_TIMEOUT ) return cOCT6100_ERR_INTRPTS_DATA_ERR_MEMORY_CONFIG; + if ( f_pIntrptConfig->ulErrorOverflowToneEventsConfig != cOCT6100_INTERRUPT_DISABLE && f_pIntrptConfig->ulErrorOverflowToneEventsConfig != cOCT6100_INTERRUPT_TIMEOUT && f_pIntrptConfig->ulErrorOverflowToneEventsConfig != cOCT6100_INTERRUPT_NO_TIMEOUT ) @@ -426,6 +433,7 @@ UINT32 Oct6100InterruptConfigureSer( pIntrptConfig->byFatalMemoryConfig = (UINT8)( f_pIntrptConfig->ulFatalMemoryConfig & 0xFF ); pIntrptConfig->byErrorMemoryConfig = (UINT8)( f_pIntrptConfig->ulErrorMemoryConfig & 0xFF ); + pIntrptConfig->byErrorOverflowToneEventsConfig = (UINT8)( f_pIntrptConfig->ulErrorOverflowToneEventsConfig & 0xFF ); pIntrptConfig->byErrorH100Config = (UINT8)( f_pIntrptConfig->ulErrorH100Config & 0xFF ); @@ -656,6 +664,7 @@ UINT32 Oct6100InterruptServiceRoutineSer( + f_pIntFlags->fErrorH100OutOfSync = FALSE; f_pIntFlags->fErrorH100ClkA = FALSE; f_pIntFlags->fErrorH100ClkB = FALSE; @@ -736,6 +745,8 @@ UINT32 Oct6100InterruptServiceRoutineSer( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; + + /* Write to the necessary IE registers. */ ulResult = Oct6100ApiWriteIntrptRegs( f_pApiInstance ); if ( ulResult != cOCT6100_ERR_OK ) @@ -1818,10 +1829,8 @@ UINT32 Oct6100ApiCheckProcessorState( UINT32 ulAfTimestamp; UINT32 ulTimestampDiff; UINT32 ulMafWPnt; - UINT32 ulResult; UINT32 i; - UINT16 usReadData; UINT16 ausReadData[ 2 ]; @@ -2072,8 +2081,8 @@ UINT32 Oct6100ApiCheckProcessorState( - return cOCT6100_ERR_OK; } + diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.c index 5dd39b9..6f8eeb8 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.c @@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 42 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.c index 3170fc1..b589f17 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 36 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.c index 5fa5830..9f54a06 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.c @@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 42 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c index d01ee0f..953e958 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 46 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c index 8887a9c..3e2ed6f 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 109 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.c index a97e237..2d3aa6d 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 35 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c index 559cd18..9a2d8e9 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.c @@ -24,9 +24,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 118 $ +$Octasic_Revision: 120 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -270,6 +270,8 @@ UINT32 Oct6100ApiInterpretTlvEntry( cOCT6100_TLV_MAX_LENGTH_VERSION_NUMBER ); if ( ulResult == cOCT6100_ERR_OK ) { + + ReadParams.ulReadAddress = f_ulTlvValueAddress; for( i = 0; i < (f_ulTlvFieldLength/2); i++ ) @@ -285,6 +287,8 @@ UINT32 Oct6100ApiInterpretTlvEntry( /* Modify the address. */ ReadParams.ulReadAddress += 2; } + + } break; diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.c index b43dcfb..4cc2ac7 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.c @@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 51 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.c index 5cb10e7..6cbfed0 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.c @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ $Octasic_Revision: 38 $ diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.c index d93dd58..ef170b4 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.c @@ -23,9 +23,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 39 $ +$Octasic_Revision: 40 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -563,3 +563,5 @@ UINT32 Oct6100ApiReleaseTsst( return cOCT6100_ERR_OK; } + + diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_user.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_user.c index 64b5b36..b9f7d76 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_user.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_user.c @@ -22,9 +22,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.02.04 $ +$Octasic_Release: OCT612xAPI-01.03.00 $ -$Octasic_Revision: 29 $ +$Octasic_Revision: 31 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -471,4 +471,3 @@ UINT32 Oct6100UserDriverReadBurstOs( - |