12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652 |
- /**
- * @file csl_cgemAux.h
- *
- * @brief
- * This is the CGEM Auxilary Header file.
- *
- * \par
- * ============================================================================
- * @n (C) Copyright 2010 Texas Instruments, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
- #ifndef CSL_CGEMAUX_H_
- #define CSL_CGEMAUX_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <ti/csl/csl_cgem.h>
- /** @addtogroup CSL_CGEM_FUNCTION
- @{ */
- /** ============================================================================
- * @n@b CSL_CGEM_getECFGPriorityLevel
- *
- * @b Description
- * @n This function gets the UMC priority level of MDMA requests.
- *
- * @b Arguments
- @verbatim
- priorityLevel - Priority Level populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_ECFGARBE_PRI
- *
- * @b Example
- * @verbatim
- Uint8 priorityLevel;
-
- CSL_CGEM_getECFGPriorityLevel (&priorityLevel);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getECFGPriorityLevel(Uint8* priorityLevel)
- {
- *priorityLevel = CSL_FEXT(hCGEM->ECFGARBE, CGEM_ECFGARBE_PRI);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_setECFGPriorityLevel
- *
- * @b Description
- * @n This function sets the UMC priority level of MDMA requests.
- *
- * @b Arguments
- @verbatim
- priorityLevel - Priority Level to be configured
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_ECFGARBE_PRI
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_setECFGPriorityLevel (1);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_setECFGPriorityLevel(Uint8 priorityLevel)
- {
- CSL_FINS(hCGEM->ECFGARBE, CGEM_ECFGARBE_PRI, priorityLevel);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getEMCFaultAddress
- *
- * @b Description
- * @n This function gets the EMC Fault address
- *
- * @b Arguments
- @verbatim
- faultAddress - Fault Address populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_ICFGMPFAR
- *
- * @b Example
- * @verbatim
- Uint32 faultAddress;
-
- CSL_CGEM_getEMCFaultAddress (&faultAddress);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getEMCFaultAddress(Uint32* faultAddress)
- {
- *faultAddress = hCGEM->ICFGMPFAR;
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getEMCFaultStatus
- *
- * @b Description
- * @n This function gets the EMC Fault status
- *
- * @b Arguments
- @verbatim
- faultStatus - Fault Status populated by this API
- faultId - Fault Identifier populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_ICFGMPFSR_FID
- *
- * @b Example
- * @verbatim
- Uint8 faultStatus;
- Uint8 faultId;
- // Get the EMC Fault Status
- CSL_CGEM_getEMCFaultStatus (&faultStatus, &faultId);
- if (faultStatus != 0)
- {
- // Fault Detected
- }
- else
- {
- // No Fault
- }
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getEMCFaultStatus(Uint8* faultStatus, Uint8* faultId)
- {
- Uint32 value = hCGEM->ICFGMPFSR;
- *faultStatus = CSL_FEXTR(value, 7, 0);
- *faultId = CSL_FEXT(value, CGEM_ICFGMPFSR_FID);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_clearEMCFault
- *
- * @b Description
- * @n This function clears the EMC Fault
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_ICFGMPFCR_MPFCLR=1
- *
- * @b Affects
- * @n CGEM_ICFGMPFSR=0
- *
- * @b Example
- * @verbatim
- Uint8 faultStatus;
- Uint8 faultId;
- // Get the EMC Fault Status
- CSL_CGEM_getEMCFaultStatus (&faultStatus, &faultId);
- if (faultStatus != 0)
- {
- // Fault Detected
- ...
- // Clear the EMC Fault
- CSL_CGEM_clearEMCFault();
- }
- else
- {
- // No Fault
- }
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_clearEMCFault(void)
- {
- hCGEM->ICFGMPFCR = CSL_FMK(CGEM_ICFGMPFCR_MPFCLR, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getECFGErrorStatus
- *
- * @b Description
- * @n This function gets the ECFG Error Status
- *
- * @b Arguments
- @verbatim
- stat - Transaction Status populated by this API
- xid - Transaction ID populated by this API
- err - Error Detected populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_ECFGERR_STAT, CGEM_ECFGERR_XID, CGEM_ECFGERR_ERR
- *
- * @b Example
- * @verbatim
- Uint8 stat;
- Uint8 xid;
- Uint8 err;
- // Get the ECFG Error Status
- CSL_CGEM_getECFGErrorStatus (&stat, &xid, &err);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getECFGErrorStatus
- (
- Uint8* stat,
- Uint8* xid,
- Uint8* err
- )
- {
- Uint32 value = hCGEM->ECFGERR;
- *stat = CSL_FEXT(value, CGEM_ECFGERR_STAT);
- *xid = CSL_FEXT(value, CGEM_ECFGERR_XID);
- *err = CSL_FEXT(value, CGEM_ECFGERR_ERR);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_clearECFGError
- *
- * @b Description
- * @n This function clears the ECFG Error Status
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_ECFGERRCLR_CLR=1
- *
- * @b Affects
- * @n CGEM_ECFGERR=0
- *
- * @b Example
- * @verbatim
- Uint8 stat;
- Uint8 xid;
- Uint8 err;
- // Get the ECFG Error Status
- CSL_CGEM_getECFGErrorStatus (&stat, &xid, &err);
- ...
- // Clear the ECFG Error
- CSL_CGEM_clearECFGError();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_clearECFGError(void)
- {
- hCGEM->ECFGERRCLR = CSL_FMK(CGEM_ECFGERRCLR_CLR, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_isL2EDCEnabled
- *
- * @b Description
- * @n This function is used to check if the L2 EDC is enabled or not?
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n TRUE - L2 EDC is enabled.
- * @n FALSE - L2 EDC is disabled.
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L2EDSTAT_EN
- *
- * @b Example
- * @verbatim
- // Check if L2-EDC is enabled or not?
- if (CSL_CGEM_isL2EDCEnabled() == TRUE)
- {
- // L2 EDC is enabled
- }
- else
- {
- // L2 EDC is disabled.
- }
-
- @endverbatim
- * =============================================================================
- */
- static inline Bool CSL_CGEM_isL2EDCEnabled(void)
- {
- return (Bool)CSL_FEXT(hCGEM->L2EDSTAT, CGEM_L2EDSTAT_EN);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_isL2EDCSuspended
- *
- * @b Description
- * @n This function is used to check if the L2 EDC is suspended or not?
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n TRUE - L2 EDC is suspended.
- * @n FALSE - L2 EDC is NOT suspended.
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L2EDSTAT_SUSP
- *
- * @b Example
- * @verbatim
- // Check if L2-EDC is suspended or not?
- if (CSL_CGEM_isL2EDCSuspended() == TRUE)
- {
- // L2 EDC is suspended
- }
- else
- {
- // L2 EDC is not suspended.
- }
-
- @endverbatim
- * =============================================================================
- */
- static inline Bool CSL_CGEM_isL2EDCSuspended(void)
- {
- return (Bool)CSL_FEXT(hCGEM->L2EDSTAT, CGEM_L2EDSTAT_SUSP);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getL2EDCErrorStatus
- *
- * @b Description
- * @n This function gets the error status associated with the L2 EDC.
- *
- * @b Arguments
- @verbatim
- derr - DERR field populated by this API
- perr - Parity Check error field populated by this API
- dmaerr - DMA Error populated by this API
- verr - Victim Error field populated by this API
- nerr - NERR field populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L2EDSTAT_DERR, CGEM_L2EDSTAT_PERR, CGEM_L2EDSTAT_DMAERR,
- * @n CGEM_L2EDSTAT_VERR, CGEM_L2EDSTAT_NERR
- *
- * @b Example
- * @verbatim
- Uint8 derr;
- Uint8 perr;
- Uint8 dmaerr;
- Uint8 verr;
- Uint8 nerr;
-
- // Get the L2 EDC Error Status
- CSL_CGEM_getL2EDCErrorStatus(&derr, &perr, &dmaerr, &verr, &nerr);
-
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getL2EDCErrorStatus
- (
- Uint8* derr,
- Uint8* perr,
- Uint8* dmaerr,
- Uint8* verr,
- Uint8* nerr
- )
- {
- Uint32 value = hCGEM->L2EDSTAT;
- *derr = CSL_FEXT(value, CGEM_L2EDSTAT_DERR);
- *perr = CSL_FEXT(value, CGEM_L2EDSTAT_PERR);
- *dmaerr = CSL_FEXT(value, CGEM_L2EDSTAT_DMAERR);
- *verr = CSL_FEXT(value, CGEM_L2EDSTAT_VERR);
- *nerr = CSL_FEXT(value, CGEM_L2EDSTAT_NERR);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getL2EDCBitPosition
- *
- * @b Description
- * @n This function gets the bit position on which 128bit half of the 256bit
- * word caused the error.
- *
- * @b Arguments
- @verbatim
- bitPos - BitPos populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L2EDSTAT_BITPOS
- *
- * @b Example
- * @verbatim
- Uint8 bitPos;
-
- // Get the L2 EDC Bit Position
- CSL_CGEM_getL2EDCBitPosition(&bitPos);
-
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getL2EDCBitPosition (Uint8* bitPos)
- {
- *bitPos = CSL_FEXT(hCGEM->L2EDSTAT, CGEM_L2EDSTAT_BITPOS);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_clearL2EDCErrorStatus
- *
- * @b Description
- * @n This function clears the error status associated with the L2 EDC.
- *
- * @b Arguments
- @verbatim
- derr - DERR field to be cleared.
- perr - Parity Check Error field to be cleared.
- dmaerr - DMA Error to be cleared.
- verr - Victim Error to be cleared.
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCMD_DCLR, CGEM_L2EDCMD_PCLR, CGEM_L2EDCMD_DMACLR,
- * @n CGEM_L2EDCMD_VCLR
- *
- * @b Affects
- * @n CGEM_L2EDSTAT_DERR=0, CGEM_L2EDSTAT_PERR=0, CGEM_L2EDSTAT_DMAERR=0,
- * @n CGEM_L2EDSTAT_VERR=0, CGEM_L2EDSTAT_NERR=0
- *
- * @b Example
- * @verbatim
- Uint8 derr;
- Uint8 perr;
- Uint8 dmaerr;
- Uint8 verr;
- Uint8 nerr;
-
- // Get the L2 EDC Error Status
- CSL_CGEM_getL2EDCErrorStatus(&derr, &perr, &dmaerr, &verr, &nerr);
- ...
- // Clear the L2 EDC Error Status
- CSL_CGEM_clearL2EDCErrorStatus(derr, perr, dmaerr, verr);
- ...
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_clearL2EDCErrorStatus
- (
- Uint8 derr,
- Uint8 perr,
- Uint8 dmaerr,
- Uint8 verr
- )
- {
- Uint32 value = 0;
- /* We dont want to touch the SUSP, DIS or EN bits in the L2EDCMD register */
- CSL_FINS(value, CGEM_L2EDCMD_DCLR, derr);
- CSL_FINS(value, CGEM_L2EDCMD_PCLR, perr);
- CSL_FINS(value, CGEM_L2EDCMD_DMACLR, dmaerr);
- CSL_FINS(value, CGEM_L2EDCMD_VCLR, verr);
- /* Since we are configuring the SUSP, DIS or EN bits i.e. they are set to 0. The
- * write here to the register should not have any affect on the ED State. */
- hCGEM->L2EDCMD = value;
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enableL2EDC
- *
- * @b Description
- * @n This function enables the L2 EDC
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCMD_EN=1
- *
- * @b Affects
- * @n CGEM_L2EDSTAT_EN=1
- *
- * @b Example
- * @verbatim
- // Enable L2 EDC
- CSL_CGEM_enableL2EDC();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enableL2EDC(void)
- {
- hCGEM->L2EDCMD = CSL_FMK(CGEM_L2EDCMD_EN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disableL2EDC
- *
- * @b Description
- * @n This function disables the L2 EDC
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCMD_DIS=1
- *
- * @b Affects
- * @n CGEM_L2EDSTAT_DIS=1
- *
- * @b Example
- * @verbatim
- // Disable L2 EDC
- CSL_CGEM_disableL2EDC();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disableL2EDC(void)
- {
- hCGEM->L2EDCMD = CSL_FMK (CGEM_L2EDCMD_DIS, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_suspendL2EDC
- *
- * @b Description
- * @n This function suspends the L2 EDC
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCMD_SUSP=1
- *
- * @b Affects
- * @n CGEM_L2EDSTAT_SUSP=1
- *
- * @b Example
- * @verbatim
- // Suspend L2 EDC
- CSL_CGEM_suspendL2EDC();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_suspendL2EDC(void)
- {
- hCGEM->L2EDCMD = CSL_FMK (CGEM_L2EDCMD_SUSP, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getL2EDCErrorInfo
- *
- * @b Description
- * @n This function gets the L2 EDC Error Information
- *
- * @b Arguments
- @verbatim
- errAddr - Error Address populated by this API
- l2way - The way in the cache which caused the error.
- ram - Flag which indicates if the error was detected in CACHE or RAM
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L2EDADDR_ADDR,CGEM_L2EDADDR_WAY,CGEM_L2EDADDR_RAM
- *
- * @b Example
- * @verbatim
- Uint32 errAddr;
- Uint8 l2way;
- Uint8 ram;
- // Get the L2 EDC Error Information.
- CSL_CGEM_getL2EDCErrorInfo(&errAddr, &l2way, &ram);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getL2EDCErrorInfo(Uint32* errAddr, Uint8* l2way, Uint8* ram)
- {
- Uint32 value = hCGEM->L2EDADDR;
- *errAddr = CSL_FEXT(value, CGEM_L2EDADDR_ADDR);
- *l2way = CSL_FEXT(value, CGEM_L2EDADDR_WAY);
- *ram = CSL_FEXT(value, CGEM_L2EDADDR_RAM);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getL2EDCCounters
- *
- * @b Description
- * @n This function gets the L2 EDC Error event counters
- *
- * @b Arguments
- @verbatim
- correctParityCnt - Correctable Parity Error Counters
- nonCorrectParityCnt - Non-Correctable Parity Error Counters
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L2EDADDR_ADDR,CGEM_L2EDADDR_WAY,CGEM_L2EDADDR_RAM
- *
- * @b Example
- * @verbatim
- Uint8 correctParityCnt;
- Uint8 nonCorrectParityCnt;
- // Get the L2 EDC Error event counters.
- CSL_CGEM_getL2EDCCounters(&correctParityCnt, &nonCorrectParityCnt);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getL2EDCCounters(Uint8* correctParityCnt, Uint8* nonCorrectParityCnt)
- {
- *correctParityCnt = CSL_FEXT(hCGEM->L2EDCPEC, CGEM_L2EDCPEC_CNT);
- *nonCorrectParityCnt = CSL_FEXT(hCGEM->L2EDCNEC, CGEM_L2EDCNEC_CNT);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getMDMAErrorStatus
- *
- * @b Description
- * @n This function gets the MDMA Error Status
- *
- * @b Arguments
- @verbatim
- stat - Transaction Status populated by this API
- xid - Transaction ID populated by this API
- err - Error Detected populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_MDMAERR_STAT, CGEM_MDMAERR_XID, CGEM_MDMAERR_ERR
- *
- * @b Example
- * @verbatim
- Uint8 stat;
- Uint8 xid;
- Uint8 err;
- // Get the MDMA Error Status
- CSL_CGEM_getMDMAErrorStatus(&stat, &xid, &err);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getMDMAErrorStatus(Uint8* stat, Uint8* xid, Uint8* err)
- {
- Uint32 value = hCGEM->MDMAERR;
- *stat = CSL_FEXT(value, CGEM_MDMAERR_STAT);
- *xid = CSL_FEXT(value, CGEM_MDMAERR_XID);
- *err = CSL_FEXT(value, CGEM_MDMAERR_ERR);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_clearMDMAError
- *
- * @b Description
- * @n This function clears the MDMA Error Status
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_MDMAERRCLR_CLR=1
- *
- * @b Affects
- * @n CGEM_MDMAERR_STAT=0, CGEM_MDMAERR_XID=0, CGEM_MDMAERR_ERR=0
- *
- * @b Example
- * @verbatim
- Uint8 stat;
- Uint8 xid;
- Uint8 err;
- // Get the MDMA Error Status
- CSL_CGEM_getMDMAErrorStatus(&stat, &xid, &err);
- ...
- // Clear the MDMA Error Status
- CSL_CGEM_clearMDMAError();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_clearMDMAError(void)
- {
- hCGEM->MDMAERRCLR = CSL_FMK(CGEM_MDMAERRCLR_CLR, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enableEDCDMCExternal
- *
- * @b Description
- * @n This function is used to enable the EDC on DMC reads from an external
- * address(Hits L2 cache) if L2EDCMD is enabled.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_DL2CEN=1
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_enableEDCDMCExternal();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enableEDCDMCExternal(void)
- {
- hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_DL2CEN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disableEDCDMCExternal
- *
- * @b Description
- * @n This function is used to disable the EDC on DMC reads from an external
- * address(Hits L2 cache) if L2EDCMD is enabled.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_DL2CEN=0
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_disableEDCDMCExternal();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disableEDCDMCExternal(void)
- {
- hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_DL2CEN, 0);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enableEDCPMCExternal
- *
- * @b Description
- * @n This function is used to enable the EDC on PMC reads from an external
- * address(Hits L2 cache) if L2EDCMD is enabled.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_PL2CEN=1
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_enableEDCPMCExternal();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enableEDCPMCExternal(void)
- {
- hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_PL2CEN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disableEDCPMCExternal
- *
- * @b Description
- * @n This function is used to disable the EDC on PMC reads from an external
- * address(Hits L2 cache) if L2EDCMD is enabled.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_PL2CEN=0
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_disableEDCPMCExternal();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disableEDCPMCExternal(void)
- {
- hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_PL2CEN, 0);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enableEDCDMCL2SRAM
- *
- * @b Description
- * @n This function is used to enable the EDC on DMC reads from a L2SRAM.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_DL2SEN=1
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_enableEDCDMCL2SRAM();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enableEDCDMCL2SRAM(void)
- {
- hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_DL2SEN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disableEDCDMCL2SRAM
- *
- * @b Description
- * @n This function is used to disable the EDC on DMC reads from a L2SRAM.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_DL2SEN=0
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_disableEDCDMCL2SRAM();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disableEDCDMCL2SRAM(void)
- {
- hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_DL2SEN, 0);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enableEDCPMCL2SRAM
- *
- * @b Description
- * @n This function is used to enable the EDC on PMC reads from a L2SRAM.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_PL2SEN=1
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_enableEDCPMCL2SRAM();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enableEDCPMCL2SRAM(void)
- {
- hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_PL2SEN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disableEDCPMCL2SRAM
- *
- * @b Description
- * @n This function is used to disable the EDC on PMC reads from a L2SRAM.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_PL2SEN=0
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_disableEDCPMCL2SRAM();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disableEDCPMCL2SRAM(void)
- {
- hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_PL2SEN, 0);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enableEDCSDMAL2SRAM
- *
- * @b Description
- * @n This function is used to enable the EDC on SDMA reads from L2SRAM.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_SDMAEN=1
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_enableEDCSDMAL2SRAM();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enableEDCSDMAL2SRAM(void)
- {
- hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_SDMAEN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disableEDCSDMAL2SRAM
- *
- * @b Description
- * @n This function is used to disable the EDC on SDMA reads from L2SRAM.
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L2EDCEN_SDMAEN=0
- *
- * @b Example
- * @verbatim
-
- CSL_CGEM_disableEDCSDMAL2SRAM();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disableEDCSDMAL2SRAM(void)
- {
- hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_SDMAEN, 0);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getPMCErrorDetectionStatus
- *
- * @b Description
- * @n This function is used to get the PMC error detection status
- *
- * @b Arguments
- @verbatim
- dmaErr - DMA Error Status populated by this API
- perr - PERR Status populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L1PEDSTAT_DMAERR, CGEM_L1PEDSTAT_PERR
- *
- * @b Example
- * @verbatim
-
- Uint8 dmaErr;
- Uint8 perr
- CSL_CGEM_getPMCErrorDetectionStatus(&dmaErr, &perr);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getPMCErrorDetectionStatus(Uint8* dmaErr, Uint8* perr)
- {
- Uint32 value = hCGEM->L1PEDSTAT;
- *dmaErr = CSL_FEXT (value, CGEM_L1PEDSTAT_DMAERR);
- *perr = CSL_FEXT (value, CGEM_L1PEDSTAT_PERR);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_isPMCErrorDetectionEnabled
- *
- * @b Description
- * @n This function is used to check if the PMC Error Detection is enabled or
- * not?
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n TRUE - PMC Error Detection is enabled
- * @n FALSE - PMC Error Detection is disabled
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L1PEDSTAT_EN
- *
- * @b Example
- * @verbatim
-
- if (CSL_CGEM_isPMCErrorDetectionEnabled() == TRUE)
- {
- // PMC Error Detection is enabled
- }
- else
- {
- // PMC Error Detection is disabled
- }
- @endverbatim
- * =============================================================================
- */
- static inline Bool CSL_CGEM_isPMCErrorDetectionEnabled(void)
- {
- return CSL_FEXT(hCGEM->L1PEDSTAT, CGEM_L1PEDSTAT_EN);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_isPMCErrorDetectionSuspended
- *
- * @b Description
- * @n This function is used to check if the PMC Error Detection is suspended or
- * not?
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n TRUE - PMC Error Detection is suspended
- * @n FALSE - PMC Error Detection is not suspended
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L1PEDSTAT_SUSP
- *
- * @b Example
- * @verbatim
-
- if (CSL_CGEM_isPMCErrorDetectionSuspended() == TRUE)
- {
- // PMC Error Detection is suspended
- }
- else
- {
- // PMC Error Detection is not suspended
- }
- @endverbatim
- * =============================================================================
- */
- static inline Bool CSL_CGEM_isPMCErrorDetectionSuspended(void)
- {
- return CSL_FEXT(hCGEM->L1PEDSTAT, CGEM_L1PEDSTAT_SUSP);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_clearPMCErrorDetectionStatus
- *
- * @b Description
- * @n This function is used to clear the PMC error detection status
- *
- * @b Arguments
- @verbatim
- dmaErr - DMA Error status to be cleared
- perr - PERR status to be cleared
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L1PEDCMD_DMACLR, CGEM_L1PEDCMD_PCLR
- *
- * @b Affects
- * @n CGEM_L1PEDSTAT_DMAERR=0, CGEM_L1PEDSTAT_PERR=0
- *
- * @b Example
- * @verbatim
-
- Uint8 dmaErr;
- Uint8 perr
- // Get the PMC Error Detection status
- CSL_CGEM_getPMCErrorDetectionStatus(&dmaErr, &perr);
- ...
- // Clear the PMC errors.
- CSL_CGEM_clearPMCErrorDetectionStatus(dmaErr, perr);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_clearPMCErrorDetectionStatus(Uint8 dmaErr, Uint8 perr)
- {
- Uint32 value = 0;
- /* We dont want to touch the EN, SUSP or DIS bits in the L1PEDCMD register */
- CSL_FINS (value, CGEM_L1PEDCMD_DMACLR, dmaErr);
- CSL_FINS (value, CGEM_L1PEDCMD_PCLR, perr);
- /* Since we are writing 0 to the SUSP, DIS or EN bits we should preserve the ED
- * state as indicated in the specification. */
- hCGEM->L1PEDCMD = value;
- }
- /** ============================================================================
- * @n@b CSL_CGEM_enablePMCErrorDetection
- *
- * @b Description
- * @n This function is used to enable the PMC error detection status
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L1PEDCMD_EN=1
- *
- * @b Affects
- * @n CGEM_L1PEDSTAT_EN=1
- *
- * @b Example
- * @verbatim
-
- // Enable the PMC Error Detection
- CSL_CGEM_enablePMCErrorDetection();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_enablePMCErrorDetection(void)
- {
- hCGEM->L1PEDCMD = CSL_FMK (CGEM_L1PEDCMD_EN, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_disablePMCErrorDetection
- *
- * @b Description
- * @n This function is used to disable the PMC error detection status
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L1PEDCMD_DIS=1
- *
- * @b Affects
- * @n CGEM_L1PEDSTAT_DIS=1
- *
- * @b Example
- * @verbatim
-
- // Disable the PMC Error Detection
- CSL_CGEM_disablePMCErrorDetection();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_disablePMCErrorDetection(void)
- {
- hCGEM->L1PEDCMD = CSL_FMK (CGEM_L1PEDCMD_DIS, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_suspendPMCErrorDetection
- *
- * @b Description
- * @n This function is used to suspend the PMC error detection status
- *
- * @b Arguments
- @verbatim
- None
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Writes
- * @n CGEM_L1PEDCMD_SUSP=1
- *
- * @b Affects
- * @n CGEM_L1PEDSTAT_SUSP=1
- *
- * @b Example
- * @verbatim
-
- // Suspend the PMC Error Detection
- CSL_CGEM_suspendPMCErrorDetection();
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_suspendPMCErrorDetection(void)
- {
- hCGEM->L1PEDCMD = CSL_FMK (CGEM_L1PEDCMD_SUSP, 1);
- }
- /** ============================================================================
- * @n@b CSL_CGEM_getPMCErrorInfo
- *
- * @b Description
- * @n This function is used to get the PMC Error Detection information
- *
- * @b Arguments
- @verbatim
- errAddress - Error Address which is populated by this API
- errRAM - Error RAM status which is populated by this API
- @endverbatim
- *
- * <b> Return Value </b>
- * @n None
- *
- * <b> Pre Condition </b>
- * @n None
- *
- * <b> Post Condition </b>
- * @n None
- *
- * @b Reads
- * @n CGEM_L1PEDADDR_ADDR, CGEM_L1PEDADDR_RAM
- *
- * @b Example
- * @verbatim
-
- Uint32 errAddress;
- Uint8 errRAM;
- // Get the PMC Error Detection Information
- CSL_CGEM_getPMCErrorInfo(&errAddress, &errRAM);
- @endverbatim
- * =============================================================================
- */
- static inline void CSL_CGEM_getPMCErrorInfo(Uint32* errAddress, Uint8* errRAM)
- {
- Uint32 value = hCGEM->L1PEDADDR;
- *errAddress = CSL_FEXT (value, CGEM_L1PEDADDR_ADDR);
- *errRAM = CSL_FEXT (value, CGEM_L1PEDADDR_RAM);
- }
- /**
- @}
- */
- #ifdef __cplusplus
- }
- #endif
- #endif /* CSL_CGEMAUX_H_ */
|