From 9e764fa01379cc515831e4353eade0b1cf53c8bf Mon Sep 17 00:00:00 2001 From: Octasic Inc Date: Fri, 16 Jul 2010 16:25:26 +0300 Subject: importing OCT612x-01.04.01 --- .../oct6100api/oct6100_api/oct6100_chip_open.c | 63 ++++++++++++++++++---- 1 file changed, 52 insertions(+), 11 deletions(-) (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c') diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c index 5a47ad6..16c4a4b 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.03.05 $ +$Octasic_Release: OCT612xAPI-01.04.01 $ -$Octasic_Revision: 381 $ +$Octasic_Revision: 383 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -240,6 +240,7 @@ UINT32 Oct6100ChipOpenDef( f_pChipOpen->fEnableChannelRecording = FALSE; + f_pChipOpen->fAllowDynamicRecording = FALSE; f_pChipOpen->fEnableProductionBist = FALSE; f_pChipOpen->ulProductionBistMode = cOCT6100_PRODUCTION_BIST_STANDARD; f_pChipOpen->ulNumProductionBistLoops = 1; @@ -1277,11 +1278,20 @@ UINT32 Oct6100ApiCheckChipConfiguration( - /* Check the channel recording flag. */ + /* Check the channel recording flags. */ if ( f_pChipOpen->fEnableChannelRecording != TRUE && f_pChipOpen->fEnableChannelRecording != FALSE ) return cOCT6100_ERR_OPEN_DEBUG_CHANNEL_RECORDING; + if ( f_pChipOpen->fAllowDynamicRecording != TRUE && + f_pChipOpen->fAllowDynamicRecording != FALSE ) + return cOCT6100_ERR_OPEN_DEBUG_CHANNEL_DYNAMIC_RECORDING; + + /* Preferably not both modes at the same time. */ + if ( f_pChipOpen->fEnableChannelRecording == TRUE && + f_pChipOpen->fAllowDynamicRecording == TRUE ) + return cOCT6100_ERR_OPEN_DEBUG_CHANNEL_DYNAMIC_AND_STATIC; + /* Check the enable production BIST flag. */ if ( ( f_pChipOpen->fEnableProductionBist != TRUE ) && ( f_pChipOpen->fEnableProductionBist != FALSE ) ) @@ -1306,6 +1316,7 @@ UINT32 Oct6100ApiCheckChipConfiguration( f_pChipOpen->ulMaxChannels = 0; f_pChipOpen->ulMaxTsiCncts = 0; f_pChipOpen->fEnableChannelRecording = FALSE; + f_pChipOpen->fAllowDynamicRecording = FALSE; f_pChipOpen->ulMaxBiDirChannels = 0; f_pChipOpen->ulMaxConfBridges = 0; f_pChipOpen->ulMaxPlayoutBuffers = 0; @@ -1414,6 +1425,7 @@ UINT32 Oct6100ApiCopyChipConfiguration( pSharedInfo->ChipConfig.usMaxRemoteDebugSessions = (UINT16)( f_pChipOpen->ulMaxRemoteDebugSessions & 0xFFFF ); pSharedInfo->ChipConfig.fEnableChannelRecording = (UINT8)( f_pChipOpen->fEnableChannelRecording & 0xFF ); + pSharedInfo->ChipConfig.fAllowDynamicRecording = (UINT8)( f_pChipOpen->fAllowDynamicRecording & 0xFF ); @@ -1484,7 +1496,8 @@ UINT32 Oct6100ApiInitializeMiscellaneousVariables( pSharedInfo->DebugInfo.fPouchCounter = FALSE; pSharedInfo->DebugInfo.fIsIsrCalledField = FALSE; - pSharedInfo->MiscVars.ulNumActiveChannels = 0; + pSharedInfo->MiscVars.ulNumActiveChannels = 0; + /* Initialize the image info parameters */ pSharedInfo->ImageInfo.fAdaptiveNoiseReduction = FALSE; @@ -1573,6 +1586,13 @@ UINT32 Oct6100ApiInitializeMiscellaneousVariables( } /* Initialize the channel recording info. */ pSharedInfo->DebugInfo.usRecordChanIndex = pSharedInfo->ChipConfig.usMaxChannels; + if ( ( pSharedInfo->ChipConfig.fEnableChannelRecording == FALSE ) + && ( pSharedInfo->ChipConfig.fAllowDynamicRecording == TRUE ) ) + { + if ( pSharedInfo->DebugInfo.usRecordChanIndex != 0 ) + pSharedInfo->DebugInfo.usRecordChanIndex--; + } + pSharedInfo->DebugInfo.usRecordMemIndex = cOCT6100_INVALID_INDEX; pSharedInfo->DebugInfo.usCurrentDebugChanIndex = cOCT6100_INVALID_INDEX; @@ -2209,7 +2229,7 @@ UINT32 Oct6100ApiDecodeKeyAndBist( return ulResult; /* Check if an error was reported. */ - for ( i=0; i<6; i++ ) + for ( i=0; i<6; i+=2 ) { if ( ausBistData[ i ] != 0x0000 ) { @@ -6247,7 +6267,8 @@ UINT32 Oct6100ApiInitMixer( BurstParams.pusWriteData = ausWriteData; /*======================================================================*/ /* Initialize the mixer memory if required. */ - if ( pSharedInfo->ChipConfig.fEnableChannelRecording == TRUE ) + if ( ( pSharedInfo->ChipConfig.fEnableChannelRecording == TRUE ) + || ( pSharedInfo->ChipConfig.fAllowDynamicRecording == TRUE ) ) { /* Modify the mixer pointer by adding the record event into the link list. */ pSharedInfo->MixerInfo.usFirstSinCopyEventPtr = pSharedInfo->MixerInfo.usRecordSinEventIndex; @@ -6296,6 +6317,22 @@ UINT32 Oct6100ApiInitMixer( /* Init the mixer pointer */ pSharedInfo->MixerInfo.usFirstSinCopyEventPtr = pSharedInfo->MixerInfo.usRecordSinEventIndex; + + if ( pSharedInfo->ChipConfig.fAllowDynamicRecording == TRUE ) + { + ausWriteData[ 0 ] = 0xFFFF; + ausWriteData[ 1 ] = (UINT16)(( cOCT6100_INVALID_INDEX >> 0) & 0xFFFF); + + /* Disable the hot channel since by default it is recording on channel 0 */ + BurstParams.ulWriteAddress = pSharedInfo->DebugInfo.ulHotChannelSelectBaseAddress; + BurstParams.pusWriteData = ausWriteData; + BurstParams.ulWriteLength = 2; + + mOCT6100_DRIVER_WRITE_BURST_API( BurstParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + + } } else { @@ -6353,7 +6390,8 @@ UINT32 Oct6100ApiInitRecordResources( pSharedInfo = f_pApiInstance->pSharedInfo; /* Check if recording is enabled. */ - if ( pSharedInfo->ChipConfig.fEnableChannelRecording == FALSE ) + if ( ( pSharedInfo->ChipConfig.fEnableChannelRecording == FALSE ) + && ( pSharedInfo->ChipConfig.fAllowDynamicRecording == FALSE ) ) return cOCT6100_ERR_OK; if ( pSharedInfo->DebugInfo.usRecordMemIndex == cOCT6100_INVALID_INDEX ) @@ -6372,10 +6410,13 @@ UINT32 Oct6100ApiInitRecordResources( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; - /* Open the debug channel. */ - ulResult = Oct6100ApiDebugChannelOpen( f_pApiInstance ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; + if ( pSharedInfo->ChipConfig.fEnableChannelRecording == TRUE ) + { + /* Open the debug channel. */ + ulResult = Oct6100ApiDebugChannelOpen( f_pApiInstance ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } return cOCT6100_ERR_OK; } -- cgit v1.2.3