From 2111c50fe6657c7897bba50196d41f042624e975 Mon Sep 17 00:00:00 2001 From: Octasic Inc Date: Mon, 16 Feb 2009 17:39:26 +0200 Subject: importing OCT612x-01.02.01 --- .../oct6100api/oct6100_api/oct6100_interrupts.c | 52 +++++++++++++++------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c') diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c index 3f45fda..6e5694f 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c @@ -2,7 +2,7 @@ File: oct6100_interrupts.c - Copyright (c) 2001-2008 Octasic Inc. + Copyright (c) 2001-2009 Octasic Inc. Description: @@ -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.01.01 $ +$Octasic_Release: OCT612xAPI-01.02.01 $ -$Octasic_Revision: 81 $ +$Octasic_Revision: 87 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -38,6 +38,8 @@ $Octasic_Revision: 81 $ #include "oct6100api/oct6100_errors.h" #include "oct6100api/oct6100_apiud.h" +#include "apilib/octapi_largmath.h" + #include "oct6100api/oct6100_tlv_inst.h" #include "oct6100api/oct6100_chip_open_inst.h" #include "oct6100api/oct6100_chip_stats_inst.h" @@ -45,6 +47,7 @@ $Octasic_Revision: 81 $ #include "oct6100api/oct6100_remote_debug_inst.h" #include "oct6100api/oct6100_debug_inst.h" #include "oct6100api/oct6100_api_inst.h" +#include "oct6100api/oct6100_channel_inst.h" #include "oct6100api/oct6100_interrupts_pub.h" #include "oct6100api/oct6100_chip_open_pub.h" @@ -56,6 +59,7 @@ $Octasic_Revision: 81 $ #include "oct6100_miscellaneous_priv.h" #include "oct6100_events_priv.h" #include "oct6100_interrupts_priv.h" +#include "oct6100_channel_priv.h" /**************************** PUBLIC FUNCTIONS *****************************/ @@ -82,6 +86,7 @@ UINT32 Oct6100InterruptConfigureDef( f_pIntrptConfig->ulFatalMemoryConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; f_pIntrptConfig->ulErrorMemoryConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; + f_pIntrptConfig->ulErrorOverflowToneEventsConfig = cOCT6100_INTERRUPT_NO_TIMEOUT; f_pIntrptConfig->ulErrorH100Config = cOCT6100_INTERRUPT_NO_TIMEOUT; @@ -160,6 +165,8 @@ UINT32 Oct6100InterruptServiceRoutineDef( f_pIntFlags->fErrorRefreshTooLate = FALSE; f_pIntFlags->fErrorPllJitter = FALSE; + + f_pIntFlags->fErrorOverflowToneEvents = FALSE; @@ -242,6 +249,7 @@ UINT32 Oct6100ApiIsrSwInit( { tPOCT6100_SHARED_INFO pSharedInfo; + /* Get local pointer to shared portion of instance. */ pSharedInfo = f_pApiInstance->pSharedInfo; @@ -262,6 +270,9 @@ UINT32 Oct6100ApiIsrSwInit( /* Indicate that no tone events are pending for the moment. */ pSharedInfo->IntrptManage.fToneEventsPending = FALSE; + pSharedInfo->IntrptManage.fAfBistFailedOnBoot = FALSE; + + /* The ISR has never been called. */ pSharedInfo->IntrptManage.fIsrCalled = FALSE; @@ -383,6 +394,7 @@ UINT32 Oct6100InterruptConfigureSer( f_pIntrptConfig->ulErrorMemoryConfig != cOCT6100_INTERRUPT_TIMEOUT && 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 ) @@ -413,6 +425,7 @@ UINT32 Oct6100InterruptConfigureSer( pIntrptConfig->byFatalGeneralConfig = (UINT8)( f_pIntrptConfig->ulFatalGeneralConfig & 0xFF ); 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 ); @@ -641,6 +654,8 @@ UINT32 Oct6100InterruptServiceRoutineSer( f_pIntFlags->fErrorRefreshTooLate = FALSE; f_pIntFlags->fErrorPllJitter = FALSE; + + f_pIntFlags->fErrorH100OutOfSync = FALSE; f_pIntFlags->fErrorH100ClkA = FALSE; f_pIntFlags->fErrorH100ClkB = FALSE; @@ -747,6 +762,9 @@ UINT32 Oct6100InterruptServiceRoutineSer( if ( ulResult != cOCT6100_ERR_OK ) return ulResult; + /* Remember that the ISR is being called. */ + pSharedInfo->IntrptManage.fIsrCalled = TRUE; + return cOCT6100_ERR_OK; } @@ -1008,9 +1026,6 @@ UINT32 Oct6100ApiReadIntrptRegs( /* in external memory to signal the remote client that we are called. */ if ( pSharedInfo->IntrptManage.fIsrCalled == FALSE ) { - /* Remember that we are being called. */ - pSharedInfo->IntrptManage.fIsrCalled = TRUE; - if ( pSharedInfo->DebugInfo.fIsIsrCalledField == TRUE ) { ulFeatureBytesOffset = pSharedInfo->MemoryMap.IsIsrCalledFieldOfst.usDwordOffset * 4; @@ -1798,6 +1813,7 @@ UINT32 Oct6100ApiCheckProcessorState( tOCT6100_READ_PARAMS ReadParams; tOCT6100_READ_BURST_PARAMS ReadBurstParams; + UINT32 ulNlpTimestamp; UINT32 ulAfTimestamp; UINT32 ulTimestampDiff; @@ -1813,18 +1829,20 @@ UINT32 Oct6100ApiCheckProcessorState( /* Get local pointer(s). */ pSharedInfo = f_pApiInstance->pSharedInfo; - /* Set some parameters of write struct. */ + /* Set some parameters of read struct. */ ReadParams.pProcessContext = f_pApiInstance->pProcessContext; ReadParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId; ReadParams.pusReadData = &usReadData; - /* Set some parameters of write struct. */ + /* Set some parameters of read-burst struct. */ ReadBurstParams.pProcessContext = f_pApiInstance->pProcessContext; ReadBurstParams.ulUserChipId = pSharedInfo->ChipConfig.ulUserChipId; ReadBurstParams.pusReadData = ausReadData; + + /*-----------------------------------------------------------------------*/ /* Check if chip is in reset. */ @@ -1933,45 +1951,47 @@ UINT32 Oct6100ApiCheckProcessorState( pSharedInfo->ErrorStats.fFatalChipError = TRUE; } - /*Check if AF and NLP are both stuck*/ + /* Check if AF and NLP are both stuck */ if ( f_pIntFlags->fErrorH100ClkA == FALSE && f_pIntFlags->fErrorH100ClkB == FALSE && f_pIntFlags->fErrorH100FrameA == FALSE && f_pIntFlags->fErrorH100OutOfSync == FALSE ) - { if ( ulAfTimestamp == 0 && ulNlpTimestamp == 0 ) { - /*Give some time to the counters*/ + /* Give some time to the counters */ aulWaitTime[ 0 ] = 250; aulWaitTime[ 1 ] = 0; ulResult = Oct6100ApiWaitForTime( f_pApiInstance, aulWaitTime ); if ( ulResult != cOCT6100_ERR_OK ) return ulResult; - /*Let's read again the AF timestamp to be sure. Maybe they were at 0 at the same time*/ + /* Let's read again the AF timestamp to be sure. Maybe they were at 0 at the same time */ ReadBurstParams.ulReadAddress = 0x082E0008; ReadBurstParams.ulReadLength = 2; mOCT6100_DRIVER_READ_BURST_API( ReadBurstParams, ulResult ) if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; + return ulResult; - ulAfTimestamp = (ausReadData[ 0 ] << 16) | ausReadData[ 1 ]; + ulAfTimestamp = ( ausReadData[ 0 ] << 16 ) | ausReadData[ 1 ]; if ( ulAfTimestamp == 0 ) { - /*TDM Clocks are ok but NLP and AF timestamps are both at 0*/ + /* TDM Clocks are ok but NLP and AF timestamps are both at 0 */ f_pIntFlags->ulFatalGeneralFlags |= cOCT6100_FATAL_GENERAL_ERROR_TYPE_9; f_pIntFlags->fFatalGeneral = TRUE; pSharedInfo->ErrorStats.fFatalChipError = TRUE; } } - } /*-----------------------------------------------------------------------*/ + + + + return cOCT6100_ERR_OK; } -- cgit v1.2.3