]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/fault_mgmt.git/blob - fault_mgmt.h
Initial commit.
[keystone-rtos/fault_mgmt.git] / fault_mgmt.h
1 /**
2  *   @file  fault_mgmt.h
3  *
4  *   @brief
5  *      Header file for the Fault Management library. The file exposes the 
6  *      data structures and exported API which are available for use by 
7  *      applications.
8  *
9  *  \par
10  *  NOTE:
11  *      (C) Copyright 2012-2014 Texas Instruments, Inc.
12  * 
13  *  Redistribution and use in source and binary forms, with or without 
14  *  modification, are permitted provided that the following conditions 
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright 
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the 
22  *    documentation and/or other materials provided with the   
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  */
43 /**  @mainpage Fault Management Module
44  *
45  *   @section intro  Introduction
46  *
47  *   The Fault Management Module can be used to save DSP state and notify the Host
48  *   when an exception occurs.  The module's APIs provide the following specific
49  *   functionalities:
50  *      - Notification of a local DSP core fault on all remote DSP cores through
51  *        manual fault generation on remote DSP cores via the remote core's NMI.
52  *      - ARM notification of a DSP core fault
53  *      - Halting of all hardware data transfer mechanisms
54  *          - Ability to exclude resources from the halt capability in case
55  *            something the like the Linux kernel must continue to run after
56  *            the DSP fault causes the IO halt code to execute.
57  *      - Saving of system core register status.  The register status can be used
58  *        in a core dump to extract information as to where and how the exception
59  *        occurred.
60  *      - Cleanup of DSP peripherals after a DSP application crash.  The peripheral
61  *        resources can be excluded so that any resources used by another core
62  *        (ARM Linux for example) will not be part of the cleanup process.  The
63  *        cleanup allows a DSP application to be reloaded to the DSP cores after
64  *        exception without a hard or soft reset of the board.  Only a DSP local
65  *        reset is needed on all DSP cores..
66  *
67  *   The IO halt feature currently allows disabling of the following IO
68  *      - All CPDMA transmit and receive channels
69  *      - AIF PE (transmit) and PD (receive) channels
70  *      - SGMII
71  *      - EDMA3 DMA, QDMA, and INT channels
72  *
73  *   The exception APIs can be called from a system exception context in
74  *   order to completely stop all data transfer, to preserve system crash state, and
75  *   then notify all remote DSP cores and the ARM of an exception.
76  *
77  *
78  *   The cleanup API is only available for TCI6614 devices
79  *
80  *   The cleanup API is called from a standalone DSP application loaded onto a DSP
81  *   core after an exception has occurred and a DSP local reset is performed.  The
82  *   fault management library provides the standalone DSP application in the 
83  *   fault_mgmt/util directory.  On the Linux side the dsp_cleanup.sh script can be
84  *   found at /sbin/dsp_cleanup.sh.  The prebuilt cleanup utility can be copied
85  *   into the Linux filesystem and executed using the dsp_cleanup.sh script.  The
86  *   script will handle the reset of DSPs and loading of the cleanup utility via
87  *   remoteproc.  Executing the dsp_cleanup.sh script with no input parameters
88  *   will list the help.  The cleanup utility will not clean a single DSP.  It
89  *   assumed all DSPs will be reloaded once the cleanup is complete.
90  *
91  *   The cleanup API performs the following actions when cleanup for each of the
92  *   following peripherals is enabled:
93  *      - CPPI:       Resets CPDMA tx channels, rx channels, and rx flows
94  *      - QMSS:       Disables QMSS accumulator channels and clears any pending
95  *                    accumulator channel INTD interrupts.  Resets memory
96  *                    regions.  Empties all QMSS queues.  Queues owned by
97  *                    Linux are swept of all descriptors that originate
98  *                    from memory regions inserted by a DSP application
99  *      - PA:         Redownloads firmware for PDSPs 1-5.  Resets LUT2. Delets
100  *                    all entries in LUT10 inserted by DSP.  Resets PA global
101  *                    config to default values
102  *      - EDMA3:      Disables DMA channels and clears the primary and secondary
103  *                    channel events.  Disables QDMA channels and clears primary
104  *                    and secondary events.  Disables interrupts and clears 
105  *                    pending events
106  *      - AIF2:       Resets AIF and powers down the AIF2 via the PSC
107  *      - TCP3D:      Powers down TCP3D A & B via the PSC
108  *      - BCP:        Powers down BCP via the PSC
109  *      - FFTC:       Powers down FFTC A & B via the PSC
110  *      - VCP:        Powers down the VCP via the PSC
111  *      - SA:         Clears the security context cache
112  *      - CIC:        Removes all CPINTC system to host interrupt mappings
113  *                    whose host interrupt is routed to the DSP.  Clears all
114  *                    pending CPINTC events.
115  *      - Timers:     Disables and resets timers.
116  *      - Semaphores: Soft resets semaphores
117  *
118  *   The fault_mgmt/device/[platform]/fm_device.c contains the FM global configuration
119  *   parameters and the exclusion list for the device.  The global config list
120  *   contains device peripheral information that could not be extracted from
121  *   CSL or externally-visible LLD APIs.  The exclusion list contains peripherals
122  *   resources that are in use by Linux.  These resources will not be halted or
123  *   cleaned up when the IO halt and cleanup APIs are called, respectively.
124  *
125  */
127 /** @defgroup FAULT_MGMT_API   Fault Management
128  */
130 #ifndef __FAULT_MGMT_H__
131 #define __FAULT_MGMT_H__
133 /* Standard includes */
134 #include <stdint.h>
136 /* CSL RL includes */
137 #include <ti/csl/cslr_cpintc.h>
138 #include <ti/csl/cslr_tmr.h>
140 #ifdef __cplusplus
141 extern "C" {
142 #endif
144 /**
145 @defgroup FAULT_MGMT_SYMBOL                  Fault Management Defined Symbols
146 @ingroup FAULT_MGMT_API
147 */
148 /**
149 @defgroup FAULT_MGMT_FUNCTION                Fault Management Functions
150 @ingroup FAULT_MGMT_API
151 */
152 /**
153 @defgroup FAULT_MGMT_DATA_STRUCTURE          Fault Management Data Structures
154 @ingroup FAULT_MGMT_API
155 */
156 /**
157 @defgroup FAULT_MGMT_OSAL_API                Fault Management OSAL API
158 @ingroup FAULT_MGMT_API
159 */
161 /** @addtogroup FAULT_MGMT_SYMBOL
162  @{ */
164 /* FM return and error codes */
165 /** FM successful return code */
166 #define FM_OK                                        0
168 #if (!defined(DEVICE_K2H) && !defined(DEVICE_K2K) && !defined(DEVICE_K2L) && !defined(DEVICE_K2E))
169 /** FM fault cleanup successful return code */
170 #define FM_FAULT_CLEANUP_OK                          1
172 /** FM fault cleanup status base */
173 #define FM_STATUS_BASE                               64
174 /** FM fault cleanup process is being initialized */
175 #define FM_STATUS_CLEANUP_INITIALIZATION             (FM_STATUS_BASE+1)
176 /** FM fault cleanup process has entered CPDMA cleanup */
177 #define FM_STATUS_CLEANUP_CPDMA                      (FM_STATUS_BASE+2)
178 /** FM fault cleanup process has entered QMSS accumulator cleanup */
179 #define FM_STATUS_CLEANUP_QMSS_ACCUM                 (FM_STATUS_BASE+3)
180 /** FM fault cleanup process has entered PA cleanup */
181 #define FM_STATUS_CLEANUP_PA                         (FM_STATUS_BASE+4)
182 /** FM fault cleanup process has entered EDMA3 cleanup */
183 #define FM_STATUS_CLEANUP_EDMA3                      (FM_STATUS_BASE+5)
184 /** FM fault cleanup process has entered semaphore cleanup */
185 #define FM_STATUS_CLEANUP_SEMAPHORE                  (FM_STATUS_BASE+6)
186 /** FM fault cleanup process has entered QMSS queue cleanup */
187 #define FM_STATUS_CLEANUP_QMSS_QUEUE                 (FM_STATUS_BASE+7)
188 /** FM fault cleanup process has entered AIF2 cleanup */
189 #define FM_STATUS_CLEANUP_AIF2                       (FM_STATUS_BASE+8)
190 /** FM fault cleanup process has entered TCP3D cleanup */
191 #define FM_STATUS_CLEANUP_TCP3D                      (FM_STATUS_BASE+9)
192 /** FM fault cleanup process has entered BCP cleanup */
193 #define FM_STATUS_CLEANUP_BCP                        (FM_STATUS_BASE+10)
194 /** FM fault cleanup process has entered FFTC cleanup */
195 #define FM_STATUS_CLEANUP_FFTC                       (FM_STATUS_BASE+11)
196 /** FM fault cleanup process has entered VCP cleanup */
197 #define FM_STATUS_CLEANUP_VCP                        (FM_STATUS_BASE+12)
198 /** FM fault cleanup process has entered SA cleanup */
199 #define FM_STATUS_CLEANUP_SA                         (FM_STATUS_BASE+13)
200 /** FM fault cleanup process has entered CIC cleanup */
201 #define FM_STATUS_CLEANUP_CIC                        (FM_STATUS_BASE+14)
202 /** FM fault cleanup process has entered Timer cleanup */
203 #define FM_STATUS_CLEANUP_TIMER                      (FM_STATUS_BASE+15)
204 #endif /* !(K2H && K2K && K2L && K2E) */
206 /** FM error base */
207 #define FM_ERROR_BASE                                (-64)
208 /** EDMA3 initialization failed during io halt initialization */
209 #define FM_ERROR_EDMA3_INIT_FAILED                   (FM_ERROR_BASE-1)
210 /** CPPI initialization failed during io halt or fault cleanup */
211 #define FM_ERROR_CPPI_INIT_FAILED                    (FM_ERROR_BASE-2)
212 /** QMSS initialization failed during io halt or fault cleanup */
213 #define FM_ERROR_QMSS_INIT_FAILED                    (FM_ERROR_BASE-3)
214 /** PA initialization failed during fault cleanup */
215 #define FM_ERROR_PA_INIT_FAILED                      (FM_ERROR_BASE-4)
216 /** An exclusion list entry's specified CPDMA type is incorrect based on 
217  *  fmGblCfgParams */
218 #define FM_ERROR_INVALID_CPDMA_IN_EXCLUSION_LIST     (FM_ERROR_BASE-5)
219 /** An exclusion list entry's specified EDMA3 CC number is incorrect based on 
220  *  fmGblCfgParams */
221 #define FM_ERROR_INVALID_EDMA3_CC_IN_EXCLUSION_LIST  (FM_ERROR_BASE-6)
222 /** An exclusion list entry's specified LUT number is incorrect based on 
223  *  fmGblCfgParams */
224 #define FM_ERROR_INVALID_LUT_IN_EXCLUSION_LIST       (FM_ERROR_BASE-7)
225 /** Could not continue with cleanup because cleanup initialization did not 
226  *  complete */
227 #define FM_ERROR_CLEANUP_INIT_NOT_COMPLETE           (FM_ERROR_BASE-8)
228 /** PA's command response indicated a LUT1 index could not be removed */
229 #define FM_ERROR_LUT1_INDEX_NOT_REMOVED              (FM_ERROR_BASE-9)
230 /** CPPI initialization failed during the PA cleanup process */
231 #define FM_ERROR_CPPI_INIT_FAILED_DURING_PA_RECOV    (FM_ERROR_BASE-10)
232 /** QMSS initialization failed during the PA cleanup process */
233 #define FM_ERROR_QMSS_INIT_FAILED_DURING_PA_RECOV    (FM_ERROR_BASE-11)
234 /** CPPI channel that is to be disabled is invalid */
235 #define FM_ERROR_CPPI_TX_CHANNEL_INVALID             (FM_ERROR_BASE-13)
236 /** Pa_control returned error when creating the command needed to reset
237  *  the PA global configuration to default values */
238 #define FM_ERROR_PASS_SETTING_DEF_GLBL_CMD           (FM_ERROR_BASE-14)
239 /** The command sent to PA to reset the global configuration failed */
240 #define FM_ERROR_PASS_GBL_DEF_CFG_NOT_SET            (FM_ERROR_BASE-15)
241 /** Pa_control returned error when creating the command needed to reset
242  *  the PA nat-t global configuration to default values */
243 #define FM_ERROR_PASS_SETTING_DEF_NATT_CMD           (FM_ERROR_BASE-16)
244 /** The command sent to PA to reset the nat-t global configuration failed */
245 #define FM_ERROR_PASS_NATT_DEF_CFG_NOT_SET           (FM_ERROR_BASE-17)
246 /** The monolithic descriptor buffer is not large enough to fit the 
247  *  LUT entry delete or reset global configuration commands sent to PA */
248 #define FM_ERROR_DESC_BUF_TOO_SMALL                  (FM_ERROR_BASE-18)
249 /** An exclusion list entry's specified CIC number is incorrect based on 
250  *  fmGblCfgParams */
251 #define FM_ERROR_INVALID_CIC_IN_EXCLUSION_LIST       (FM_ERROR_BASE-19)
252 /** An exclusion list entry's specified Timer range is incorrect based on 
253  *  fmGblCfgParams */
254 #define FM_ERROR_INVALID_TIMER_IN_EXCLUSION_LIST     (FM_ERROR_BASE-20)
255 /** Accumulator channel specified during INTD cleanup is not within the
256  *  highAccum or loAccum ranges defined within the fmGblCfgParams */
257 #define FM_ERROR_INVALID_ACCUM_CH                    (FM_ERROR_BASE-21)
259 /**
260  * @brief 
261  *  Size of data section used by fault management library to store coredump data that is to be 
262  *  sent to ARM.  The section size must be pre-defined at compile time since Linux Remoteproc
263  *  must know the FM's coredump region location and size at the time of DSP image download.
264  */
265 #define FAULT_MGMT_DATA_SIZE                         1024
267 /**
268 @}
269 */
271 /** @addtogroup FAULT_MGMT_DATA_STRUCTURE
272  @{ */
274 /**********************************************************************
275  ****************** EXPORTED DATA STRUCTURES **************************
276  **********************************************************************/
278 /**
279  * @brief 
280  *  This is the memory used by the fault management library to store any data that will be 
281  *  sent to the fault handling module. The region location must be pre-defined at compile time 
282  *  since the Linux DSP image downloader must know the FM's data dump region location and size 
283  *  at the time of download.
284  *
285  *  The fault_mgmt_data section is placed in the ".crash" data section.  The linker must place
286  *  ".crash" section in memory visible to the ARM. 
287  */
288 extern uint8_t  fault_mgmt_data[FAULT_MGMT_DATA_SIZE];
290 #if (!defined(DEVICE_K2H) && !defined(DEVICE_K2K) && !defined(DEVICE_K2L) && !defined(DEVICE_K2E))
291 /**
292  * @brief
293  *  First 32-bit word is used by FM cleanup code to report cleanup status to Host
294  */
295 extern int32_t  fmCleanupStatus[32];
296 #endif /* !(K2H && K2K && K2L && K2E) */
298 /**********************************************************************
299  **************************** EXPORTED API ****************************
300  **********************************************************************/
302 /** 
303  * @brief Fault Management return code.
304  */
305 typedef int32_t Fm_Result;
307 /**
308  * @brief Accumulator channel range
309  */
310 typedef struct {
311     /* Accumulator channel index start */
312     uint32_t start;
313     /* Accumulator channel index end */    
314     uint32_t end;
315 } Fm_AccumChRange;
317 /** 
318  * @brief CIC parameter structure containing information about each
319  *        CIC on the device.  A pointer to an array of these structures 
320  *        equal to the number of CICs on the device should be passed 
321  *        as part of the fmGlobalConfigParams structure.
322  */
323 typedef struct {
324     /** Pointer to the CIC's register base address */
325     volatile CSL_CPINTCRegs *cicRegs;
326     /** Input system events or interrupts */
327     uint32_t                 maxNumSysInt;
328     /** Output host events or inputerrupts */
329     uint32_t                 maxNumHostInt;
330 } Fm_CicParams;
332 /** 
333  * @brief Timer parameter structure containing information about each
334  *        Timer on the device.  A pointer to an array of these structures 
335  *        equal to the number of Timers on the device should be passed 
336  *        as part of the fmGlobalConfigParams structure.
337  */
338 typedef struct {
339     /** Pointer to the Timer's register base address */
340     volatile CSL_TmrRegs *timerRegs;
341 } Fm_TimerParams;
343 /** 
344  * @brief Fault Management global configuration structure
345  */
346 typedef struct {
347     /** Number of device cores to notify on exception */
348     uint32_t        maxNumCores;
349     /** Number of EDMA3 CCs */
350     uint32_t        maxEdma3Cc;
351     /** Max number of AIF PE (TX) channels */
352     uint32_t        maxAifPeCh;
353     /** Max number of AIF PD (RX) channels */
354     uint32_t        maxAifPdCh;
355     /** Max number of QMSS accumulator channels */
356     uint32_t        maxQmssAccumCh;
357     /** High priority accumulator channels */
358     Fm_AccumChRange highAccum;
359     /** Low priority accumulator channels */
360     Fm_AccumChRange loAccum;
361     /** Max number of PA PDSPs */
362     uint32_t        maxPaPdsps;
363     /** Max number of PA LUT1 entries */
364     uint32_t        maxLut1Entries;
365     /** Number of CICs on device */
366     uint32_t        maxCic;
367     /** Pointer to list of CIC param structures.  One param structure
368      *  per CIC */
369     Fm_CicParams   *cicParams;
370     /** Number of Timers on device */
371     uint32_t        maxTimers;
372     /** Pointer to list of timer param structures.  One param structure
373      *  per timers */
374     Fm_TimerParams *timerParams;
375 } Fm_GlobalConfigParams;
377 /**
378  * @brief IO halt resource exclusion types
379  */
380 typedef enum {
381     /** CPDMA RX channel */
382     Fm_res_CpdmaRxCh = 0,
383     /** CPDMA TX channel */
384     Fm_res_CpdmaTxCh,
385     /** CPDMA RX flow */
386     Fm_res_CpdmaRxFlow,
387     /** AIF PE (TX) channel */
388     Fm_res_AifPeCh,
389     /** AIF PD (RX) channel */
390     Fm_res_AifPdCh,
391     /** EDMA3 DMA channel */
392     Fm_res_Edma3DmaCh, 
393     /** EDMA3 QDMA channel */
394     Fm_res_Edma3QdmaCh, 
395     /** EDMA3 INT channel */
396     Fm_res_Edma3IntCh,
397     /** QMSS Accumulator channels */
398     Fm_res_QmssAccumCh,
399     /** QMSS Queues */
400     Fm_res_QmssQueue,
401     /** QMSS Memory Regions */
402     Fm_res_QmssMemRegion,
403     /** PA PDSPs */
404     Fm_res_PaPdsp,
405     /** PA LUT Entries */
406     Fm_res_PaLutEntry,
407     /** Chip Interrupt Controller Host interrupts */
408     Fm_res_CicHostInt,
409     /** Timers */
410     Fm_res_Timer,
411     /** End of exclusion array identifier */
412     Fm_res_END
413 } Fm_ResType;
415 /**
416  * @brief IO halt resource peripheral resource exclusion range
417  */
418 typedef struct {
419     /** Range start for which exclusion will apply */
420     int32_t exStart;
421     /** Range end for which exclusion will apply */
422     int32_t exEnd;
423 } Fm_ExRange;
425 /**
426  * @brief Describes a resource range that will be excluded from 
427  *        the halt logic in the Fault_Mgmt_haltIoProcessing API
428  */
429 typedef struct {
430     /** Defines the type of resource to be excluded */
431     Fm_ResType resType;
432     /** Peripheral resources exclusion range */
433     Fm_ExRange exRange;
434     /** Excluded resource's extra parsing info as described below:
435      *      #Fm_res_CpdmaRxCh
436      *      #Fm_res_CpdmaTxCh
437      *      #Fm_res_CpdmaRxFlow
438      *          - Maps to Cppi_CpDma type
439      *
440      *      #Fm_res_Edma3DmaCh
441      *      #Fm_res_Edma3QdmaCh
442      *      #Fm_res_Edma3IntCh
443      *          - Maps to CSL_InstNum EDMA3 Channel Controller (CC)
444      *
445      *      #Fm_res_AifPeCh
446      *      #Fm_res_AifPdCh
447      *      #Fm_res_QmssAccumCh
448      *      #Fm_res_QmssQueue
449      *      #Fm_res_QmssMemRegion
450      *      #Fm_res_PaPdsp
451      *      #Fm_res_Timer
452      *          - NULL
453      *
454      *      #Fm_res_PaLutEntry
455      *          - Maps to LUT 0, 1, or 2
456      *
457      *      #Fm_res_CicHostInt
458      *          - Maps to CIC number
459      */
460     uint32_t   exResInfo;
461 } Fm_ExcludedResource;
463 #if (!defined(DEVICE_K2H) && !defined(DEVICE_K2K) && !defined(DEVICE_K2L) && !defined(DEVICE_K2E))
464 /**
465  * @brief
466  *  DSP fault cleanup configuration parameters.
467  */
468 typedef struct {
469     /** Cleans CPDMA to PoR state if a non-zero value is written to this field */
470     int32_t              cleanCpdma;
471     /** Cleans QMSS to PoR state if a non-zero value is written to this field */
472     int32_t              cleanQmss;
473     /** Cleans PA to PoR state if a non-zero value is written to this field */
474     int32_t              cleanPa;
475     /** Cleans EDMA3 to PoR state if a non-zero value is written to this field */
476     int32_t              cleanEdma3;
477     /** Cleans AIF2 to PoR state if a non-zero value is written to this field */
478     int32_t              cleanAif2;
479     /** Powers down TCP3D if a non-zero value is written to this field */
480     int32_t              cleanTcp3d;
481     /** Powers down BCP if a non-zero value is written to this field */
482     int32_t              cleanBcp;
483     /** Powers down FFTC (A & B) if a non-zero value is written to this field */
484     int32_t              cleanFftc;
485     /** Powers down VCP if a non-zero value is written to this field */
486     int32_t              cleanVcp;
487     /** Cleans SA security context entries */
488     int32_t              cleanSa;
489     /** Cleans the Chip Interrupt Controllers (CIC) */
490     int32_t              cleanCics;
491     /** Cleans the device timers */
492     int32_t              cleanTimers;
493     /** List of resources to not reset when trying to cleanup from
494      *  a DSP fault.  Used to avoid resetting Linux kernel features, such 
495      *  as the network driver, that use may use CPDMA channels.
496      *
497      *  Pass NULL to reset all peripherals to their PoR state. */
498     Fm_ExcludedResource *excludedResources;
499 } Fm_CleanupCfg;
500 #endif /* !(K2H && K2K && K2L && K2E) */
502 /**
503  * @brief
504  *  DSP subsystem halt configuration parameters.
505  */
506 typedef struct {
507     /** Disables the AIF2 send and receive channels if a non-zero value is written to
508      *  this field */
509     int32_t              haltAif2;
510     /** Halts SGMII tx/rx logic if a non-zero value is written to this field */
511     int32_t              haltSGMII;
512     /** Halts EDMA3 channels if a non-zero value is written to this field */
513     int32_t              haltEdma3;
514     /** Halts CPDMA tx/rx channels if a non-zero value is written to this field */
515     int32_t              haltCpdma;
516     /** List of resources to exclude from IO halt feature.  Can be used
517      *  to avoid halting key Linux kernel features, such as the network driver, that
518      *  use may use CPDMA channels.
519      *
520      *  Pass NULL to disable all receive channels for all resource types. */
521     Fm_ExcludedResource *excludedResources;
522 } Fm_HaltCfg;
524 /**
525 @}
526 */
528 /** @addtogroup FAULT_MGMT_FUNCTION
529  @{ */
531 #if (!defined(DEVICE_K2H) && !defined(DEVICE_K2K) && !defined(DEVICE_K2L) && !defined(DEVICE_K2E))
532 /**
533  *  @b Description
534  *  @n  
535  *      The function is used to clean the DSP peripherals to their power on reset state
536  *      after a DSP crash occurs.  The reset can be augmented to ignore peripheral resources
537  *      in use by the ARM (specifically, Linux).  The peripherals that are supported in 
538  *      PoR cleanup are:
539  *          - CPPI
540  *          - QMSS
541  *          - PA
542  *          - EDMA3
543  *          - AIF2
544  *          - TCP3D
545  *          - BCP
546  *          - FFTC
547  *          - VCP
548  *          - SA
549  *          - CIC
550  *          - Timers
551  *          - Semaphores
552  *
553  *  @param[in]  *fmGblCfgParams
554  *      Pointer to the fault managment device specific global configuration parameters 
555  *  @param[in]  *cleanupCfg
556  *      Configuration structure that allows control over which peripheral's should be recovered
557  *      and which peripheral resources to avoid during cleanup.
558  *
559  *  @retval
560  *      Success - #FM_FAULT_CLEANUP_OK
561  *  @retval
562  *      Failure - return value <0
563  */
564 extern Fm_Result Fault_Mgmt_faultCleanup(Fm_GlobalConfigParams *fmGblCfgParams, Fm_CleanupCfg *cleanupCfg);
565 #endif /* !(K2H && K2K && K2L && K2E) */
567 /**
568  *  @b Description
569  *  @n  
570  *      The function is used to halt IO processing when a crash occurs.  Currently disables:
571  *          - EDMA3 DMA, QDMA, and INT channels
572  *          - AIF PE/PD channels
573  *          - SGMII switch
574  *          - CPDMA tx/rx channels
575  *
576  *  @param[in]  *fmGblCfgParams
577  *      Pointer to the fault managment device specific global configuration parameters 
578  *  @param[in]  *haltCfg
579  *      Configuration structure that allows control over what portions of the system can be
580  *      disabled.
581  *
582  *  @retval
583  *      Success - #FM_OK
584  *  @retval
585  *      Failure - return value <0 
586  */
587 extern Fm_Result Fault_Mgmt_haltIoProcessing(Fm_GlobalConfigParams *fmGblCfgParams, Fm_HaltCfg *haltCfg);
589 /**
590  *  @b Description
591  *  @n  
592  *      The function is used to get the register status and store it in the fault management
593  *      data region.
594  *
595  *  @retval
596  *      Not Applicable    
597  */
598 extern void Fault_Mgmt_getLastRegStatus(void);
600 /**
601  *  @b Description
602  *  @n  
603  *      The function is used to notify ARM the DSP core has faulted. The fault 
604  *      information collected are read by the ARM from the relevant sections. 
605  *
606  *  @retval
607  *      Not Applicable
608  */
609 extern void Fault_Mgmt_notify(void);
611 /**
612  *  @b Description
613  *  @n  
614  *      The function is used to notify and manually fault a remote DSP core because
615  *      a fault has occurred on the on the local core.  The fault on the remote
616  *      core is generated by a NMI pulse to the GEM. The fault information collected 
617  *      is read by the ARM from the relevant sections. 
618  *
619  *  @retval
620  *      Not Applicable
621  */
622 extern void Fault_Mgmt_notify_remote_core(uint32_t core_id);
624 /**
625  *  @b Description
626  *  @n  
627  *      Returns the required size of the fault management data
628  *      region containing the crash dump data.
629  *
630  *  @retval
631  *      Required size of the fault management crash dump data region in bytes
632  */
633 extern uint32_t Fault_Mgmt_getSizes(void);
635 /**
636 @}
637 */
639 #ifdef __cplusplus
641 #endif
643 #endif /* __FAULT_MGMT_H__ */