summaryrefslogtreecommitdiff
path: root/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c')
-rw-r--r--software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.c
index 4d0cf79..1a7ebc6 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.00-PR48 $
+$Octasic_Release: OCT612xAPI-01.00-PR49 $
-$Octasic_Revision: 78 $
+$Octasic_Revision: 81 $
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
@@ -1831,15 +1831,18 @@ UINT32 Oct6100ApiCheckProcessorState(
tPOCT6100_SHARED_INFO pSharedInfo;
tOCT6100_READ_PARAMS ReadParams;
tOCT6100_READ_BURST_PARAMS ReadBurstParams;
+
UINT32 ulNlpTimestamp;
UINT32 ulAfTimestamp;
UINT32 ulTimestampDiff;
UINT32 ulResult;
UINT32 i;
-
+
UINT16 usReadData;
UINT16 ausReadData[ 2 ];
+
+ UINT32 aulWaitTime[ 2 ];
/* Get local pointer(s). */
pSharedInfo = f_pApiInstance->pSharedInfo;
@@ -1947,7 +1950,7 @@ UINT32 Oct6100ApiCheckProcessorState(
/*-----------------------------------------------------------------------*/
/* Check the validity of the timestamp. */
-
+
if ( ulAfTimestamp > ulNlpTimestamp )
{
/* The NLP timestamp wrapped. */
@@ -1964,6 +1967,43 @@ UINT32 Oct6100ApiCheckProcessorState(
pSharedInfo->ErrorStats.fFatalChipError = TRUE;
}
+ /*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*/
+ 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*/
+ ReadBurstParams.ulReadAddress = 0x082E0008;
+ ReadBurstParams.ulReadLength = 2;
+
+ mOCT6100_DRIVER_READ_BURST_API( ReadBurstParams, ulResult )
+ if ( ulResult != cOCT6100_ERR_OK )
+ return ulResult;
+
+ ulAfTimestamp = (ausReadData[ 0 ] << 16) | ausReadData[ 1 ];
+
+ if ( ulAfTimestamp == 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;