csl_cgemAux.h 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652
  1. /**
  2. * @file csl_cgemAux.h
  3. *
  4. * @brief
  5. * This is the CGEM Auxilary Header file.
  6. *
  7. * \par
  8. * ============================================================================
  9. * @n (C) Copyright 2010 Texas Instruments, Inc.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. *
  15. * Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. *
  18. * Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in the
  20. * documentation and/or other materials provided with the
  21. * distribution.
  22. *
  23. * Neither the name of Texas Instruments Incorporated nor the names of
  24. * its contributors may be used to endorse or promote products derived
  25. * from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  30. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  31. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  33. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  34. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  35. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  36. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef CSL_CGEMAUX_H_
  41. #define CSL_CGEMAUX_H_
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #include <ti/csl/csl_cgem.h>
  46. /** @addtogroup CSL_CGEM_FUNCTION
  47. @{ */
  48. /** ============================================================================
  49. * @n@b CSL_CGEM_getECFGPriorityLevel
  50. *
  51. * @b Description
  52. * @n This function gets the UMC priority level of MDMA requests.
  53. *
  54. * @b Arguments
  55. @verbatim
  56. priorityLevel - Priority Level populated by this API
  57. @endverbatim
  58. *
  59. * <b> Return Value </b>
  60. * @n None
  61. *
  62. * <b> Pre Condition </b>
  63. * @n None
  64. *
  65. * <b> Post Condition </b>
  66. * @n None
  67. *
  68. * @b Reads
  69. * @n CGEM_ECFGARBE_PRI
  70. *
  71. * @b Example
  72. * @verbatim
  73. Uint8 priorityLevel;
  74. CSL_CGEM_getECFGPriorityLevel (&priorityLevel);
  75. @endverbatim
  76. * =============================================================================
  77. */
  78. static inline void CSL_CGEM_getECFGPriorityLevel(Uint8* priorityLevel)
  79. {
  80. *priorityLevel = CSL_FEXT(hCGEM->ECFGARBE, CGEM_ECFGARBE_PRI);
  81. }
  82. /** ============================================================================
  83. * @n@b CSL_CGEM_setECFGPriorityLevel
  84. *
  85. * @b Description
  86. * @n This function sets the UMC priority level of MDMA requests.
  87. *
  88. * @b Arguments
  89. @verbatim
  90. priorityLevel - Priority Level to be configured
  91. @endverbatim
  92. *
  93. * <b> Return Value </b>
  94. * @n None
  95. *
  96. * <b> Pre Condition </b>
  97. * @n None
  98. *
  99. * <b> Post Condition </b>
  100. * @n None
  101. *
  102. * @b Writes
  103. * @n CGEM_ECFGARBE_PRI
  104. *
  105. * @b Example
  106. * @verbatim
  107. CSL_CGEM_setECFGPriorityLevel (1);
  108. @endverbatim
  109. * =============================================================================
  110. */
  111. static inline void CSL_CGEM_setECFGPriorityLevel(Uint8 priorityLevel)
  112. {
  113. CSL_FINS(hCGEM->ECFGARBE, CGEM_ECFGARBE_PRI, priorityLevel);
  114. }
  115. /** ============================================================================
  116. * @n@b CSL_CGEM_getEMCFaultAddress
  117. *
  118. * @b Description
  119. * @n This function gets the EMC Fault address
  120. *
  121. * @b Arguments
  122. @verbatim
  123. faultAddress - Fault Address populated by this API
  124. @endverbatim
  125. *
  126. * <b> Return Value </b>
  127. * @n None
  128. *
  129. * <b> Pre Condition </b>
  130. * @n None
  131. *
  132. * <b> Post Condition </b>
  133. * @n None
  134. *
  135. * @b Reads
  136. * @n CGEM_ICFGMPFAR
  137. *
  138. * @b Example
  139. * @verbatim
  140. Uint32 faultAddress;
  141. CSL_CGEM_getEMCFaultAddress (&faultAddress);
  142. @endverbatim
  143. * =============================================================================
  144. */
  145. static inline void CSL_CGEM_getEMCFaultAddress(Uint32* faultAddress)
  146. {
  147. *faultAddress = hCGEM->ICFGMPFAR;
  148. }
  149. /** ============================================================================
  150. * @n@b CSL_CGEM_getEMCFaultStatus
  151. *
  152. * @b Description
  153. * @n This function gets the EMC Fault status
  154. *
  155. * @b Arguments
  156. @verbatim
  157. faultStatus - Fault Status populated by this API
  158. faultId - Fault Identifier populated by this API
  159. @endverbatim
  160. *
  161. * <b> Return Value </b>
  162. * @n None
  163. *
  164. * <b> Pre Condition </b>
  165. * @n None
  166. *
  167. * <b> Post Condition </b>
  168. * @n None
  169. *
  170. * @b Reads
  171. * @n CGEM_ICFGMPFSR_FID
  172. *
  173. * @b Example
  174. * @verbatim
  175. Uint8 faultStatus;
  176. Uint8 faultId;
  177. // Get the EMC Fault Status
  178. CSL_CGEM_getEMCFaultStatus (&faultStatus, &faultId);
  179. if (faultStatus != 0)
  180. {
  181. // Fault Detected
  182. }
  183. else
  184. {
  185. // No Fault
  186. }
  187. @endverbatim
  188. * =============================================================================
  189. */
  190. static inline void CSL_CGEM_getEMCFaultStatus(Uint8* faultStatus, Uint8* faultId)
  191. {
  192. Uint32 value = hCGEM->ICFGMPFSR;
  193. *faultStatus = CSL_FEXTR(value, 7, 0);
  194. *faultId = CSL_FEXT(value, CGEM_ICFGMPFSR_FID);
  195. }
  196. /** ============================================================================
  197. * @n@b CSL_CGEM_clearEMCFault
  198. *
  199. * @b Description
  200. * @n This function clears the EMC Fault
  201. *
  202. * @b Arguments
  203. @verbatim
  204. None
  205. @endverbatim
  206. *
  207. * <b> Return Value </b>
  208. * @n None
  209. *
  210. * <b> Pre Condition </b>
  211. * @n None
  212. *
  213. * <b> Post Condition </b>
  214. * @n None
  215. *
  216. * @b Writes
  217. * @n CGEM_ICFGMPFCR_MPFCLR=1
  218. *
  219. * @b Affects
  220. * @n CGEM_ICFGMPFSR=0
  221. *
  222. * @b Example
  223. * @verbatim
  224. Uint8 faultStatus;
  225. Uint8 faultId;
  226. // Get the EMC Fault Status
  227. CSL_CGEM_getEMCFaultStatus (&faultStatus, &faultId);
  228. if (faultStatus != 0)
  229. {
  230. // Fault Detected
  231. ...
  232. // Clear the EMC Fault
  233. CSL_CGEM_clearEMCFault();
  234. }
  235. else
  236. {
  237. // No Fault
  238. }
  239. @endverbatim
  240. * =============================================================================
  241. */
  242. static inline void CSL_CGEM_clearEMCFault(void)
  243. {
  244. hCGEM->ICFGMPFCR = CSL_FMK(CGEM_ICFGMPFCR_MPFCLR, 1);
  245. }
  246. /** ============================================================================
  247. * @n@b CSL_CGEM_getECFGErrorStatus
  248. *
  249. * @b Description
  250. * @n This function gets the ECFG Error Status
  251. *
  252. * @b Arguments
  253. @verbatim
  254. stat - Transaction Status populated by this API
  255. xid - Transaction ID populated by this API
  256. err - Error Detected populated by this API
  257. @endverbatim
  258. *
  259. * <b> Return Value </b>
  260. * @n None
  261. *
  262. * <b> Pre Condition </b>
  263. * @n None
  264. *
  265. * <b> Post Condition </b>
  266. * @n None
  267. *
  268. * @b Reads
  269. * @n CGEM_ECFGERR_STAT, CGEM_ECFGERR_XID, CGEM_ECFGERR_ERR
  270. *
  271. * @b Example
  272. * @verbatim
  273. Uint8 stat;
  274. Uint8 xid;
  275. Uint8 err;
  276. // Get the ECFG Error Status
  277. CSL_CGEM_getECFGErrorStatus (&stat, &xid, &err);
  278. @endverbatim
  279. * =============================================================================
  280. */
  281. static inline void CSL_CGEM_getECFGErrorStatus
  282. (
  283. Uint8* stat,
  284. Uint8* xid,
  285. Uint8* err
  286. )
  287. {
  288. Uint32 value = hCGEM->ECFGERR;
  289. *stat = CSL_FEXT(value, CGEM_ECFGERR_STAT);
  290. *xid = CSL_FEXT(value, CGEM_ECFGERR_XID);
  291. *err = CSL_FEXT(value, CGEM_ECFGERR_ERR);
  292. }
  293. /** ============================================================================
  294. * @n@b CSL_CGEM_clearECFGError
  295. *
  296. * @b Description
  297. * @n This function clears the ECFG Error Status
  298. *
  299. * @b Arguments
  300. @verbatim
  301. None
  302. @endverbatim
  303. *
  304. * <b> Return Value </b>
  305. * @n None
  306. *
  307. * <b> Pre Condition </b>
  308. * @n None
  309. *
  310. * <b> Post Condition </b>
  311. * @n None
  312. *
  313. * @b Writes
  314. * @n CGEM_ECFGERRCLR_CLR=1
  315. *
  316. * @b Affects
  317. * @n CGEM_ECFGERR=0
  318. *
  319. * @b Example
  320. * @verbatim
  321. Uint8 stat;
  322. Uint8 xid;
  323. Uint8 err;
  324. // Get the ECFG Error Status
  325. CSL_CGEM_getECFGErrorStatus (&stat, &xid, &err);
  326. ...
  327. // Clear the ECFG Error
  328. CSL_CGEM_clearECFGError();
  329. @endverbatim
  330. * =============================================================================
  331. */
  332. static inline void CSL_CGEM_clearECFGError(void)
  333. {
  334. hCGEM->ECFGERRCLR = CSL_FMK(CGEM_ECFGERRCLR_CLR, 1);
  335. }
  336. /** ============================================================================
  337. * @n@b CSL_CGEM_isL2EDCEnabled
  338. *
  339. * @b Description
  340. * @n This function is used to check if the L2 EDC is enabled or not?
  341. *
  342. * @b Arguments
  343. @verbatim
  344. None
  345. @endverbatim
  346. *
  347. * <b> Return Value </b>
  348. * @n TRUE - L2 EDC is enabled.
  349. * @n FALSE - L2 EDC is disabled.
  350. *
  351. * <b> Pre Condition </b>
  352. * @n None
  353. *
  354. * <b> Post Condition </b>
  355. * @n None
  356. *
  357. * @b Reads
  358. * @n CGEM_L2EDSTAT_EN
  359. *
  360. * @b Example
  361. * @verbatim
  362. // Check if L2-EDC is enabled or not?
  363. if (CSL_CGEM_isL2EDCEnabled() == TRUE)
  364. {
  365. // L2 EDC is enabled
  366. }
  367. else
  368. {
  369. // L2 EDC is disabled.
  370. }
  371. @endverbatim
  372. * =============================================================================
  373. */
  374. static inline Bool CSL_CGEM_isL2EDCEnabled(void)
  375. {
  376. return (Bool)CSL_FEXT(hCGEM->L2EDSTAT, CGEM_L2EDSTAT_EN);
  377. }
  378. /** ============================================================================
  379. * @n@b CSL_CGEM_isL2EDCSuspended
  380. *
  381. * @b Description
  382. * @n This function is used to check if the L2 EDC is suspended or not?
  383. *
  384. * @b Arguments
  385. @verbatim
  386. None
  387. @endverbatim
  388. *
  389. * <b> Return Value </b>
  390. * @n TRUE - L2 EDC is suspended.
  391. * @n FALSE - L2 EDC is NOT suspended.
  392. *
  393. * <b> Pre Condition </b>
  394. * @n None
  395. *
  396. * <b> Post Condition </b>
  397. * @n None
  398. *
  399. * @b Reads
  400. * @n CGEM_L2EDSTAT_SUSP
  401. *
  402. * @b Example
  403. * @verbatim
  404. // Check if L2-EDC is suspended or not?
  405. if (CSL_CGEM_isL2EDCSuspended() == TRUE)
  406. {
  407. // L2 EDC is suspended
  408. }
  409. else
  410. {
  411. // L2 EDC is not suspended.
  412. }
  413. @endverbatim
  414. * =============================================================================
  415. */
  416. static inline Bool CSL_CGEM_isL2EDCSuspended(void)
  417. {
  418. return (Bool)CSL_FEXT(hCGEM->L2EDSTAT, CGEM_L2EDSTAT_SUSP);
  419. }
  420. /** ============================================================================
  421. * @n@b CSL_CGEM_getL2EDCErrorStatus
  422. *
  423. * @b Description
  424. * @n This function gets the error status associated with the L2 EDC.
  425. *
  426. * @b Arguments
  427. @verbatim
  428. derr - DERR field populated by this API
  429. perr - Parity Check error field populated by this API
  430. dmaerr - DMA Error populated by this API
  431. verr - Victim Error field populated by this API
  432. nerr - NERR field populated by this API
  433. @endverbatim
  434. *
  435. * <b> Return Value </b>
  436. * @n None
  437. *
  438. * <b> Pre Condition </b>
  439. * @n None
  440. *
  441. * <b> Post Condition </b>
  442. * @n None
  443. *
  444. * @b Reads
  445. * @n CGEM_L2EDSTAT_DERR, CGEM_L2EDSTAT_PERR, CGEM_L2EDSTAT_DMAERR,
  446. * @n CGEM_L2EDSTAT_VERR, CGEM_L2EDSTAT_NERR
  447. *
  448. * @b Example
  449. * @verbatim
  450. Uint8 derr;
  451. Uint8 perr;
  452. Uint8 dmaerr;
  453. Uint8 verr;
  454. Uint8 nerr;
  455. // Get the L2 EDC Error Status
  456. CSL_CGEM_getL2EDCErrorStatus(&derr, &perr, &dmaerr, &verr, &nerr);
  457. @endverbatim
  458. * =============================================================================
  459. */
  460. static inline void CSL_CGEM_getL2EDCErrorStatus
  461. (
  462. Uint8* derr,
  463. Uint8* perr,
  464. Uint8* dmaerr,
  465. Uint8* verr,
  466. Uint8* nerr
  467. )
  468. {
  469. Uint32 value = hCGEM->L2EDSTAT;
  470. *derr = CSL_FEXT(value, CGEM_L2EDSTAT_DERR);
  471. *perr = CSL_FEXT(value, CGEM_L2EDSTAT_PERR);
  472. *dmaerr = CSL_FEXT(value, CGEM_L2EDSTAT_DMAERR);
  473. *verr = CSL_FEXT(value, CGEM_L2EDSTAT_VERR);
  474. *nerr = CSL_FEXT(value, CGEM_L2EDSTAT_NERR);
  475. }
  476. /** ============================================================================
  477. * @n@b CSL_CGEM_getL2EDCBitPosition
  478. *
  479. * @b Description
  480. * @n This function gets the bit position on which 128bit half of the 256bit
  481. * word caused the error.
  482. *
  483. * @b Arguments
  484. @verbatim
  485. bitPos - BitPos populated by this API
  486. @endverbatim
  487. *
  488. * <b> Return Value </b>
  489. * @n None
  490. *
  491. * <b> Pre Condition </b>
  492. * @n None
  493. *
  494. * <b> Post Condition </b>
  495. * @n None
  496. *
  497. * @b Reads
  498. * @n CGEM_L2EDSTAT_BITPOS
  499. *
  500. * @b Example
  501. * @verbatim
  502. Uint8 bitPos;
  503. // Get the L2 EDC Bit Position
  504. CSL_CGEM_getL2EDCBitPosition(&bitPos);
  505. @endverbatim
  506. * =============================================================================
  507. */
  508. static inline void CSL_CGEM_getL2EDCBitPosition (Uint8* bitPos)
  509. {
  510. *bitPos = CSL_FEXT(hCGEM->L2EDSTAT, CGEM_L2EDSTAT_BITPOS);
  511. }
  512. /** ============================================================================
  513. * @n@b CSL_CGEM_clearL2EDCErrorStatus
  514. *
  515. * @b Description
  516. * @n This function clears the error status associated with the L2 EDC.
  517. *
  518. * @b Arguments
  519. @verbatim
  520. derr - DERR field to be cleared.
  521. perr - Parity Check Error field to be cleared.
  522. dmaerr - DMA Error to be cleared.
  523. verr - Victim Error to be cleared.
  524. @endverbatim
  525. *
  526. * <b> Return Value </b>
  527. * @n None
  528. *
  529. * <b> Pre Condition </b>
  530. * @n None
  531. *
  532. * <b> Post Condition </b>
  533. * @n None
  534. *
  535. * @b Writes
  536. * @n CGEM_L2EDCMD_DCLR, CGEM_L2EDCMD_PCLR, CGEM_L2EDCMD_DMACLR,
  537. * @n CGEM_L2EDCMD_VCLR
  538. *
  539. * @b Affects
  540. * @n CGEM_L2EDSTAT_DERR=0, CGEM_L2EDSTAT_PERR=0, CGEM_L2EDSTAT_DMAERR=0,
  541. * @n CGEM_L2EDSTAT_VERR=0, CGEM_L2EDSTAT_NERR=0
  542. *
  543. * @b Example
  544. * @verbatim
  545. Uint8 derr;
  546. Uint8 perr;
  547. Uint8 dmaerr;
  548. Uint8 verr;
  549. Uint8 nerr;
  550. // Get the L2 EDC Error Status
  551. CSL_CGEM_getL2EDCErrorStatus(&derr, &perr, &dmaerr, &verr, &nerr);
  552. ...
  553. // Clear the L2 EDC Error Status
  554. CSL_CGEM_clearL2EDCErrorStatus(derr, perr, dmaerr, verr);
  555. ...
  556. @endverbatim
  557. * =============================================================================
  558. */
  559. static inline void CSL_CGEM_clearL2EDCErrorStatus
  560. (
  561. Uint8 derr,
  562. Uint8 perr,
  563. Uint8 dmaerr,
  564. Uint8 verr
  565. )
  566. {
  567. Uint32 value = 0;
  568. /* We dont want to touch the SUSP, DIS or EN bits in the L2EDCMD register */
  569. CSL_FINS(value, CGEM_L2EDCMD_DCLR, derr);
  570. CSL_FINS(value, CGEM_L2EDCMD_PCLR, perr);
  571. CSL_FINS(value, CGEM_L2EDCMD_DMACLR, dmaerr);
  572. CSL_FINS(value, CGEM_L2EDCMD_VCLR, verr);
  573. /* Since we are configuring the SUSP, DIS or EN bits i.e. they are set to 0. The
  574. * write here to the register should not have any affect on the ED State. */
  575. hCGEM->L2EDCMD = value;
  576. }
  577. /** ============================================================================
  578. * @n@b CSL_CGEM_enableL2EDC
  579. *
  580. * @b Description
  581. * @n This function enables the L2 EDC
  582. *
  583. * @b Arguments
  584. @verbatim
  585. None
  586. @endverbatim
  587. *
  588. * <b> Return Value </b>
  589. * @n None
  590. *
  591. * <b> Pre Condition </b>
  592. * @n None
  593. *
  594. * <b> Post Condition </b>
  595. * @n None
  596. *
  597. * @b Writes
  598. * @n CGEM_L2EDCMD_EN=1
  599. *
  600. * @b Affects
  601. * @n CGEM_L2EDSTAT_EN=1
  602. *
  603. * @b Example
  604. * @verbatim
  605. // Enable L2 EDC
  606. CSL_CGEM_enableL2EDC();
  607. @endverbatim
  608. * =============================================================================
  609. */
  610. static inline void CSL_CGEM_enableL2EDC(void)
  611. {
  612. hCGEM->L2EDCMD = CSL_FMK(CGEM_L2EDCMD_EN, 1);
  613. }
  614. /** ============================================================================
  615. * @n@b CSL_CGEM_disableL2EDC
  616. *
  617. * @b Description
  618. * @n This function disables the L2 EDC
  619. *
  620. * @b Arguments
  621. @verbatim
  622. None
  623. @endverbatim
  624. *
  625. * <b> Return Value </b>
  626. * @n None
  627. *
  628. * <b> Pre Condition </b>
  629. * @n None
  630. *
  631. * <b> Post Condition </b>
  632. * @n None
  633. *
  634. * @b Writes
  635. * @n CGEM_L2EDCMD_DIS=1
  636. *
  637. * @b Affects
  638. * @n CGEM_L2EDSTAT_DIS=1
  639. *
  640. * @b Example
  641. * @verbatim
  642. // Disable L2 EDC
  643. CSL_CGEM_disableL2EDC();
  644. @endverbatim
  645. * =============================================================================
  646. */
  647. static inline void CSL_CGEM_disableL2EDC(void)
  648. {
  649. hCGEM->L2EDCMD = CSL_FMK (CGEM_L2EDCMD_DIS, 1);
  650. }
  651. /** ============================================================================
  652. * @n@b CSL_CGEM_suspendL2EDC
  653. *
  654. * @b Description
  655. * @n This function suspends the L2 EDC
  656. *
  657. * @b Arguments
  658. @verbatim
  659. None
  660. @endverbatim
  661. *
  662. * <b> Return Value </b>
  663. * @n None
  664. *
  665. * <b> Pre Condition </b>
  666. * @n None
  667. *
  668. * <b> Post Condition </b>
  669. * @n None
  670. *
  671. * @b Writes
  672. * @n CGEM_L2EDCMD_SUSP=1
  673. *
  674. * @b Affects
  675. * @n CGEM_L2EDSTAT_SUSP=1
  676. *
  677. * @b Example
  678. * @verbatim
  679. // Suspend L2 EDC
  680. CSL_CGEM_suspendL2EDC();
  681. @endverbatim
  682. * =============================================================================
  683. */
  684. static inline void CSL_CGEM_suspendL2EDC(void)
  685. {
  686. hCGEM->L2EDCMD = CSL_FMK (CGEM_L2EDCMD_SUSP, 1);
  687. }
  688. /** ============================================================================
  689. * @n@b CSL_CGEM_getL2EDCErrorInfo
  690. *
  691. * @b Description
  692. * @n This function gets the L2 EDC Error Information
  693. *
  694. * @b Arguments
  695. @verbatim
  696. errAddr - Error Address populated by this API
  697. l2way - The way in the cache which caused the error.
  698. ram - Flag which indicates if the error was detected in CACHE or RAM
  699. @endverbatim
  700. *
  701. * <b> Return Value </b>
  702. * @n None
  703. *
  704. * <b> Pre Condition </b>
  705. * @n None
  706. *
  707. * <b> Post Condition </b>
  708. * @n None
  709. *
  710. * @b Reads
  711. * @n CGEM_L2EDADDR_ADDR,CGEM_L2EDADDR_WAY,CGEM_L2EDADDR_RAM
  712. *
  713. * @b Example
  714. * @verbatim
  715. Uint32 errAddr;
  716. Uint8 l2way;
  717. Uint8 ram;
  718. // Get the L2 EDC Error Information.
  719. CSL_CGEM_getL2EDCErrorInfo(&errAddr, &l2way, &ram);
  720. @endverbatim
  721. * =============================================================================
  722. */
  723. static inline void CSL_CGEM_getL2EDCErrorInfo(Uint32* errAddr, Uint8* l2way, Uint8* ram)
  724. {
  725. Uint32 value = hCGEM->L2EDADDR;
  726. *errAddr = CSL_FEXT(value, CGEM_L2EDADDR_ADDR);
  727. *l2way = CSL_FEXT(value, CGEM_L2EDADDR_WAY);
  728. *ram = CSL_FEXT(value, CGEM_L2EDADDR_RAM);
  729. }
  730. /** ============================================================================
  731. * @n@b CSL_CGEM_getL2EDCCounters
  732. *
  733. * @b Description
  734. * @n This function gets the L2 EDC Error event counters
  735. *
  736. * @b Arguments
  737. @verbatim
  738. correctParityCnt - Correctable Parity Error Counters
  739. nonCorrectParityCnt - Non-Correctable Parity Error Counters
  740. @endverbatim
  741. *
  742. * <b> Return Value </b>
  743. * @n None
  744. *
  745. * <b> Pre Condition </b>
  746. * @n None
  747. *
  748. * <b> Post Condition </b>
  749. * @n None
  750. *
  751. * @b Reads
  752. * @n CGEM_L2EDADDR_ADDR,CGEM_L2EDADDR_WAY,CGEM_L2EDADDR_RAM
  753. *
  754. * @b Example
  755. * @verbatim
  756. Uint8 correctParityCnt;
  757. Uint8 nonCorrectParityCnt;
  758. // Get the L2 EDC Error event counters.
  759. CSL_CGEM_getL2EDCCounters(&correctParityCnt, &nonCorrectParityCnt);
  760. @endverbatim
  761. * =============================================================================
  762. */
  763. static inline void CSL_CGEM_getL2EDCCounters(Uint8* correctParityCnt, Uint8* nonCorrectParityCnt)
  764. {
  765. *correctParityCnt = CSL_FEXT(hCGEM->L2EDCPEC, CGEM_L2EDCPEC_CNT);
  766. *nonCorrectParityCnt = CSL_FEXT(hCGEM->L2EDCNEC, CGEM_L2EDCNEC_CNT);
  767. }
  768. /** ============================================================================
  769. * @n@b CSL_CGEM_getMDMAErrorStatus
  770. *
  771. * @b Description
  772. * @n This function gets the MDMA Error Status
  773. *
  774. * @b Arguments
  775. @verbatim
  776. stat - Transaction Status populated by this API
  777. xid - Transaction ID populated by this API
  778. err - Error Detected populated by this API
  779. @endverbatim
  780. *
  781. * <b> Return Value </b>
  782. * @n None
  783. *
  784. * <b> Pre Condition </b>
  785. * @n None
  786. *
  787. * <b> Post Condition </b>
  788. * @n None
  789. *
  790. * @b Reads
  791. * @n CGEM_MDMAERR_STAT, CGEM_MDMAERR_XID, CGEM_MDMAERR_ERR
  792. *
  793. * @b Example
  794. * @verbatim
  795. Uint8 stat;
  796. Uint8 xid;
  797. Uint8 err;
  798. // Get the MDMA Error Status
  799. CSL_CGEM_getMDMAErrorStatus(&stat, &xid, &err);
  800. @endverbatim
  801. * =============================================================================
  802. */
  803. static inline void CSL_CGEM_getMDMAErrorStatus(Uint8* stat, Uint8* xid, Uint8* err)
  804. {
  805. Uint32 value = hCGEM->MDMAERR;
  806. *stat = CSL_FEXT(value, CGEM_MDMAERR_STAT);
  807. *xid = CSL_FEXT(value, CGEM_MDMAERR_XID);
  808. *err = CSL_FEXT(value, CGEM_MDMAERR_ERR);
  809. }
  810. /** ============================================================================
  811. * @n@b CSL_CGEM_clearMDMAError
  812. *
  813. * @b Description
  814. * @n This function clears the MDMA Error Status
  815. *
  816. * @b Arguments
  817. @verbatim
  818. None
  819. @endverbatim
  820. *
  821. * <b> Return Value </b>
  822. * @n None
  823. *
  824. * <b> Pre Condition </b>
  825. * @n None
  826. *
  827. * <b> Post Condition </b>
  828. * @n None
  829. *
  830. * @b Writes
  831. * @n CGEM_MDMAERRCLR_CLR=1
  832. *
  833. * @b Affects
  834. * @n CGEM_MDMAERR_STAT=0, CGEM_MDMAERR_XID=0, CGEM_MDMAERR_ERR=0
  835. *
  836. * @b Example
  837. * @verbatim
  838. Uint8 stat;
  839. Uint8 xid;
  840. Uint8 err;
  841. // Get the MDMA Error Status
  842. CSL_CGEM_getMDMAErrorStatus(&stat, &xid, &err);
  843. ...
  844. // Clear the MDMA Error Status
  845. CSL_CGEM_clearMDMAError();
  846. @endverbatim
  847. * =============================================================================
  848. */
  849. static inline void CSL_CGEM_clearMDMAError(void)
  850. {
  851. hCGEM->MDMAERRCLR = CSL_FMK(CGEM_MDMAERRCLR_CLR, 1);
  852. }
  853. /** ============================================================================
  854. * @n@b CSL_CGEM_enableEDCDMCExternal
  855. *
  856. * @b Description
  857. * @n This function is used to enable the EDC on DMC reads from an external
  858. * address(Hits L2 cache) if L2EDCMD is enabled.
  859. *
  860. * @b Arguments
  861. @verbatim
  862. None
  863. @endverbatim
  864. *
  865. * <b> Return Value </b>
  866. * @n None
  867. *
  868. * <b> Pre Condition </b>
  869. * @n None
  870. *
  871. * <b> Post Condition </b>
  872. * @n None
  873. *
  874. * @b Writes
  875. * @n CGEM_L2EDCEN_DL2CEN=1
  876. *
  877. * @b Example
  878. * @verbatim
  879. CSL_CGEM_enableEDCDMCExternal();
  880. @endverbatim
  881. * =============================================================================
  882. */
  883. static inline void CSL_CGEM_enableEDCDMCExternal(void)
  884. {
  885. hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_DL2CEN, 1);
  886. }
  887. /** ============================================================================
  888. * @n@b CSL_CGEM_disableEDCDMCExternal
  889. *
  890. * @b Description
  891. * @n This function is used to disable the EDC on DMC reads from an external
  892. * address(Hits L2 cache) if L2EDCMD is enabled.
  893. *
  894. * @b Arguments
  895. @verbatim
  896. None
  897. @endverbatim
  898. *
  899. * <b> Return Value </b>
  900. * @n None
  901. *
  902. * <b> Pre Condition </b>
  903. * @n None
  904. *
  905. * <b> Post Condition </b>
  906. * @n None
  907. *
  908. * @b Writes
  909. * @n CGEM_L2EDCEN_DL2CEN=0
  910. *
  911. * @b Example
  912. * @verbatim
  913. CSL_CGEM_disableEDCDMCExternal();
  914. @endverbatim
  915. * =============================================================================
  916. */
  917. static inline void CSL_CGEM_disableEDCDMCExternal(void)
  918. {
  919. hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_DL2CEN, 0);
  920. }
  921. /** ============================================================================
  922. * @n@b CSL_CGEM_enableEDCPMCExternal
  923. *
  924. * @b Description
  925. * @n This function is used to enable the EDC on PMC reads from an external
  926. * address(Hits L2 cache) if L2EDCMD is enabled.
  927. *
  928. * @b Arguments
  929. @verbatim
  930. None
  931. @endverbatim
  932. *
  933. * <b> Return Value </b>
  934. * @n None
  935. *
  936. * <b> Pre Condition </b>
  937. * @n None
  938. *
  939. * <b> Post Condition </b>
  940. * @n None
  941. *
  942. * @b Writes
  943. * @n CGEM_L2EDCEN_PL2CEN=1
  944. *
  945. * @b Example
  946. * @verbatim
  947. CSL_CGEM_enableEDCPMCExternal();
  948. @endverbatim
  949. * =============================================================================
  950. */
  951. static inline void CSL_CGEM_enableEDCPMCExternal(void)
  952. {
  953. hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_PL2CEN, 1);
  954. }
  955. /** ============================================================================
  956. * @n@b CSL_CGEM_disableEDCPMCExternal
  957. *
  958. * @b Description
  959. * @n This function is used to disable the EDC on PMC reads from an external
  960. * address(Hits L2 cache) if L2EDCMD is enabled.
  961. *
  962. * @b Arguments
  963. @verbatim
  964. None
  965. @endverbatim
  966. *
  967. * <b> Return Value </b>
  968. * @n None
  969. *
  970. * <b> Pre Condition </b>
  971. * @n None
  972. *
  973. * <b> Post Condition </b>
  974. * @n None
  975. *
  976. * @b Writes
  977. * @n CGEM_L2EDCEN_PL2CEN=0
  978. *
  979. * @b Example
  980. * @verbatim
  981. CSL_CGEM_disableEDCPMCExternal();
  982. @endverbatim
  983. * =============================================================================
  984. */
  985. static inline void CSL_CGEM_disableEDCPMCExternal(void)
  986. {
  987. hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_PL2CEN, 0);
  988. }
  989. /** ============================================================================
  990. * @n@b CSL_CGEM_enableEDCDMCL2SRAM
  991. *
  992. * @b Description
  993. * @n This function is used to enable the EDC on DMC reads from a L2SRAM.
  994. *
  995. * @b Arguments
  996. @verbatim
  997. None
  998. @endverbatim
  999. *
  1000. * <b> Return Value </b>
  1001. * @n None
  1002. *
  1003. * <b> Pre Condition </b>
  1004. * @n None
  1005. *
  1006. * <b> Post Condition </b>
  1007. * @n None
  1008. *
  1009. * @b Writes
  1010. * @n CGEM_L2EDCEN_DL2SEN=1
  1011. *
  1012. * @b Example
  1013. * @verbatim
  1014. CSL_CGEM_enableEDCDMCL2SRAM();
  1015. @endverbatim
  1016. * =============================================================================
  1017. */
  1018. static inline void CSL_CGEM_enableEDCDMCL2SRAM(void)
  1019. {
  1020. hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_DL2SEN, 1);
  1021. }
  1022. /** ============================================================================
  1023. * @n@b CSL_CGEM_disableEDCDMCL2SRAM
  1024. *
  1025. * @b Description
  1026. * @n This function is used to disable the EDC on DMC reads from a L2SRAM.
  1027. *
  1028. * @b Arguments
  1029. @verbatim
  1030. None
  1031. @endverbatim
  1032. *
  1033. * <b> Return Value </b>
  1034. * @n None
  1035. *
  1036. * <b> Pre Condition </b>
  1037. * @n None
  1038. *
  1039. * <b> Post Condition </b>
  1040. * @n None
  1041. *
  1042. * @b Writes
  1043. * @n CGEM_L2EDCEN_DL2SEN=0
  1044. *
  1045. * @b Example
  1046. * @verbatim
  1047. CSL_CGEM_disableEDCDMCL2SRAM();
  1048. @endverbatim
  1049. * =============================================================================
  1050. */
  1051. static inline void CSL_CGEM_disableEDCDMCL2SRAM(void)
  1052. {
  1053. hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_DL2SEN, 0);
  1054. }
  1055. /** ============================================================================
  1056. * @n@b CSL_CGEM_enableEDCPMCL2SRAM
  1057. *
  1058. * @b Description
  1059. * @n This function is used to enable the EDC on PMC reads from a L2SRAM.
  1060. *
  1061. * @b Arguments
  1062. @verbatim
  1063. None
  1064. @endverbatim
  1065. *
  1066. * <b> Return Value </b>
  1067. * @n None
  1068. *
  1069. * <b> Pre Condition </b>
  1070. * @n None
  1071. *
  1072. * <b> Post Condition </b>
  1073. * @n None
  1074. *
  1075. * @b Writes
  1076. * @n CGEM_L2EDCEN_PL2SEN=1
  1077. *
  1078. * @b Example
  1079. * @verbatim
  1080. CSL_CGEM_enableEDCPMCL2SRAM();
  1081. @endverbatim
  1082. * =============================================================================
  1083. */
  1084. static inline void CSL_CGEM_enableEDCPMCL2SRAM(void)
  1085. {
  1086. hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_PL2SEN, 1);
  1087. }
  1088. /** ============================================================================
  1089. * @n@b CSL_CGEM_disableEDCPMCL2SRAM
  1090. *
  1091. * @b Description
  1092. * @n This function is used to disable the EDC on PMC reads from a L2SRAM.
  1093. *
  1094. * @b Arguments
  1095. @verbatim
  1096. None
  1097. @endverbatim
  1098. *
  1099. * <b> Return Value </b>
  1100. * @n None
  1101. *
  1102. * <b> Pre Condition </b>
  1103. * @n None
  1104. *
  1105. * <b> Post Condition </b>
  1106. * @n None
  1107. *
  1108. * @b Writes
  1109. * @n CGEM_L2EDCEN_PL2SEN=0
  1110. *
  1111. * @b Example
  1112. * @verbatim
  1113. CSL_CGEM_disableEDCPMCL2SRAM();
  1114. @endverbatim
  1115. * =============================================================================
  1116. */
  1117. static inline void CSL_CGEM_disableEDCPMCL2SRAM(void)
  1118. {
  1119. hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_PL2SEN, 0);
  1120. }
  1121. /** ============================================================================
  1122. * @n@b CSL_CGEM_enableEDCSDMAL2SRAM
  1123. *
  1124. * @b Description
  1125. * @n This function is used to enable the EDC on SDMA reads from L2SRAM.
  1126. *
  1127. * @b Arguments
  1128. @verbatim
  1129. None
  1130. @endverbatim
  1131. *
  1132. * <b> Return Value </b>
  1133. * @n None
  1134. *
  1135. * <b> Pre Condition </b>
  1136. * @n None
  1137. *
  1138. * <b> Post Condition </b>
  1139. * @n None
  1140. *
  1141. * @b Writes
  1142. * @n CGEM_L2EDCEN_SDMAEN=1
  1143. *
  1144. * @b Example
  1145. * @verbatim
  1146. CSL_CGEM_enableEDCSDMAL2SRAM();
  1147. @endverbatim
  1148. * =============================================================================
  1149. */
  1150. static inline void CSL_CGEM_enableEDCSDMAL2SRAM(void)
  1151. {
  1152. hCGEM->L2EDCEN = CSL_FMK(CGEM_L2EDCEN_SDMAEN, 1);
  1153. }
  1154. /** ============================================================================
  1155. * @n@b CSL_CGEM_disableEDCSDMAL2SRAM
  1156. *
  1157. * @b Description
  1158. * @n This function is used to disable the EDC on SDMA reads from L2SRAM.
  1159. *
  1160. * @b Arguments
  1161. @verbatim
  1162. None
  1163. @endverbatim
  1164. *
  1165. * <b> Return Value </b>
  1166. * @n None
  1167. *
  1168. * <b> Pre Condition </b>
  1169. * @n None
  1170. *
  1171. * <b> Post Condition </b>
  1172. * @n None
  1173. *
  1174. * @b Writes
  1175. * @n CGEM_L2EDCEN_SDMAEN=0
  1176. *
  1177. * @b Example
  1178. * @verbatim
  1179. CSL_CGEM_disableEDCSDMAL2SRAM();
  1180. @endverbatim
  1181. * =============================================================================
  1182. */
  1183. static inline void CSL_CGEM_disableEDCSDMAL2SRAM(void)
  1184. {
  1185. hCGEM->L2EDCEN = CSL_FMK (CGEM_L2EDCEN_SDMAEN, 0);
  1186. }
  1187. /** ============================================================================
  1188. * @n@b CSL_CGEM_getPMCErrorDetectionStatus
  1189. *
  1190. * @b Description
  1191. * @n This function is used to get the PMC error detection status
  1192. *
  1193. * @b Arguments
  1194. @verbatim
  1195. dmaErr - DMA Error Status populated by this API
  1196. perr - PERR Status populated by this API
  1197. @endverbatim
  1198. *
  1199. * <b> Return Value </b>
  1200. * @n None
  1201. *
  1202. * <b> Pre Condition </b>
  1203. * @n None
  1204. *
  1205. * <b> Post Condition </b>
  1206. * @n None
  1207. *
  1208. * @b Reads
  1209. * @n CGEM_L1PEDSTAT_DMAERR, CGEM_L1PEDSTAT_PERR
  1210. *
  1211. * @b Example
  1212. * @verbatim
  1213. Uint8 dmaErr;
  1214. Uint8 perr
  1215. CSL_CGEM_getPMCErrorDetectionStatus(&dmaErr, &perr);
  1216. @endverbatim
  1217. * =============================================================================
  1218. */
  1219. static inline void CSL_CGEM_getPMCErrorDetectionStatus(Uint8* dmaErr, Uint8* perr)
  1220. {
  1221. Uint32 value = hCGEM->L1PEDSTAT;
  1222. *dmaErr = CSL_FEXT (value, CGEM_L1PEDSTAT_DMAERR);
  1223. *perr = CSL_FEXT (value, CGEM_L1PEDSTAT_PERR);
  1224. }
  1225. /** ============================================================================
  1226. * @n@b CSL_CGEM_isPMCErrorDetectionEnabled
  1227. *
  1228. * @b Description
  1229. * @n This function is used to check if the PMC Error Detection is enabled or
  1230. * not?
  1231. *
  1232. * @b Arguments
  1233. @verbatim
  1234. None
  1235. @endverbatim
  1236. *
  1237. * <b> Return Value </b>
  1238. * @n TRUE - PMC Error Detection is enabled
  1239. * @n FALSE - PMC Error Detection is disabled
  1240. *
  1241. * <b> Pre Condition </b>
  1242. * @n None
  1243. *
  1244. * <b> Post Condition </b>
  1245. * @n None
  1246. *
  1247. * @b Reads
  1248. * @n CGEM_L1PEDSTAT_EN
  1249. *
  1250. * @b Example
  1251. * @verbatim
  1252. if (CSL_CGEM_isPMCErrorDetectionEnabled() == TRUE)
  1253. {
  1254. // PMC Error Detection is enabled
  1255. }
  1256. else
  1257. {
  1258. // PMC Error Detection is disabled
  1259. }
  1260. @endverbatim
  1261. * =============================================================================
  1262. */
  1263. static inline Bool CSL_CGEM_isPMCErrorDetectionEnabled(void)
  1264. {
  1265. return CSL_FEXT(hCGEM->L1PEDSTAT, CGEM_L1PEDSTAT_EN);
  1266. }
  1267. /** ============================================================================
  1268. * @n@b CSL_CGEM_isPMCErrorDetectionSuspended
  1269. *
  1270. * @b Description
  1271. * @n This function is used to check if the PMC Error Detection is suspended or
  1272. * not?
  1273. *
  1274. * @b Arguments
  1275. @verbatim
  1276. None
  1277. @endverbatim
  1278. *
  1279. * <b> Return Value </b>
  1280. * @n TRUE - PMC Error Detection is suspended
  1281. * @n FALSE - PMC Error Detection is not suspended
  1282. *
  1283. * <b> Pre Condition </b>
  1284. * @n None
  1285. *
  1286. * <b> Post Condition </b>
  1287. * @n None
  1288. *
  1289. * @b Reads
  1290. * @n CGEM_L1PEDSTAT_SUSP
  1291. *
  1292. * @b Example
  1293. * @verbatim
  1294. if (CSL_CGEM_isPMCErrorDetectionSuspended() == TRUE)
  1295. {
  1296. // PMC Error Detection is suspended
  1297. }
  1298. else
  1299. {
  1300. // PMC Error Detection is not suspended
  1301. }
  1302. @endverbatim
  1303. * =============================================================================
  1304. */
  1305. static inline Bool CSL_CGEM_isPMCErrorDetectionSuspended(void)
  1306. {
  1307. return CSL_FEXT(hCGEM->L1PEDSTAT, CGEM_L1PEDSTAT_SUSP);
  1308. }
  1309. /** ============================================================================
  1310. * @n@b CSL_CGEM_clearPMCErrorDetectionStatus
  1311. *
  1312. * @b Description
  1313. * @n This function is used to clear the PMC error detection status
  1314. *
  1315. * @b Arguments
  1316. @verbatim
  1317. dmaErr - DMA Error status to be cleared
  1318. perr - PERR status to be cleared
  1319. @endverbatim
  1320. *
  1321. * <b> Return Value </b>
  1322. * @n None
  1323. *
  1324. * <b> Pre Condition </b>
  1325. * @n None
  1326. *
  1327. * <b> Post Condition </b>
  1328. * @n None
  1329. *
  1330. * @b Writes
  1331. * @n CGEM_L1PEDCMD_DMACLR, CGEM_L1PEDCMD_PCLR
  1332. *
  1333. * @b Affects
  1334. * @n CGEM_L1PEDSTAT_DMAERR=0, CGEM_L1PEDSTAT_PERR=0
  1335. *
  1336. * @b Example
  1337. * @verbatim
  1338. Uint8 dmaErr;
  1339. Uint8 perr
  1340. // Get the PMC Error Detection status
  1341. CSL_CGEM_getPMCErrorDetectionStatus(&dmaErr, &perr);
  1342. ...
  1343. // Clear the PMC errors.
  1344. CSL_CGEM_clearPMCErrorDetectionStatus(dmaErr, perr);
  1345. @endverbatim
  1346. * =============================================================================
  1347. */
  1348. static inline void CSL_CGEM_clearPMCErrorDetectionStatus(Uint8 dmaErr, Uint8 perr)
  1349. {
  1350. Uint32 value = 0;
  1351. /* We dont want to touch the EN, SUSP or DIS bits in the L1PEDCMD register */
  1352. CSL_FINS (value, CGEM_L1PEDCMD_DMACLR, dmaErr);
  1353. CSL_FINS (value, CGEM_L1PEDCMD_PCLR, perr);
  1354. /* Since we are writing 0 to the SUSP, DIS or EN bits we should preserve the ED
  1355. * state as indicated in the specification. */
  1356. hCGEM->L1PEDCMD = value;
  1357. }
  1358. /** ============================================================================
  1359. * @n@b CSL_CGEM_enablePMCErrorDetection
  1360. *
  1361. * @b Description
  1362. * @n This function is used to enable the PMC error detection status
  1363. *
  1364. * @b Arguments
  1365. @verbatim
  1366. None
  1367. @endverbatim
  1368. *
  1369. * <b> Return Value </b>
  1370. * @n None
  1371. *
  1372. * <b> Pre Condition </b>
  1373. * @n None
  1374. *
  1375. * <b> Post Condition </b>
  1376. * @n None
  1377. *
  1378. * @b Writes
  1379. * @n CGEM_L1PEDCMD_EN=1
  1380. *
  1381. * @b Affects
  1382. * @n CGEM_L1PEDSTAT_EN=1
  1383. *
  1384. * @b Example
  1385. * @verbatim
  1386. // Enable the PMC Error Detection
  1387. CSL_CGEM_enablePMCErrorDetection();
  1388. @endverbatim
  1389. * =============================================================================
  1390. */
  1391. static inline void CSL_CGEM_enablePMCErrorDetection(void)
  1392. {
  1393. hCGEM->L1PEDCMD = CSL_FMK (CGEM_L1PEDCMD_EN, 1);
  1394. }
  1395. /** ============================================================================
  1396. * @n@b CSL_CGEM_disablePMCErrorDetection
  1397. *
  1398. * @b Description
  1399. * @n This function is used to disable the PMC error detection status
  1400. *
  1401. * @b Arguments
  1402. @verbatim
  1403. None
  1404. @endverbatim
  1405. *
  1406. * <b> Return Value </b>
  1407. * @n None
  1408. *
  1409. * <b> Pre Condition </b>
  1410. * @n None
  1411. *
  1412. * <b> Post Condition </b>
  1413. * @n None
  1414. *
  1415. * @b Writes
  1416. * @n CGEM_L1PEDCMD_DIS=1
  1417. *
  1418. * @b Affects
  1419. * @n CGEM_L1PEDSTAT_DIS=1
  1420. *
  1421. * @b Example
  1422. * @verbatim
  1423. // Disable the PMC Error Detection
  1424. CSL_CGEM_disablePMCErrorDetection();
  1425. @endverbatim
  1426. * =============================================================================
  1427. */
  1428. static inline void CSL_CGEM_disablePMCErrorDetection(void)
  1429. {
  1430. hCGEM->L1PEDCMD = CSL_FMK (CGEM_L1PEDCMD_DIS, 1);
  1431. }
  1432. /** ============================================================================
  1433. * @n@b CSL_CGEM_suspendPMCErrorDetection
  1434. *
  1435. * @b Description
  1436. * @n This function is used to suspend the PMC error detection status
  1437. *
  1438. * @b Arguments
  1439. @verbatim
  1440. None
  1441. @endverbatim
  1442. *
  1443. * <b> Return Value </b>
  1444. * @n None
  1445. *
  1446. * <b> Pre Condition </b>
  1447. * @n None
  1448. *
  1449. * <b> Post Condition </b>
  1450. * @n None
  1451. *
  1452. * @b Writes
  1453. * @n CGEM_L1PEDCMD_SUSP=1
  1454. *
  1455. * @b Affects
  1456. * @n CGEM_L1PEDSTAT_SUSP=1
  1457. *
  1458. * @b Example
  1459. * @verbatim
  1460. // Suspend the PMC Error Detection
  1461. CSL_CGEM_suspendPMCErrorDetection();
  1462. @endverbatim
  1463. * =============================================================================
  1464. */
  1465. static inline void CSL_CGEM_suspendPMCErrorDetection(void)
  1466. {
  1467. hCGEM->L1PEDCMD = CSL_FMK (CGEM_L1PEDCMD_SUSP, 1);
  1468. }
  1469. /** ============================================================================
  1470. * @n@b CSL_CGEM_getPMCErrorInfo
  1471. *
  1472. * @b Description
  1473. * @n This function is used to get the PMC Error Detection information
  1474. *
  1475. * @b Arguments
  1476. @verbatim
  1477. errAddress - Error Address which is populated by this API
  1478. errRAM - Error RAM status which is populated by this API
  1479. @endverbatim
  1480. *
  1481. * <b> Return Value </b>
  1482. * @n None
  1483. *
  1484. * <b> Pre Condition </b>
  1485. * @n None
  1486. *
  1487. * <b> Post Condition </b>
  1488. * @n None
  1489. *
  1490. * @b Reads
  1491. * @n CGEM_L1PEDADDR_ADDR, CGEM_L1PEDADDR_RAM
  1492. *
  1493. * @b Example
  1494. * @verbatim
  1495. Uint32 errAddress;
  1496. Uint8 errRAM;
  1497. // Get the PMC Error Detection Information
  1498. CSL_CGEM_getPMCErrorInfo(&errAddress, &errRAM);
  1499. @endverbatim
  1500. * =============================================================================
  1501. */
  1502. static inline void CSL_CGEM_getPMCErrorInfo(Uint32* errAddress, Uint8* errRAM)
  1503. {
  1504. Uint32 value = hCGEM->L1PEDADDR;
  1505. *errAddress = CSL_FEXT (value, CGEM_L1PEDADDR_ADDR);
  1506. *errRAM = CSL_FEXT (value, CGEM_L1PEDADDR_RAM);
  1507. }
  1508. /**
  1509. @}
  1510. */
  1511. #ifdef __cplusplus
  1512. }
  1513. #endif
  1514. #endif /* CSL_CGEMAUX_H_ */