csl_msmcAux.h 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524
  1. /**
  2. * @file csl_msmcAux.h
  3. *
  4. * @brief
  5. * This is the MSMC Auxilary Header File which exposes the various
  6. * CSL Functional Layer API's to configure the MSMC Module.
  7. *
  8. * \par
  9. * ============================================================================
  10. * @n (C) Copyright 2008, 2009, Texas Instruments, Inc.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. *
  16. * Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. *
  19. * Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in the
  21. * documentation and/or other materials provided with the
  22. * distribution.
  23. *
  24. * Neither the name of Texas Instruments Incorporated nor the names of
  25. * its contributors may be used to endorse or promote products derived
  26. * from this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. */
  41. #ifndef CSL_MSMCAUX_H_
  42. #define CSL_MSMCAUX_H_
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. #include <ti/csl/csl_msmc.h>
  47. /** @addtogroup CSL_MSMC_FUNCTION
  48. @{ */
  49. /** ============================================================================
  50. * @n@b CSL_MSMC_getPID
  51. *
  52. * @b Description
  53. * @n This function gets the peripheral ID register for the MSMC IP.
  54. *
  55. * @b Arguments
  56. * @n None
  57. *
  58. * <b> Return Value </b>
  59. * @n None
  60. *
  61. * <b> Pre Condition </b>
  62. * @n None
  63. *
  64. * <b> Post Condition </b>
  65. * @n None
  66. *
  67. * @b Reads
  68. * @n MSMC_PID
  69. *
  70. * @b Example
  71. * @verbatim
  72. Uint32 pid;
  73. // Get the Mode change progress flag
  74. mcpFlag = CSL_MSMC_getModeChangeProgress ();
  75. @endverbatim
  76. * =============================================================================
  77. */
  78. static inline Uint32 CSL_MSMC_getPID (void)
  79. {
  80. return hMsmc->PID;
  81. }
  82. /** ============================================================================
  83. * @n@b CSL_MSMC_getModeChangeProgress
  84. *
  85. * @b Description
  86. * @n This function gets the mode change progress flag
  87. *
  88. * @b Arguments
  89. * @n None
  90. *
  91. * <b> Return Value </b>
  92. * @n None
  93. *
  94. * <b> Pre Condition </b>
  95. * @n None
  96. *
  97. * <b> Post Condition </b>
  98. * @n None
  99. *
  100. * @b Reads
  101. * @n MSMC_SMCC_MCP
  102. *
  103. * @b Example
  104. * @verbatim
  105. Uint8 mcpFlag;
  106. // Get the Mode change progress flag
  107. mcpFlag = CSL_MSMC_getModeChangeProgress ();
  108. @endverbatim
  109. * =============================================================================
  110. */
  111. static inline Uint8 CSL_MSMC_getModeChangeProgress (void)
  112. {
  113. return CSL_FEXT (hMsmc->SMCC, MSMC_SMCC_MCP);
  114. }
  115. /** ============================================================================
  116. * @n@b CSL_MSMC_getSoftErrorAddress
  117. *
  118. * @b Description
  119. * @n When ECM bit is 1 in SMCFG register this function gets the corrupted
  120. * location error address.
  121. *
  122. * @b Arguments
  123. * @n None
  124. *
  125. * <b> Return Value </b>
  126. * Sof Error Address.
  127. *
  128. * <b> Pre Condition </b>
  129. * @n None
  130. *
  131. * <b> Post Condition </b>
  132. * @n None
  133. *
  134. * @b Reads
  135. * @n MSMC_SMCERRAR_SEADDR
  136. *
  137. * @b Example
  138. * @verbatim
  139. Uint32 errAddr;
  140. errAddr = CSL_MSMC_getSoftErrorAddress ();
  141. @endverbatim
  142. * =============================================================================
  143. */
  144. static inline Uint32 CSL_MSMC_getSoftErrorAddress (void)
  145. {
  146. return CSL_FEXT (hMsmc->SMCERRAR, MSMC_SMCERRAR_SEADDR);
  147. }
  148. /** ============================================================================
  149. * @n@b CSL_MSMC_getSoftErrorAddressExtension
  150. *
  151. * @b Description
  152. * @n This function gets the address extension used for the faulting address.
  153. *
  154. * @b Arguments
  155. * @n None
  156. *
  157. * <b> Return Value </b>
  158. * Soft Address Extension.
  159. *
  160. * <b> Pre Condition </b>
  161. * @n None
  162. *
  163. * <b> Post Condition </b>
  164. * @n None
  165. *
  166. * @b Reads
  167. * @n MSMC_SMCERRXR_ESYN, MSMC_SMCERRXR_SEEADDR, MSMC_SMCERRXR_SEPID,MSMC_SMCERRXR_SER
  168. *
  169. * @b Example
  170. * @verbatim
  171. Uint8 esyn;
  172. Uint8 errAddrExt;
  173. Uint8 sepId;
  174. Uint8 ser;
  175. CSL_MSMC_getSoftErrorAddressExtension (&esyn, &errAddrExt, &sepId, &ser);
  176. @endverbatim
  177. * =============================================================================
  178. */
  179. static inline void CSL_MSMC_getSoftErrorAddressExtension
  180. (
  181. Uint8* esyn,
  182. Uint8* address,
  183. Uint8* sepId,
  184. Uint8* ser
  185. )
  186. {
  187. Uint32 value = hMsmc->SMCERRXR;
  188. *esyn = CSL_FEXT (value, MSMC_SMCERRXR_ESYN);
  189. *address = CSL_FEXT (value, MSMC_SMCERRXR_SEEADDR);
  190. *sepId = CSL_FEXT (value, MSMC_SMCERRXR_SEPID);
  191. *ser = CSL_FEXT (value, MSMC_SMCERRXR_SER);
  192. }
  193. /** ============================================================================
  194. * @n@b CSL_MSMC_setCounterBankRefreshRead
  195. *
  196. * @b Description
  197. * @n This function programs REFDEL counter to the number of MSMC clock cycles
  198. * between each bank refresh read access.
  199. *
  200. * @b Arguments
  201. @verbatim
  202. refdel number of MSMC clock cycles
  203. @endverbatim
  204. *
  205. * <b> Return Value </b>
  206. * @n None
  207. *
  208. * <b> Pre Condition </b>
  209. * @n None
  210. *
  211. * <b> Post Condition </b>
  212. * @n None
  213. *
  214. * @b Writes
  215. * @n MSMC_SMEDCC_REFDEL
  216. *
  217. * @b Example
  218. * @verbatim
  219. CSL_MSMC_setCounterBankRefreshRead (1);
  220. @endverbatim
  221. * =============================================================================
  222. */
  223. static inline void CSL_MSMC_setCounterBankRefreshRead (Uint32 refdel)
  224. {
  225. CSL_FINS (hMsmc->SMEDCC, MSMC_SMEDCC_REFDEL, refdel);
  226. }
  227. /** ============================================================================
  228. * @n@b CSL_MSMC_getCounterBankRefreshRead
  229. *
  230. * @b Description
  231. * @n This function gets REFDEL counter to the number of MSMC clock cycles
  232. * between each bank refresh read access.
  233. *
  234. * @b Arguments
  235. * @n None
  236. *
  237. * <b> Return Value </b>
  238. * REFDEL counter
  239. *
  240. * <b> Pre Condition </b>
  241. * @n None
  242. *
  243. * <b> Post Condition </b>
  244. * @n None
  245. *
  246. * @b Reads
  247. * @n MSMC_SMEDCC_REFDEL
  248. *
  249. * @b Example
  250. * @verbatim
  251. Uint32 refdel;
  252. refdel = CSL_MSMC_getCounterBankRefreshRead ();
  253. @endverbatim
  254. * =============================================================================
  255. */
  256. static inline Uint32 CSL_MSMC_getCounterBankRefreshRead (void)
  257. {
  258. return CSL_FEXT (hMsmc->SMEDCC, MSMC_SMEDCC_REFDEL);
  259. }
  260. /** ============================================================================
  261. * @n@b CSL_MSMC_getParityRAM
  262. *
  263. * @b Description
  264. * @n This function programs gets the parity RAM status
  265. *
  266. * @b Arguments
  267. @verbatim
  268. None
  269. @endverbatim
  270. *
  271. * <b> Return Value </b>
  272. * @n Parity RAM
  273. *
  274. * <b> Pre Condition </b>
  275. * @n None
  276. *
  277. * <b> Post Condition </b>
  278. * @n None
  279. *
  280. * @b Reads
  281. * @n MSMC_SMEDCC_PRR
  282. *
  283. * @b Example
  284. * @verbatim
  285. Uint8 parityRAM;
  286. parityRAM = CSL_MSMC_getParityRAM ();
  287. @endverbatim
  288. * =============================================================================
  289. */
  290. static inline Uint8 CSL_MSMC_getParityRAM (void)
  291. {
  292. return CSL_FEXT (hMsmc->SMEDCC, MSMC_SMEDCC_PRR);
  293. }
  294. /** ============================================================================
  295. * @n@b CSL_MSMC_getCSE
  296. *
  297. * @b Description
  298. * @n This function programs reads the CSE bit to determine if there is a parity
  299. * mismatch
  300. *
  301. * @b Arguments
  302. @verbatim
  303. None
  304. @endverbatim
  305. *
  306. * <b> Return Value </b>
  307. * @n CSE Status
  308. *
  309. * <b> Pre Condition </b>
  310. * @n None
  311. *
  312. * <b> Post Condition </b>
  313. * @n None
  314. *
  315. * @b Reads
  316. * @n MSMC_SMEDCC_CSE
  317. *
  318. * @b Example
  319. * @verbatim
  320. Uint8 cse;
  321. cse = CSL_MSMC_getCSE ();
  322. @endverbatim
  323. * =============================================================================
  324. */
  325. static inline Uint8 CSL_MSMC_getCSE (void)
  326. {
  327. return CSL_FEXT (hMsmc->SMEDCC, MSMC_SMEDCC_CSE);
  328. }
  329. /** ============================================================================
  330. * @n@b CSL_MSMC_setCSE
  331. *
  332. * @b Description
  333. * @n This function programs sets the CSE bit
  334. *
  335. * @b Arguments
  336. @verbatim
  337. None
  338. @endverbatim
  339. *
  340. * <b> Return Value </b>
  341. * @n None
  342. *
  343. * <b> Pre Condition </b>
  344. * @n None
  345. *
  346. * <b> Post Condition </b>
  347. * @n None
  348. *
  349. * @b Writes
  350. * @n MSMC_SMEDCC_CSE
  351. *
  352. * @b Example
  353. * @verbatim
  354. // Clear the CSE Bit.
  355. CSL_MSMC_setCSE (0);
  356. @endverbatim
  357. * =============================================================================
  358. */
  359. static inline void CSL_MSMC_setCSE (Uint8 cse)
  360. {
  361. CSL_FINS(hMsmc->SMEDCC, MSMC_SMEDCC_CSE, cse);
  362. }
  363. /** ============================================================================
  364. * @n@b CSL_MSMC_getECM
  365. *
  366. * @b Description
  367. * @n This function programs gets the status of the error correcting mode
  368. *
  369. * @b Arguments
  370. @verbatim
  371. None
  372. @endverbatim
  373. *
  374. * <b> Return Value </b>
  375. * @n ECM Mode
  376. *
  377. * <b> Pre Condition </b>
  378. * @n None
  379. *
  380. * <b> Post Condition </b>
  381. * @n None
  382. *
  383. * @b Reads
  384. * @n MSMC_SMEDCC_ECM
  385. *
  386. * @b Example
  387. * @verbatim
  388. Uint8 ecm;
  389. ecm = CSL_MSMC_getECM ();
  390. @endverbatim
  391. * =============================================================================
  392. */
  393. static inline Uint8 CSL_MSMC_getECM (void)
  394. {
  395. return CSL_FEXT (hMsmc->SMEDCC, MSMC_SMEDCC_ECM);
  396. }
  397. /** ============================================================================
  398. * @n@b CSL_MSMC_setECM
  399. *
  400. * @b Description
  401. * @n This function programs sets the error correcting mode.
  402. *
  403. * @b Arguments
  404. @verbatim
  405. None
  406. @endverbatim
  407. *
  408. * <b> Return Value </b>
  409. * @n None
  410. *
  411. * <b> Pre Condition </b>
  412. * @n None
  413. *
  414. * <b> Post Condition </b>
  415. * @n None
  416. *
  417. * @b Writes
  418. * @n MSMC_SMEDCC_ECM
  419. *
  420. * @b Example
  421. * @verbatim
  422. // Set Error Correcting Mode
  423. CSL_MSMC_setECM (0);
  424. @endverbatim
  425. * =============================================================================
  426. */
  427. static inline void CSL_MSMC_setECM (Uint8 ecm)
  428. {
  429. CSL_FINS(hMsmc->SMEDCC, MSMC_SMEDCC_ECM, ecm);
  430. }
  431. /** ============================================================================
  432. * @n@b CSL_MSMC_enableScrubbingEngine
  433. *
  434. * @b Description
  435. * @n This function enables the scrubbing engine.
  436. *
  437. * @b Arguments
  438. * @n None
  439. *
  440. * <b> Return Value </b>
  441. * @n None
  442. *
  443. * <b> Pre Condition </b>
  444. * @n None
  445. *
  446. * <b> Post Condition </b>
  447. * @n Scrubbing Engine is enabled.
  448. *
  449. * @b Writes
  450. * @n MSMC_SMEDCC_SEN=0
  451. *
  452. * @b Example
  453. * @verbatim
  454. CSL_MSMC_enableScrubbingEngine ();
  455. @endverbatim
  456. * =============================================================================
  457. */
  458. static inline void CSL_MSMC_enableScrubbingEngine (void)
  459. {
  460. CSL_FINS (hMsmc->SMEDCC, MSMC_SMEDCC_SEN, 0x0);
  461. }
  462. /** ============================================================================
  463. * @n@b CSL_MSMC_disableScrubbingEngine
  464. *
  465. * @b Description
  466. * @n This function disables the scrubbing engine.
  467. *
  468. * @b Arguments
  469. * @n None
  470. *
  471. * <b> Return Value </b>
  472. * @n None
  473. *
  474. * <b> Pre Condition </b>
  475. * @n None
  476. *
  477. * <b> Post Condition </b>
  478. * @n Scrubbing Engine is disabled.
  479. *
  480. * @b Writes
  481. * @n MSMC_SMEDCC_SEN=1
  482. *
  483. * @b Example
  484. * @verbatim
  485. CSL_MSMC_disableScrubbingEngine ();
  486. @endverbatim
  487. * =============================================================================
  488. */
  489. static inline void CSL_MSMC_disableScrubbingEngine (void)
  490. {
  491. CSL_FINS (hMsmc->SMEDCC, MSMC_SMEDCC_SEN, (Uint32)1);
  492. }
  493. /** ============================================================================
  494. * @n@b CSL_MSMC_getScrubbingEngineState
  495. *
  496. * @b Description
  497. * @n This function gets the state of scrubbing engine, if it is
  498. * enabled/disabled.
  499. *
  500. * @b Arguments
  501. * @n None
  502. *
  503. * <b> Return Value </b>
  504. * @li 1 - Scrubbing Engine is enabled.
  505. * @li 0 - Scrubbing Engine is disabled.
  506. *
  507. * <b> Pre Condition </b>
  508. * @n None
  509. *
  510. * <b> Post Condition </b>
  511. * @n None
  512. *
  513. * @b Reads
  514. * @n MSMC_SMEDCC_SEN
  515. *
  516. * @b Example
  517. * @verbatim
  518. Uint32 stateSE;
  519. stateSE = CSL_MSMC_getScrubbingEngineState ();
  520. @endverbatim
  521. * =============================================================================
  522. */
  523. static inline Uint32 CSL_MSMC_getScrubbingEngineState (void)
  524. {
  525. return CSL_FEXT (hMsmc->SMEDCC, MSMC_SMEDCC_SEN);
  526. }
  527. /** ============================================================================
  528. * @n@b CSL_MSMC_getScrubErrorCorrectedAddress
  529. *
  530. * @b Description
  531. * @n This function gets address of the location whose contents have been
  532. * corrected by the scrubbing engine.
  533. *
  534. * @b Arguments
  535. * @n None
  536. *
  537. * <b> Return Value </b> Uint32
  538. *
  539. * <b> Pre Condition </b>
  540. * @n None
  541. *
  542. * <b> Post Condition </b>
  543. * @n None
  544. *
  545. * @b Reads
  546. * @n MSMC_SMCEA_SECA
  547. *
  548. * @b Example
  549. * @verbatim
  550. Uint32 correctedAddr;
  551. correctedAddr = CSL_MSMC_getScrubErrorCorrectedAddress ();
  552. @endverbatim
  553. * =============================================================================
  554. */
  555. static inline Uint32 CSL_MSMC_getScrubErrorCorrectedAddress (void)
  556. {
  557. return CSL_FEXT (hMsmc->SMCEA, MSMC_SMCEA_SECA);
  558. }
  559. /** ============================================================================
  560. * @n@b CSL_MSMC_getSyndromeValue
  561. *
  562. * @b Description
  563. * @n This function gets the syndrome value that identifies the erroneous bit
  564. * in the data which the scrubbing engine has corrected.
  565. *
  566. * @b Arguments
  567. * @n None
  568. *
  569. * <b> Return Value </b>
  570. * @n ESYN Field
  571. *
  572. * <b> Pre Condition </b>
  573. * @n None
  574. *
  575. * <b> Post Condition </b>
  576. * @n SMSECA register configured with the value zero.
  577. *
  578. * @b Reads
  579. * @n MSMC_SMCEA_ESYN
  580. *
  581. * @b Example
  582. * @verbatim
  583. Uint8 esynValue;
  584. esynValue = CSL_MSMC_getSyndromeValue ();
  585. @endverbatim
  586. * =============================================================================
  587. */
  588. static inline Uint8 CSL_MSMC_getSyndromeValue (void)
  589. {
  590. return CSL_FEXT (hMsmc->SMCEA, MSMC_SMCEA_ESYN);
  591. }
  592. /** ============================================================================
  593. * @n@b CSL_MSMC_getScrubCorrectableErrorCounter
  594. *
  595. * @b Description
  596. * @n This function gets the Scrubbing Engine Correctable Error Counter.
  597. *
  598. * @b Arguments
  599. * @n None
  600. *
  601. * <b> Return Value </b> Uint32
  602. *
  603. * <b> Pre Condition </b>
  604. * @n None
  605. *
  606. * <b> Post Condition </b>
  607. * @n None
  608. *
  609. * @b Reads
  610. * @n MSMC_SMSECC_SCEC
  611. *
  612. * @b Example
  613. * @verbatim
  614. Uint32 cCounter;
  615. cCounter = CSL_MSMC_getScrubCorrectableErrorCounter ();
  616. @endverbatim
  617. * =============================================================================
  618. */
  619. static inline Uint32 CSL_MSMC_getScrubCorrectableErrorCounter (void)
  620. {
  621. return CSL_FEXT (hMsmc->SMSECC, MSMC_SMSECC_SCEC);
  622. }
  623. /** ============================================================================
  624. * @n@b CSL_MSMC_clearScrubCorrectableErrorCounter
  625. *
  626. * @b Description
  627. * @n This function clears the Scrub Correctable Error Counter.
  628. *
  629. * @b Arguments
  630. * @n None
  631. *
  632. * <b> Return Value </b>
  633. * @n None
  634. *
  635. * <b> Pre Condition </b>
  636. * @n None
  637. *
  638. * <b> Post Condition </b>
  639. * @n SMSECC register configured with the value passed.
  640. *
  641. * @b Writes
  642. * @n MSMC_SMSECC_SCEC=0
  643. *
  644. * @b Example
  645. * @verbatim
  646. CSL_MSMC_clearScrubCorrectableErrorCounter ();
  647. @endverbatim
  648. * =============================================================================
  649. */
  650. static inline void CSL_MSMC_clearScrubCorrectableErrorCounter (void)
  651. {
  652. CSL_FINS (hMsmc->SMSECC, MSMC_SMSECC_SCEC, 0);
  653. return;
  654. }
  655. /** ============================================================================
  656. * @n@b CSL_MSMC_getScrubNonCorrectableErrorCounter
  657. *
  658. * @b Description
  659. * @n This function gets the Scrubbing Engine NonCorrectable Error Counter.
  660. *
  661. * @b Arguments
  662. * @n None
  663. *
  664. * <b> Return Value </b> Uint32
  665. *
  666. * <b> Pre Condition </b>
  667. * @n None
  668. *
  669. * <b> Post Condition </b>
  670. * @n None
  671. *
  672. * @b Reads
  673. * @n MSMC_SMSECC_SNCEC
  674. *
  675. * @b Example
  676. * @verbatim
  677. Uint32 ncCounter;
  678. ncCounter = CSL_MSMC_getScrubNonCorrectableErrorCounter ();
  679. @endverbatim
  680. * =============================================================================
  681. */
  682. static inline Uint32 CSL_MSMC_getScrubNonCorrectableErrorCounter (void)
  683. {
  684. return CSL_FEXT (hMsmc->SMSECC, MSMC_SMSECC_SNCEC);
  685. }
  686. /** ============================================================================
  687. * @n@b CSL_MSMC_clearScrubNonCorrectableErrorCounter
  688. *
  689. * @b Description
  690. * @n his function clears the Scrub Non Correctable Error Counter.
  691. *
  692. * @b Arguments
  693. * @n None
  694. *
  695. * <b> Return Value </b>
  696. * @n None
  697. *
  698. * <b> Pre Condition </b>
  699. * @n None
  700. *
  701. * <b> Post Condition </b>
  702. * @n SMSECC register configured with the value passed.
  703. *
  704. * @b Writes
  705. * @n MSMC_SMSECC_SNCEC=0
  706. *
  707. * @b Example
  708. * @verbatim
  709. CSL_MSMC_clearScrubNonCorrectableErrorCounter ();
  710. @endverbatim
  711. * =============================================================================
  712. */
  713. static inline void CSL_MSMC_clearScrubNonCorrectableErrorCounter (void)
  714. {
  715. CSL_FINS (hMsmc->SMSECC, MSMC_SMSECC_SNCEC, 0);
  716. return;
  717. }
  718. /** ============================================================================
  719. * @n@b CSL_MSMC_getFaultAddress
  720. *
  721. * @b Description
  722. * @n This function gets the access address causing the fault.
  723. *
  724. * @b Arguments
  725. * @n None
  726. *
  727. * <b> Return Value </b>
  728. * Fault Address
  729. *
  730. * <b> Pre Condition </b>
  731. * @n None
  732. *
  733. * <b> Post Condition </b>
  734. * @n None
  735. *
  736. * @b Reads
  737. * @n MSMC_SMPFAR_FAULT_ADDRESS
  738. *
  739. * @b Example
  740. * @verbatim
  741. Uint32 faultAddr;
  742. faultAddr = CSL_MSMC_getFaultAddress ();
  743. @endverbatim
  744. * =============================================================================
  745. */
  746. static inline Uint32 CSL_MSMC_getFaultAddress (void)
  747. {
  748. return CSL_FEXT (hMsmc->SMPFAR, MSMC_SMPFAR_FAULT_ADDRESS);
  749. }
  750. /** ============================================================================
  751. * @n@b CSL_MSMC_getFaultAddressNMStatus
  752. *
  753. * @b Description
  754. * @n This function gets the NM Status which is set if the access address
  755. * causing the fault does not match any of the segment BADDR
  756. *
  757. * @b Arguments
  758. * @n None
  759. *
  760. * <b> Return Value </b>
  761. * Fault Address NM Status
  762. *
  763. * <b> Pre Condition </b>
  764. * @n None
  765. *
  766. * <b> Post Condition </b>
  767. * @n None
  768. *
  769. * @b Reads
  770. * @n MSMC_SMPFXR_NM
  771. *
  772. * @b Example
  773. * @verbatim
  774. Uint8 faultNMStatus;
  775. faultNMStatus = CSL_MSMC_getFaultAddressNMStatus ();
  776. @endverbatim
  777. * =============================================================================
  778. */
  779. static inline Uint8 CSL_MSMC_getFaultAddressNMStatus(void)
  780. {
  781. return CSL_FEXT (hMsmc->SMPFXR, MSMC_SMPFXR_NM);
  782. }
  783. /** ============================================================================
  784. * @n@b CSL_MSMC_getFaultInfo
  785. *
  786. * @b Description
  787. * @n This function gets the MSMC fault information. This include the event
  788. * bits event bits for all PrivID's and the Master ID which caused the
  789. * fault.
  790. *
  791. * @b Arguments
  792. * @verbatim
  793. faultPrivID Fault Priv ID populated by this API.
  794. faultMstID Fault Master ID populated by this API.
  795. @endverbatim
  796. *
  797. * <b> Return Value </b>
  798. * @n None
  799. *
  800. * <b> Pre Condition </b>
  801. * @n None
  802. *
  803. * <b> Post Condition </b>
  804. * @n None
  805. *
  806. * @b Reads
  807. * @n MSMC_SMPFR_FPID, MSMC_SMPFR_FMSTID
  808. *
  809. * @b Example
  810. * @verbatim
  811. Uint8 faultPrivID;
  812. Uint8 faultMstID;
  813. // Get the fault information.
  814. CSL_MSMC_getFaultInfo &faultPrivID, &faultMstID);
  815. @endverbatim
  816. * =============================================================================
  817. */
  818. static inline void CSL_MSMC_getFaultInfo (Uint8* faultPrivID, Uint8* faultMstID)
  819. {
  820. Uint32 value = hMsmc->SMPFR;
  821. *faultPrivID = CSL_FEXT (value, MSMC_SMPFR_FPID);
  822. *faultMstID = CSL_FEXT (value, MSMC_SMPFR_FMSTID);
  823. }
  824. /** ============================================================================
  825. * @n@b CSL_MSMC_clearFaultPrivID
  826. *
  827. * @b Description
  828. * @n This function clears the faulted PrivID bit set in SMPFV register.
  829. *
  830. * @b Arguments
  831. * @n None
  832. *
  833. * <b> Return Value </b>
  834. * @n None
  835. *
  836. * <b> Pre Condition </b>
  837. * @n None
  838. *
  839. * <b> Post Condition </b>
  840. * @n Fault ID is cleared.
  841. *
  842. * @b Writes
  843. * @n MSMC_SMPFCR_CLR=1
  844. *
  845. * @b Example
  846. * @verbatim
  847. CSL_MSMC_clearFaultPrivID ();
  848. @endverbatim
  849. * =============================================================================
  850. */
  851. static inline void CSL_MSMC_clearFaultPrivID (void)
  852. {
  853. CSL_FINS (hMsmc->SMPFCR, MSMC_SMPFCR_CLR, 1);
  854. return;
  855. }
  856. /** ============================================================================
  857. * @n@b CSL_MSMC_setStarvationBoundCGEM
  858. *
  859. * @b Description
  860. * @n This function sets the starvation bound for CCGEM slaves.
  861. *
  862. * @b Arguments
  863. @verbatim
  864. index CGEM slave to configure starvation bound for
  865. strvEmifArbiter Starvation bound to be configured for the EMIF Arbiter
  866. strvRAMArbiter Starvation bound to be configured for the RAM Bank Arbiter
  867. @endverbatim
  868. *
  869. * <b> Return Value </b>
  870. * @n None
  871. *
  872. * <b> Pre Condition </b>
  873. * @n None
  874. *
  875. * <b> Post Condition </b>
  876. * @n None
  877. *
  878. * @b Writes
  879. * @n MSMC_SBNDC0_SCNTCE, MSMC_SBNDC0_SCNTCM
  880. *
  881. * @b Example
  882. * @verbatim
  883. CSL_MSMC_setStarvationBoundCGEM (1,1,1);
  884. @endverbatim
  885. * =============================================================================
  886. */
  887. static inline void CSL_MSMC_setStarvationBoundCGEM
  888. (
  889. Uint32 index,
  890. Uint8 strvEmifArbiter,
  891. Uint8 strvRAMArbiter
  892. )
  893. {
  894. hMsmc->SBND[index] = CSL_FMK (MSMC_SBNDC0_SCNTCE, strvEmifArbiter) |
  895. CSL_FMK (MSMC_SBNDC0_SCNTCM, strvRAMArbiter);
  896. return;
  897. }
  898. /** ============================================================================
  899. * @n@b CSL_MSMC_getStarvationBoundCGEM
  900. *
  901. * @b Description
  902. * @n This function gets the starvation bound for CCGEM slaves.
  903. *
  904. * @b Arguments
  905. @verbatim
  906. index CGEM slave index
  907. strvEmifArbiter Starvation bound for the EMIF Arbiter
  908. strvRAMArbiter Starvation bound for the RAM Bank Arbiter
  909. @endverbatim
  910. *
  911. * <b> Return Value </b>
  912. * @n None
  913. *
  914. * <b> Pre Condition </b>
  915. * @n None
  916. *
  917. * <b> Post Condition </b>
  918. * @n None
  919. *
  920. * @b Reads
  921. * @n MSMC_SBNDC0_SCNTCE, MSMC_SBNDC0_SCNTCM
  922. *
  923. * @b Example
  924. * @verbatim
  925. Uint8 strvEMIF;
  926. Uint8 strvRAM;
  927. CSL_MSMC_getStarvationBoundCGEM (1, &strvEMIF, &strvRAM);
  928. @endverbatim
  929. * =============================================================================
  930. */
  931. static inline void CSL_MSMC_getStarvationBoundCGEM
  932. (
  933. Uint32 index,
  934. Uint8* strvEmifArbiter,
  935. Uint8* strvRAMArbiter
  936. )
  937. {
  938. Uint32 value = hMsmc->SBND[index];
  939. *strvEmifArbiter = CSL_FEXT (value, MSMC_SBNDC0_SCNTCE);
  940. *strvRAMArbiter = CSL_FEXT (value, MSMC_SBNDC0_SCNTCM);
  941. }
  942. /** ============================================================================
  943. * @n@b CSL_MSMC_setStarvationBoundSMS
  944. *
  945. * @b Description
  946. * @n This function sets the starvation bound for SMS port.
  947. *
  948. * @b Arguments
  949. @verbatim
  950. sbnd starvation bound to be configured
  951. @endverbatim
  952. *
  953. * <b> Return Value </b>
  954. * @n None
  955. *
  956. * <b> Pre Condition </b>
  957. * @n None
  958. *
  959. * <b> Post Condition </b>
  960. * @n Starvation Count for the SMS Port is configured.
  961. *
  962. * @b Writes
  963. * @n MSMC_SBNDM_SCNTMM
  964. *
  965. * @b Example
  966. * @verbatim
  967. CSL_MSMC_setStarvationBoundSMS (1);
  968. @endverbatim
  969. * =============================================================================
  970. */
  971. static inline void CSL_MSMC_setStarvationBoundSMS (Uint32 sbnd)
  972. {
  973. CSL_FINS (hMsmc->SBNDM, MSMC_SBNDM_SCNTMM, sbnd);
  974. return;
  975. }
  976. /** ============================================================================
  977. * @n@b CSL_MSMC_getStarvationBoundSMS
  978. *
  979. * @b Description
  980. * @n This function gets the starvation bound for SMS port.
  981. *
  982. * @b Arguments
  983. * @n None
  984. *
  985. * <b> Return Value </b>
  986. * Starvation Bound for the SMS Port.
  987. *
  988. * <b> Pre Condition </b>
  989. * @n None
  990. *
  991. * <b> Post Condition </b>
  992. * @n None
  993. *
  994. * @b Reads
  995. * @n MSMC_SBNDM_SCNTMM
  996. *
  997. * @b Example
  998. * @verbatim
  999. Uint32 sbndm;
  1000. sbndm = CSL_MSMC_getStarvationBoundSMS ();
  1001. @endverbatim
  1002. * =============================================================================
  1003. */
  1004. static inline Uint32 CSL_MSMC_getStarvationBoundSMS (void)
  1005. {
  1006. return CSL_FEXT (hMsmc->SBNDM, MSMC_SBNDM_SCNTMM);
  1007. }
  1008. /** ============================================================================
  1009. * @n@b CSL_MSMC_setStarvationBoundSES
  1010. *
  1011. * @b Description
  1012. * @n This function sets the starvation bound for SES port.
  1013. *
  1014. * @b Arguments
  1015. @verbatim
  1016. sbnd starvation bound to be configured
  1017. @endverbatim
  1018. *
  1019. * <b> Return Value </b>
  1020. * @n None
  1021. *
  1022. * <b> Pre Condition </b>
  1023. * @n None
  1024. *
  1025. * <b> Post Condition </b>
  1026. * @n Starvation count for the SES port is configured
  1027. *
  1028. * @b Writes
  1029. * @n MSMC_SBNDE_SCNTEM
  1030. *
  1031. * @b Example
  1032. * @verbatim
  1033. CSL_MSMC_setStarvationBoundSES (1);
  1034. @endverbatim
  1035. * =============================================================================
  1036. */
  1037. static inline void CSL_MSMC_setStarvationBoundSES (Uint32 sbnd)
  1038. {
  1039. CSL_FINS (hMsmc->SBNDE, MSMC_SBNDE_SCNTEM, sbnd);
  1040. return;
  1041. }
  1042. /** ============================================================================
  1043. * @n@b CSL_MSMC_getStarvationBoundSES
  1044. *
  1045. * @b Description
  1046. * @n This function gets the starvation bound for SES port.
  1047. *
  1048. * @b Arguments
  1049. * @n None
  1050. *
  1051. * <b> Return Value </b>
  1052. * Starvation Bound for the SES Port.
  1053. *
  1054. * <b> Pre Condition </b>
  1055. * @n None
  1056. *
  1057. * <b> Post Condition </b>
  1058. * @n None
  1059. *
  1060. * @b Reads
  1061. * @n MSMC_SBNDE_SCNTEM
  1062. *
  1063. * @b Example
  1064. * @verbatim
  1065. Uint32 sbnde;
  1066. sbnde = CSL_MSMC_getStarvationBoundSES ();
  1067. @endverbatim
  1068. * =============================================================================
  1069. */
  1070. static inline Uint32 CSL_MSMC_getStarvationBoundSES (void)
  1071. {
  1072. return CSL_FEXT (hMsmc->SBNDE, MSMC_SBNDE_SCNTEM);
  1073. }
  1074. /** ============================================================================
  1075. * @n@b CSL_MSMC_setSMSMPAXH
  1076. *
  1077. * @b Description
  1078. * @n This function sets the contents of SMS_MPAXH register.
  1079. *
  1080. * @b Arguments
  1081. @verbatim
  1082. privid PrivID
  1083. index Index into the set of 8 registers for this particular
  1084. PrivID
  1085. mpaxh CSL_MSMC_SMSMPAXH structure that needs to be set into the
  1086. register
  1087. @endverbatim
  1088. *
  1089. * <b> Return Value </b>
  1090. * @n None
  1091. *
  1092. * <b> Pre Condition </b>
  1093. * @n None
  1094. *
  1095. * <b> Post Condition </b>
  1096. * @n SMS MPAXH register for the PrivID configured with the value passed.
  1097. *
  1098. * @b Writes
  1099. * @n MSMC_SMS_MPAXH_0_SEGSZ..MSMC_SMS_MPAXH_7_SEGSZ,
  1100. * MSMC_SMS_MPAXH_0_BADDR..MSMC_SMS_MPAXH_7_BADDR
  1101. *
  1102. * @b Example
  1103. * @verbatim
  1104. Uint32 privid = 1;
  1105. Uint32 index = 0;
  1106. CSL_MSMC_SMSMPAXH mpaxh;
  1107. mpaxh.segSz = 4;
  1108. mpaxh.baddr = 0x10;
  1109. CSL_MSMC_setSMSMPAXH (privid, index, &mpaxh);
  1110. @endverbatim
  1111. * =============================================================================
  1112. */
  1113. static inline void CSL_MSMC_setSMSMPAXH
  1114. (
  1115. Uint32 privid,
  1116. Uint32 index,
  1117. CSL_MSMC_SMSMPAXH* mpaxh
  1118. )
  1119. {
  1120. hMsmc->SMS_MPAX_PER_PRIVID[privid].SMS[index].MPAXH =
  1121. CSL_FMK (MSMC_SMS_MPAXH_0_SEGSZ, mpaxh->segSz) |
  1122. CSL_FMK (MSMC_SMS_MPAXH_0_BADDR, mpaxh->baddr);
  1123. }
  1124. /** ============================================================================
  1125. * @n@b CSL_MSMC_getSMSMPAXH
  1126. *
  1127. * @b Description
  1128. * @n This function gets the contents of SMS_MPAXH register.
  1129. *
  1130. * @b Arguments
  1131. @verbatim
  1132. privid PrivID
  1133. index Index into the set of 8 registers for this particular
  1134. PrivID
  1135. mpaxh CSL_MSMC_SMSMPAXH structure that needs to be set into the
  1136. register
  1137. @endverbatim
  1138. *
  1139. * <b> Return Value </b>
  1140. * @n None
  1141. *
  1142. * <b> Pre Condition </b>
  1143. * @n None
  1144. *
  1145. * <b> Post Condition </b>
  1146. * @n None
  1147. *
  1148. * @b Reads
  1149. * @n MSMC_SMS_MPAXH_0_SEGSZ..MSMC_SMS_MPAXH_7_SEGSZ,
  1150. * MSMC_SMS_MPAXH_0_BADDR..MSMC_SMS_MPAXH_7_BADDR
  1151. *
  1152. * @b Example
  1153. * @verbatim
  1154. Uint32 privid = 1;
  1155. Uint32 index = 0;
  1156. CSL_MSMC_SMSMPAXH mpaxh;
  1157. CSL_MSMC_getSMSMPAXH (privid, index, &mpaxh);
  1158. @endverbatim
  1159. * =============================================================================
  1160. */
  1161. static inline void CSL_MSMC_getSMSMPAXH (
  1162. Uint32 privid,
  1163. Uint32 index,
  1164. CSL_MSMC_SMSMPAXH* mpaxh
  1165. )
  1166. {
  1167. Uint32 value = hMsmc->SMS_MPAX_PER_PRIVID[privid].SMS[index].MPAXH;
  1168. mpaxh->segSz = CSL_FEXT (value, MSMC_SMS_MPAXH_0_SEGSZ);
  1169. mpaxh->baddr = CSL_FEXT (value, MSMC_SMS_MPAXH_0_BADDR);
  1170. }
  1171. /** ============================================================================
  1172. * @n@b CSL_MSMC_setSMSMPAXL
  1173. *
  1174. * @b Description
  1175. * @n This function sets the contents of SMS_MPAXL register.
  1176. *
  1177. * @b Arguments
  1178. @verbatim
  1179. privid PrivID
  1180. index Index into the set of 8 registers for this particular
  1181. PrivID
  1182. mpaxl CSL_MSMC_SMSMPAXL structure that needs to be set into the
  1183. register
  1184. @endverbatim
  1185. *
  1186. * <b> Return Value </b>
  1187. * @n None
  1188. *
  1189. * <b> Pre Condition </b>
  1190. * @n None
  1191. *
  1192. * <b> Post Condition </b>
  1193. * @n SMS MPAXL register for the PrivID configured with the value passed.
  1194. *
  1195. * @b Writes
  1196. * @n MSMC_SMS_MPAXL_0_UX..MSMC_SMS_MPAXL_7_UX,
  1197. * MSMC_SMS_MPAXL_0_UW..MSMC_SMS_MPAXL_7_UW,
  1198. * MSMC_SMS_MPAXL_0_UR..MSMC_SMS_MPAXL_7_UR,
  1199. * MSMC_SMS_MPAXL_0_SX..MSMC_SMS_MPAXL_7_SX,
  1200. * MSMC_SMS_MPAXL_0_SW..MSMC_SMS_MPAXL_7_SW,
  1201. * MSMC_SMS_MPAXL_0_SR..MSMC_SMS_MPAXL_7_SR,
  1202. * MSMC_SMS_MPAXL_0_RADDR..MSMC_SMS_MPAXL_7_RADDR,
  1203. *
  1204. * @b Example
  1205. * @verbatim
  1206. Uint32 privid = 1;
  1207. Uint32 index = 0;
  1208. CSL_MSMC_SMSMPAXL mpaxl;
  1209. mpaxl.ux = 1;
  1210. mpaxl.uw = 1;
  1211. mpaxl.ur = 1;
  1212. mpaxl.sx = 1;
  1213. mpaxl.sw = 1;
  1214. mpaxl.sr = 1;
  1215. mpaxl.emu = 0;
  1216. mpaxl.ns = 1;
  1217. mpaxl.raddr = 0x100;
  1218. CSL_MSMC_setSMSMPAXL (privid, index, &mpaxl);
  1219. @endverbatim
  1220. * =============================================================================
  1221. */
  1222. static inline void CSL_MSMC_setSMSMPAXL
  1223. (
  1224. Uint32 privid,
  1225. Uint32 index,
  1226. CSL_MSMC_SMSMPAXL* mpaxl
  1227. )
  1228. {
  1229. Uint32 value = 0;
  1230. CSL_FINS (value, MSMC_SMS_MPAXL_0_UX, mpaxl->ux);
  1231. CSL_FINS (value, MSMC_SMS_MPAXL_0_UW, mpaxl->uw);
  1232. CSL_FINS (value, MSMC_SMS_MPAXL_0_UR, mpaxl->ur);
  1233. CSL_FINS (value, MSMC_SMS_MPAXL_0_SX, mpaxl->sx);
  1234. CSL_FINS (value, MSMC_SMS_MPAXL_0_SW, mpaxl->sw);
  1235. CSL_FINS (value, MSMC_SMS_MPAXL_0_SR, mpaxl->sr);
  1236. CSL_FINS (value, MSMC_SMS_MPAXL_0_RADDR, mpaxl->raddr);
  1237. hMsmc->SMS_MPAX_PER_PRIVID[privid].SMS[index].MPAXL = value;
  1238. }
  1239. /** ============================================================================
  1240. * @n@b CSL_MSMC_getSMSMPAXL
  1241. *
  1242. * @b Description
  1243. * @n This function gets the contents of SMS_MPAXL register.
  1244. *
  1245. * @b Arguments
  1246. @verbatim
  1247. privid PrivID
  1248. index Index into the set of 8 registers for this particular
  1249. PrivID
  1250. mpaxl CSL_MSMC_SMSMPAXL structure that needs to be set into the
  1251. register
  1252. @endverbatim
  1253. *
  1254. * <b> Return Value </b>
  1255. * @n None
  1256. *
  1257. * <b> Pre Condition </b>
  1258. * @n None
  1259. *
  1260. * <b> Post Condition </b>
  1261. * @n None
  1262. *
  1263. * @b Reads
  1264. * @n MSMC_SMS_MPAXL_0_UX..MSMC_SMS_MPAXL_7_UX,
  1265. * MSMC_SMS_MPAXL_0_UW..MSMC_SMS_MPAXL_7_UW,
  1266. * MSMC_SMS_MPAXL_0_UR..MSMC_SMS_MPAXL_7_UR,
  1267. * MSMC_SMS_MPAXL_0_SX..MSMC_SMS_MPAXL_7_SX,
  1268. * MSMC_SMS_MPAXL_0_SW..MSMC_SMS_MPAXL_7_SW,
  1269. * MSMC_SMS_MPAXL_0_SR..MSMC_SMS_MPAXL_7_SR,
  1270. * MSMC_SMS_MPAXL_0_RADDR..MSMC_SMS_MPAXL_7_RADDR,
  1271. *
  1272. * @b Example
  1273. * @verbatim
  1274. Uint32 privid = 1;
  1275. Uint32 index = 0;
  1276. CSL_MSMC_SMSMPAXL mpaxl;
  1277. CSL_MSMC_getSMSMPAXL (privid, index, &mpaxl);
  1278. @endverbatim
  1279. * =============================================================================
  1280. */
  1281. static inline void CSL_MSMC_getSMSMPAXL
  1282. (
  1283. Uint32 privid,
  1284. Uint32 index,
  1285. CSL_MSMC_SMSMPAXL* mpaxl
  1286. )
  1287. {
  1288. Uint32 value = hMsmc->SMS_MPAX_PER_PRIVID[privid].SMS[index].MPAXL;
  1289. mpaxl->raddr = CSL_FEXT (value, MSMC_SMS_MPAXL_0_RADDR);
  1290. mpaxl->sr = CSL_FEXT (value, MSMC_SMS_MPAXL_0_SR);
  1291. mpaxl->sw = CSL_FEXT (value, MSMC_SMS_MPAXL_0_SW);
  1292. mpaxl->sx = CSL_FEXT (value, MSMC_SMS_MPAXL_0_SX);
  1293. mpaxl->ur = CSL_FEXT (value, MSMC_SMS_MPAXL_0_UR);
  1294. mpaxl->uw = CSL_FEXT (value, MSMC_SMS_MPAXL_0_UW);
  1295. mpaxl->ux = CSL_FEXT (value, MSMC_SMS_MPAXL_0_UX);
  1296. }
  1297. /** ============================================================================
  1298. * @n@b CSL_MSMC_setSESMPAXH
  1299. *
  1300. * @b Description
  1301. * @n This function sets the contents of SES_MPAXH register.
  1302. *
  1303. * @b Arguments
  1304. @verbatim
  1305. privid PrivID
  1306. index Index into the set of 8 registers for this particular
  1307. PrivID
  1308. mpaxh CSL_MSMC_SESMPAXH structure that needs to be set into the
  1309. register
  1310. @endverbatim
  1311. *
  1312. * <b> Return Value </b>
  1313. * @n None
  1314. *
  1315. * <b> Pre Condition </b>
  1316. * @n None
  1317. *
  1318. * <b> Post Condition </b>
  1319. * @n SES MPAXH register for the PrivID configured with the value passed.
  1320. *
  1321. * @b Writes
  1322. * @n MSMC_SES_MPAXH_0_BE..MSMC_SES_MPAXH_7_BE,
  1323. * MSMC_SES_MPAXH_0_AI..MSMC_SES_MPAXH_7_AI,
  1324. * MSMC_SES_MPAXH_0_SEGSZ..MSMC_SES_MPAXH_7_SEGSZ,
  1325. * MSMC_SES_MPAXH_0_BADDR..MSMC_SES_MPAXH_7_BADDR
  1326. *
  1327. * @b Example
  1328. * @verbatim
  1329. Uint32 privid = 1;
  1330. Uint32 index = 0;
  1331. CSL_MSMC_SESMPAXH mpaxh;
  1332. mpaxh.segSize = 4;
  1333. mpaxh.baseAddress = 0x100;
  1334. mpaxh.be = 1;
  1335. mpaxh.ai = 1;
  1336. CSL_MSMC_setSESMPAXH (privid, index, &mpaxh);
  1337. @endverbatim
  1338. * =============================================================================
  1339. */
  1340. static inline void CSL_MSMC_setSESMPAXH
  1341. (
  1342. Uint32 privid,
  1343. Uint32 index,
  1344. CSL_MSMC_SESMPAXH* mpaxh
  1345. )
  1346. {
  1347. Uint32 value = 0;
  1348. CSL_FINS (value, MSMC_SES_MPAXH_0_BE, mpaxh->be);
  1349. CSL_FINS (value, MSMC_SES_MPAXH_0_AI, mpaxh->ai);
  1350. CSL_FINS (value, MSMC_SES_MPAXH_0_SEGSZ, mpaxh->segSz);
  1351. CSL_FINS (value, MSMC_SES_MPAXH_0_BADDR, mpaxh->baddr);
  1352. hMsmc->SES_MPAX_PER_PRIVID[privid].SES[index].MPAXH = value;
  1353. }
  1354. /** ============================================================================
  1355. * @n@b CSL_MSMC_getSESMPAXH
  1356. *
  1357. * @b Description
  1358. * @n This function gets the contents of SES_MPAXH register.
  1359. *
  1360. * @b Arguments
  1361. @verbatim
  1362. privid PrivID
  1363. index Index into the set of 8 registers for this particular
  1364. PrivID
  1365. mpaxh CSL_MSMC_SESMPAXH structure that needs to be set into the
  1366. register
  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 Reads
  1379. * @n MSMC_SES_MPAXH_0_BE..MSMC_SES_MPAXH_7_BE,
  1380. * MSMC_SES_MPAXH_0_AI..MSMC_SES_MPAXH_7_AI,
  1381. * MSMC_SES_MPAXH_0_SEGSZ..MSMC_SES_MPAXH_7_SEGSZ,
  1382. * MSMC_SES_MPAXH_0_BADDR..MSMC_SES_MPAXH_7_BADDR
  1383. *
  1384. * @b Example
  1385. * @verbatim
  1386. Uint32 privid = 1;
  1387. Uint32 index = 0;
  1388. CSL_MSMC_SESMPAXH mpaxh;
  1389. CSL_MSMC_getSESMPAXH (privid, index, &mpaxh);
  1390. @endverbatim
  1391. * =============================================================================
  1392. */
  1393. static inline void CSL_MSMC_getSESMPAXH
  1394. (
  1395. Uint32 privid,
  1396. Uint32 index,
  1397. CSL_MSMC_SESMPAXH* mpaxh
  1398. )
  1399. {
  1400. Uint32 value = hMsmc->SES_MPAX_PER_PRIVID[privid].SES[index].MPAXH;
  1401. mpaxh->be = CSL_FEXT (value, MSMC_SES_MPAXH_0_BE);
  1402. mpaxh->ai = CSL_FEXT (value, MSMC_SES_MPAXH_0_AI);
  1403. mpaxh->segSz = CSL_FEXT (value, MSMC_SES_MPAXH_0_SEGSZ);
  1404. mpaxh->baddr = CSL_FEXT (value, MSMC_SES_MPAXH_0_BADDR);
  1405. }
  1406. /** ============================================================================
  1407. * @n@b CSL_MSMC_setSESMPAXL
  1408. *
  1409. * @b Description
  1410. * @n This function sets the contents of SES_MPAXL register.
  1411. *
  1412. * @b Arguments
  1413. @verbatim
  1414. privid PrivID
  1415. index Index into the set of 8 registers for this particular
  1416. PrivID
  1417. mpaxl CSL_MSMC_SESMPAXL structure that needs to be set into the
  1418. register
  1419. @endverbatim
  1420. *
  1421. * <b> Return Value </b>
  1422. * @n None
  1423. *
  1424. * <b> Pre Condition </b>
  1425. * @n None
  1426. *
  1427. * <b> Post Condition </b>
  1428. * @n SES MPAXL register for the PrivID configured with the value passed.
  1429. *
  1430. * @b Writes
  1431. * @n MSMC_SES_MPAXL_0_UX..MSMC_SES_MPAXL_7_UX,
  1432. * MSMC_SES_MPAXL_0_UW..MSMC_SES_MPAXL_7_UW,
  1433. * MSMC_SES_MPAXL_0_UR..MSMC_SES_MPAXL_7_UR,
  1434. * MSMC_SES_MPAXL_0_SX..MSMC_SES_MPAXL_7_SX,
  1435. * MSMC_SES_MPAXL_0_SW..MSMC_SES_MPAXL_7_SW,
  1436. * MSMC_SES_MPAXL_0_SR..MSMC_SES_MPAXL_7_SR,
  1437. * MSMC_SES_MPAXL_0_RADDR..MSMC_SES_MPAXL_7_RADDR
  1438. *
  1439. * @b Example
  1440. * @verbatim
  1441. Uint32 privid = 1;
  1442. Uint32 index = 0;
  1443. CSL_MSMC_SESMPAXL mpaxl;
  1444. mpaxl.ux = 1;
  1445. mpaxl.uw = 1;
  1446. mpaxl.ur = 1;
  1447. mpaxl.sx = 1;
  1448. mpaxl.sw = 1;
  1449. mpaxl.sr = 1;
  1450. mpaxl.raddr = 0x4000;
  1451. CSL_MSMC_setSESMPAXL (privid, index, &mpaxl);
  1452. @endverbatim
  1453. * =============================================================================
  1454. */
  1455. static inline void CSL_MSMC_setSESMPAXL
  1456. (
  1457. Uint32 privid,
  1458. Uint32 index,
  1459. CSL_MSMC_SESMPAXL* mpaxl
  1460. )
  1461. {
  1462. Uint32 value = 0;
  1463. CSL_FINS (value, MSMC_SES_MPAXL_0_UX, mpaxl->ux);
  1464. CSL_FINS (value, MSMC_SES_MPAXL_0_UW, mpaxl->uw);
  1465. CSL_FINS (value, MSMC_SES_MPAXL_0_UR, mpaxl->ur);
  1466. CSL_FINS (value, MSMC_SES_MPAXL_0_SX, mpaxl->sx);
  1467. CSL_FINS (value, MSMC_SES_MPAXL_0_SW, mpaxl->sw);
  1468. CSL_FINS (value, MSMC_SES_MPAXL_0_SR, mpaxl->sr);
  1469. CSL_FINS (value, MSMC_SES_MPAXL_0_RADDR, mpaxl->raddr);
  1470. hMsmc->SES_MPAX_PER_PRIVID[privid].SES[index].MPAXL = value;
  1471. }
  1472. /** ============================================================================
  1473. * @n@b CSL_MSMC_getSESMPAXL
  1474. *
  1475. * @b Description
  1476. * @n This function gets the contents of SES_MPAXL register.
  1477. *
  1478. * @b Arguments
  1479. @verbatim
  1480. privid PrivID
  1481. index Index into the set of 8 registers for this particular
  1482. PrivID
  1483. mpaxl CSL_MSMC_SESMPAXL structure that needs to be set into the
  1484. register
  1485. @endverbatim
  1486. *
  1487. * <b> Return Value </b>
  1488. * @n None
  1489. *
  1490. * <b> Pre Condition </b>
  1491. * @n None
  1492. *
  1493. * <b> Post Condition </b>
  1494. * @n None
  1495. *
  1496. * @b Reads
  1497. * @n MSMC_SES_MPAXL_0_UX..MSMC_SES_MPAXL_7_UX,
  1498. * MSMC_SES_MPAXL_0_UW..MSMC_SES_MPAXL_7_UW,
  1499. * MSMC_SES_MPAXL_0_UR..MSMC_SES_MPAXL_7_UR,
  1500. * MSMC_SES_MPAXL_0_SX..MSMC_SES_MPAXL_7_SX,
  1501. * MSMC_SES_MPAXL_0_SW..MSMC_SES_MPAXL_7_SW,
  1502. * MSMC_SES_MPAXL_0_SR..MSMC_SES_MPAXL_7_SR,
  1503. * MSMC_SES_MPAXL_0_RADDR..MSMC_SES_MPAXL_7_RADDR
  1504. *
  1505. * @b Example
  1506. * @verbatim
  1507. Uint32 privid = 1;
  1508. Uint32 index = 0;
  1509. CSL_MSMC_SESMPAXL mpaxl;
  1510. CSL_MSMC_getSESMPAXL (privid, index, &mpaxl);
  1511. @endverbatim
  1512. * =============================================================================
  1513. */
  1514. static inline void CSL_MSMC_getSESMPAXL
  1515. (
  1516. Uint32 privid,
  1517. Uint32 index,
  1518. CSL_MSMC_SESMPAXL* mpaxl
  1519. )
  1520. {
  1521. Uint32 value = hMsmc->SES_MPAX_PER_PRIVID[privid].SES[index].MPAXL;
  1522. mpaxl->raddr = CSL_FEXT (value, MSMC_SES_MPAXL_0_RADDR);
  1523. mpaxl->sr = CSL_FEXT (value, MSMC_SES_MPAXL_0_SR);
  1524. mpaxl->sw = CSL_FEXT (value, MSMC_SES_MPAXL_0_SW);
  1525. mpaxl->sx = CSL_FEXT (value, MSMC_SES_MPAXL_0_SX);
  1526. mpaxl->ur = CSL_FEXT (value, MSMC_SES_MPAXL_0_UR);
  1527. mpaxl->uw = CSL_FEXT (value, MSMC_SES_MPAXL_0_UW);
  1528. mpaxl->ux = CSL_FEXT (value, MSMC_SES_MPAXL_0_UX);
  1529. return;
  1530. }
  1531. /** ============================================================================
  1532. * @n@b CSL_MSMC_lockNonMPAX
  1533. *
  1534. * @b Description
  1535. * @n This function locks the write access for all non MPAX registers.
  1536. *
  1537. * @b Arguments
  1538. * @n None
  1539. *
  1540. * <b> Return Value </b>
  1541. * @n None
  1542. *
  1543. * <b> Pre Condition </b>
  1544. * @n None
  1545. *
  1546. * <b> Post Condition </b>
  1547. * @n All the non MPAX registers are locked for write-access.
  1548. *
  1549. * @b Writes
  1550. * @n MSMC_CFGLCK_MGCID=0x2CD00000,MSMC_CFGLCK_WLCK=1
  1551. *
  1552. * @b Example
  1553. * @verbatim
  1554. CSL_MSMC_lockNonMPAX ();
  1555. @endverbatim
  1556. * =============================================================================
  1557. */
  1558. static inline void CSL_MSMC_lockNonMPAX (void)
  1559. {
  1560. hMsmc->CFGLCK = CSL_FMK(MSMC_CFGLCK_MGCID, 0x2CD0) | CSL_FMK(MSMC_CFGLCK_WLCK, 1);
  1561. }
  1562. /** ============================================================================
  1563. * @n@b CSL_MSMC_isNonMPAXLocked
  1564. *
  1565. * @b Description
  1566. * @n This function gets the status of the lock for non MPAX registers.
  1567. *
  1568. * @b Arguments
  1569. * @n None
  1570. *
  1571. * <b> Return Value </b>
  1572. * @n TRUE - Non MPAX Register Write Access is locked
  1573. * @n FALSE - Non MPAX Register Write Access is unlocked
  1574. *
  1575. * <b> Pre Condition </b>
  1576. * @n None
  1577. *
  1578. * <b> Post Condition </b>
  1579. * @n None
  1580. *
  1581. * @b Reads
  1582. * @n MSMC_CFGLCKSTAT_WSTAT
  1583. *
  1584. * @b Example
  1585. * @verbatim
  1586. if (CSL_MSMC_isNonMPAXLocked () == TRUE)
  1587. {
  1588. // Non MPAX Registers are locked.
  1589. }
  1590. else
  1591. {
  1592. // MPAX Registers are not locked.
  1593. }
  1594. @endverbatim
  1595. * =============================================================================
  1596. */
  1597. static inline Bool CSL_MSMC_isNonMPAXLocked (void)
  1598. {
  1599. return (Bool)CSL_FEXT (hMsmc->CFGLCKSTAT, MSMC_CFGLCKSTAT_WSTAT);
  1600. }
  1601. /** ============================================================================
  1602. * @n@b CSL_MSMC_unlockNonMPAX
  1603. *
  1604. * @b Description
  1605. * @n This function unlocks the write access for all non MPAX registers.
  1606. *
  1607. * @b Arguments
  1608. * @n None
  1609. *
  1610. * <b> Return Value </b>
  1611. * @n None
  1612. *
  1613. * <b> Pre Condition </b>
  1614. * @n @a CSL_MSMC_lockNonMPAX() must be called.
  1615. *
  1616. * <b> Post Condition </b>
  1617. * @n All the non MPAX registers are available for write-access.
  1618. *
  1619. * @b Writes
  1620. * @n MSMC_CFGULCK_MGCID=0x2CD00000,MSMC_CFGULCK_WEN=1
  1621. *
  1622. * @b Example
  1623. * @verbatim
  1624. if (CSL_MSMC_isNonMPAXLocked () == TRUE)
  1625. {
  1626. // Non MPAX Registers are locked
  1627. ...
  1628. // Unlock the Non-MPAX registers.
  1629. CSL_MSMC_unlockNonMPAX ();
  1630. }
  1631. @endverbatim
  1632. * =============================================================================
  1633. */
  1634. static inline void CSL_MSMC_unlockNonMPAX (void)
  1635. {
  1636. hMsmc->CFGULCK = CSL_FMK(MSMC_CFGULCK_MGCID, 0x2CD0) | CSL_FMK(MSMC_CFGULCK_WEN, 1);
  1637. }
  1638. /** ============================================================================
  1639. * @n@b CSL_MSMC_lockSMS
  1640. *
  1641. * @b Description
  1642. * @n This function locks the write access for all SMS MPAX registers.
  1643. *
  1644. * @b Arguments
  1645. @verbatim
  1646. privid PrivID for which the SMS MPAX registers will be locked.
  1647. @endverbatim
  1648. *
  1649. * <b> Return Value </b>
  1650. * @n None
  1651. *
  1652. * <b> Pre Condition </b>
  1653. * @n None
  1654. *
  1655. * <b> Post Condition </b>
  1656. * @n All the SMS MPAX registers for the specific PrivID are locked for
  1657. * write-access.
  1658. *
  1659. * @b Writes
  1660. * @n MSMC_SMS_MPAX_LCK_MGCID=0x2CD10000, MSMC_SMS_MPAX_LCK_WLCK
  1661. *
  1662. * @b Example
  1663. * @verbatim
  1664. // Lock SMS MPAX registers for priv-id 1.
  1665. CSL_MSMC_lockSMS (1);
  1666. @endverbatim
  1667. * =============================================================================
  1668. */
  1669. static inline void CSL_MSMC_lockSMS (Uint32 privid)
  1670. {
  1671. hMsmc->SMS_MPAX_LCK = CSL_FMK(MSMC_SMS_MPAX_LCK_MGCID, 0x2CD1) | CSL_FMKR (privid, privid, 1);
  1672. }
  1673. /** ============================================================================
  1674. * @n@b CSL_MSMC_isSMSLocked
  1675. *
  1676. * @b Description
  1677. * @n This function gets the status of the lock for SMS MPAX registers for the
  1678. * specific priv-id
  1679. *
  1680. * @b Arguments
  1681. @verbatim
  1682. privid PrivID for which the status is required.
  1683. @endverbatim
  1684. *
  1685. * <b> Return Value </b>
  1686. * @n TRUE - SMS MPAX Register Write Access is locked for the priv-id
  1687. * @n FALSE - SMS MPAX Register Write Access is unlocked for the priv-id
  1688. *
  1689. * <b> Pre Condition </b>
  1690. * @n None
  1691. *
  1692. * <b> Post Condition </b>
  1693. * @n None
  1694. *
  1695. * @b Reads
  1696. * @n MSMC_SMS_MPAX_LCKSTAT_WSTAT
  1697. *
  1698. * @b Example
  1699. * @verbatim
  1700. if (CSL_MSMC_isSMSLocked (1) == TRUE)
  1701. {
  1702. // SMS MPAX Registers for Priv-ID 1 are locked.
  1703. }
  1704. else
  1705. {
  1706. // SMS MPAX Registers for Priv-ID 1 are not locked.
  1707. }
  1708. @endverbatim
  1709. * =============================================================================
  1710. */
  1711. static inline Bool CSL_MSMC_isSMSLocked (Uint32 privId)
  1712. {
  1713. return (Bool)CSL_FEXTR (hMsmc->SMS_MPAX_LCKSTAT, privId, privId);
  1714. }
  1715. /** ============================================================================
  1716. * @n@b CSL_MSMC_unlockSMS
  1717. *
  1718. * @b Description
  1719. * @n This function unlocks the write access for all SMS MPAX registers.
  1720. *
  1721. * @b Arguments
  1722. @verbatim
  1723. privid PrivID for which the SMS MPAX registers will be unlocked.
  1724. @endverbatim
  1725. *
  1726. * <b> Return Value </b>
  1727. * @n None
  1728. *
  1729. * <b> Pre Condition </b>
  1730. * @n @a CSL_MSMC_lockSMS() must be called.
  1731. *
  1732. * <b> Post Condition </b>
  1733. * @n All the SMS MPAX registers for the specific PrivID are unlocked for
  1734. * write-access.
  1735. *
  1736. * @b Writes
  1737. * @n MSMC_SMS_MPAX_ULCK_MGCID=0x2CD10000,MSMC_SMS_MPAX_ULCK_WEN
  1738. *
  1739. * @b Example
  1740. * @verbatim
  1741. ...
  1742. if (CSL_MSMC_isSMSLocked (1) == TRUE)
  1743. {
  1744. // SMS MPAX Registers for Priv-ID 1 are locked.
  1745. ...
  1746. // Unlock SMS MPAX registers for priv-id 1.
  1747. CSL_MSMC_unlockSMS (1);
  1748. }
  1749. @endverbatim
  1750. * =============================================================================
  1751. */
  1752. static inline void CSL_MSMC_unlockSMS (Uint32 privid)
  1753. {
  1754. hMsmc->SMS_MPAX_ULCK = CSL_FMK(MSMC_SMS_MPAX_ULCK_MGCID, 0x2CD1) | CSL_FMKR (privid, privid, 1);
  1755. }
  1756. /** ============================================================================
  1757. * @n@b CSL_MSMC_lockSES
  1758. *
  1759. * @b Description
  1760. * @n This function locks the write access for all SES MPAX registers.
  1761. *
  1762. * @b Arguments
  1763. @verbatim
  1764. privid PrivID for which the SES MPAX registers will be locked.
  1765. @endverbatim
  1766. *
  1767. * <b> Return Value </b>
  1768. * @n None
  1769. *
  1770. * <b> Pre Condition </b>
  1771. * @n None
  1772. *
  1773. * <b> Post Condition </b>
  1774. * @n All the SES MPAX registers for the specific PrivID are locked for
  1775. * write-access.
  1776. *
  1777. * @b Writes
  1778. * @n MSMC_SES_MPAX_LCK_MGCID=0x2CD20000,MSMC_SES_MPAX_LCK_WLCK
  1779. *
  1780. * @b Example
  1781. * @verbatim
  1782. // Lock SES MPAX registers for priv-id 1.
  1783. CSL_MSMC_lockSES (1);
  1784. @endverbatim
  1785. * =============================================================================
  1786. */
  1787. static inline void CSL_MSMC_lockSES (Uint32 privid)
  1788. {
  1789. hMsmc->SES_MPAX_LCK = CSL_FMK(MSMC_SES_MPAX_LCK_MGCID, 0x2CD2) | CSL_FMKR (privid, privid, 1);
  1790. }
  1791. /** ============================================================================
  1792. * @n@b CSL_MSMC_isSESLocked
  1793. *
  1794. * @b Description
  1795. * @n This function gets the status of the lock for SES MPAX registers for the
  1796. * specific priv-id
  1797. *
  1798. * @b Arguments
  1799. @verbatim
  1800. privid PrivID for which the status is required.
  1801. @endverbatim
  1802. *
  1803. * <b> Return Value </b>
  1804. * @n TRUE - SES MPAX Register Write Access is locked for the priv-id
  1805. * @n FALSE - SES MPAX Register Write Access is unlocked for the priv-id
  1806. *
  1807. * <b> Pre Condition </b>
  1808. * @n None
  1809. *
  1810. * <b> Post Condition </b>
  1811. * @n None
  1812. *
  1813. * @b Reads
  1814. * @n MSMC_SES_MPAX_LCKSTAT_WSTAT
  1815. *
  1816. * @b Example
  1817. * @verbatim
  1818. if (CSL_MSMC_isSESLocked (1) == TRUE)
  1819. {
  1820. // SES MPAX Registers for Priv-ID 1 are locked.
  1821. }
  1822. else
  1823. {
  1824. // SES MPAX Registers for Priv-ID 1 are not locked.
  1825. }
  1826. @endverbatim
  1827. * =============================================================================
  1828. */
  1829. static inline Bool CSL_MSMC_isSESLocked (Uint32 privId)
  1830. {
  1831. return (Bool)CSL_FEXTR (hMsmc->SES_MPAX_LCKSTAT, privId, privId);
  1832. }
  1833. /** ============================================================================
  1834. * @n@b CSL_MSMC_unlockSES
  1835. *
  1836. * @b Description
  1837. * @n This function unlocks the write access for all SES MPAX registers.
  1838. *
  1839. * @b Arguments
  1840. @verbatim
  1841. privid PrivID for which the SES MPAX registers will be unlocked.
  1842. @endverbatim
  1843. *
  1844. * <b> Return Value </b>
  1845. * @n None
  1846. *
  1847. * <b> Pre Condition </b>
  1848. * @n @a CSL_MSMC_lockSES() must be called.
  1849. *
  1850. * <b> Post Condition </b>
  1851. * @n All the SES MPAX registers for the specific PrivID are unlocked for
  1852. * write-access.
  1853. *
  1854. * @b Writes
  1855. * @n MSMC_SES_MPAX_ULCK_MGCID=0x2CD20000,MSMC_SES_MPAX_ULCK_WEN
  1856. *
  1857. * @b Example
  1858. * @verbatim
  1859. ...
  1860. if (CSL_MSMC_isSESLocked (1) == TRUE)
  1861. {
  1862. // SES MPAX Registers for Priv-ID 1 are locked.
  1863. ...
  1864. // Unlock SES MPAX registers for priv-id 1.
  1865. CSL_MSMC_unlockSES (1);
  1866. }
  1867. @endverbatim
  1868. * =============================================================================
  1869. */
  1870. static inline void CSL_MSMC_unlockSES (Uint32 privid)
  1871. {
  1872. hMsmc->SES_MPAX_ULCK = CSL_FMK(MSMC_SES_MPAX_ULCK_MGCID, 0x2CD2) | CSL_FMKR (privid, privid, 1);
  1873. }
  1874. /** ============================================================================
  1875. * @n@b CSL_MSMC_getPendingInterrupts
  1876. *
  1877. * @b Description
  1878. * @n This function gets the status of all pending interrupts i.e. which have
  1879. * been enabled and an interrupt has occurred.
  1880. *
  1881. * @b Arguments
  1882. @verbatim
  1883. pfeStat Protection Fault Status
  1884. cees Correctable EDC Error
  1885. ncees Non-Correctable EDC Error
  1886. cses Correctable Scrubbing Error
  1887. nces Non-Correctable Scrubbing Error
  1888. @endverbatim
  1889. *
  1890. * <b> Return Value </b>
  1891. * @n None
  1892. *
  1893. * <b> Pre Condition </b>
  1894. * @n None
  1895. *
  1896. * <b> Post Condition </b>
  1897. * @n None
  1898. *
  1899. * @b Reads
  1900. * @n MSMC_SMESTAT_PFESTAT, MSMC_SMESTAT_CEES, MSMC_SMESTAT_NCEES,
  1901. * @n MSMC_SMESTAT_CSES, MSMC_SMESTAT_NCSES
  1902. *
  1903. * @b Example
  1904. * @verbatim
  1905. Uint16 pfeStat;
  1906. Uint8 cees;
  1907. Uint8 ncees;
  1908. Uint8 cses;
  1909. Uint8 ncses;
  1910. // Get the MSMC Pending Interrupt Status
  1911. CSL_MSMC_getPendingInterrupts (&pfeStat,&cees, &ncees, &cses, &ncses);
  1912. @endverbatim
  1913. * =============================================================================
  1914. */
  1915. static inline void CSL_MSMC_getPendingInterrupts
  1916. (
  1917. Uint16* pfeStat,
  1918. Uint8* cees,
  1919. Uint8* ncees,
  1920. Uint8* cses,
  1921. Uint8* ncses
  1922. )
  1923. {
  1924. Uint32 value = hMsmc->SMESTAT;
  1925. *pfeStat = CSL_FEXT (value, MSMC_SMESTAT_PFESTAT);
  1926. *cees = CSL_FEXT (value, MSMC_SMESTAT_CEES);
  1927. *ncees = CSL_FEXT (value, MSMC_SMESTAT_NCEES);
  1928. *cses = CSL_FEXT (value, MSMC_SMESTAT_CSES);
  1929. *ncses = CSL_FEXT (value, MSMC_SMESTAT_NCSES);
  1930. }
  1931. /** ============================================================================
  1932. * @n@b CSL_MSMC_getRawInterruptStatus
  1933. *
  1934. * @b Description
  1935. * @n This function gets the RAW Interrupt Status.
  1936. *
  1937. * @b Arguments
  1938. @verbatim
  1939. pfeStat Protection Fault Status
  1940. cees Correctable EDC Error
  1941. ncees Non-Correctable EDC Error
  1942. cses Correctable Scrubbing Error
  1943. nces Non-Correctable Scrubbing Error
  1944. @endverbatim
  1945. *
  1946. * <b> Return Value </b>
  1947. * @n None
  1948. *
  1949. * <b> Pre Condition </b>
  1950. * @n None
  1951. *
  1952. * <b> Post Condition </b>
  1953. * @n None
  1954. *
  1955. * @b Reads
  1956. * @n MSMC_SMIRSTAT_PFESTAT, MSMC_SMIRSTAT_CEES, MSMC_SMIRSTAT_NCEES,
  1957. * @n MSMC_SMIRSTAT_CSES, MSMC_SMIRSTAT_NCSES
  1958. *
  1959. * @b Example
  1960. * @verbatim
  1961. Uint16 pfeStat;
  1962. Uint8 cees;
  1963. Uint8 ncees;
  1964. Uint8 cses;
  1965. Uint8 ncses;
  1966. // Get the MSMC Raw Interrupt Status
  1967. CSL_MSMC_getRawInterruptStatus (&pfeStat, &cees, &ncees, &cses, &ncses);
  1968. @endverbatim
  1969. * =============================================================================
  1970. */
  1971. static inline void CSL_MSMC_getRawInterruptStatus
  1972. (
  1973. Uint16* pfeStat,
  1974. Uint8* cees,
  1975. Uint8* ncees,
  1976. Uint8* cses,
  1977. Uint8* ncses
  1978. )
  1979. {
  1980. Uint32 value = hMsmc->SMIRSTAT;
  1981. *pfeStat = CSL_FEXT (value, MSMC_SMIRSTAT_PFESTAT);
  1982. *cees = CSL_FEXT (value, MSMC_SMIRSTAT_CEES);
  1983. *ncees = CSL_FEXT (value, MSMC_SMIRSTAT_NCEES);
  1984. *cses = CSL_FEXT (value, MSMC_SMIRSTAT_CSES);
  1985. *ncses = CSL_FEXT (value, MSMC_SMIRSTAT_NCSES);
  1986. }
  1987. /** ============================================================================
  1988. * @n@b CSL_MSMC_setRawInterruptStatus
  1989. *
  1990. * @b Description
  1991. * @n This function sets the RAW Interrupt Status.
  1992. *
  1993. * @b Arguments
  1994. @verbatim
  1995. pfiStat Protection Fault Status
  1996. cei Correctable EDC Error
  1997. ncei Non-Correctable EDC Error
  1998. csi Correctable Scrubbing Error
  1999. ncsi Non-Correctable Scrubbing Error
  2000. @endverbatim
  2001. *
  2002. * <b> Return Value </b>
  2003. * @n None
  2004. *
  2005. * <b> Pre Condition </b>
  2006. * @n None
  2007. *
  2008. * <b> Post Condition </b>
  2009. * @n None
  2010. *
  2011. * @b Writes
  2012. * @n MSMC_SMIRSTAT_PFESTAT, MSMC_SMIRSTAT_CEES, MSMC_SMIRSTAT_NCEES,
  2013. * @n MSMC_SMIRSTAT_CSES, MSMC_SMIRSTAT_NCSES
  2014. *
  2015. * @b Example
  2016. * @verbatim
  2017. // Ensure only the Correctable EDC Errors is set
  2018. CSL_MSMC_setRawInterruptStatus (0x0, 0x1, 0x0, 0x0, 0x0);
  2019. @endverbatim
  2020. * =============================================================================
  2021. */
  2022. static inline void CSL_MSMC_setRawInterruptStatus
  2023. (
  2024. Uint16 pfiStat,
  2025. Uint8 cei,
  2026. Uint8 ncei,
  2027. Uint8 csi,
  2028. Uint8 ncsi
  2029. )
  2030. {
  2031. hMsmc->SMIRSTAT = CSL_FMK (MSMC_SMIRSTAT_PFESTAT, pfiStat) |
  2032. CSL_FMK (MSMC_SMIRSTAT_CEES, cei) |
  2033. CSL_FMK (MSMC_SMIRSTAT_NCEES, ncei) |
  2034. CSL_FMK (MSMC_SMIRSTAT_CSES, csi) |
  2035. CSL_FMK (MSMC_SMIRSTAT_NCSES, ncsi);
  2036. }
  2037. /** ============================================================================
  2038. * @n@b CSL_MSMC_clearRawInterruptStatus
  2039. *
  2040. * @b Description
  2041. * @n This function clears the RAW Interrupt Status.
  2042. *
  2043. * @b Arguments
  2044. @verbatim
  2045. pfiStat Protection Fault Status
  2046. cei Correctable EDC Error
  2047. ncei Non-Correctable EDC Error
  2048. csi Correctable Scrubbing Error
  2049. ncsi Non-Correctable Scrubbing Error
  2050. @endverbatim
  2051. *
  2052. * <b> Return Value </b>
  2053. * @n None
  2054. *
  2055. * <b> Pre Condition </b>
  2056. * @n None
  2057. *
  2058. * <b> Post Condition </b>
  2059. * @n None
  2060. *
  2061. * @b Writes
  2062. * @n MSMC_SMIRC_PFIC, MSMC_SMIRC_MPEC, MSMC_SMIRC_CEC,
  2063. * @n MSMC_SMIRC_NCEC, MSMC_SMIRC_CSC, MSMC_SMIRC_NCSC
  2064. *
  2065. * @b Example
  2066. * @verbatim
  2067. Uint16 pfiStat;
  2068. Uint8 cei;
  2069. Uint8 ncei;
  2070. Uint8 csi;
  2071. Uint8 ncsi;
  2072. // Get the MSMC Raw Interrupt Status
  2073. CSL_MSMC_getRawInterruptStatus (&pfiStat, &cei, &ncei, &csi, &ncsi);
  2074. ...
  2075. // Clear the MSMC Interrupt Status.
  2076. CSL_MSMC_clearRawInterruptStatus (pfiStat, cei, ncei, csi, ncsi);
  2077. @endverbatim
  2078. * =============================================================================
  2079. */
  2080. static inline void CSL_MSMC_clearRawInterruptStatus
  2081. (
  2082. Uint16 pfiStat,
  2083. Uint8 cei,
  2084. Uint8 ncei,
  2085. Uint8 csi,
  2086. Uint8 ncsi
  2087. )
  2088. {
  2089. hMsmc->SMIRC = CSL_FMK (MSMC_SMIRC_PFIC, pfiStat) |
  2090. CSL_FMK (MSMC_SMIRC_CEC, cei) |
  2091. CSL_FMK (MSMC_SMIRC_NCEC, ncei) |
  2092. CSL_FMK (MSMC_SMIRC_CSC, csi) |
  2093. CSL_FMK (MSMC_SMIRC_NCSC, ncsi);
  2094. }
  2095. /** ============================================================================
  2096. * @n@b CSL_MSMC_getInterruptEnableStatus
  2097. *
  2098. * @b Description
  2099. * @n This function is used to get the interrupt enable/disable status
  2100. *
  2101. * @b Arguments
  2102. @verbatim
  2103. pfiStat Protection Fault Status
  2104. cei Correctable EDC Error
  2105. ncei Non-Correctable EDC Error
  2106. csi Correctable Scrubbing Error
  2107. ncsi Non-Correctable Scrubbing Error
  2108. @endverbatim
  2109. *
  2110. * <b> Return Value </b>
  2111. * @n None
  2112. *
  2113. * <b> Pre Condition </b>
  2114. * @n None
  2115. *
  2116. * <b> Post Condition </b>
  2117. * @n None
  2118. *
  2119. * @b Reads
  2120. * @n MSMC_SMIESTAT_PFIESTAT, MSMC_SMIESTAT_CEIE, MSMC_SMIESTAT_NCEIE,
  2121. * @n MSMC_SMIESTAT_CSIE,MSMC_SMIESTAT_NCSIE
  2122. *
  2123. * @b Example
  2124. * @verbatim
  2125. Uint16 pfiStat;
  2126. Uint8 cei;
  2127. Uint8 ncei;
  2128. Uint8 csi;
  2129. Uint8 ncsi;
  2130. // Get the interrupt enable status.
  2131. CSL_MSMC_getInterruptEnableStatus (&pfiStat, &cei, &ncei, &csi, &ncsi);
  2132. @endverbatim
  2133. * =============================================================================
  2134. */
  2135. static inline void CSL_MSMC_getInterruptEnableStatus
  2136. (
  2137. Uint16* pfiStat,
  2138. Uint8* cei,
  2139. Uint8* ncei,
  2140. Uint8* csi,
  2141. Uint8* ncsi
  2142. )
  2143. {
  2144. Uint32 value = hMsmc->SMIESTAT;
  2145. *pfiStat = CSL_FEXT (value, MSMC_SMIESTAT_PFIESTAT);
  2146. *cei = CSL_FEXT (value, MSMC_SMIESTAT_CEIE);
  2147. *ncei = CSL_FEXT (value, MSMC_SMIESTAT_NCEIE);
  2148. *csi = CSL_FEXT (value, MSMC_SMIESTAT_CSIE);
  2149. *ncsi = CSL_FEXT (value, MSMC_SMIESTAT_NCSIE);
  2150. }
  2151. /** ============================================================================
  2152. * @n@b CSL_MSMC_enableInterrupts
  2153. *
  2154. * @b Description
  2155. * @n This function enables the MSMC interrupts
  2156. *
  2157. * @b Arguments
  2158. @verbatim
  2159. pfiStat Protection Fault Status
  2160. cei Correctable EDC Error
  2161. ncei Non-Correctable EDC Error
  2162. csi Correctable Scrubbing Error
  2163. ncsi Non-Correctable Scrubbing Error
  2164. @endverbatim
  2165. *
  2166. * <b> Return Value </b>
  2167. * @n None
  2168. *
  2169. * <b> Pre Condition </b>
  2170. * @n None
  2171. *
  2172. * <b> Post Condition </b>
  2173. * @n None
  2174. *
  2175. * @b Writes
  2176. * @n MSMC_SMIESTAT_PFIESTAT, MSMC_SMIESTAT_CEIE, MSMC_SMIESTAT_NCEIE,
  2177. * @n MSMC_SMIESTAT_CSIE,MSMC_SMIESTAT_NCSIE
  2178. *
  2179. * @b Example
  2180. * @verbatim
  2181. // Enable all interrupts except the scrubbing errors.
  2182. CSL_MSMC_enableInterrupts (0xFFFF, 0x1, 0x1, 0x0, 0x0);
  2183. @endverbatim
  2184. * =============================================================================
  2185. */
  2186. static inline void CSL_MSMC_enableInterrupts
  2187. (
  2188. Uint16 pfiStat,
  2189. Uint8 cei,
  2190. Uint8 ncei,
  2191. Uint8 csi,
  2192. Uint8 ncsi
  2193. )
  2194. {
  2195. hMsmc->SMIESTAT = CSL_FMK (MSMC_SMIESTAT_PFIESTAT, pfiStat) |
  2196. CSL_FMK (MSMC_SMIESTAT_CEIE, cei) |
  2197. CSL_FMK (MSMC_SMIESTAT_NCEIE, ncei) |
  2198. CSL_FMK (MSMC_SMIESTAT_CSIE, csi) |
  2199. CSL_FMK (MSMC_SMIESTAT_NCSIE, ncsi);
  2200. }
  2201. /** ============================================================================
  2202. * @n@b CSL_MSMC_disableInterrupts
  2203. *
  2204. * @b Description
  2205. * @n This function disables the MSMC interrupts
  2206. *
  2207. * @b Arguments
  2208. @verbatim
  2209. pfiStat Protection Fault Status
  2210. cei Correctable EDC Error
  2211. ncei Non-Correctable EDC Error
  2212. csi Correctable Scrubbing Error
  2213. ncsi Non-Correctable Scrubbing Error
  2214. @endverbatim
  2215. *
  2216. * <b> Return Value </b>
  2217. * @n None
  2218. *
  2219. * <b> Pre Condition </b>
  2220. * @n None
  2221. *
  2222. * <b> Post Condition </b>
  2223. * @n None
  2224. *
  2225. * @b Writes
  2226. * @n MSMC_SMIEC_PFIEC, MSMC_SMIEC_CEEC, MSMC_SMIEC_NCEEC,
  2227. * @n MSMC_SMIEC_CSEC, MSMC_SMIEC_NCSEC
  2228. *
  2229. * @b Example
  2230. * @verbatim
  2231. // Disable all interrupts except the scrubbing errors.
  2232. CSL_MSMC_disableInterrupts (0xFFFF, 0x1, 0x1, 0x0, 0x0);
  2233. @endverbatim
  2234. * =============================================================================
  2235. */
  2236. static inline void CSL_MSMC_disableInterrupts
  2237. (
  2238. Uint16 pfiStat,
  2239. Uint8 cei,
  2240. Uint8 ncei,
  2241. Uint8 csi,
  2242. Uint8 ncsi
  2243. )
  2244. {
  2245. hMsmc->SMIEC = CSL_FMK (MSMC_SMIEC_PFIEC, pfiStat) |
  2246. CSL_FMK (MSMC_SMIEC_CEEC, cei) |
  2247. CSL_FMK (MSMC_SMIEC_NCEEC, ncei) |
  2248. CSL_FMK (MSMC_SMIEC_CSEC, csi) |
  2249. CSL_FMK (MSMC_SMIEC_NCSEC, ncsi);
  2250. }
  2251. /** ============================================================================
  2252. * @n@b CSL_MSMC_getTransmitHeader
  2253. *
  2254. * @b Description
  2255. * @n This function gets the transmit header for analysis counter state
  2256. * export through STM
  2257. *
  2258. * @b Arguments
  2259. * @n None
  2260. *
  2261. * <b> Return Value </b>
  2262. * @n Transmit Header
  2263. *
  2264. * <b> Pre Condition </b>
  2265. * @n None
  2266. *
  2267. * <b> Post Condition </b>
  2268. * @n None
  2269. *
  2270. * @b Reads
  2271. * @n MSMC_SMATH
  2272. *
  2273. * @b Example
  2274. * @verbatim
  2275. Uint32 transmitHeader;
  2276. // Get the Transmit Header
  2277. transmitHeader = CSL_MSMC_getTransmitHeader();
  2278. @endverbatim
  2279. * =============================================================================
  2280. */
  2281. static inline Uint32 CSL_MSMC_getTransmitHeader (void)
  2282. {
  2283. return hMsmc->SMATH;
  2284. }
  2285. /** ============================================================================
  2286. * @n@b CSL_MSMC_setTransmitHeader
  2287. *
  2288. * @b Description
  2289. * @n This function sets the transmit header for analysis counter state
  2290. * export through STM
  2291. *
  2292. * @b Arguments
  2293. @verbatim
  2294. transmitHeader Transmit header to be configured
  2295. @endverbatim
  2296. *
  2297. * <b> Return Value </b>
  2298. * @n None
  2299. *
  2300. * <b> Pre Condition </b>
  2301. * @n None
  2302. *
  2303. * <b> Post Condition </b>
  2304. * @n None
  2305. *
  2306. * @b Writes
  2307. * @n MSMC_SMATH
  2308. *
  2309. * @b Example
  2310. * @verbatim
  2311. // Set the Transmit Header
  2312. CSL_MSMC_getTransmitHeader(0x100);
  2313. @endverbatim
  2314. * =============================================================================
  2315. */
  2316. static inline void CSL_MSMC_setTransmitHeader (Uint32 transmitHeader)
  2317. {
  2318. hMsmc->SMATH = transmitHeader;
  2319. }
  2320. /** ============================================================================
  2321. * @n@b CSL_MSMC_getHitCounter
  2322. *
  2323. * @b Description
  2324. * @n This function gets the hit counter for the cache. If the HM bit in SMAC
  2325. * is set, it is a counter for Cache hits+SRAM accesses
  2326. *
  2327. * @b Arguments
  2328. * @n None
  2329. *
  2330. * <b> Return Value </b>
  2331. * @n Hit Counter
  2332. *
  2333. * <b> Pre Condition </b>
  2334. * @n None
  2335. *
  2336. * <b> Post Condition </b>
  2337. * @n None
  2338. *
  2339. * @b Reads
  2340. * @n MSMC_SMAH_HCNT
  2341. *
  2342. * @b Example
  2343. * @verbatim
  2344. Uint32 hitCounter;
  2345. // Get the Hit Counter
  2346. hitCounter = CSL_MSMC_getHitCounter();
  2347. @endverbatim
  2348. * =============================================================================
  2349. */
  2350. static inline Uint32 CSL_MSMC_getHitCounter (void)
  2351. {
  2352. return CSL_FEXT (hMsmc->SMAH, MSMC_SMAH_HCNT);
  2353. }
  2354. /** ============================================================================
  2355. * @n@b CSL_MSMC_setHitCounter
  2356. *
  2357. * @b Description
  2358. * @n This function sets the hit counter for the cache. If the HM bit in SMAC
  2359. * is set, it is a counter for Cache hits+SRAM accesses
  2360. *
  2361. * @b Arguments
  2362. * @n hitCounter - Hit Counter to be configured.
  2363. *
  2364. * <b> Return Value </b>
  2365. * @n None
  2366. *
  2367. * <b> Pre Condition </b>
  2368. * @n None
  2369. *
  2370. * <b> Post Condition </b>
  2371. * @n None
  2372. *
  2373. * @b Writes
  2374. * @n MSMC_SMAH_HCNT
  2375. *
  2376. * @b Example
  2377. * @verbatim
  2378. // Reset the hit counter
  2379. CSL_MSMC_setHitCounter(0);
  2380. @endverbatim
  2381. * =============================================================================
  2382. */
  2383. static inline void CSL_MSMC_setHitCounter (Uint32 hitCounter)
  2384. {
  2385. CSL_FINS (hMsmc->SMAH, MSMC_SMAH_HCNT, hitCounter);
  2386. }
  2387. /** ============================================================================
  2388. * @n@b CSL_MSMC_getMissCounter
  2389. *
  2390. * @b Description
  2391. * @n This function gets the reads/write miss counters
  2392. *
  2393. * @b Arguments
  2394. @verbatim
  2395. readMissCntr Read Miss Counter
  2396. writeMissCntr Write Miss Counter
  2397. @endverbatim
  2398. *
  2399. * <b> Return Value </b>
  2400. * @n None
  2401. *
  2402. * <b> Pre Condition </b>
  2403. * @n None
  2404. *
  2405. * <b> Post Condition </b>
  2406. * @n None
  2407. *
  2408. * @b Reads
  2409. * @n MSMC_SMARM_RMCNT,MSMC_SMAWM_WMCNT
  2410. *
  2411. * @b Example
  2412. * @verbatim
  2413. Uint32 readMiss;
  2414. Uint32 writeMiss;
  2415. // Get the Read and Write Miss Counters
  2416. CSL_MSMC_getMissCounter(&readMiss, &writeMiss);
  2417. @endverbatim
  2418. * =============================================================================
  2419. */
  2420. static inline void CSL_MSMC_getMissCounter (Uint32* readMiss, Uint32* writeMiss)
  2421. {
  2422. *readMiss = CSL_FEXT (hMsmc->SMARM, MSMC_SMARM_RMCNT);
  2423. *writeMiss = CSL_FEXT (hMsmc->SMAWM, MSMC_SMAWM_WMCNT);
  2424. }
  2425. /** ============================================================================
  2426. * @n@b CSL_MSMC_setMissCounter
  2427. *
  2428. * @b Description
  2429. * @n This function sets the reads/write miss counters
  2430. *
  2431. * @b Arguments
  2432. @verbatim
  2433. readMissCntr Read Miss Counter
  2434. writeMissCntr Write Miss Counter
  2435. @endverbatim
  2436. *
  2437. * <b> Return Value </b>
  2438. * @n None
  2439. *
  2440. * <b> Pre Condition </b>
  2441. * @n None
  2442. *
  2443. * <b> Post Condition </b>
  2444. * @n None
  2445. *
  2446. * @b Writes
  2447. * @n MSMC_SMARM_RMCNT, MSMC_SMAWM_WMCNT
  2448. *
  2449. * @b Example
  2450. * @verbatim
  2451. // Clear the Read & Write Miss Counters
  2452. CSL_MSMC_getMissCounter(&readMiss, &writeMiss);
  2453. @endverbatim
  2454. * =============================================================================
  2455. */
  2456. static inline void CSL_MSMC_setMissCounter (Uint32 readMiss, Uint32 writeMiss)
  2457. {
  2458. CSL_FINS (hMsmc->SMARM, MSMC_SMARM_RMCNT, readMiss);
  2459. CSL_FINS (hMsmc->SMAWM, MSMC_SMAWM_WMCNT, writeMiss);
  2460. }
  2461. /** ============================================================================
  2462. * @n@b CSL_MSMC_getVictimCounter
  2463. *
  2464. * @b Description
  2465. * @n This function gets the victim counter
  2466. *
  2467. * @b Arguments
  2468. * @n None
  2469. *
  2470. * <b> Return Value </b>
  2471. * @n Victim Counter
  2472. *
  2473. * <b> Pre Condition </b>
  2474. * @n None
  2475. *
  2476. * <b> Post Condition </b>
  2477. * @n None
  2478. *
  2479. * @b Reads
  2480. * @n MSMC_SMAV_VCNT
  2481. *
  2482. * @b Example
  2483. * @verbatim
  2484. Uint32 victimCounter;
  2485. // Get the Victim Counter
  2486. victimCounter = CSL_MSMC_getVictimCounter();
  2487. @endverbatim
  2488. * =============================================================================
  2489. */
  2490. static inline Uint32 CSL_MSMC_getVictimCounter (void)
  2491. {
  2492. return CSL_FEXT (hMsmc->SMAV, MSMC_SMAV_VCNT);
  2493. }
  2494. /** ============================================================================
  2495. * @n@b CSL_MSMC_setVictimCounter
  2496. *
  2497. * @b Description
  2498. * @n This function sets the victim counter
  2499. *
  2500. * @b Arguments
  2501. * @n None
  2502. *
  2503. * <b> Return Value </b>
  2504. * @n Victim Counter
  2505. *
  2506. * <b> Pre Condition </b>
  2507. * @n None
  2508. *
  2509. * <b> Post Condition </b>
  2510. * @n None
  2511. *
  2512. * @b Writes
  2513. * @n MSMC_SMAV_VCNT
  2514. *
  2515. * @b Example
  2516. * @verbatim
  2517. // Reset the Victim Counter
  2518. CSL_MSMC_setVictimCounter(0);
  2519. @endverbatim
  2520. * =============================================================================
  2521. */
  2522. static inline void CSL_MSMC_setVictimCounter (Uint32 victimCounter)
  2523. {
  2524. CSL_FINS (hMsmc->SMAV, MSMC_SMAV_VCNT, victimCounter);
  2525. }
  2526. /** ============================================================================
  2527. * @n@b CSL_MSMC_getMemoryArbiterCounters
  2528. *
  2529. * @b Description
  2530. * @n This function gets the performance counters for the memory arbiters
  2531. * (all banks).
  2532. *
  2533. * @b Arguments
  2534. @verbatim
  2535. priorityElevationCounter Priority Elevation Counter
  2536. accCyclesCounter Accumulated Cycles counter
  2537. @endverbatim
  2538. *
  2539. * <b> Return Value </b>
  2540. * @n None
  2541. *
  2542. * <b> Pre Condition </b>
  2543. * @n None
  2544. *
  2545. * <b> Post Condition </b>
  2546. * @n None
  2547. *
  2548. * @b Reads
  2549. * @n MSMC_SMAMP_MPECNT, MSMC_SMAMP_ACWM
  2550. *
  2551. * @b Example
  2552. * @verbatim
  2553. Uint8 priorityElevationCounter;
  2554. Uint32 accCyclesCounter;
  2555. // Get the Memory Arbiter Counters
  2556. CSL_MSMC_getMemoryArbiterCounters(&priorityElevationCounter, &accCyclesCounter);
  2557. @endverbatim
  2558. * =============================================================================
  2559. */
  2560. static inline void CSL_MSMC_getMemoryArbiterCounters
  2561. (
  2562. Uint8* priorityElevationCounter,
  2563. Uint32* accCyclesCounter
  2564. )
  2565. {
  2566. *priorityElevationCounter = CSL_FEXT (hMsmc->SMAMP, MSMC_SMAMP_MPECNT);
  2567. *accCyclesCounter = CSL_FEXT (hMsmc->SMAMP, MSMC_SMAMP_ACWM);
  2568. }
  2569. /** ============================================================================
  2570. * @n@b CSL_MSMC_setMemoryArbiterCounters
  2571. *
  2572. * @b Description
  2573. * @n This function sets the performance counters for the memory arbiters
  2574. * (all banks).
  2575. *
  2576. * @b Arguments
  2577. @verbatim
  2578. accCyclesCounter Accumulated Cycles counter
  2579. @endverbatim
  2580. *
  2581. * <b> Return Value </b>
  2582. * @n None
  2583. *
  2584. * <b> Pre Condition </b>
  2585. * @n None
  2586. *
  2587. * <b> Post Condition </b>
  2588. * @n None
  2589. *
  2590. * @b Writes
  2591. * @n MSMC_SMAMP_ACWM
  2592. *
  2593. * @b Example
  2594. * @verbatim
  2595. // Clear the Memory Arbiter Counters
  2596. CSL_MSMC_setMemoryArbiterCounters(0);
  2597. @endverbatim
  2598. * =============================================================================
  2599. */
  2600. static inline void CSL_MSMC_setMemoryArbiterCounters(Uint32 accCyclesCounter)
  2601. {
  2602. CSL_FINS (hMsmc->SMAMP, MSMC_SMAMP_ACWM, accCyclesCounter);
  2603. }
  2604. /** ============================================================================
  2605. * @n@b CSL_MSMC_getPortArbiterCounters
  2606. *
  2607. * @b Description
  2608. * @n This function gets the performance counters for the port arbiters
  2609. *
  2610. * @b Arguments
  2611. @verbatim
  2612. priorityElevationCounter Priority Elevation Counter
  2613. accCyclesCounter Accumulated Cycles counter
  2614. @endverbatim
  2615. *
  2616. * <b> Return Value </b>
  2617. * @n None
  2618. *
  2619. * <b> Pre Condition </b>
  2620. * @n None
  2621. *
  2622. * <b> Post Condition </b>
  2623. * @n None
  2624. *
  2625. * @b Reads
  2626. * @n MSMC_SMAEP_EPECNT, MSMC_SMAEP_ACWE
  2627. *
  2628. * @b Example
  2629. * @verbatim
  2630. Uint8 priorityElevationCounter;
  2631. Uint32 accCyclesCounter;
  2632. // Get the Port Arbiter Counters
  2633. CSL_MSMC_getPortArbiterCounters(&priorityElevationCounter, &accCyclesCounter);
  2634. @endverbatim
  2635. * =============================================================================
  2636. */
  2637. static inline void CSL_MSMC_getPortArbiterCounters
  2638. (
  2639. Uint8* priorityElevationCounter,
  2640. Uint32* accCyclesCounter
  2641. )
  2642. {
  2643. *priorityElevationCounter = CSL_FEXT (hMsmc->SMAEP, MSMC_SMAEP_EPECNT);
  2644. *accCyclesCounter = CSL_FEXT (hMsmc->SMAEP, MSMC_SMAEP_ACWE);
  2645. }
  2646. /** ============================================================================
  2647. * @n@b CSL_MSMC_setPortArbiterCounters
  2648. *
  2649. * @b Description
  2650. * @n This function sets the performance counters for the port arbiters
  2651. *
  2652. * @b Arguments
  2653. @verbatim
  2654. accCyclesCounter Accumulated Cycles counter
  2655. @endverbatim
  2656. *
  2657. * <b> Return Value </b>
  2658. * @n None
  2659. *
  2660. * <b> Pre Condition </b>
  2661. * @n None
  2662. *
  2663. * <b> Post Condition </b>
  2664. * @n None
  2665. *
  2666. * @b Writes
  2667. * @n MSMC_SMAEP_ACWE
  2668. *
  2669. * @b Example
  2670. * @verbatim
  2671. // Reset the Port Arbiter Counters
  2672. CSL_MSMC_setPortArbiterCounters(0);
  2673. @endverbatim
  2674. * =============================================================================
  2675. */
  2676. static inline void CSL_MSMC_setPortArbiterCounters(Uint32 accCyclesCounter)
  2677. {
  2678. CSL_FINS (hMsmc->SMAEP, MSMC_SMAEP_ACWE, accCyclesCounter);
  2679. }
  2680. /** ============================================================================
  2681. * @n@b CSL_MSMC_getPerfFilters
  2682. *
  2683. * @b Description
  2684. * @n This function gets the performance counters filters
  2685. *
  2686. * @b Arguments
  2687. @verbatim
  2688. ccf CPU filter for counters
  2689. pidf System request PrivID filter for counters
  2690. hm Selects if SMAH:HCNT counts only cache hits or SRAM accesses
  2691. pth Priority threshold filter
  2692. @endverbatim
  2693. *
  2694. * <b> Return Value </b>
  2695. * @n None
  2696. *
  2697. * <b> Pre Condition </b>
  2698. * @n None
  2699. *
  2700. * <b> Post Condition </b>
  2701. * @n None
  2702. *
  2703. * @b Reads
  2704. * @n MSMC_SMAC_CCF, MSMC_SMAC_PIDF, MSMC_SMAC_HM, MSMC_SMAC_PTH
  2705. *
  2706. * @b Example
  2707. * @verbatim
  2708. Uint8 ccf;
  2709. Uint16 pidf;
  2710. Uint8 hm;
  2711. Uint8 pth;
  2712. // Get the Performance Filters
  2713. CSL_MSMC_getPerfFilters(&ccf, &pidf, &hm, &pth);
  2714. @endverbatim
  2715. * =============================================================================
  2716. */
  2717. static inline void CSL_MSMC_getPerfFilters
  2718. (
  2719. Uint8* ccf,
  2720. Uint16* pidf,
  2721. Uint8* hm,
  2722. Uint8* pth
  2723. )
  2724. {
  2725. Uint32 value = hMsmc->SMAC;
  2726. *ccf = CSL_FEXT (value, MSMC_SMAC_CCF);
  2727. *pidf = CSL_FEXT (value, MSMC_SMAC_PIDF);
  2728. *hm = CSL_FEXT (value, MSMC_SMAC_HM);
  2729. *pth = CSL_FEXT (value, MSMC_SMAC_PTH);
  2730. }
  2731. /** ============================================================================
  2732. * @n@b CSL_MSMC_setPerfFilters
  2733. *
  2734. * @b Description
  2735. * @n This function sets the performance counters filters
  2736. *
  2737. * @b Arguments
  2738. @verbatim
  2739. ccf CPU filter for counters
  2740. pidf System request PrivID filter for counters
  2741. hm Selects if SMAH:HCNT counts only cache hits or SRAM accesses
  2742. pth Priority threshold filter
  2743. @endverbatim
  2744. *
  2745. * <b> Return Value </b>
  2746. * @n None
  2747. *
  2748. * <b> Pre Condition </b>
  2749. * @n None
  2750. *
  2751. * <b> Post Condition </b>
  2752. * @n None
  2753. *
  2754. * @b Writes
  2755. * @n MSMC_SMAC_CCF, MSMC_SMAC_PIDF, MSMC_SMAC_HM, MSMC_SMAC_PTH
  2756. *
  2757. * @b Example
  2758. * @verbatim
  2759. Uint8 ccf;
  2760. Uint16 pidf;
  2761. Uint8 hm;
  2762. Uint8 pth;
  2763. // Get the Performance Filters
  2764. CSL_MSMC_getPerfFilters(&ccf, &pidf, &hm, &pth);
  2765. ...
  2766. // Make sure we counter SRAM access also.
  2767. CSL_MSMC_setPerfFilters(ccf, pidf, 1, pth);
  2768. ...
  2769. @endverbatim
  2770. * =============================================================================
  2771. */
  2772. static inline void CSL_MSMC_setPerfFilters
  2773. (
  2774. Uint8 ccf,
  2775. Uint16 pidf,
  2776. Uint8 hm,
  2777. Uint8 pth
  2778. )
  2779. {
  2780. hMsmc->SMAC = CSL_FMK(MSMC_SMAC_CCF, ccf) |
  2781. CSL_FMK(MSMC_SMAC_PIDF, pidf) |
  2782. CSL_FMK(MSMC_SMAC_HM, hm) |
  2783. CSL_FMK(MSMC_SMAC_PTH, pth);
  2784. }
  2785. /** ============================================================================
  2786. * @n@b CSL_MSMC_enableAnalysisCounter
  2787. *
  2788. * @b Description
  2789. * @n This function enables the analysis counters
  2790. *
  2791. * @b Arguments
  2792. * @n None
  2793. *
  2794. * <b> Return Value </b>
  2795. * @n None
  2796. *
  2797. * <b> Pre Condition </b>
  2798. * @n None
  2799. *
  2800. * <b> Post Condition </b>
  2801. * @n None
  2802. *
  2803. * @b Writes
  2804. * @n MSMC_SMAC_AEN=1
  2805. *
  2806. * @b Example
  2807. * @verbatim
  2808. // Enables the performance analysis counter
  2809. CSL_MSMC_enableAnalysisCounter();
  2810. @endverbatim
  2811. * =============================================================================
  2812. */
  2813. static inline void CSL_MSMC_enableAnalysisCounter (void)
  2814. {
  2815. CSL_FINS (hMsmc->SMAC, MSMC_SMAC_AEN, 1);
  2816. }
  2817. /** ============================================================================
  2818. * @n@b CSL_MSMC_disableAnalysisCounter
  2819. *
  2820. * @b Description
  2821. * @n This function disables the analysis counters
  2822. *
  2823. * @b Arguments
  2824. * @n None
  2825. *
  2826. * <b> Return Value </b>
  2827. * @n None
  2828. *
  2829. * <b> Pre Condition </b>
  2830. * @n None
  2831. *
  2832. * <b> Post Condition </b>
  2833. * @n None
  2834. *
  2835. * @b Writes
  2836. * @n MSMC_SMAC_AEN=0
  2837. *
  2838. * @b Example
  2839. * @verbatim
  2840. // Disables the performance analysis counter
  2841. CSL_MSMC_disableAnalysisCounter();
  2842. @endverbatim
  2843. * =============================================================================
  2844. */
  2845. static inline void CSL_MSMC_disableAnalysisCounter (void)
  2846. {
  2847. CSL_FINS (hMsmc->SMAC, MSMC_SMAC_AEN, 0);
  2848. }
  2849. /** ============================================================================
  2850. * @n@b CSL_MSMC_getPriorityLevel
  2851. *
  2852. * @b Description
  2853. * @n This function gets the priority level used for software initiated
  2854. * global invalidate
  2855. *
  2856. * @b Arguments
  2857. * @n None
  2858. *
  2859. * <b> Return Value </b>
  2860. * @n None
  2861. *
  2862. * <b> Pre Condition </b>
  2863. * @n None
  2864. *
  2865. * <b> Post Condition </b>
  2866. * @n None
  2867. *
  2868. * @b Reads
  2869. * @n MSMC_SMCFG_INVP
  2870. *
  2871. * @b Example
  2872. * @verbatim
  2873. Uint8 priorityLevel;
  2874. // Get the priority Level.
  2875. priorityLevel = CSL_MSMC_getPriorityLevel ();
  2876. @endverbatim
  2877. * =============================================================================
  2878. */
  2879. static inline Uint8 CSL_MSMC_getPriorityLevel (void)
  2880. {
  2881. return CSL_FEXT (hMsmc->SMCFG, MSMC_SMCFG_INVP);
  2882. }
  2883. /** ============================================================================
  2884. * @n@b CSL_MSMC_setPriorityLevel
  2885. *
  2886. * @b Description
  2887. * @n This function sets the priority level used for software initiated
  2888. * global invalidate
  2889. *
  2890. * @b Arguments
  2891. * @n None
  2892. *
  2893. * <b> Return Value </b>
  2894. * @n None
  2895. *
  2896. * <b> Pre Condition </b>
  2897. * @n None
  2898. *
  2899. * <b> Post Condition </b>
  2900. * @n None
  2901. *
  2902. * @b Writes
  2903. * @n MSMC_SMCFG_INVP
  2904. *
  2905. * @b Example
  2906. * @verbatim
  2907. // Set the priority Level.
  2908. CSL_MSMC_setPriorityLevel (0x1);
  2909. @endverbatim
  2910. * =============================================================================
  2911. */
  2912. static inline void CSL_MSMC_setPriorityLevel (Uint8 priorityLevel)
  2913. {
  2914. CSL_FINS (hMsmc->SMCFG, MSMC_SMCFG_INVP, priorityLevel);
  2915. }
  2916. /** ============================================================================
  2917. * @n@b CSL_MSMC_freezeCache
  2918. *
  2919. * @b Description
  2920. * @n This function freezes the MSMC cache
  2921. *
  2922. * @b Arguments
  2923. * @n None
  2924. *
  2925. * <b> Return Value </b>
  2926. * @n None
  2927. *
  2928. * <b> Pre Condition </b>
  2929. * @n None
  2930. *
  2931. * <b> Post Condition </b>
  2932. * @n None
  2933. *
  2934. * @b Writes
  2935. * @n MSMC_SMCFG_EFZ=1
  2936. *
  2937. * @b Example
  2938. * @verbatim
  2939. // Freeze the MSMC Cache
  2940. CSL_MSMC_freezeCache ();
  2941. @endverbatim
  2942. * =============================================================================
  2943. */
  2944. static inline void CSL_MSMC_freezeCache (void)
  2945. {
  2946. CSL_FINS (hMsmc->SMCFG, MSMC_SMCFG_EFZ, 1);
  2947. }
  2948. /** ============================================================================
  2949. * @n@b CSL_MSMC_unFreezeCache
  2950. *
  2951. * @b Description
  2952. * @n This function unfreezes the MSMC cache
  2953. *
  2954. * @b Arguments
  2955. * @n None
  2956. *
  2957. * <b> Return Value </b>
  2958. * @n None
  2959. *
  2960. * <b> Pre Condition </b>
  2961. * @n None
  2962. *
  2963. * <b> Post Condition </b>
  2964. * @n None
  2965. *
  2966. * @b Writes
  2967. * @n MSMC_SMCFG_EFZ=0
  2968. *
  2969. * @b Example
  2970. * @verbatim
  2971. // Unfreeze the MSMC Cache
  2972. CSL_MSMC_unFreezeCache ();
  2973. @endverbatim
  2974. * =============================================================================
  2975. */
  2976. static inline void CSL_MSMC_unFreezeCache (void)
  2977. {
  2978. CSL_FINS (hMsmc->SMCFG, MSMC_SMCFG_EFZ, 0);
  2979. }
  2980. /** ============================================================================
  2981. * @n@b CSL_MSMC_isCacheFrozen
  2982. *
  2983. * @b Description
  2984. * @n This function checks if the MSMC cache is frozen or not?
  2985. *
  2986. * @b Arguments
  2987. * @n None
  2988. *
  2989. * <b> Return Value </b>
  2990. * @n TRUE - Cache is frozen
  2991. * @n FALSE - Cache is not frozen
  2992. *
  2993. * <b> Pre Condition </b>
  2994. * @n None
  2995. *
  2996. * <b> Post Condition </b>
  2997. * @n None
  2998. *
  2999. * @b Reads
  3000. * @n MSMC_SMCFG_EFZ
  3001. *
  3002. * @b Example
  3003. * @verbatim
  3004. // Check the status of the cache
  3005. if (CSL_MSMC_isCacheFrozen () == TRUE)
  3006. {
  3007. // Cache is frozen.
  3008. }
  3009. else
  3010. {
  3011. // Cache is NOT frozen.
  3012. }
  3013. @endverbatim
  3014. * =============================================================================
  3015. */
  3016. static inline Bool CSL_MSMC_isCacheFrozen (void)
  3017. {
  3018. if (CSL_FEXT (hMsmc->SMCFG, MSMC_SMCFG_EFZ) == 1)
  3019. return TRUE;
  3020. return FALSE;
  3021. }
  3022. /** ============================================================================
  3023. * @n@b CSL_MSMC_invalidateCache
  3024. *
  3025. * @b Description
  3026. * @n This function does a global invalidation of all the lines in the cache.
  3027. *
  3028. * @b Arguments
  3029. * @n None
  3030. *
  3031. * <b> Return Value </b>
  3032. * @n None
  3033. *
  3034. * <b> Pre Condition </b>
  3035. * @n None
  3036. *
  3037. * <b> Post Condition </b>
  3038. * @n All Cache lines are invalidated.
  3039. *
  3040. * @b Writes
  3041. * @n MSMC_SMCFG_GIW=1
  3042. *
  3043. * @b Example
  3044. * @verbatim
  3045. CSL_MSMC_invalidateCache ();
  3046. @endverbatim
  3047. * =============================================================================
  3048. */
  3049. static inline void CSL_MSMC_invalidateCache (void)
  3050. {
  3051. CSL_FINS (hMsmc->SMCFG, MSMC_SMCFG_GIW, 1);
  3052. }
  3053. /** ============================================================================
  3054. * @n@b CSL_MSMC_getInvalidateCacheStatus
  3055. *
  3056. * @b Description
  3057. * @n This function returns the value of invalidate bit in SMCFG register.
  3058. *
  3059. * @b Arguments
  3060. * @n None
  3061. *
  3062. * <b> Return Value </b>
  3063. *
  3064. * <b> Pre Condition </b>
  3065. * @n None
  3066. *
  3067. * <b> Post Condition </b>
  3068. * @n None
  3069. *
  3070. * @b Reads
  3071. * @n MSMC_SMCFG_GIW
  3072. *
  3073. * @b Example
  3074. * @verbatim
  3075. Uint32 invStatus;
  3076. invStatus = CSL_MSMC_getInvalidateCacheStatus ();
  3077. @endverbatim
  3078. * =============================================================================
  3079. */
  3080. static inline Uint32 CSL_MSMC_getInvalidateCacheStatus (void)
  3081. {
  3082. return CSL_FEXT (hMsmc->SMCFG, MSMC_SMCFG_GIW);
  3083. }
  3084. /** ============================================================================
  3085. * @n@b CSL_MSMC_setCacheSize
  3086. *
  3087. * @b Description
  3088. * @n This function sets the amount of memory configured as cache.
  3089. *
  3090. * @b Arguments
  3091. @verbatim
  3092. cmode size of cache
  3093. @endverbatim
  3094. *
  3095. * <b> Return Value </b>
  3096. * @n None
  3097. *
  3098. * <b> Pre Condition </b>
  3099. * @n None
  3100. *
  3101. * <b> Post Condition </b>
  3102. * @n MSMC Cache Memory Size is configured.
  3103. *
  3104. * @b Writes
  3105. * @n MSMC_SMCFG_CMODE
  3106. *
  3107. * @b Example
  3108. * @verbatim
  3109. CSL_MSMC_setCacheSize (2);
  3110. @endverbatim
  3111. * =============================================================================
  3112. */
  3113. static inline void CSL_MSMC_setCacheSize (Uint32 cmode)
  3114. {
  3115. CSL_FINS (hMsmc->SMCFG, MSMC_SMCFG_CMODE, cmode);
  3116. }
  3117. /** ============================================================================
  3118. * @n@b CSL_MSMC_getCacheSize
  3119. *
  3120. * @b Description
  3121. * @n This function returns the amount of memory configured as cache.
  3122. *
  3123. * @b Arguments
  3124. * @n None
  3125. *
  3126. * <b> Return Value </b>
  3127. * @n Cache Size
  3128. *
  3129. * <b> Pre Condition </b>
  3130. * @n None
  3131. *
  3132. * <b> Post Condition </b>
  3133. * @n None
  3134. *
  3135. * @b Reads
  3136. * @n MSMC_SMCFG_CMODE
  3137. *
  3138. * @b Example
  3139. * @verbatim
  3140. Uint32 cacheSize;
  3141. cacheSize = CSL_MSMC_getCacheSize ();
  3142. @endverbatim
  3143. * =============================================================================
  3144. */
  3145. static inline Uint32 CSL_MSMC_getCacheSize (void)
  3146. {
  3147. return CSL_FEXT (hMsmc->SMCFG, MSMC_SMCFG_CMODE);
  3148. }
  3149. /** ============================================================================
  3150. * @n@b CSL_MSMC_getSharedMemoryErrorAddress
  3151. *
  3152. * @b Description
  3153. * @n This function returns the lower 32 bits of the 36 bit address used in the
  3154. * accessing the corrupted location.
  3155. *
  3156. * @b Arguments
  3157. * @n None
  3158. *
  3159. * <b> Return Value </b>
  3160. * @n Shared Memory Error Address
  3161. *
  3162. * <b> Pre Condition </b>
  3163. * @n None
  3164. *
  3165. * <b> Post Condition </b>
  3166. * @n None
  3167. *
  3168. * @b Reads
  3169. * @n MSMC_SMNCERRAR
  3170. *
  3171. * @b Example
  3172. * @verbatim
  3173. Uint32 memErrAddress;
  3174. memErrAddress = CSL_MSMC_getSharedMemoryErrorAddress ();
  3175. @endverbatim
  3176. * =============================================================================
  3177. */
  3178. static inline Uint32 CSL_MSMC_getSharedMemoryErrorAddress (void)
  3179. {
  3180. return hMsmc->SMNCERRAR;
  3181. }
  3182. /** ============================================================================
  3183. * @n@b CSL_MSMC_getSharedMemoryErrorAddressExtendedInfo
  3184. *
  3185. * @b Description
  3186. * @n This function returns extended information i.e. upper 4 bits, priv id
  3187. * which caused the error which accessing the corrupted location.
  3188. *
  3189. * @b Arguments
  3190. * @n None
  3191. *
  3192. * <b> Return Value </b>
  3193. * @n Shared Memory Extended Information
  3194. *
  3195. * <b> Pre Condition </b>
  3196. * @n None
  3197. *
  3198. * <b> Post Condition </b>
  3199. * @n None
  3200. *
  3201. * @b Reads
  3202. * @n MSMC_SMNCERRXR_SEEADDR, MSMC_SMNCERRXR_SEPID, MSMC_SMNCERRXR_SER
  3203. *
  3204. * @b Example
  3205. * @verbatim
  3206. Uint8 seeAddr;
  3207. Uint8 sepId;
  3208. Uint8 ser;
  3209. CSL_MSMC_getSharedMemoryErrorAddressExtendedInfo (&seeAddr, &sepId, &ser);
  3210. @endverbatim
  3211. * =============================================================================
  3212. */
  3213. static inline void CSL_MSMC_getSharedMemoryErrorAddressExtendedInfo
  3214. (
  3215. Uint8* seeAddr,
  3216. Uint8* sepId,
  3217. Uint8* ser
  3218. )
  3219. {
  3220. Uint32 value = hMsmc->SMNCERRXR;
  3221. *seeAddr = CSL_FEXT (value, MSMC_SMNCERRXR_SEEADDR);
  3222. *sepId = CSL_FEXT (value, MSMC_SMNCERRXR_SEPID);
  3223. *ser = CSL_FEXT (value, MSMC_SMNCERRXR_SER);
  3224. }
  3225. /** ============================================================================
  3226. * @n@b CSL_MSMC_getScrubbingEngineErrorAddress
  3227. *
  3228. * @b Description
  3229. * @n This function returns the scrubbing engine address after a 2-bit non
  3230. * correctable address is detected.
  3231. *
  3232. * @b Arguments
  3233. * @n None
  3234. *
  3235. * <b> Return Value </b>
  3236. * @n Address which caused the error
  3237. *
  3238. * <b> Pre Condition </b>
  3239. * @n None
  3240. *
  3241. * <b> Post Condition </b>
  3242. * @n None
  3243. *
  3244. * @b Reads
  3245. * @n MSMC_SMNCEA_SENCA
  3246. *
  3247. * @b Example
  3248. * @verbatim
  3249. Uint32 errAddress;
  3250. errAddress = CSL_MSMC_getScrubbingEngineErrorAddress ();
  3251. @endverbatim
  3252. * =============================================================================
  3253. */
  3254. static inline Uint32 CSL_MSMC_getScrubbingEngineErrorAddress()
  3255. {
  3256. return CSL_FEXT (hMsmc->SMNCEA, MSMC_SMNCEA_SENCA);
  3257. }
  3258. /* @} */
  3259. #ifdef __cplusplus
  3260. }
  3261. #endif
  3262. #endif /* CSL_MSMCAUX_H_ */