hw_aes.h 287 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379
  1. /******************************************************************************
  2. * Filename: hw_aes.h
  3. * Revised: $Date: 2013-04-12 15:10:54 +0200 (Fri, 12 Apr 2013) $
  4. * Revision: $Revision: 9735 $
  5. *
  6. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  7. *
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. *
  16. * Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the distribution.
  19. *
  20. * Neither the name of Texas Instruments Incorporated nor the names of
  21. * its contributors may be used to endorse or promote products derived
  22. * from this software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. ******************************************************************************/
  37. #ifndef __HW_AES_H__
  38. #define __HW_AES_H__
  39. //*****************************************************************************
  40. //
  41. // The following are defines for the AES register offsets.
  42. //
  43. //*****************************************************************************
  44. #define AES_DMAC_CH0_CTRL 0x4008B000 // Channel control This register
  45. // is used for channel enabling and
  46. // priority selection. When a
  47. // channel is disabled, it becomes
  48. // inactive only when all ongoing
  49. // requests are finished.
  50. #define AES_DMAC_CH0_EXTADDR 0x4008B004 // Channel external address
  51. #define AES_DMAC_CH0_DMALENGTH \
  52. 0x4008B00C // Channel DMA length
  53. #define AES_DMAC_STATUS 0x4008B018 // DMAC status This register
  54. // provides the actual state of
  55. // each DMA channel. It also
  56. // reports port errors in case
  57. // these were received by the
  58. // master interface module during
  59. // the data transfer.
  60. #define AES_DMAC_SWRES 0x4008B01C // DMAC software reset register
  61. // Software reset is used to reset
  62. // the DMAC to stop all transfers
  63. // and clears the port error status
  64. // register. After the software
  65. // reset is performed, all the
  66. // channels are disabled and no new
  67. // requests are performed by the
  68. // channels. The DMAC waits for the
  69. // existing (active) requests to
  70. // finish and accordingly sets the
  71. // DMAC status registers.
  72. #define AES_DMAC_CH1_CTRL 0x4008B020 // Channel control This register
  73. // is used for channel enabling and
  74. // priority selection. When a
  75. // channel is disabled, it becomes
  76. // inactive only when all ongoing
  77. // requests are finished.
  78. #define AES_DMAC_CH1_EXTADDR 0x4008B024 // Channel external address
  79. #define AES_DMAC_CH1_DMALENGTH \
  80. 0x4008B02C // Channel DMA length
  81. #define AES_DMAC_MST_RUNPARAMS \
  82. 0x4008B078 // DMAC master run-time parameters
  83. // This register defines all the
  84. // run-time parameters for the AHB
  85. // master interface port. These
  86. // parameters are required for the
  87. // proper functioning of the
  88. // EIP-101m AHB master adapter.
  89. #define AES_DMAC_PERSR 0x4008B07C // DMAC port error raw status
  90. // register This register provides
  91. // the actual status of individual
  92. // port errors. It also indicates
  93. // which channel is serviced by an
  94. // external AHB port (which is
  95. // frozen by a port error). A port
  96. // error aborts operations on all
  97. // serviced channels (channel
  98. // enable bit is forced to 0) and
  99. // prevents further transfers via
  100. // that port until the error is
  101. // cleared by writing to the
  102. // DMAC_SWRES register.
  103. #define AES_DMAC_OPTIONS 0x4008B0F8 // DMAC options register These
  104. // registers contain information
  105. // regarding the different options
  106. // configured in this DMAC.
  107. #define AES_DMAC_VERSION 0x4008B0FC // DMAC version register This
  108. // register contains an indication
  109. // (or signature) of the EIP type
  110. // of this DMAC, as well as the
  111. // hardware version/patch numbers.
  112. #define AES_KEY_STORE_WRITE_AREA \
  113. 0x4008B400 // Key store write area register
  114. // This register defines where the
  115. // keys should be written in the
  116. // key store RAM. After writing
  117. // this register, the key store
  118. // module is ready to receive the
  119. // keys through a DMA operation. In
  120. // case the key data transfer
  121. // triggered an error in the key
  122. // store, the error will be
  123. // available in the interrupt
  124. // status register after the DMA is
  125. // finished. The key store
  126. // write-error is asserted when the
  127. // programmed/selected area is not
  128. // completely written. This error
  129. // is also asserted when the DMA
  130. // operation writes to ram areas
  131. // that are not selected. The key
  132. // store RAM is divided into 8
  133. // areas of 128 bits. 192-bit keys
  134. // written in the key store RAM
  135. // should start on boundaries of
  136. // 256 bits. This means that
  137. // writing a 192-bit key to the key
  138. // store RAM must be done by
  139. // writing 256 bits of data with
  140. // the 64 most-significant bits set
  141. // to 0. These bits are ignored by
  142. // the AES engine.
  143. #define AES_KEY_STORE_WRITTEN_AREA \
  144. 0x4008B404 // Key store written area register
  145. // This register shows which areas
  146. // of the key store RAM contain
  147. // valid written keys. When a new
  148. // key needs to be written to the
  149. // key store, on a location that is
  150. // already occupied by a valid key,
  151. // this key area must be cleared
  152. // first. This can be done by
  153. // writing this register before the
  154. // new key is written to the key
  155. // store memory. Attempting to
  156. // write to a key area that already
  157. // contains a valid key is not
  158. // allowed and results in an error.
  159. #define AES_KEY_STORE_SIZE 0x4008B408 // Key store size register This
  160. // register defines the size of the
  161. // keys that are written with DMA.
  162. // This register should be
  163. // configured before writing to the
  164. // KEY_STORE_WRITE_AREA register.
  165. #define AES_KEY_STORE_READ_AREA \
  166. 0x4008B40C // Key store read area register
  167. // This register selects the key
  168. // store RAM area from where the
  169. // key needs to be read that will
  170. // be used for an AES operation.
  171. // The operation directly starts
  172. // after writing this register.
  173. // When the operation is finished,
  174. // the status of the key store read
  175. // operation is available in the
  176. // interrupt status register. Key
  177. // store read error is asserted
  178. // when a RAM area is selected
  179. // which does not contain valid
  180. // written key.
  181. #define AES_AES_KEY2_0 0x4008B500 // AES_KEY2_0 / AES_GHASH_H_IN_0
  182. // Second Key / GHASH Key
  183. // (internal, but clearable) The
  184. // following registers are not
  185. // accessible through the host for
  186. // reading and writing. They are
  187. // used to store internally
  188. // calculated key information and
  189. // intermediate results. However,
  190. // when the host performs a write
  191. // to the any of the respective
  192. // AES_KEY2_n or AES_KEY3_n
  193. // addresses, respectively the
  194. // whole 128-bit AES_KEY2_n or
  195. // AES_KEY3_n register is cleared
  196. // to 0s. The AES_GHASH_H_IN_n
  197. // registers (required for GHASH,
  198. // which is part of GCM) are mapped
  199. // to the AES_KEY2_n registers. The
  200. // (intermediate) authentication
  201. // result for GCM and CCM is stored
  202. // in the AES_KEY3_n register.
  203. #define AES_AES_KEY2_1 0x4008B504 // AES_KEY2_1 / AES_GHASH_H_IN_1
  204. // Second Key / GHASH Key
  205. // (internal, but clearable) The
  206. // following registers are not
  207. // accessible through the host for
  208. // reading and writing. They are
  209. // used to store internally
  210. // calculated key information and
  211. // intermediate results. However,
  212. // when the host performs a write
  213. // to the any of the respective
  214. // AES_KEY2_n or AES_KEY3_n
  215. // addresses, respectively the
  216. // whole 128-bit AES_KEY2_n or
  217. // AES_KEY3_n register is cleared
  218. // to 0s. The AES_GHASH_H_IN_n
  219. // registers (required for GHASH,
  220. // which is part of GCM) are mapped
  221. // to the AES_KEY2_n registers. The
  222. // (intermediate) authentication
  223. // result for GCM and CCM is stored
  224. // in the AES_KEY3_n register.
  225. #define AES_AES_KEY2_2 0x4008B508 // AES_KEY2_2 / AES_GHASH_H_IN_2
  226. // Second Key / GHASH Key
  227. // (internal, but clearable) The
  228. // following registers are not
  229. // accessible through the host for
  230. // reading and writing. They are
  231. // used to store internally
  232. // calculated key information and
  233. // intermediate results. However,
  234. // when the host performs a write
  235. // to the any of the respective
  236. // AES_KEY2_n or AES_KEY3_n
  237. // addresses, respectively the
  238. // whole 128-bit AES_KEY2_n or
  239. // AES_KEY3_n register is cleared
  240. // to 0s. The AES_GHASH_H_IN_n
  241. // registers (required for GHASH,
  242. // which is part of GCM) are mapped
  243. // to the AES_KEY2_n registers. The
  244. // (intermediate) authentication
  245. // result for GCM and CCM is stored
  246. // in the AES_KEY3_n register.
  247. #define AES_AES_KEY2_3 0x4008B50C // AES_KEY2_3 / AES_GHASH_H_IN_3
  248. // Second Key / GHASH Key
  249. // (internal, but clearable) The
  250. // following registers are not
  251. // accessible through the host for
  252. // reading and writing. They are
  253. // used to store internally
  254. // calculated key information and
  255. // intermediate results. However,
  256. // when the host performs a write
  257. // to the any of the respective
  258. // AES_KEY2_n or AES_KEY3_n
  259. // addresses, respectively the
  260. // whole 128-bit AES_KEY2_n or
  261. // AES_KEY3_n register is cleared
  262. // to 0s. The AES_GHASH_H_IN_n
  263. // registers (required for GHASH,
  264. // which is part of GCM) are mapped
  265. // to the AES_KEY2_n registers. The
  266. // (intermediate) authentication
  267. // result for GCM and CCM is stored
  268. // in the AES_KEY3_n register.
  269. #define AES_AES_KEY3_0 0x4008B510 // AES_KEY3_0 / AES_KEY2_4 Third
  270. // Key / Second Key (internal, but
  271. // clearable) The following
  272. // registers are not accessible
  273. // through the host for reading and
  274. // writing. They are used to store
  275. // internally calculated key
  276. // information and intermediate
  277. // results. However, when the host
  278. // performs a write to the any of
  279. // the respective AES_KEY2_n or
  280. // AES_KEY3_n addresses,
  281. // respectively the whole 128-bit
  282. // AES_KEY2_n or AES_KEY3_n
  283. // register is cleared to 0s. The
  284. // AES_GHASH_H_IN_n registers
  285. // (required for GHASH, which is
  286. // part of GCM) are mapped to the
  287. // AES_KEY2_n registers. The
  288. // (intermediate) authentication
  289. // result for GCM and CCM is stored
  290. // in the AES_KEY3_n register.
  291. #define AES_AES_KEY3_1 0x4008B514 // AES_KEY3_1 / AES_KEY2_5 Third
  292. // Key / Second Key (internal, but
  293. // clearable) The following
  294. // registers are not accessible
  295. // through the host for reading and
  296. // writing. They are used to store
  297. // internally calculated key
  298. // information and intermediate
  299. // results. However, when the host
  300. // performs a write to the any of
  301. // the respective AES_KEY2_n or
  302. // AES_KEY3_n addresses,
  303. // respectively the whole 128-bit
  304. // AES_KEY2_n or AES_KEY3_n
  305. // register is cleared to 0s. The
  306. // AES_GHASH_H_IN_n registers
  307. // (required for GHASH, which is
  308. // part of GCM) are mapped to the
  309. // AES_KEY2_n registers. The
  310. // (intermediate) authentication
  311. // result for GCM and CCM is stored
  312. // in the AES_KEY3_n register.
  313. #define AES_AES_KEY3_2 0x4008B518 // AES_KEY3_2 / AES_KEY2_6 Third
  314. // Key / Second Key (internal, but
  315. // clearable) The following
  316. // registers are not accessible
  317. // through the host for reading and
  318. // writing. They are used to store
  319. // internally calculated key
  320. // information and intermediate
  321. // results. However, when the host
  322. // performs a write to the any of
  323. // the respective AES_KEY2_n or
  324. // AES_KEY3_n addresses,
  325. // respectively the whole 128-bit
  326. // AES_KEY2_n or AES_KEY3_n
  327. // register is cleared to 0s. The
  328. // AES_GHASH_H_IN_n registers
  329. // (required for GHASH, which is
  330. // part of GCM) are mapped to the
  331. // AES_KEY2_n registers. The
  332. // (intermediate) authentication
  333. // result for GCM and CCM is stored
  334. // in the AES_KEY3_n register.
  335. #define AES_AES_KEY3_3 0x4008B51C // AES_KEY3_3 / AES_KEY2_7 Third
  336. // Key / Second Key (internal, but
  337. // clearable) The following
  338. // registers are not accessible
  339. // through the host for reading and
  340. // writing. They are used to store
  341. // internally calculated key
  342. // information and intermediate
  343. // results. However, when the host
  344. // performs a write to the any of
  345. // the respective AES_KEY2_n or
  346. // AES_KEY3_n addresses,
  347. // respectively the whole 128-bit
  348. // AES_KEY2_n or AES_KEY3_n
  349. // register is cleared to 0s. The
  350. // AES_GHASH_H_IN_n registers
  351. // (required for GHASH, which is
  352. // part of GCM) are mapped to the
  353. // AES_KEY2_n registers. The
  354. // (intermediate) authentication
  355. // result for GCM and CCM is stored
  356. // in the AES_KEY3_n register.
  357. #define AES_AES_IV_0 0x4008B540 // AES initialization vector
  358. // registers These registers are
  359. // used to provide and read the IV
  360. // from the AES engine.
  361. #define AES_AES_IV_1 0x4008B544 // AES initialization vector
  362. // registers These registers are
  363. // used to provide and read the IV
  364. // from the AES engine.
  365. #define AES_AES_IV_2 0x4008B548 // AES initialization vector
  366. // registers These registers are
  367. // used to provide and read the IV
  368. // from the AES engine.
  369. #define AES_AES_IV_3 0x4008B54C // AES initialization vector
  370. // registers These registers are
  371. // used to provide and read the IV
  372. // from the AES engine.
  373. #define AES_AES_CTRL 0x4008B550 // AES input/output buffer control
  374. // and mode register This register
  375. // specifies the AES mode of
  376. // operation for the EIP-120t.
  377. // Electronic codebook (ECB) mode
  378. // is automatically selected if
  379. // bits [28:5] of this register are
  380. // all 0.
  381. #define AES_AES_C_LENGTH_0 0x4008B554 // AES crypto length registers
  382. // (LSW) These registers are used
  383. // to write the Length values to
  384. // the EIP-120t. While processing,
  385. // the length values decrement to
  386. // 0. If both lengths are 0, the
  387. // data stream is finished and a
  388. // new context is requested. For
  389. // basic AES modes (ECB, CBC, and
  390. // CTR), a crypto length of 0 can
  391. // be written if multiple streams
  392. // need to be processed with the
  393. // same key. Writing 0 length
  394. // results in continued data
  395. // requests until a new context is
  396. // written. For the other modes
  397. // (CBC-MAC, GCM, and CCM) no (new)
  398. // data requests are done if the
  399. // length decrements to or equals
  400. // 0. It is advised to write a new
  401. // length per packet. If the length
  402. // registers decrement to 0, no new
  403. // data is processed until a new
  404. // context or length value is
  405. // written. When writing a new mode
  406. // without writing the length
  407. // registers, the length register
  408. // values from the previous context
  409. // is reused.
  410. #define AES_AES_C_LENGTH_1 0x4008B558 // AES crypto length registers
  411. // (MSW) These registers are used
  412. // to write the Length values to
  413. // the EIP-120t. While processing,
  414. // the length values decrement to
  415. // 0. If both lengths are 0, the
  416. // data stream is finished and a
  417. // new context is requested. For
  418. // basic AES modes (ECB, CBC, and
  419. // CTR), a crypto length of 0 can
  420. // be written if multiple streams
  421. // need to be processed with the
  422. // same key. Writing 0 length
  423. // results in continued data
  424. // requests until a new context is
  425. // written. For the other modes
  426. // (CBC-MAC, GCM and CCM) no (new)
  427. // data requests are done if the
  428. // length decrements to or equals
  429. // 0. It is advised to write a new
  430. // length per packet. If the length
  431. // registers decrement to 0, no new
  432. // data is processed until a new
  433. // context or length value is
  434. // written. When writing a new mode
  435. // without writing the length
  436. // registers, the length register
  437. // values from the previous context
  438. // is reused.
  439. #define AES_AES_AUTH_LENGTH 0x4008B55C // Authentication length register
  440. #define AES_AES_DATA_IN_OUT_0 0x4008B560 // Data input/output registers The
  441. // data registers are typically
  442. // accessed through the DMA and not
  443. // with host writes and/or reads.
  444. // However, for debugging purposes
  445. // the data input/output registers
  446. // can be accessed via host write
  447. // and read operations. The
  448. // registers are used to buffer the
  449. // input/output data blocks to/from
  450. // the EIP-120t. Note: The data
  451. // input buffer (AES_DATA_IN_n) and
  452. // data output buffer
  453. // (AES_DATA_OUT_n) are mapped to
  454. // the same address locations.
  455. // Writes (both DMA and host) to
  456. // these addresses load the Input
  457. // Buffer while reads pull from the
  458. // Output Buffer. Therefore, for
  459. // write access, the data input
  460. // buffer is written; for read
  461. // access, the data output buffer
  462. // is read. The data input buffer
  463. // must be written before starting
  464. // an operation. The data output
  465. // buffer contains valid data on
  466. // completion of an operation.
  467. // Therefore, any 128-bit data
  468. // block can be split over multiple
  469. // 32-bit word transfers; these can
  470. // be mixed with other host
  471. // transfers over the external
  472. // interface.
  473. #define AES_AES_DATA_IN_OUT_1 0x4008B564 // Data Input/Output Registers The
  474. // data registers are typically
  475. // accessed via DMA and not with
  476. // host writes and/or reads.
  477. // However, for debugging purposes
  478. // the Data Input/Output Registers
  479. // can be accessed via host write
  480. // and read operations. The
  481. // registers are used to buffer the
  482. // input/output data blocks to/from
  483. // the EIP-120t. Note: The data
  484. // input buffer (AES_DATA_IN_n) and
  485. // data output buffer
  486. // (AES_DATA_OUT_n) are mapped to
  487. // the same address locations.
  488. // Writes (both DMA and host) to
  489. // these addresses load the Input
  490. // Buffer while reads pull from the
  491. // Output Buffer. Therefore, for
  492. // write access, the data input
  493. // buffer is written; for read
  494. // access, the data output buffer
  495. // is read. The data input buffer
  496. // must be written before starting
  497. // an operation. The data output
  498. // buffer contains valid data on
  499. // completion of an operation.
  500. // Therefore, any 128-bit data
  501. // block can be split over multiple
  502. // 32-bit word transfers; these can
  503. // be mixed with other host
  504. // transfers over the external
  505. // interface.
  506. #define AES_AES_DATA_IN_OUT_2 0x4008B568 // Data Input/Output Registers The
  507. // data registers are typically
  508. // accessed via DMA and not with
  509. // host writes and/or reads.
  510. // However, for debugging purposes
  511. // the Data Input/Output Registers
  512. // can be accessed via host write
  513. // and read operations. The
  514. // registers are used to buffer the
  515. // input/output data blocks to/from
  516. // the EIP-120t. Note: The data
  517. // input buffer (AES_DATA_IN_n) and
  518. // data output buffer
  519. // (AES_DATA_OUT_n) are mapped to
  520. // the same address locations.
  521. // Writes (both DMA and host) to
  522. // these addresses load the Input
  523. // Buffer while reads pull from the
  524. // Output Buffer. Therefore, for
  525. // write access, the data input
  526. // buffer is written; for read
  527. // access, the data output buffer
  528. // is read. The data input buffer
  529. // must be written before starting
  530. // an operation. The data output
  531. // buffer contains valid data on
  532. // completion of an operation.
  533. // Therefore, any 128-bit data
  534. // block can be split over multiple
  535. // 32-bit word transfers; these can
  536. // be mixed with other host
  537. // transfers over the external
  538. // interface.
  539. #define AES_AES_DATA_IN_OUT_3 0x4008B56C // Data Input/Output Registers The
  540. // data registers are typically
  541. // accessed via DMA and not with
  542. // host writes and/or reads.
  543. // However, for debugging purposes
  544. // the Data Input/Output Registers
  545. // can be accessed via host write
  546. // and read operations. The
  547. // registers are used to buffer the
  548. // input/output data blocks to/from
  549. // the EIP-120t. Note: The data
  550. // input buffer (AES_DATA_IN_n) and
  551. // data output buffer
  552. // (AES_DATA_OUT_n) are mapped to
  553. // the same address locations.
  554. // Writes (both DMA and host) to
  555. // these addresses load the Input
  556. // Buffer while reads pull from the
  557. // Output Buffer. Therefore, for
  558. // write access, the data input
  559. // buffer is written; for read
  560. // access, the data output buffer
  561. // is read. The data input buffer
  562. // must be written before starting
  563. // an operation. The data output
  564. // buffer contains valid data on
  565. // completion of an operation.
  566. // Therefore, any 128-bit data
  567. // block can be split over multiple
  568. // 32-bit word transfers; these can
  569. // be mixed with other host
  570. // transfers over the external
  571. // interface.
  572. #define AES_AES_TAG_OUT_0 0x4008B570 // TAG registers The tag registers
  573. // can be accessed via DMA or
  574. // directly with host reads. These
  575. // registers buffer the TAG from
  576. // the EIP-120t. The registers are
  577. // shared with the intermediate
  578. // authentication result registers,
  579. // but cannot be read until the
  580. // processing is finished. While
  581. // processing, a read from these
  582. // registers returns 0s. If an
  583. // operation does not return a TAG,
  584. // reading from these registers
  585. // returns an IV. If an operation
  586. // returns a TAG plus an IV and
  587. // both need to be read by the
  588. // host, the host must first read
  589. // the TAG followed by the IV.
  590. // Reading these in reverse order
  591. // will return the IV twice.
  592. #define AES_AES_TAG_OUT_1 0x4008B574 // TAG registers The tag registers
  593. // can be accessed via DMA or
  594. // directly with host reads. These
  595. // registers buffer the TAG from
  596. // the EIP-120t. The registers are
  597. // shared with the intermediate
  598. // authentication result registers,
  599. // but cannot be read until the
  600. // processing is finished. While
  601. // processing, a read from these
  602. // registers returns 0s. If an
  603. // operation does not return a TAG,
  604. // reading from these registers
  605. // returns an IV. If an operation
  606. // returns a TAG plus an IV and
  607. // both need to be read by the
  608. // host, the host must first read
  609. // the TAG followed by the IV.
  610. // Reading these in reverse order
  611. // returns the IV twice.
  612. #define AES_AES_TAG_OUT_2 0x4008B578 // TAG registers The tag registers
  613. // can be accessed via DMA or
  614. // directly with host reads. These
  615. // registers buffer the TAG from
  616. // the EIP-120t. The registers are
  617. // shared with the intermediate
  618. // authentication result registers,
  619. // but cannot be read until the
  620. // processing is finished. While
  621. // processing, a read from these
  622. // registers returns 0s. If an
  623. // operation does not return a TAG,
  624. // reading from these registers
  625. // returns an IV. If an operation
  626. // returns a TAG plus an IV and
  627. // both need to be read by the
  628. // host, the host must first read
  629. // the TAG followed by the IV.
  630. // Reading these in reverse order
  631. // returns the IV twice.
  632. #define AES_AES_TAG_OUT_3 0x4008B57C // TAG registers The tag registers
  633. // can be accessed via DMA or
  634. // directly with host reads. These
  635. // registers buffer the TAG from
  636. // the EIP-120t. The registers are
  637. // shared with the intermediate
  638. // authentication result registers,
  639. // but cannot be read until the
  640. // processing is finished. While
  641. // processing, a read from these
  642. // registers returns 0s. If an
  643. // operation does not return a TAG,
  644. // reading from these registers
  645. // returns an IV. If an operation
  646. // returns a TAG plus an IV and
  647. // both need to be read by the
  648. // host, the host must first read
  649. // the TAG followed by the IV.
  650. // Reading these in reverse order
  651. // returns the IV twice.
  652. #define AES_HASH_DATA_IN_0 0x4008B600 // HASH data input registers The
  653. // data input registers should be
  654. // used to provide input data to
  655. // the hash module through the
  656. // slave interface.
  657. #define AES_HASH_DATA_IN_1 0x4008B604 // HASH data input registers The
  658. // data input registers should be
  659. // used to provide input data to
  660. // the hash module through the
  661. // slave interface.
  662. #define AES_HASH_DATA_IN_2 0x4008B608 // HASH data input registers The
  663. // data input registers should be
  664. // used to provide input data to
  665. // the hash module through the
  666. // slave interface.
  667. #define AES_HASH_DATA_IN_3 0x4008B60C // HASH data input registers The
  668. // data input registers should be
  669. // used to provide input data to
  670. // the hash module through the
  671. // slave interface.
  672. #define AES_HASH_DATA_IN_4 0x4008B610 // HASH data input registers The
  673. // data input registers should be
  674. // used to provide input data to
  675. // the hash module through the
  676. // slave interface.
  677. #define AES_HASH_DATA_IN_5 0x4008B614 // HASH data input registers The
  678. // data input registers should be
  679. // used to provide input data to
  680. // the hash module through the
  681. // slave interface.
  682. #define AES_HASH_DATA_IN_6 0x4008B618 // HASH data input registers The
  683. // data input registers should be
  684. // used to provide input data to
  685. // the hash module through the
  686. // slave interface.
  687. #define AES_HASH_DATA_IN_7 0x4008B61C // HASH data input registers The
  688. // data input registers should be
  689. // used to provide input data to
  690. // the hash module through the
  691. // slave interface.
  692. #define AES_HASH_DATA_IN_8 0x4008B620 // HASH data input registers The
  693. // data input registers should be
  694. // used to provide input data to
  695. // the hash module through the
  696. // slave interface.
  697. #define AES_HASH_DATA_IN_9 0x4008B624 // HASH data input registers The
  698. // data input registers should be
  699. // used to provide input data to
  700. // the hash module through the
  701. // slave interface.
  702. #define AES_HASH_DATA_IN_10 0x4008B628 // HASH data input registers The
  703. // data input registers should be
  704. // used to provide input data to
  705. // the hash module through the
  706. // slave interface.
  707. #define AES_HASH_DATA_IN_11 0x4008B62C // HASH data input registers The
  708. // data input registers should be
  709. // used to provide input data to
  710. // the hash module through the
  711. // slave interface.
  712. #define AES_HASH_DATA_IN_12 0x4008B630 // HASH data input registers The
  713. // data input registers should be
  714. // used to provide input data to
  715. // the hash module through the
  716. // slave interface.
  717. #define AES_HASH_DATA_IN_13 0x4008B634 // HASH data input registers The
  718. // data input registers should be
  719. // used to provide input data to
  720. // the hash module through the
  721. // slave interface.
  722. #define AES_HASH_DATA_IN_14 0x4008B638 // HASH data input registers The
  723. // data input registers should be
  724. // used to provide input data to
  725. // the hash module through the
  726. // slave interface.
  727. #define AES_HASH_DATA_IN_15 0x4008B63C // HASH data input registers The
  728. // data input registers should be
  729. // used to provide input data to
  730. // the hash module through the
  731. // slave interface.
  732. #define AES_HASH_IO_BUF_CTRL 0x4008B640 // Input/output buffer control and
  733. // status register This register
  734. // pair shares a single address
  735. // location and contains bits that
  736. // control and monitor the data
  737. // flow between the host and the
  738. // hash engine.
  739. #define AES_HASH_MODE_IN 0x4008B644 // Hash mode register
  740. #define AES_HASH_LENGTH_IN_L 0x4008B648 // Hash length register
  741. #define AES_HASH_LENGTH_IN_H 0x4008B64C // Hash length register
  742. #define AES_HASH_DIGEST_A 0x4008B650 // Hash digest registers The hash
  743. // digest registers consist of
  744. // eight 32-bit registers, named
  745. // HASH_DIGEST_A to HASH_DIGEST_H.
  746. // After processing a message, the
  747. // output digest can be read from
  748. // these registers. These registers
  749. // can be written with an
  750. // intermediate hash result for
  751. // continued hash operations.
  752. #define AES_HASH_DIGEST_B 0x4008B654 // Hash digest registers The hash
  753. // digest registers consist of
  754. // eight 32-bit registers, named
  755. // HASH_DIGEST_A to HASH_DIGEST_H.
  756. // After processing a message, the
  757. // output digest can be read from
  758. // these registers. These registers
  759. // can be written with an
  760. // intermediate hash result for
  761. // continued hash operations.
  762. #define AES_HASH_DIGEST_C 0x4008B658 // Hash digest registers The hash
  763. // digest registers consist of
  764. // eight 32-bit registers, named
  765. // HASH_DIGEST_A to HASH_DIGEST_H.
  766. // After processing a message, the
  767. // output digest can be read from
  768. // these registers. These registers
  769. // can be written with an
  770. // intermediate hash result for
  771. // continued hash operations.
  772. #define AES_HASH_DIGEST_D 0x4008B65C // Hash digest registers The hash
  773. // digest registers consist of
  774. // eight 32-bit registers, named
  775. // HASH_DIGEST_A to HASH_DIGEST_H.
  776. // After processing a message, the
  777. // output digest can be read from
  778. // these registers. These registers
  779. // can be written with an
  780. // intermediate hash result for
  781. // continued hash operations.
  782. #define AES_HASH_DIGEST_E 0x4008B660 // Hash digest registers The hash
  783. // digest registers consist of
  784. // eight 32-bit registers, named
  785. // HASH_DIGEST_A to HASH_DIGEST_H.
  786. // After processing a message, the
  787. // output digest can be read from
  788. // these registers. These registers
  789. // can be written with an
  790. // intermediate hash result for
  791. // continued hash operations.
  792. #define AES_HASH_DIGEST_F 0x4008B664 // Hash digest registers The hash
  793. // digest registers consist of
  794. // eight 32-bit registers, named
  795. // HASH_DIGEST_A to HASH_DIGEST_H.
  796. // After processing a message, the
  797. // output digest can be read from
  798. // these registers. These registers
  799. // can be written with an
  800. // intermediate hash result for
  801. // continued hash operations.
  802. #define AES_HASH_DIGEST_G 0x4008B668 // Hash digest registers The hash
  803. // digest registers consist of
  804. // eight 32-bit registers, named
  805. // HASH_DIGEST_A to HASH_DIGEST_H.
  806. // After processing a message, the
  807. // output digest can be read from
  808. // these registers. These registers
  809. // can be written with an
  810. // intermediate hash result for
  811. // continued hash operations.
  812. #define AES_HASH_DIGEST_H 0x4008B66C // Hash digest registers The hash
  813. // digest registers consist of
  814. // eight 32-bit registers, named
  815. // HASH_DIGEST_A to HASH_DIGEST_H.
  816. // After processing a message, the
  817. // output digest can be read from
  818. // these registers. These registers
  819. // can be written with an
  820. // intermediate hash result for
  821. // continued hash operations.
  822. #define AES_CTRL_ALG_SEL 0x4008B700 // Algorithm select This algorithm
  823. // selection register configures
  824. // the internal destination of the
  825. // DMA controller.
  826. #define AES_CTRL_PROT_EN 0x4008B704 // Master PROT privileged access
  827. // enable This register enables the
  828. // second bit (bit [1]) of the AHB
  829. // HPROT bus of the AHB master
  830. // interface when a read action of
  831. // key(s) is performed on the AHB
  832. // master interface for writing
  833. // keys into the store module.
  834. #define AES_CTRL_SW_RESET 0x4008B740 // Software reset
  835. #define AES_CTRL_INT_CFG 0x4008B780 // Interrupt configuration
  836. #define AES_CTRL_INT_EN 0x4008B784 // Interrupt enable
  837. #define AES_CTRL_INT_CLR 0x4008B788 // Interrupt clear
  838. #define AES_CTRL_INT_SET 0x4008B78C // Interrupt set
  839. #define AES_CTRL_INT_STAT 0x4008B790 // Interrupt status
  840. #define AES_CTRL_OPTIONS 0x4008B7F8 // Options register
  841. #define AES_CTRL_VERSION 0x4008B7FC // Version register
  842. //*****************************************************************************
  843. //
  844. // The following are defines for the bit fields in the
  845. // AES_DMAC_CH0_CTRL register.
  846. //
  847. //*****************************************************************************
  848. #define AES_DMAC_CH0_CTRL_PRIO 0x00000002 // Channel priority 0: Low 1: High
  849. // If both channels have the same
  850. // priority, access of the channels
  851. // to the external port is
  852. // arbitrated using the round robin
  853. // scheme. If one channel has a
  854. // high priority and another one
  855. // low, the channel with the high
  856. // priority is served first, in
  857. // case of simultaneous access
  858. // requests.
  859. #define AES_DMAC_CH0_CTRL_PRIO_M \
  860. 0x00000002
  861. #define AES_DMAC_CH0_CTRL_PRIO_S 1
  862. #define AES_DMAC_CH0_CTRL_EN 0x00000001 // Channel enable 0: Disabled 1:
  863. // Enable Note: Disabling an active
  864. // channel interrupts the DMA
  865. // operation. The ongoing block
  866. // transfer completes, but no new
  867. // transfers are requested.
  868. #define AES_DMAC_CH0_CTRL_EN_M 0x00000001
  869. #define AES_DMAC_CH0_CTRL_EN_S 0
  870. //*****************************************************************************
  871. //
  872. // The following are defines for the bit fields in the
  873. // AES_DMAC_CH0_EXTADDR register.
  874. //
  875. //*****************************************************************************
  876. #define AES_DMAC_CH0_EXTADDR_ADDR_M \
  877. 0xFFFFFFFF // Channel external address value
  878. // When read during operation, it
  879. // holds the last updated external
  880. // address after being sent to the
  881. // master interface.
  882. #define AES_DMAC_CH0_EXTADDR_ADDR_S 0
  883. //*****************************************************************************
  884. //
  885. // The following are defines for the bit fields in the
  886. // AES_DMAC_CH0_DMALENGTH register.
  887. //
  888. //*****************************************************************************
  889. #define AES_DMAC_CH0_DMALENGTH_DMALEN_M \
  890. 0x0000FFFF // Channel DMA length in bytes
  891. // During configuration, this
  892. // register contains the DMA
  893. // transfer length in bytes. During
  894. // operation, it contains the last
  895. // updated value of the DMA
  896. // transfer length after being sent
  897. // to the master interface. Note:
  898. // Setting this register to a
  899. // nonzero value starts the
  900. // transfer if the channel is
  901. // enabled. Therefore, this
  902. // register must be written last
  903. // when setting up a DMA channel.
  904. #define AES_DMAC_CH0_DMALENGTH_DMALEN_S 0
  905. //*****************************************************************************
  906. //
  907. // The following are defines for the bit fields in the
  908. // AES_DMAC_STATUS register.
  909. //
  910. //*****************************************************************************
  911. #define AES_DMAC_STATUS_PORT_ERR \
  912. 0x00020000 // Reflects possible transfer
  913. // errors on the AHB port.
  914. #define AES_DMAC_STATUS_PORT_ERR_M \
  915. 0x00020000
  916. #define AES_DMAC_STATUS_PORT_ERR_S 17
  917. #define AES_DMAC_STATUS_CH1_ACT 0x00000002 // A value of 1 indicates that
  918. // channel 1 is active (DMA
  919. // transfer on-going).
  920. #define AES_DMAC_STATUS_CH1_ACT_M \
  921. 0x00000002
  922. #define AES_DMAC_STATUS_CH1_ACT_S 1
  923. #define AES_DMAC_STATUS_CH0_ACT 0x00000001 // A value of 1 indicates that
  924. // channel 0 is active (DMA
  925. // transfer on-going).
  926. #define AES_DMAC_STATUS_CH0_ACT_M \
  927. 0x00000001
  928. #define AES_DMAC_STATUS_CH0_ACT_S 0
  929. //*****************************************************************************
  930. //
  931. // The following are defines for the bit fields in the
  932. // AES_DMAC_SWRES register.
  933. //
  934. //*****************************************************************************
  935. #define AES_DMAC_SWRES_SWRES 0x00000001 // Software reset enable 0 =
  936. // Disabled 1 = Enabled
  937. // (self-cleared to 0) Completion
  938. // of the software reset must be
  939. // checked through the DMAC_STATUS
  940. // register.
  941. #define AES_DMAC_SWRES_SWRES_M 0x00000001
  942. #define AES_DMAC_SWRES_SWRES_S 0
  943. //*****************************************************************************
  944. //
  945. // The following are defines for the bit fields in the
  946. // AES_DMAC_CH1_CTRL register.
  947. //
  948. //*****************************************************************************
  949. #define AES_DMAC_CH1_CTRL_PRIO 0x00000002 // Channel priority 0: Low 1: High
  950. // If both channels have the same
  951. // priority, access of the channels
  952. // to the external port is
  953. // arbitrated using the round robin
  954. // scheme. If one channel has a
  955. // high priority and another one
  956. // low, the channel with the high
  957. // priority is served first, in
  958. // case of simultaneous access
  959. // requests.
  960. #define AES_DMAC_CH1_CTRL_PRIO_M \
  961. 0x00000002
  962. #define AES_DMAC_CH1_CTRL_PRIO_S 1
  963. #define AES_DMAC_CH1_CTRL_EN 0x00000001 // Channel enable 0: Disabled 1:
  964. // Enable Note: Disabling an active
  965. // channel interrupts the DMA
  966. // operation. The ongoing block
  967. // transfer completes, but no new
  968. // transfers are requested.
  969. #define AES_DMAC_CH1_CTRL_EN_M 0x00000001
  970. #define AES_DMAC_CH1_CTRL_EN_S 0
  971. //*****************************************************************************
  972. //
  973. // The following are defines for the bit fields in the
  974. // AES_DMAC_CH1_EXTADDR register.
  975. //
  976. //*****************************************************************************
  977. #define AES_DMAC_CH1_EXTADDR_ADDR_M \
  978. 0xFFFFFFFF // Channel external address value.
  979. // When read during operation, it
  980. // holds the last updated external
  981. // address after being sent to the
  982. // master interface.
  983. #define AES_DMAC_CH1_EXTADDR_ADDR_S 0
  984. //*****************************************************************************
  985. //
  986. // The following are defines for the bit fields in the
  987. // AES_DMAC_CH1_DMALENGTH register.
  988. //
  989. //*****************************************************************************
  990. #define AES_DMAC_CH1_DMALENGTH_DMALEN_M \
  991. 0x0000FFFF // Channel DMA length in bytes.
  992. // During configuration, this
  993. // register contains the DMA
  994. // transfer length in bytes. During
  995. // operation, it contains the last
  996. // updated value of the DMA
  997. // transfer length after being sent
  998. // to the master interface. Note:
  999. // Setting this register to a
  1000. // nonzero value starts the
  1001. // transfer if the channel is
  1002. // enabled. Therefore, this
  1003. // register must be written last
  1004. // when setting up a DMA channel.
  1005. #define AES_DMAC_CH1_DMALENGTH_DMALEN_S 0
  1006. //*****************************************************************************
  1007. //
  1008. // The following are defines for the bit fields in the
  1009. // AES_DMAC_MST_RUNPARAMS register.
  1010. //
  1011. //*****************************************************************************
  1012. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BURST_SIZE_M \
  1013. 0x0000F000 // Maximum burst size that can be
  1014. // performed on the AHB bus 0010b =
  1015. // 4 bytes (default) 0011b = 8
  1016. // bytes 0100b = 16 bytes 0101b =
  1017. // 32 bytes 0110b = 64 bytes Others
  1018. // = Reserved
  1019. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BURST_SIZE_S 12
  1020. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_IDLE_EN \
  1021. 0x00000800 // Idle insertion between
  1022. // consecutive burst transfers on
  1023. // AHB 0: No Idle insertion 1: Idle
  1024. // insertion
  1025. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_IDLE_EN_M \
  1026. 0x00000800
  1027. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_IDLE_EN_S 11
  1028. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_INCR_EN \
  1029. 0x00000400 // Burst length type of AHB
  1030. // transfer 0: Unspecified length
  1031. // burst transfers 1: Fixed length
  1032. // burst or single transfers
  1033. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_INCR_EN_M \
  1034. 0x00000400
  1035. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_INCR_EN_S 10
  1036. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_LOCK_EN \
  1037. 0x00000200 // Locked transform on AHB 0:
  1038. // Transfers are not locked 1:
  1039. // Transfers are locked
  1040. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_LOCK_EN_M \
  1041. 0x00000200
  1042. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_LOCK_EN_S 9
  1043. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BIGEND \
  1044. 0x00000100 // Endianess for the AHB master 0:
  1045. // Little endian 1: Big endian
  1046. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BIGEND_M \
  1047. 0x00000100
  1048. #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BIGEND_S 8
  1049. //*****************************************************************************
  1050. //
  1051. // The following are defines for the bit fields in the
  1052. // AES_DMAC_PERSR register.
  1053. //
  1054. //*****************************************************************************
  1055. #define AES_DMAC_PERSR_PORT1_AHB_ERROR \
  1056. 0x00001000 // A value of 1 indicates that the
  1057. // EIP-101 has detected an AHB bus
  1058. // error
  1059. #define AES_DMAC_PERSR_PORT1_AHB_ERROR_M \
  1060. 0x00001000
  1061. #define AES_DMAC_PERSR_PORT1_AHB_ERROR_S 12
  1062. #define AES_DMAC_PERSR_PORT1_CHANNEL \
  1063. 0x00000200 // Indicates which channel has
  1064. // serviced last (channel 0 or
  1065. // channel 1) by AHB master port.
  1066. #define AES_DMAC_PERSR_PORT1_CHANNEL_M \
  1067. 0x00000200
  1068. #define AES_DMAC_PERSR_PORT1_CHANNEL_S 9
  1069. //*****************************************************************************
  1070. //
  1071. // The following are defines for the bit fields in the
  1072. // AES_DMAC_OPTIONS register.
  1073. //
  1074. //*****************************************************************************
  1075. #define AES_DMAC_OPTIONS_NR_OF_CHANNELS_M \
  1076. 0x00000F00 // Number of channels implemented,
  1077. // value in the range 1-8.
  1078. #define AES_DMAC_OPTIONS_NR_OF_CHANNELS_S 8
  1079. #define AES_DMAC_OPTIONS_NR_OF_PORTS_M \
  1080. 0x00000007 // Number of ports implemented,
  1081. // value in range 1-4.
  1082. #define AES_DMAC_OPTIONS_NR_OF_PORTS_S 0
  1083. //*****************************************************************************
  1084. //
  1085. // The following are defines for the bit fields in the
  1086. // AES_DMAC_VERSION register.
  1087. //
  1088. //*****************************************************************************
  1089. #define AES_DMAC_VERSION_HW_MAJOR_VERSION_M \
  1090. 0x0F000000 // Major version number
  1091. #define AES_DMAC_VERSION_HW_MAJOR_VERSION_S 24
  1092. #define AES_DMAC_VERSION_HW_MINOR_VERSION_M \
  1093. 0x00F00000 // Minor version number
  1094. #define AES_DMAC_VERSION_HW_MINOR_VERSION_S 20
  1095. #define AES_DMAC_VERSION_HW_PATCH_LEVEL_M \
  1096. 0x000F0000 // Patch level Starts at 0 at
  1097. // first delivery of this version
  1098. #define AES_DMAC_VERSION_HW_PATCH_LEVEL_S 16
  1099. #define AES_DMAC_VERSION_EIP_NUMBER_COMPL_M \
  1100. 0x0000FF00 // Bit-by-bit complement of the
  1101. // EIP_NUMBER field bits.
  1102. #define AES_DMAC_VERSION_EIP_NUMBER_COMPL_S 8
  1103. #define AES_DMAC_VERSION_EIP_NUMBER_M \
  1104. 0x000000FF // Binary encoding of the
  1105. // EIP-number of this DMA
  1106. // controller (209)
  1107. #define AES_DMAC_VERSION_EIP_NUMBER_S 0
  1108. //*****************************************************************************
  1109. //
  1110. // The following are defines for the bit fields in the
  1111. // AES_KEY_STORE_WRITE_AREA register.
  1112. //
  1113. //*****************************************************************************
  1114. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA7 \
  1115. 0x00000080 // Each RAM_AREAx represents an
  1116. // area of 128 bits. Select the key
  1117. // store RAM area(s) where the
  1118. // key(s) needs to be written 0:
  1119. // RAM_AREA7 is not selected to be
  1120. // written. 1: RAM_AREA7 is
  1121. // selected to be written. Writing
  1122. // to multiple RAM locations is
  1123. // possible only when the selected
  1124. // RAM areas are sequential. Keys
  1125. // that require more than one RAM
  1126. // locations (key size is 192 or
  1127. // 256 bits), must start at one of
  1128. // the following areas: RAM_AREA0,
  1129. // RAM_AREA2, RAM_AREA4, or
  1130. // RAM_AREA6.
  1131. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA7_M \
  1132. 0x00000080
  1133. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA7_S 7
  1134. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA6 \
  1135. 0x00000040 // Each RAM_AREAx represents an
  1136. // area of 128 bits. Select the key
  1137. // store RAM area(s) where the
  1138. // key(s) needs to be written 0:
  1139. // RAM_AREA6 is not selected to be
  1140. // written. 1: RAM_AREA6 is
  1141. // selected to be written. Writing
  1142. // to multiple RAM locations is
  1143. // possible only when the selected
  1144. // RAM areas are sequential. Keys
  1145. // that require more than one RAM
  1146. // locations (key size is 192 or
  1147. // 256 bits), must start at one of
  1148. // the following areas: RAM_AREA0,
  1149. // RAM_AREA2, RAM_AREA4, or
  1150. // RAM_AREA6.
  1151. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA6_M \
  1152. 0x00000040
  1153. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA6_S 6
  1154. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA5 \
  1155. 0x00000020 // Each RAM_AREAx represents an
  1156. // area of 128 bits. Select the key
  1157. // store RAM area(s) where the
  1158. // key(s) needs to be written 0:
  1159. // RAM_AREA5 is not selected to be
  1160. // written. 1: RAM_AREA5 is
  1161. // selected to be written. Writing
  1162. // to multiple RAM locations is
  1163. // possible only when the selected
  1164. // RAM areas are sequential. Keys
  1165. // that require more than one RAM
  1166. // locations (key size is 192 or
  1167. // 256 bits), must start at one of
  1168. // the following areas: RAM_AREA0,
  1169. // RAM_AREA2, RAM_AREA4, or
  1170. // RAM_AREA6.
  1171. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA5_M \
  1172. 0x00000020
  1173. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA5_S 5
  1174. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA4 \
  1175. 0x00000010 // Each RAM_AREAx represents an
  1176. // area of 128 bits. Select the key
  1177. // store RAM area(s) where the
  1178. // key(s) needs to be written 0:
  1179. // RAM_AREA4 is not selected to be
  1180. // written. 1: RAM_AREA4 is
  1181. // selected to be written. Writing
  1182. // to multiple RAM locations is
  1183. // possible only when the selected
  1184. // RAM areas are sequential. Keys
  1185. // that require more than one RAM
  1186. // locations (key size is 192 or
  1187. // 256 bits), must start at one of
  1188. // the following areas: RAM_AREA0,
  1189. // RAM_AREA2, RAM_AREA4, or
  1190. // RAM_AREA6.
  1191. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA4_M \
  1192. 0x00000010
  1193. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA4_S 4
  1194. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA3 \
  1195. 0x00000008 // Each RAM_AREAx represents an
  1196. // area of 128 bits. Select the key
  1197. // store RAM area(s) where the
  1198. // key(s) needs to be written 0:
  1199. // RAM_AREA3 is not selected to be
  1200. // written. 1: RAM_AREA3 is
  1201. // selected to be written. Writing
  1202. // to multiple RAM locations is
  1203. // possible only when the selected
  1204. // RAM areas are sequential. Keys
  1205. // that require more than one RAM
  1206. // locations (key size is 192 or
  1207. // 256 bits), must start at one of
  1208. // the following areas: RAM_AREA0,
  1209. // RAM_AREA2, RAM_AREA4, or
  1210. // RAM_AREA6.
  1211. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA3_M \
  1212. 0x00000008
  1213. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA3_S 3
  1214. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA2 \
  1215. 0x00000004 // Each RAM_AREAx represents an
  1216. // area of 128 bits. Select the key
  1217. // store RAM area(s) where the
  1218. // key(s) needs to be written 0:
  1219. // RAM_AREA2 is not selected to be
  1220. // written. 1: RAM_AREA2 is
  1221. // selected to be written. Writing
  1222. // to multiple RAM locations is
  1223. // possible only when the selected
  1224. // RAM areas are sequential. Keys
  1225. // that require more than one RAM
  1226. // locations (key size is 192 or
  1227. // 256 bits), must start at one of
  1228. // the following areas: RAM_AREA0,
  1229. // RAM_AREA2, RAM_AREA4, or
  1230. // RAM_AREA6.
  1231. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA2_M \
  1232. 0x00000004
  1233. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA2_S 2
  1234. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA1 \
  1235. 0x00000002 // Each RAM_AREAx represents an
  1236. // area of 128 bits. Select the key
  1237. // store RAM area(s) where the
  1238. // key(s) needs to be written 0:
  1239. // RAM_AREA1 is not selected to be
  1240. // written. 1: RAM_AREA1 is
  1241. // selected to be written. Writing
  1242. // to multiple RAM locations is
  1243. // possible only when the selected
  1244. // RAM areas are sequential. Keys
  1245. // that require more than one RAM
  1246. // locations (key size is 192 or
  1247. // 256 bits), must start at one of
  1248. // the following areas: RAM_AREA0,
  1249. // RAM_AREA2, RAM_AREA4, or
  1250. // RAM_AREA6.
  1251. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA1_M \
  1252. 0x00000002
  1253. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA1_S 1
  1254. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA0 \
  1255. 0x00000001 // Each RAM_AREAx represents an
  1256. // area of 128 bits. Select the key
  1257. // store RAM area(s) where the
  1258. // key(s) needs to be written 0:
  1259. // RAM_AREA0 is not selected to be
  1260. // written. 1: RAM_AREA0 is
  1261. // selected to be written. Writing
  1262. // to multiple RAM locations is
  1263. // possible only when the selected
  1264. // RAM areas are sequential. Keys
  1265. // that require more than one RAM
  1266. // locations (key size is 192 or
  1267. // 256 bits), must start at one of
  1268. // the following areas: RAM_AREA0,
  1269. // RAM_AREA2, RAM_AREA4, or
  1270. // RAM_AREA6.
  1271. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA0_M \
  1272. 0x00000001
  1273. #define AES_KEY_STORE_WRITE_AREA_RAM_AREA0_S 0
  1274. //*****************************************************************************
  1275. //
  1276. // The following are defines for the bit fields in the
  1277. // AES_KEY_STORE_WRITTEN_AREA register.
  1278. //
  1279. //*****************************************************************************
  1280. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN7 \
  1281. 0x00000080 // Read operation: 0: This RAM
  1282. // area is not written with valid
  1283. // key information. 1: This RAM
  1284. // area is written with valid key
  1285. // information. Each individual
  1286. // ram_area_writtenx bit can be
  1287. // reset by writing 1. Note: This
  1288. // register is reset on a soft
  1289. // reset from the master control
  1290. // module. After a soft reset, all
  1291. // keys must be rewritten to the
  1292. // key store memory.
  1293. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN7_M \
  1294. 0x00000080
  1295. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN7_S 7
  1296. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN6 \
  1297. 0x00000040 // Read operation: 0: This RAM
  1298. // area is not written with valid
  1299. // key information. 1: This RAM
  1300. // area is written with valid key
  1301. // information. Each individual
  1302. // ram_area_writtenx bit can be
  1303. // reset by writing 1. Note: This
  1304. // register is reset on a soft
  1305. // reset from the master control
  1306. // module. After a soft reset, all
  1307. // keys must be rewritten to the
  1308. // key store memory.
  1309. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN6_M \
  1310. 0x00000040
  1311. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN6_S 6
  1312. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN5 \
  1313. 0x00000020 // Read operation: 0: This RAM
  1314. // area is not written with valid
  1315. // key information. 1: This RAM
  1316. // area is written with valid key
  1317. // information. Each individual
  1318. // ram_area_writtenx bit can be
  1319. // reset by writing 1. Note: This
  1320. // register is reset on a soft
  1321. // reset from the master control
  1322. // module. After a soft reset, all
  1323. // keys must be rewritten to the
  1324. // key store memory.
  1325. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN5_M \
  1326. 0x00000020
  1327. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN5_S 5
  1328. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN4 \
  1329. 0x00000010 // Read operation: 0: This RAM
  1330. // area is not written with valid
  1331. // key information. 1: This RAM
  1332. // area is written with valid key
  1333. // information. Each individual
  1334. // ram_area_writtenx bit can be
  1335. // reset by writing 1. Note: This
  1336. // register is reset on a soft
  1337. // reset from the master control
  1338. // module. After a soft reset, all
  1339. // keys must be rewritten to the
  1340. // key store memory.
  1341. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN4_M \
  1342. 0x00000010
  1343. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN4_S 4
  1344. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN3 \
  1345. 0x00000008 // Read operation: 0: This RAM
  1346. // area is not written with valid
  1347. // key information. 1: This RAM
  1348. // area is written with valid key
  1349. // information. Each individual
  1350. // ram_area_writtenx bit can be
  1351. // reset by writing 1. Note: This
  1352. // register is reset on a soft
  1353. // reset from the master control
  1354. // module. After a soft reset, all
  1355. // keys must be rewritten to the
  1356. // key store memory.
  1357. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN3_M \
  1358. 0x00000008
  1359. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN3_S 3
  1360. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN2 \
  1361. 0x00000004 // Read operation: 0: This RAM
  1362. // area is not written with valid
  1363. // key information. 1: This RAM
  1364. // area is written with valid key
  1365. // information. Each individual
  1366. // ram_area_writtenx bit can be
  1367. // reset by writing 1. Note: This
  1368. // register is reset on a soft
  1369. // reset from the master control
  1370. // module. After a soft reset, all
  1371. // keys must be rewritten to the
  1372. // key store memory.
  1373. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN2_M \
  1374. 0x00000004
  1375. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN2_S 2
  1376. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN1 \
  1377. 0x00000002 // Read operation: 0: This RAM
  1378. // area is not written with valid
  1379. // key information. 1: This RAM
  1380. // area is written with valid key
  1381. // information. Each individual
  1382. // ram_area_writtenx bit can be
  1383. // reset by writing 1. Note: This
  1384. // register is reset on a soft
  1385. // reset from the master control
  1386. // module. After a soft reset, all
  1387. // keys must be rewritten to the
  1388. // key store memory.
  1389. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN1_M \
  1390. 0x00000002
  1391. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN1_S 1
  1392. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN0 \
  1393. 0x00000001 // Read operation: 0: This RAM
  1394. // area is not written with valid
  1395. // key information. 1: This RAM
  1396. // area is written with valid key
  1397. // information. Each individual
  1398. // ram_area_writtenx bit can be
  1399. // reset by writing 1. Note: This
  1400. // register is reset on a soft
  1401. // reset from the master control
  1402. // module. After a soft reset, all
  1403. // keys must be rewritten to the
  1404. // key store memory.
  1405. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN0_M \
  1406. 0x00000001
  1407. #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN0_S 0
  1408. //*****************************************************************************
  1409. //
  1410. // The following are defines for the bit fields in the
  1411. // AES_KEY_STORE_SIZE register.
  1412. //
  1413. //*****************************************************************************
  1414. #define AES_KEY_STORE_SIZE_KEY_SIZE_M \
  1415. 0x00000003 // Key size: 00: Reserved 01: 128
  1416. // bits 10: 192 bits 11: 256 bits
  1417. // When writing this to this
  1418. // register, the
  1419. // KEY_STORE_WRITTEN_AREA register
  1420. // is reset.
  1421. #define AES_KEY_STORE_SIZE_KEY_SIZE_S 0
  1422. //*****************************************************************************
  1423. //
  1424. // The following are defines for the bit fields in the
  1425. // AES_KEY_STORE_READ_AREA register.
  1426. //
  1427. //*****************************************************************************
  1428. #define AES_KEY_STORE_READ_AREA_BUSY \
  1429. 0x80000000 // Key store operation busy status
  1430. // flag (read only): 0: Operation
  1431. // is complete. 1: Operation is not
  1432. // completed and the key store is
  1433. // busy.
  1434. #define AES_KEY_STORE_READ_AREA_BUSY_M \
  1435. 0x80000000
  1436. #define AES_KEY_STORE_READ_AREA_BUSY_S 31
  1437. #define AES_KEY_STORE_READ_AREA_RAM_AREA_M \
  1438. 0x0000000F // Selects the area of the key
  1439. // store RAM from where the key
  1440. // needs to be read that will be
  1441. // writen to the AES engine
  1442. // RAM_AREA: 0000: RAM_AREA0 0001:
  1443. // RAM_AREA1 0010: RAM_AREA2 0011:
  1444. // RAM_AREA3 0100: RAM_AREA4 0101:
  1445. // RAM_AREA5 0110: RAM_AREA6 0111:
  1446. // RAM_AREA7 1000: no RAM area
  1447. // selected 1001-1111: Reserved RAM
  1448. // areas RAM_AREA0, RAM_AREA2,
  1449. // RAM_AREA4 and RAM_AREA6 are the
  1450. // only valid read areas for 192
  1451. // and 256 bits key sizes. Only RAM
  1452. // areas that contain valid written
  1453. // keys can be selected.
  1454. #define AES_KEY_STORE_READ_AREA_RAM_AREA_S 0
  1455. //*****************************************************************************
  1456. //
  1457. // The following are defines for the bit fields in the
  1458. // AES_AES_KEY2_0 register.
  1459. //
  1460. //*****************************************************************************
  1461. #define AES_AES_KEY2_0_AES_KEY2_M \
  1462. 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[31:0] For
  1463. // GCM: -[127:0] - GHASH_H - The
  1464. // internally calculated GHASH key
  1465. // is stored in these registers.
  1466. // Only used for modes that use the
  1467. // GHASH function (GCM). -[255:128]
  1468. // - This register is used to store
  1469. // intermediate values and is
  1470. // initialized with 0s when loading
  1471. // a new key. For CCM: -[255:0] -
  1472. // This register is used to store
  1473. // intermediate values. For
  1474. // CBC-MAC: -[255:0] - ZEROES -
  1475. // This register must remain 0.
  1476. #define AES_AES_KEY2_0_AES_KEY2_S 0
  1477. //*****************************************************************************
  1478. //
  1479. // The following are defines for the bit fields in the
  1480. // AES_AES_KEY2_1 register.
  1481. //
  1482. //*****************************************************************************
  1483. #define AES_AES_KEY2_1_AES_KEY2_M \
  1484. 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[63:32] For
  1485. // GCM: -[127:0] - GHASH_H - The
  1486. // internally calculated GHASH key
  1487. // is stored in these registers.
  1488. // Only used for modes that use the
  1489. // GHASH function (GCM). -[255:128]
  1490. // - This register is used to store
  1491. // intermediate values and is
  1492. // initialized with 0s when loading
  1493. // a new key. For CCM: -[255:0] -
  1494. // This register is used to store
  1495. // intermediate values. For
  1496. // CBC-MAC: -[255:0] - ZEROES -
  1497. // This register must remain 0.
  1498. #define AES_AES_KEY2_1_AES_KEY2_S 0
  1499. //*****************************************************************************
  1500. //
  1501. // The following are defines for the bit fields in the
  1502. // AES_AES_KEY2_2 register.
  1503. //
  1504. //*****************************************************************************
  1505. #define AES_AES_KEY2_2_AES_KEY2_M \
  1506. 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[95:64] For
  1507. // GCM: -[127:0] - GHASH_H - The
  1508. // internally calculated GHASH key
  1509. // is stored in these registers.
  1510. // Only used for modes that use the
  1511. // GHASH function (GCM). -[255:128]
  1512. // - This register is used to store
  1513. // intermediate values and is
  1514. // initialized with 0s when loading
  1515. // a new key. For CCM: -[255:0] -
  1516. // This register is used to store
  1517. // intermediate values. For
  1518. // CBC-MAC: -[255:0] - ZEROES -
  1519. // This register must remain 0.
  1520. #define AES_AES_KEY2_2_AES_KEY2_S 0
  1521. //*****************************************************************************
  1522. //
  1523. // The following are defines for the bit fields in the
  1524. // AES_AES_KEY2_3 register.
  1525. //
  1526. //*****************************************************************************
  1527. #define AES_AES_KEY2_3_AES_KEY2_M \
  1528. 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[127:96]
  1529. // For GCM: -[127:0] - GHASH_H -
  1530. // The internally calculated GHASH
  1531. // key is stored in these
  1532. // registers. Only used for modes
  1533. // that use the GHASH function
  1534. // (GCM). -[255:128] - This
  1535. // register is used to store
  1536. // intermediate values and is
  1537. // initialized with 0s when loading
  1538. // a new key. For CCM: -[255:0] -
  1539. // This register is used to store
  1540. // intermediate values. For
  1541. // CBC-MAC: -[255:0] - ZEROES -
  1542. // This register must remain 0.
  1543. #define AES_AES_KEY2_3_AES_KEY2_S 0
  1544. //*****************************************************************************
  1545. //
  1546. // The following are defines for the bit fields in the
  1547. // AES_AES_KEY3_0 register.
  1548. //
  1549. //*****************************************************************************
  1550. #define AES_AES_KEY3_0_AES_KEY3_M \
  1551. 0xFFFFFFFF //
  1552. // AES_KEY3[31:0]/AES_KEY2[159:128]
  1553. // For GCM: -[127:0] - GHASH_H -
  1554. // The internally calculated GHASH
  1555. // key is stored in these
  1556. // registers. Only used for modes
  1557. // that use the GHASH function
  1558. // (GCM). -[255:128] - This
  1559. // register is used to store
  1560. // intermediate values and is
  1561. // initialized with 0s when loading
  1562. // a new key. For CCM: -[255:0] -
  1563. // This register is used to store
  1564. // intermediate values. For
  1565. // CBC-MAC: -[255:0] - ZEROES -
  1566. // This register must remain 0.
  1567. #define AES_AES_KEY3_0_AES_KEY3_S 0
  1568. //*****************************************************************************
  1569. //
  1570. // The following are defines for the bit fields in the
  1571. // AES_AES_KEY3_1 register.
  1572. //
  1573. //*****************************************************************************
  1574. #define AES_AES_KEY3_1_AES_KEY3_M \
  1575. 0xFFFFFFFF //
  1576. // AES_KEY3[63:32]/AES_KEY2[191:160]
  1577. // For GCM: -[127:0] - GHASH_H -
  1578. // The internally calculated GHASH
  1579. // key is stored in these
  1580. // registers. Only used for modes
  1581. // that use the GHASH function
  1582. // (GCM). -[255:128] - This
  1583. // register is used to store
  1584. // intermediate values and is
  1585. // initialized with 0s when loading
  1586. // a new key. For CCM: -[255:0] -
  1587. // This register is used to store
  1588. // intermediate values. For
  1589. // CBC-MAC: -[255:0] - ZEROES -
  1590. // This register must remain 0.
  1591. #define AES_AES_KEY3_1_AES_KEY3_S 0
  1592. //*****************************************************************************
  1593. //
  1594. // The following are defines for the bit fields in the
  1595. // AES_AES_KEY3_2 register.
  1596. //
  1597. //*****************************************************************************
  1598. #define AES_AES_KEY3_2_AES_KEY3_M \
  1599. 0xFFFFFFFF //
  1600. // AES_KEY3[95:64]/AES_KEY2[223:192]
  1601. // For GCM: -[127:0] - GHASH_H -
  1602. // The internally calculated GHASH
  1603. // key is stored in these
  1604. // registers. Only used for modes
  1605. // that use the GHASH function
  1606. // (GCM). -[255:128] - This
  1607. // register is used to store
  1608. // intermediate values and is
  1609. // initialized with 0s when loading
  1610. // a new key. For CCM: -[255:0] -
  1611. // This register is used to store
  1612. // intermediate values. For
  1613. // CBC-MAC: -[255:0] - ZEROES -
  1614. // This register must remain 0.
  1615. #define AES_AES_KEY3_2_AES_KEY3_S 0
  1616. //*****************************************************************************
  1617. //
  1618. // The following are defines for the bit fields in the
  1619. // AES_AES_KEY3_3 register.
  1620. //
  1621. //*****************************************************************************
  1622. #define AES_AES_KEY3_3_AES_KEY3_M \
  1623. 0xFFFFFFFF //
  1624. // AES_KEY3[127:96]/AES_KEY2[255:224]
  1625. // For GCM: -[127:0] - GHASH_H -
  1626. // The internally calculated GHASH
  1627. // key is stored in these
  1628. // registers. Only used for modes
  1629. // that use the GHASH function
  1630. // (GCM). -[255:128] - This
  1631. // register is used to store
  1632. // intermediate values and is
  1633. // initialized with 0s when loading
  1634. // a new key. For CCM: -[255:0] -
  1635. // This register is used to store
  1636. // intermediate values. For
  1637. // CBC-MAC: -[255:0] - ZEROES -
  1638. // This register must remain 0.
  1639. #define AES_AES_KEY3_3_AES_KEY3_S 0
  1640. //*****************************************************************************
  1641. //
  1642. // The following are defines for the bit fields in the AES_AES_IV_0 register.
  1643. //
  1644. //*****************************************************************************
  1645. #define AES_AES_IV_0_AES_IV_M 0xFFFFFFFF // AES_IV[31:0] Initialization
  1646. // vector Used for regular non-ECB
  1647. // modes (CBC/CTR): -[127:0] -
  1648. // AES_IV - For regular AES
  1649. // operations (CBC and CTR) these
  1650. // registers must be written with a
  1651. // new 128-bit IV. After an
  1652. // operation, these registers
  1653. // contain the latest 128-bit
  1654. // result IV, generated by the
  1655. // EIP-120t. If CTR mode is
  1656. // selected, this value is
  1657. // incremented with 0x1: After
  1658. // first use - When a new data
  1659. // block is submitted to the engine
  1660. // For GCM: -[127:0] - AES_IV - For
  1661. // GCM operations, these registers
  1662. // must be written with a new
  1663. // 128-bit IV. After an operation,
  1664. // these registers contain the
  1665. // updated 128-bit result IV,
  1666. // generated by the EIP-120t. Note
  1667. // that bits [127:96] of the IV
  1668. // represent the initial counter
  1669. // value (which is 1 for GCM) and
  1670. // must therefore be initialized to
  1671. // 0x01000000. This value is
  1672. // incremented with 0x1: After
  1673. // first use - When a new data
  1674. // block is submitted to the
  1675. // engine. For CCM: -[127:0] - A0:
  1676. // For CCM this field must be
  1677. // written with value A0, this
  1678. // value is the concatenation of:
  1679. // A0-flags (5-bits of 0 and 3-bits
  1680. // 'L'), Nonce and counter value.
  1681. // 'L' must be a copy from the 'L'
  1682. // value of the AES_CTRL register.
  1683. // This 'L' indicates the width of
  1684. // the Nonce and counter. The
  1685. // loaded counter must be
  1686. // initialized to 0. The total
  1687. // width of A0 is 128-bit. For
  1688. // CBC-MAC: -[127:0] - Zeroes - For
  1689. // CBC-MAC this register must be
  1690. // written with 0s at the start of
  1691. // each operation. After an
  1692. // operation, these registers
  1693. // contain the 128-bit TAG output,
  1694. // generated by the EIP-120t.
  1695. #define AES_AES_IV_0_AES_IV_S 0
  1696. //*****************************************************************************
  1697. //
  1698. // The following are defines for the bit fields in the AES_AES_IV_1 register.
  1699. //
  1700. //*****************************************************************************
  1701. #define AES_AES_IV_1_AES_IV_M 0xFFFFFFFF // AES_IV[63:32] Initialization
  1702. // vector Used for regular non-ECB
  1703. // modes (CBC/CTR): -[127:0] -
  1704. // AES_IV - For regular AES
  1705. // operations (CBC and CTR) these
  1706. // registers must be written with a
  1707. // new 128-bit IV. After an
  1708. // operation, these registers
  1709. // contain the latest 128-bit
  1710. // result IV, generated by the
  1711. // EIP-120t. If CTR mode is
  1712. // selected, this value is
  1713. // incremented with 0x1: After
  1714. // first use - When a new data
  1715. // block is submitted to the engine
  1716. // For GCM: -[127:0] - AES_IV - For
  1717. // GCM operations, these registers
  1718. // must be written with a new
  1719. // 128-bit IV. After an operation,
  1720. // these registers contain the
  1721. // updated 128-bit result IV,
  1722. // generated by the EIP-120t. Note
  1723. // that bits [127:96] of the IV
  1724. // represent the initial counter
  1725. // value (which is 1 for GCM) and
  1726. // must therefore be initialized to
  1727. // 0x01000000. This value is
  1728. // incremented with 0x1: After
  1729. // first use - When a new data
  1730. // block is submitted to the
  1731. // engine. For CCM: -[127:0] - A0:
  1732. // For CCM this field must be
  1733. // written with value A0, this
  1734. // value is the concatenation of:
  1735. // A0-flags (5-bits of 0 and 3-bits
  1736. // 'L'), Nonce and counter value.
  1737. // 'L' must be a copy from the 'L'
  1738. // value of the AES_CTRL register.
  1739. // This 'L' indicates the width of
  1740. // the Nonce and counter. The
  1741. // loaded counter must be
  1742. // initialized to 0. The total
  1743. // width of A0 is 128-bit. For
  1744. // CBC-MAC: -[127:0] - Zeroes - For
  1745. // CBC-MAC this register must be
  1746. // written with 0s at the start of
  1747. // each operation. After an
  1748. // operation, these registers
  1749. // contain the 128-bit TAG output,
  1750. // generated by the EIP-120t.
  1751. #define AES_AES_IV_1_AES_IV_S 0
  1752. //*****************************************************************************
  1753. //
  1754. // The following are defines for the bit fields in the AES_AES_IV_2 register.
  1755. //
  1756. //*****************************************************************************
  1757. #define AES_AES_IV_2_AES_IV_M 0xFFFFFFFF // AES_IV[95:64] Initialization
  1758. // vector Used for regular non-ECB
  1759. // modes (CBC/CTR): -[127:0] -
  1760. // AES_IV - For regular AES
  1761. // operations (CBC and CTR) these
  1762. // registers must be written with a
  1763. // new 128-bit IV. After an
  1764. // operation, these registers
  1765. // contain the latest 128-bit
  1766. // result IV, generated by the
  1767. // EIP-120t. If CTR mode is
  1768. // selected, this value is
  1769. // incremented with 0x1: After
  1770. // first use - When a new data
  1771. // block is submitted to the engine
  1772. // For GCM: -[127:0] - AES_IV - For
  1773. // GCM operations, these registers
  1774. // must be written with a new
  1775. // 128-bit IV. After an operation,
  1776. // these registers contain the
  1777. // updated 128-bit result IV,
  1778. // generated by the EIP-120t. Note
  1779. // that bits [127:96] of the IV
  1780. // represent the initial counter
  1781. // value (which is 1 for GCM) and
  1782. // must therefore be initialized to
  1783. // 0x01000000. This value is
  1784. // incremented with 0x1: After
  1785. // first use - When a new data
  1786. // block is submitted to the
  1787. // engine. For CCM: -[127:0] - A0:
  1788. // For CCM this field must be
  1789. // written with value A0, this
  1790. // value is the concatenation of:
  1791. // A0-flags (5-bits of 0 and 3-bits
  1792. // 'L'), Nonce and counter value.
  1793. // 'L' must be a copy from the 'L'
  1794. // value of the AES_CTRL register.
  1795. // This 'L' indicates the width of
  1796. // the Nonce and counter. The
  1797. // loaded counter must be
  1798. // initialized to 0. The total
  1799. // width of A0 is 128-bit. For
  1800. // CBC-MAC: -[127:0] - Zeroes - For
  1801. // CBC-MAC this register must be
  1802. // written with 0s at the start of
  1803. // each operation. After an
  1804. // operation, these registers
  1805. // contain the 128-bit TAG output,
  1806. // generated by the EIP-120t.
  1807. #define AES_AES_IV_2_AES_IV_S 0
  1808. //*****************************************************************************
  1809. //
  1810. // The following are defines for the bit fields in the AES_AES_IV_3 register.
  1811. //
  1812. //*****************************************************************************
  1813. #define AES_AES_IV_3_AES_IV_M 0xFFFFFFFF // AES_IV[127:96] Initialization
  1814. // vector Used for regular non-ECB
  1815. // modes (CBC/CTR): -[127:0] -
  1816. // AES_IV - For regular AES
  1817. // operations (CBC and CTR) these
  1818. // registers must be written with a
  1819. // new 128-bit IV. After an
  1820. // operation, these registers
  1821. // contain the latest 128-bit
  1822. // result IV, generated by the
  1823. // EIP-120t. If CTR mode is
  1824. // selected, this value is
  1825. // incremented with 0x1: After
  1826. // first use - When a new data
  1827. // block is submitted to the engine
  1828. // For GCM: -[127:0] - AES_IV - For
  1829. // GCM operations, these registers
  1830. // must be written with a new
  1831. // 128-bit IV. After an operation,
  1832. // these registers contain the
  1833. // updated 128-bit result IV,
  1834. // generated by the EIP-120t. Note
  1835. // that bits [127:96] of the IV
  1836. // represent the initial counter
  1837. // value (which is 1 for GCM) and
  1838. // must therefore be initialized to
  1839. // 0x01000000. This value is
  1840. // incremented with 0x1: After
  1841. // first use - When a new data
  1842. // block is submitted to the
  1843. // engine. For CCM: -[127:0] - A0:
  1844. // For CCM this field must be
  1845. // written with value A0, this
  1846. // value is the concatenation of:
  1847. // A0-flags (5-bits of 0 and 3-bits
  1848. // 'L'), Nonce and counter value.
  1849. // 'L' must be a copy from the 'L'
  1850. // value of the AES_CTRL register.
  1851. // This 'L' indicates the width of
  1852. // the Nonce and counter. The
  1853. // loaded counter must be
  1854. // initialized to 0. The total
  1855. // width of A0 is 128-bit. For
  1856. // CBC-MAC: -[127:0] - Zeroes - For
  1857. // CBC-MAC this register must be
  1858. // written with 0s at the start of
  1859. // each operation. After an
  1860. // operation, these registers
  1861. // contain the 128-bit TAG output,
  1862. // generated by the EIP-120t.
  1863. #define AES_AES_IV_3_AES_IV_S 0
  1864. //*****************************************************************************
  1865. //
  1866. // The following are defines for the bit fields in the AES_AES_CTRL register.
  1867. //
  1868. //*****************************************************************************
  1869. #define AES_AES_CTRL_context_ready \
  1870. 0x80000000 // If 1, this read-only status bit
  1871. // indicates that the context data
  1872. // registers can be overwritten and
  1873. // the host is permitted to write
  1874. // the next context.
  1875. #define AES_AES_CTRL_context_ready_M \
  1876. 0x80000000
  1877. #define AES_AES_CTRL_context_ready_S 31
  1878. #define AES_AES_CTRL_saved_context_ready \
  1879. 0x40000000 // If 1, this status bit indicates
  1880. // that an AES authentication TAG
  1881. // and/or IV block(s) is/are
  1882. // available for the host to
  1883. // retrieve. This bit is only
  1884. // asserted if the save_context bit
  1885. // is set to 1. The bit is mutual
  1886. // exclusive with the context_ready
  1887. // bit. Writing one clears the bit
  1888. // to 0, indicating the AES core
  1889. // can start its next operation.
  1890. // This bit is also cleared when
  1891. // the 4th word of the output TAG
  1892. // and/or IV is read. Note: All
  1893. // other mode bit writes are
  1894. // ignored when this mode bit is
  1895. // written with 1. Note: This bit
  1896. // is controlled automatically by
  1897. // the EIP-120t for TAG read DMA
  1898. // operations.
  1899. #define AES_AES_CTRL_saved_context_ready_M \
  1900. 0x40000000
  1901. #define AES_AES_CTRL_saved_context_ready_S 30
  1902. #define AES_AES_CTRL_save_context \
  1903. 0x20000000 // This bit indicates that an
  1904. // authentication TAG or result IV
  1905. // needs to be stored as a result
  1906. // context. Typically this bit must
  1907. // be set for authentication modes
  1908. // returning a TAG (CBC-MAC, GCM
  1909. // and CCM), or for basic
  1910. // encryption modes that require
  1911. // future continuation with the
  1912. // current result IV. If this bit
  1913. // is set, the engine retains its
  1914. // full context until the TAG
  1915. // and/or IV registers are read.
  1916. // The TAG or IV must be read
  1917. // before the AES engine can start
  1918. // a new operation.
  1919. #define AES_AES_CTRL_save_context_M \
  1920. 0x20000000
  1921. #define AES_AES_CTRL_save_context_S 29
  1922. #define AES_AES_CTRL_CCM_M_M 0x01C00000 // Defines M, which indicates the
  1923. // length of the authentication
  1924. // field for CCM operations; the
  1925. // authentication field length
  1926. // equals two times (the value of
  1927. // CCM-M plus one). Note: The
  1928. // EIP-120t always returns a
  1929. // 128-bit authentication field, of
  1930. // which the M least significant
  1931. // bytes are valid. All values are
  1932. // supported.
  1933. #define AES_AES_CTRL_CCM_M_S 22
  1934. #define AES_AES_CTRL_CCM_L_M 0x00380000 // Defines L, which indicates the
  1935. // width of the length field for
  1936. // CCM operations; the length field
  1937. // in bytes equals the value of
  1938. // CMM-L plus one. All values are
  1939. // supported.
  1940. #define AES_AES_CTRL_CCM_L_S 19
  1941. #define AES_AES_CTRL_CCM 0x00040000 // If set to 1, AES-CCM is
  1942. // selected AES-CCM is a combined
  1943. // mode, using AES for
  1944. // authentication and encryption.
  1945. // Note: Selecting AES-CCM mode
  1946. // requires writing of the AAD
  1947. // length register after all other
  1948. // registers. Note: The CTR mode
  1949. // bit in this register must also
  1950. // be set to 1 to enable AES-CTR;
  1951. // selecting other AES modes than
  1952. // CTR mode is invalid.
  1953. #define AES_AES_CTRL_CCM_M 0x00040000
  1954. #define AES_AES_CTRL_CCM_S 18
  1955. #define AES_AES_CTRL_GCM_M 0x00030000 // Set these bits to 11 to select
  1956. // AES-GCM mode. AES-GCM is a
  1957. // combined mode, using the Galois
  1958. // field multiplier GF(2 to the
  1959. // power of 128) for authentication
  1960. // and AES-CTR mode for encryption.
  1961. // Note: The CTR mode bit in this
  1962. // register must also be set to 1
  1963. // to enable AES-CTR Bit
  1964. // combination description: 00 = No
  1965. // GCM mode 01 = Reserved, do not
  1966. // select 10 = Reserved, do not
  1967. // select 11 = Autonomous GHASH
  1968. // (both H- and Y0-encrypted
  1969. // calculated internally) Note: The
  1970. // EIP-120t-1 configuration only
  1971. // supports mode 11 (autonomous
  1972. // GHASH), other GCM modes are not
  1973. // allowed.
  1974. #define AES_AES_CTRL_GCM_S 16
  1975. #define AES_AES_CTRL_CBC_MAC 0x00008000 // Set to 1 to select AES-CBC MAC
  1976. // mode. The direction bit must be
  1977. // set to 1 for this mode.
  1978. // Selecting this mode requires
  1979. // writing the length register
  1980. // after all other registers.
  1981. #define AES_AES_CTRL_CBC_MAC_M 0x00008000
  1982. #define AES_AES_CTRL_CBC_MAC_S 15
  1983. #define AES_AES_CTRL_ctr_width_M \
  1984. 0x00000180 // Specifies the counter width for
  1985. // AES-CTR mode 00 = 32-bit counter
  1986. // 01 = 64-bit counter 10 = 96-bit
  1987. // counter 11 = 128-bit counter
  1988. #define AES_AES_CTRL_ctr_width_S 7
  1989. #define AES_AES_CTRL_CTR 0x00000040 // If set to 1, AES counter mode
  1990. // (CTR) is selected. Note: This
  1991. // bit must also be set for GCM and
  1992. // CCM, when encryption/decryption
  1993. // is required.
  1994. #define AES_AES_CTRL_CTR_M 0x00000040
  1995. #define AES_AES_CTRL_CTR_S 6
  1996. #define AES_AES_CTRL_CBC 0x00000020 // If set to 1,
  1997. // cipher-block-chaining (CBC) mode
  1998. // is selected.
  1999. #define AES_AES_CTRL_CBC_M 0x00000020
  2000. #define AES_AES_CTRL_CBC_S 5
  2001. #define AES_AES_CTRL_key_size_M 0x00000018 // This read-only field specifies
  2002. // the key size. The key size is
  2003. // automatically configured when a
  2004. // new key is loaded through the
  2005. // key store module. 00 = N/A -
  2006. // Reserved 01 = 128-bit 10 =
  2007. // 192-bit 11 = 256-bit
  2008. #define AES_AES_CTRL_key_size_S 3
  2009. #define AES_AES_CTRL_direction 0x00000004 // If set to 1 an encrypt
  2010. // operation is performed. If set
  2011. // to 0 a decrypt operation is
  2012. // performed. This bit must be
  2013. // written with a 1 when CBC-MAC is
  2014. // selected.
  2015. #define AES_AES_CTRL_direction_M \
  2016. 0x00000004
  2017. #define AES_AES_CTRL_direction_S 2
  2018. #define AES_AES_CTRL_input_ready \
  2019. 0x00000002 // If 1, this status bit indicates
  2020. // that the 16-byte AES input
  2021. // buffer is empty. The host is
  2022. // permitted to write the next
  2023. // block of data. Writing 0 clears
  2024. // the bit to 0 and indicates that
  2025. // the AES core can use the
  2026. // provided input data block.
  2027. // Writing 1 to this bit is
  2028. // ignored. Note: For DMA
  2029. // operations, this bit is
  2030. // automatically controlled by the
  2031. // EIP-120t. After reset, this bit
  2032. // is 0. After writing a context,
  2033. // this bit becomes 1.
  2034. #define AES_AES_CTRL_input_ready_M \
  2035. 0x00000002
  2036. #define AES_AES_CTRL_input_ready_S 1
  2037. #define AES_AES_CTRL_output_ready \
  2038. 0x00000001 // If 1, this status bit indicates
  2039. // that an AES output block is
  2040. // available to be retrieved by the
  2041. // host. Writing 0 clears the bit
  2042. // to 0 and indicates that output
  2043. // data is read by the host. The
  2044. // AES core can provide a next
  2045. // output data block. Writing 1 to
  2046. // this bit is ignored. Note: For
  2047. // DMA operations, this bit is
  2048. // automatically controlled by the
  2049. // EIP-120t.
  2050. #define AES_AES_CTRL_output_ready_M \
  2051. 0x00000001
  2052. #define AES_AES_CTRL_output_ready_S 0
  2053. //*****************************************************************************
  2054. //
  2055. // The following are defines for the bit fields in the
  2056. // AES_AES_C_LENGTH_0 register.
  2057. //
  2058. //*****************************************************************************
  2059. #define AES_AES_C_LENGTH_0_C_LENGTH_M \
  2060. 0xFFFFFFFF // C_LENGTH[31:0] Bits [60:0] of
  2061. // the crypto length registers (LSW
  2062. // and MSW) store the cryptographic
  2063. // data length in bytes for all
  2064. // modes. Once processing with this
  2065. // context is started, this length
  2066. // decrements to 0. Data lengths up
  2067. // to (261: 1) bytes are allowed.
  2068. // For GCM, any value up to 236 -
  2069. // 32 bytes can be used. This is
  2070. // because a 32-bit counter mode is
  2071. // used; the maximum number of
  2072. // 128-bit blocks is 232 - 2,
  2073. // resulting in a maximum number of
  2074. // bytes of 236 - 32. A write to
  2075. // this register triggers the
  2076. // engine to start using this
  2077. // context. This is valid for all
  2078. // modes except GCM and CCM. Note:
  2079. // For the combined modes (GCM and
  2080. // CCM), this length does not
  2081. // include the authentication only
  2082. // data; the authentication length
  2083. // is specified in the
  2084. // AES_AUTH_LENGTH register below.
  2085. // All modes must have a length
  2086. // greater than 0. For the combined
  2087. // modes, it is allowed to have one
  2088. // of the lengths equal to 0. For
  2089. // the basic encryption modes (ECB,
  2090. // CBC, and CTR) it is allowed to
  2091. // program zero to the length
  2092. // field; in that case the length
  2093. // is assumed infinite. All data
  2094. // must be byte (8-bit) aligned for
  2095. // stream cipher modes; bit aligned
  2096. // data streams are not supported
  2097. // by the EIP-120t. For block
  2098. // cipher modes, the data length
  2099. // must be programmed in multiples
  2100. // of the block cipher size, 16
  2101. // bytes. For a host read
  2102. // operation, these registers
  2103. // return all-0s.
  2104. #define AES_AES_C_LENGTH_0_C_LENGTH_S 0
  2105. //*****************************************************************************
  2106. //
  2107. // The following are defines for the bit fields in the
  2108. // AES_AES_C_LENGTH_1 register.
  2109. //
  2110. //*****************************************************************************
  2111. #define AES_AES_C_LENGTH_1_C_LENGTH_M \
  2112. 0x1FFFFFFF // C_LENGTH[60:32] Bits [60:0] of
  2113. // the crypto length registers (LSW
  2114. // and MSW) store the cryptographic
  2115. // data length in bytes for all
  2116. // modes. Once processing with this
  2117. // context is started, this length
  2118. // decrements to 0. Data lengths up
  2119. // to (261: 1) bytes are allowed.
  2120. // For GCM, any value up to 236 -
  2121. // 32 bytes can be used. This is
  2122. // because a 32-bit counter mode is
  2123. // used; the maximum number of
  2124. // 128-bit blocks is 232 - 2,
  2125. // resulting in a maximum number of
  2126. // bytes of 236 - 32. A write to
  2127. // this register triggers the
  2128. // engine to start using this
  2129. // context. This is valid for all
  2130. // modes except GCM and CCM. Note:
  2131. // For the combined modes (GCM and
  2132. // CCM), this length does not
  2133. // include the authentication only
  2134. // data; the authentication length
  2135. // is specified in the
  2136. // AES_AUTH_LENGTH register below.
  2137. // All modes must have a length
  2138. // greater than 0. For the combined
  2139. // modes, it is allowed to have one
  2140. // of the lengths equal to 0. For
  2141. // the basic encryption modes (ECB,
  2142. // CBC, and CTR) it is allowed to
  2143. // program zero to the length
  2144. // field; in that case the length
  2145. // is assumed infinite. All data
  2146. // must be byte (8-bit) aligned for
  2147. // stream cipher modes; bit aligned
  2148. // data streams are not supported
  2149. // by the EIP-120t. For block
  2150. // cipher modes, the data length
  2151. // must be programmed in multiples
  2152. // of the block cipher size, 16
  2153. // bytes. For a host read
  2154. // operation, these registers
  2155. // return all-0s.
  2156. #define AES_AES_C_LENGTH_1_C_LENGTH_S 0
  2157. //*****************************************************************************
  2158. //
  2159. // The following are defines for the bit fields in the
  2160. // AES_AES_AUTH_LENGTH register.
  2161. //
  2162. //*****************************************************************************
  2163. #define AES_AES_AUTH_LENGTH_AUTH_LENGTH_M \
  2164. 0xFFFFFFFF // Bits [31:0] of the
  2165. // authentication length register
  2166. // store the authentication data
  2167. // length in bytes for combined
  2168. // modes only (GCM or CCM).
  2169. // Supported AAD-lengths for CCM
  2170. // are from 0 to (2^16 - 2^8)
  2171. // bytes. For GCM any value up to
  2172. // (2^32 - 1) bytes can be used.
  2173. // Once processing with this
  2174. // context is started, this length
  2175. // decrements to 0. A write to this
  2176. // register triggers the engine to
  2177. // start using this context for GCM
  2178. // and CCM. For a host read
  2179. // operation, these registers
  2180. // return all-0s.
  2181. #define AES_AES_AUTH_LENGTH_AUTH_LENGTH_S 0
  2182. //*****************************************************************************
  2183. //
  2184. // The following are defines for the bit fields in the
  2185. // AES_AES_DATA_IN_OUT_0 register.
  2186. //
  2187. //*****************************************************************************
  2188. #define AES_AES_DATA_IN_OUT_0_AES_DATA_IN_OUT_M \
  2189. 0xFFFFFFFF // AES input data[31:0] / AES
  2190. // output data[31:0] Data registers
  2191. // for input/output block data
  2192. // to/from the EIP-120t. For normal
  2193. // operations, this register is not
  2194. // used, since data input and
  2195. // output is transferred from and
  2196. // to the AES core via DMA. For a
  2197. // host write operation, these
  2198. // registers must be written with
  2199. // the 128-bit input block for the
  2200. // next AES operation. Writing at a
  2201. // word-aligned offset within this
  2202. // address range stores the word (4
  2203. // bytes) of data into the
  2204. // corresponding position of 4-word
  2205. // deep (16 bytes = 128-bit AES
  2206. // block) data input buffer. This
  2207. // buffer is used for the next AES
  2208. // operation. If the last data
  2209. // block is not completely filled
  2210. // with valid data (see notes
  2211. // below), it is allowed to write
  2212. // only the words with valid data.
  2213. // Next AES operation is triggered
  2214. // by writing to the input_ready
  2215. // flag of the AES_CTRL register.
  2216. // For a host read operation, these
  2217. // registers contain the 128-bit
  2218. // output block from the latest AES
  2219. // operation. Reading from a
  2220. // word-aligned offset within this
  2221. // address range reads one word (4
  2222. // bytes) of data out the 4-word
  2223. // deep (16 bytes = 128-bits AES
  2224. // block) data output buffer. The
  2225. // words (4 words, one full block)
  2226. // should be read before the core
  2227. // will move the next block to the
  2228. // data output buffer. To empty the
  2229. // data output buffer, the
  2230. // output_ready flag of the
  2231. // AES_CTRL register must be
  2232. // written. For the modes with
  2233. // authentication (CBC-MAC, GCM and
  2234. // CCM), the invalid (message)
  2235. // bytes/words can be written with
  2236. // any data. Note: AES typically
  2237. // operates on 128 bits block
  2238. // multiple input data. The CTR,
  2239. // GCM and CCM modes form an
  2240. // exception. The last block of a
  2241. // CTR-mode message may contain
  2242. // less than 128 bits (refer to
  2243. // [NIST 800-38A]). For GCM/CCM,
  2244. // the last block of both AAD and
  2245. // message data may contain less
  2246. // than 128 bits (refer to [NIST
  2247. // 800-38D]). The EIP-120t
  2248. // automatically pads or masks
  2249. // misaligned ending data blocks
  2250. // with 0s for GCM, CCM and
  2251. // CBC-MAC. For CTR mode, the
  2252. // remaining data in an unaligned
  2253. // data block is ignored. Note: The
  2254. // AAD / authentication only data
  2255. // is not copied to the output
  2256. // buffer but only used for
  2257. // authentication.
  2258. #define AES_AES_DATA_IN_OUT_0_AES_DATA_IN_OUT_S 0
  2259. //*****************************************************************************
  2260. //
  2261. // The following are defines for the bit fields in the
  2262. // AES_AES_DATA_IN_OUT_1 register.
  2263. //
  2264. //*****************************************************************************
  2265. #define AES_AES_DATA_IN_OUT_1_AES_DATA_IN_OUT_M \
  2266. 0xFFFFFFFF // AES input data[63:32] / AES
  2267. // output data[63:32] Data
  2268. // registers for input/output block
  2269. // data to/from the EIP-120t. For
  2270. // normal operations, this register
  2271. // is not used, since data input
  2272. // and output is transferred from
  2273. // and to the AES core via DMA. For
  2274. // a host write operation, these
  2275. // registers must be written with
  2276. // the 128-bit input block for the
  2277. // next AES operation. Writing at a
  2278. // word-aligned offset within this
  2279. // address range stores the word (4
  2280. // bytes) of data into the
  2281. // corresponding position of 4-word
  2282. // deep (16 bytes = 128-bit AES
  2283. // block) data input buffer. This
  2284. // buffer is used for the next AES
  2285. // operation. If the last data
  2286. // block is not completely filled
  2287. // with valid data (see notes
  2288. // below), it is allowed to write
  2289. // only the words with valid data.
  2290. // Next AES operation is triggered
  2291. // by writing to the input_ready
  2292. // flag of the AES_CTRL register.
  2293. // For a host read operation, these
  2294. // registers contain the 128-bit
  2295. // output block from the latest AES
  2296. // operation. Reading from a
  2297. // word-aligned offset within this
  2298. // address range reads one word (4
  2299. // bytes) of data out the 4-word
  2300. // deep (16 bytes = 128-bits AES
  2301. // block) data output buffer. The
  2302. // words (4 words, one full block)
  2303. // should be read before the core
  2304. // will move the next block to the
  2305. // data output buffer. To empty the
  2306. // data output buffer, the
  2307. // output_ready flag of the
  2308. // AES_CTRL register must be
  2309. // written. For the modes with
  2310. // authentication (CBC-MAC, GCM and
  2311. // CCM), the invalid (message)
  2312. // bytes/words can be written with
  2313. // any data. Note: AES typically
  2314. // operates on 128 bits block
  2315. // multiple input data. The CTR,
  2316. // GCM and CCM modes form an
  2317. // exception. The last block of a
  2318. // CTR-mode message may contain
  2319. // less than 128 bits (refer to
  2320. // [NIST 800-38A]). For GCM/CCM,
  2321. // the last block of both AAD and
  2322. // message data may contain less
  2323. // than 128 bits (refer to [NIST
  2324. // 800-38D]). The EIP-120t
  2325. // automatically pads or masks
  2326. // misaligned ending data blocks
  2327. // with 0s for GCM, CCM and
  2328. // CBC-MAC. For CTR mode, the
  2329. // remaining data in an unaligned
  2330. // data block is ignored. Note: The
  2331. // AAD / authentication only data
  2332. // is not copied to the output
  2333. // buffer but only used for
  2334. // authentication.
  2335. #define AES_AES_DATA_IN_OUT_1_AES_DATA_IN_OUT_S 0
  2336. //*****************************************************************************
  2337. //
  2338. // The following are defines for the bit fields in the
  2339. // AES_AES_DATA_IN_OUT_2 register.
  2340. //
  2341. //*****************************************************************************
  2342. #define AES_AES_DATA_IN_OUT_2_AES_DATA_IN_OUT_M \
  2343. 0xFFFFFFFF // AES input data[95:64] / AES
  2344. // output data[95:64] Data
  2345. // registers for input/output block
  2346. // data to/from the EIP-120t. For
  2347. // normal operations, this register
  2348. // is not used, since data input
  2349. // and output is transferred from
  2350. // and to the AES core via DMA. For
  2351. // a host write operation, these
  2352. // registers must be written with
  2353. // the 128-bit input block for the
  2354. // next AES operation. Writing at a
  2355. // word-aligned offset within this
  2356. // address range stores the word (4
  2357. // bytes) of data into the
  2358. // corresponding position of 4-word
  2359. // deep (16 bytes = 128-bit AES
  2360. // block) data input buffer. This
  2361. // buffer is used for the next AES
  2362. // operation. If the last data
  2363. // block is not completely filled
  2364. // with valid data (see notes
  2365. // below), it is allowed to write
  2366. // only the words with valid data.
  2367. // Next AES operation is triggered
  2368. // by writing to the input_ready
  2369. // flag of the AES_CTRL register.
  2370. // For a host read operation, these
  2371. // registers contain the 128-bit
  2372. // output block from the latest AES
  2373. // operation. Reading from a
  2374. // word-aligned offset within this
  2375. // address range reads one word (4
  2376. // bytes) of data out the 4-word
  2377. // deep (16 bytes = 128-bits AES
  2378. // block) data output buffer. The
  2379. // words (4 words, one full block)
  2380. // should be read before the core
  2381. // will move the next block to the
  2382. // data output buffer. To empty the
  2383. // data output buffer, the
  2384. // output_ready flag of the
  2385. // AES_CTRL register must be
  2386. // written. For the modes with
  2387. // authentication (CBC-MAC, GCM and
  2388. // CCM), the invalid (message)
  2389. // bytes/words can be written with
  2390. // any data. Note: AES typically
  2391. // operates on 128 bits block
  2392. // multiple input data. The CTR,
  2393. // GCM and CCM modes form an
  2394. // exception. The last block of a
  2395. // CTR-mode message may contain
  2396. // less than 128 bits (refer to
  2397. // [NIST 800-38A]). For GCM/CCM,
  2398. // the last block of both AAD and
  2399. // message data may contain less
  2400. // than 128 bits (refer to [NIST
  2401. // 800-38D]). The EIP-120t
  2402. // automatically pads or masks
  2403. // misaligned ending data blocks
  2404. // with 0s for GCM, CCM and
  2405. // CBC-MAC. For CTR mode, the
  2406. // remaining data in an unaligned
  2407. // data block is ignored. Note: The
  2408. // AAD / authentication only data
  2409. // is not copied to the output
  2410. // buffer but only used for
  2411. // authentication.
  2412. #define AES_AES_DATA_IN_OUT_2_AES_DATA_IN_OUT_S 0
  2413. //*****************************************************************************
  2414. //
  2415. // The following are defines for the bit fields in the
  2416. // AES_AES_DATA_IN_OUT_3 register.
  2417. //
  2418. //*****************************************************************************
  2419. #define AES_AES_DATA_IN_OUT_3_AES_DATA_IN_OUT_M \
  2420. 0xFFFFFFFF // AES input data[127:96] / AES
  2421. // output data[127:96] Data
  2422. // registers for input/output block
  2423. // data to/from the EIP-120t. For
  2424. // normal operations, this register
  2425. // is not used, since data input
  2426. // and output is transferred from
  2427. // and to the AES core via DMA. For
  2428. // a host write operation, these
  2429. // registers must be written with
  2430. // the 128-bit input block for the
  2431. // next AES operation. Writing at a
  2432. // word-aligned offset within this
  2433. // address range stores the word (4
  2434. // bytes) of data into the
  2435. // corresponding position of 4-word
  2436. // deep (16 bytes = 128-bit AES
  2437. // block) data input buffer. This
  2438. // buffer is used for the next AES
  2439. // operation. If the last data
  2440. // block is not completely filled
  2441. // with valid data (see notes
  2442. // below), it is allowed to write
  2443. // only the words with valid data.
  2444. // Next AES operation is triggered
  2445. // by writing to the input_ready
  2446. // flag of the AES_CTRL register.
  2447. // For a host read operation, these
  2448. // registers contain the 128-bit
  2449. // output block from the latest AES
  2450. // operation. Reading from a
  2451. // word-aligned offset within this
  2452. // address range reads one word (4
  2453. // bytes) of data out the 4-word
  2454. // deep (16 bytes = 128-bits AES
  2455. // block) data output buffer. The
  2456. // words (4 words, one full block)
  2457. // should be read before the core
  2458. // will move the next block to the
  2459. // data output buffer. To empty the
  2460. // data output buffer, the
  2461. // output_ready flag of the
  2462. // AES_CTRL register must be
  2463. // written. For the modes with
  2464. // authentication (CBC-MAC, GCM and
  2465. // CCM), the invalid (message)
  2466. // bytes/words can be written with
  2467. // any data. Note: AES typically
  2468. // operates on 128 bits block
  2469. // multiple input data. The CTR,
  2470. // GCM and CCM modes form an
  2471. // exception. The last block of a
  2472. // CTR-mode message may contain
  2473. // less than 128 bits (refer to
  2474. // [NIST 800-38A]). For GCM/CCM,
  2475. // the last block of both AAD and
  2476. // message data may contain less
  2477. // than 128 bits (refer to [NIST
  2478. // 800-38D]). The EIP-120t
  2479. // automatically pads or masks
  2480. // misaligned ending data blocks
  2481. // with 0s for GCM, CCM and
  2482. // CBC-MAC. For CTR mode, the
  2483. // remaining data in an unaligned
  2484. // data block is ignored. Note: The
  2485. // AAD / authentication only data
  2486. // is not copied to the output
  2487. // buffer but only used for
  2488. // authentication.
  2489. #define AES_AES_DATA_IN_OUT_3_AES_DATA_IN_OUT_S 0
  2490. //*****************************************************************************
  2491. //
  2492. // The following are defines for the bit fields in the
  2493. // AES_AES_TAG_OUT_0 register.
  2494. //
  2495. //*****************************************************************************
  2496. #define AES_AES_TAG_OUT_0_AES_TAG_M \
  2497. 0xFFFFFFFF // AES_TAG[31:0] Bits [31:0] of
  2498. // the AES_TAG registers store the
  2499. // authentication value for the
  2500. // combined and authentication only
  2501. // modes. For a host read
  2502. // operation, these registers
  2503. // contain the last 128-bit TAG
  2504. // output of the EIP-120t; the TAG
  2505. // is available until the next
  2506. // context is written. This
  2507. // register will only contain valid
  2508. // data if the TAG is available and
  2509. // when the store_ready bit from
  2510. // AES_CTRL register is set. During
  2511. // processing or for
  2512. // operations/modes that do not
  2513. // return a TAG, reads from this
  2514. // register return data from the IV
  2515. // register.
  2516. #define AES_AES_TAG_OUT_0_AES_TAG_S 0
  2517. //*****************************************************************************
  2518. //
  2519. // The following are defines for the bit fields in the
  2520. // AES_AES_TAG_OUT_1 register.
  2521. //
  2522. //*****************************************************************************
  2523. #define AES_AES_TAG_OUT_1_AES_TAG_M \
  2524. 0xFFFFFFFF // AES_TAG[63:32] For a host read
  2525. // operation, these registers
  2526. // contain the last 128-bit TAG
  2527. // output of the EIP-120t; the TAG
  2528. // is available until the next
  2529. // context is written. This
  2530. // register contains valid data
  2531. // only if the TAG is available and
  2532. // when the store_ready bit from
  2533. // AES_CTRL register is set. During
  2534. // processing or for
  2535. // operations/modes that do not
  2536. // return a TAG, reads from this
  2537. // register return data from the IV
  2538. // register.
  2539. #define AES_AES_TAG_OUT_1_AES_TAG_S 0
  2540. //*****************************************************************************
  2541. //
  2542. // The following are defines for the bit fields in the
  2543. // AES_AES_TAG_OUT_2 register.
  2544. //
  2545. //*****************************************************************************
  2546. #define AES_AES_TAG_OUT_2_AES_TAG_M \
  2547. 0xFFFFFFFF // AES_TAG[95:64] For a host read
  2548. // operation, these registers
  2549. // contain the last 128-bit TAG
  2550. // output of the EIP-120t; the TAG
  2551. // is available until the next
  2552. // context is written. This
  2553. // register contains valid data
  2554. // only if the TAG is available and
  2555. // when the store_ready bit from
  2556. // AES_CTRL register is set. During
  2557. // processing or for
  2558. // operations/modes that do not
  2559. // return a TAG, reads from this
  2560. // register return data from the IV
  2561. // register.
  2562. #define AES_AES_TAG_OUT_2_AES_TAG_S 0
  2563. //*****************************************************************************
  2564. //
  2565. // The following are defines for the bit fields in the
  2566. // AES_AES_TAG_OUT_3 register.
  2567. //
  2568. //*****************************************************************************
  2569. #define AES_AES_TAG_OUT_3_AES_TAG_M \
  2570. 0xFFFFFFFF // AES_TAG[127:96] For a host read
  2571. // operation, these registers
  2572. // contain the last 128-bit TAG
  2573. // output of the EIP-120t; the TAG
  2574. // is available until the next
  2575. // context is written. This
  2576. // register contains valid data
  2577. // only if the TAG is available and
  2578. // when the store_ready bit from
  2579. // AES_CTRL register is set. During
  2580. // processing or for
  2581. // operations/modes that do not
  2582. // return a TAG, reads from this
  2583. // register return data from the IV
  2584. // register.
  2585. #define AES_AES_TAG_OUT_3_AES_TAG_S 0
  2586. //*****************************************************************************
  2587. //
  2588. // The following are defines for the bit fields in the
  2589. // AES_HASH_DATA_IN_0 register.
  2590. //
  2591. //*****************************************************************************
  2592. #define AES_HASH_DATA_IN_0_HASH_DATA_IN_M \
  2593. 0xFFFFFFFF // HASH_DATA_IN[31:0] These
  2594. // registers must be written with
  2595. // the 512-bit input data. The data
  2596. // lines are connected directly to
  2597. // the data input of the hash
  2598. // module and hence into the
  2599. // engine's internal data buffer.
  2600. // Writing to each of the registers
  2601. // triggers a corresponding 32-bit
  2602. // write enable to the internal
  2603. // buffer. Note: The host may only
  2604. // write the input data buffer when
  2605. // the rfd_in bit of the
  2606. // HASH_IO_BUF_CTRL register is
  2607. // high. If the rfd_in bit is 0,
  2608. // the engine is busy with
  2609. // processing. During processing,
  2610. // it is not allowed to write new
  2611. // input data. For message lengths
  2612. // larger than 64 bytes, multiple
  2613. // blocks of data are written to
  2614. // this input buffer using a
  2615. // handshake through flags of the
  2616. // HASH_IO_BUF_CTRL register. All
  2617. // blocks except the last are
  2618. // required to be 512 bits in size.
  2619. // If the last block is not 512
  2620. // bits long, only the least
  2621. // significant bits of data must be
  2622. // written, but they must be padded
  2623. // with 0s to the next 32-bit
  2624. // boundary. Host read operations
  2625. // from these register addresses
  2626. // return 0s.
  2627. #define AES_HASH_DATA_IN_0_HASH_DATA_IN_S 0
  2628. //*****************************************************************************
  2629. //
  2630. // The following are defines for the bit fields in the
  2631. // AES_HASH_DATA_IN_1 register.
  2632. //
  2633. //*****************************************************************************
  2634. #define AES_HASH_DATA_IN_1_HASH_DATA_IN_M \
  2635. 0xFFFFFFFF // HASH_DATA_IN[63:32] These
  2636. // registers must be written with
  2637. // the 512-bit input data. The data
  2638. // lines are connected directly to
  2639. // the data input of the hash
  2640. // module and hence into the
  2641. // engine's internal data buffer.
  2642. // Writing to each of the registers
  2643. // triggers a corresponding 32-bit
  2644. // write enable to the internal
  2645. // buffer. Note: The host may only
  2646. // write the input data buffer when
  2647. // the rfd_in bit of the
  2648. // HASH_IO_BUF_CTRL register is
  2649. // high. If the rfd_in bit is 0,
  2650. // the engine is busy with
  2651. // processing. During processing,
  2652. // it is not allowed to write new
  2653. // input data. For message lengths
  2654. // larger than 64 bytes, multiple
  2655. // blocks of data are written to
  2656. // this input buffer using a
  2657. // handshake through flags of the
  2658. // HASH_IO_BUF_CTRL register. All
  2659. // blocks except the last are
  2660. // required to be 512 bits in size.
  2661. // If the last block is not 512
  2662. // bits long, only the least
  2663. // significant bits of data must be
  2664. // written, but they must be padded
  2665. // with 0s to the next 32-bit
  2666. // boundary. Host read operations
  2667. // from these register addresses
  2668. // return 0s.
  2669. #define AES_HASH_DATA_IN_1_HASH_DATA_IN_S 0
  2670. //*****************************************************************************
  2671. //
  2672. // The following are defines for the bit fields in the
  2673. // AES_HASH_DATA_IN_2 register.
  2674. //
  2675. //*****************************************************************************
  2676. #define AES_HASH_DATA_IN_2_HASH_DATA_IN_M \
  2677. 0xFFFFFFFF // HASH_DATA_IN[95:64] These
  2678. // registers must be written with
  2679. // the 512-bit input data. The data
  2680. // lines are connected directly to
  2681. // the data input of the hash
  2682. // module and hence into the
  2683. // engine's internal data buffer.
  2684. // Writing to each of the registers
  2685. // triggers a corresponding 32-bit
  2686. // write enable to the internal
  2687. // buffer. Note: The host may only
  2688. // write the input data buffer when
  2689. // the rfd_in bit of the
  2690. // HASH_IO_BUF_CTRL register is
  2691. // high. If the rfd_in bit is 0,
  2692. // the engine is busy with
  2693. // processing. During processing,
  2694. // it is not allowed to write new
  2695. // input data. For message lengths
  2696. // larger than 64 bytes, multiple
  2697. // blocks of data are written to
  2698. // this input buffer using a
  2699. // handshake through flags of the
  2700. // HASH_IO_BUF_CTRL register. All
  2701. // blocks except the last are
  2702. // required to be 512 bits in size.
  2703. // If the last block is not 512
  2704. // bits long, only the least
  2705. // significant bits of data must be
  2706. // written, but they must be padded
  2707. // with 0s to the next 32-bit
  2708. // boundary. Host read operations
  2709. // from these register addresses
  2710. // return 0s.
  2711. #define AES_HASH_DATA_IN_2_HASH_DATA_IN_S 0
  2712. //*****************************************************************************
  2713. //
  2714. // The following are defines for the bit fields in the
  2715. // AES_HASH_DATA_IN_3 register.
  2716. //
  2717. //*****************************************************************************
  2718. #define AES_HASH_DATA_IN_3_HASH_DATA_IN_M \
  2719. 0xFFFFFFFF // HASH_DATA_IN[127:96] These
  2720. // registers must be written with
  2721. // the 512-bit input data. The data
  2722. // lines are connected directly to
  2723. // the data input of the hash
  2724. // module and hence into the
  2725. // engine's internal data buffer.
  2726. // Writing to each of the registers
  2727. // triggers a corresponding 32-bit
  2728. // write enable to the internal
  2729. // buffer. Note: The host may only
  2730. // write the input data buffer when
  2731. // the rfd_in bit of the
  2732. // HASH_IO_BUF_CTRL register is
  2733. // high. If the rfd_in bit is 0,
  2734. // the engine is busy with
  2735. // processing. During processing,
  2736. // it is not allowed to write new
  2737. // input data. For message lengths
  2738. // larger than 64 bytes, multiple
  2739. // blocks of data are written to
  2740. // this input buffer using a
  2741. // handshake through flags of the
  2742. // HASH_IO_BUF_CTRL register. All
  2743. // blocks except the last are
  2744. // required to be 512 bits in size.
  2745. // If the last block is not 512
  2746. // bits long, only the least
  2747. // significant bits of data must be
  2748. // written, but they must be padded
  2749. // with 0s to the next 32-bit
  2750. // boundary. Host read operations
  2751. // from these register addresses
  2752. // return 0s.
  2753. #define AES_HASH_DATA_IN_3_HASH_DATA_IN_S 0
  2754. //*****************************************************************************
  2755. //
  2756. // The following are defines for the bit fields in the
  2757. // AES_HASH_DATA_IN_4 register.
  2758. //
  2759. //*****************************************************************************
  2760. #define AES_HASH_DATA_IN_4_HASH_DATA_IN_M \
  2761. 0xFFFFFFFF // HASH_DATA_IN[159:128] These
  2762. // registers must be written with
  2763. // the 512-bit input data. The data
  2764. // lines are connected directly to
  2765. // the data input of the hash
  2766. // module and hence into the
  2767. // engine's internal data buffer.
  2768. // Writing to each of the registers
  2769. // triggers a corresponding 32-bit
  2770. // write enable to the internal
  2771. // buffer. Note: The host may only
  2772. // write the input data buffer when
  2773. // the rfd_in bit of the
  2774. // HASH_IO_BUF_CTRL register is
  2775. // high. If the rfd_in bit is 0,
  2776. // the engine is busy with
  2777. // processing. During processing,
  2778. // it is not allowed to write new
  2779. // input data. For message lengths
  2780. // larger than 64 bytes, multiple
  2781. // blocks of data are written to
  2782. // this input buffer using a
  2783. // handshake through flags of the
  2784. // HASH_IO_BUF_CTRL register. All
  2785. // blocks except the last are
  2786. // required to be 512 bits in size.
  2787. // If the last block is not 512
  2788. // bits long, only the least
  2789. // significant bits of data must be
  2790. // written, but they must be padded
  2791. // with 0s to the next 32-bit
  2792. // boundary. Host read operations
  2793. // from these register addresses
  2794. // return 0s.
  2795. #define AES_HASH_DATA_IN_4_HASH_DATA_IN_S 0
  2796. //*****************************************************************************
  2797. //
  2798. // The following are defines for the bit fields in the
  2799. // AES_HASH_DATA_IN_5 register.
  2800. //
  2801. //*****************************************************************************
  2802. #define AES_HASH_DATA_IN_5_HASH_DATA_IN_M \
  2803. 0xFFFFFFFF // HASH_DATA_IN[191:160] These
  2804. // registers must be written with
  2805. // the 512-bit input data. The data
  2806. // lines are connected directly to
  2807. // the data input of the hash
  2808. // module and hence into the
  2809. // engine's internal data buffer.
  2810. // Writing to each of the registers
  2811. // triggers a corresponding 32-bit
  2812. // write enable to the internal
  2813. // buffer. Note: The host may only
  2814. // write the input data buffer when
  2815. // the rfd_in bit of the
  2816. // HASH_IO_BUF_CTRL register is
  2817. // high. If the rfd_in bit is 0,
  2818. // the engine is busy with
  2819. // processing. During processing,
  2820. // it is not allowed to write new
  2821. // input data. For message lengths
  2822. // larger than 64 bytes, multiple
  2823. // blocks of data are written to
  2824. // this input buffer using a
  2825. // handshake through flags of the
  2826. // HASH_IO_BUF_CTRL register. All
  2827. // blocks except the last are
  2828. // required to be 512 bits in size.
  2829. // If the last block is not 512
  2830. // bits long, only the least
  2831. // significant bits of data must be
  2832. // written, but they must be padded
  2833. // with 0s to the next 32-bit
  2834. // boundary. Host read operations
  2835. // from these register addresses
  2836. // return 0s.
  2837. #define AES_HASH_DATA_IN_5_HASH_DATA_IN_S 0
  2838. //*****************************************************************************
  2839. //
  2840. // The following are defines for the bit fields in the
  2841. // AES_HASH_DATA_IN_6 register.
  2842. //
  2843. //*****************************************************************************
  2844. #define AES_HASH_DATA_IN_6_HASH_DATA_IN_M \
  2845. 0xFFFFFFFF // HASH_DATA_IN[223:192] These
  2846. // registers must be written with
  2847. // the 512-bit input data. The data
  2848. // lines are connected directly to
  2849. // the data input of the hash
  2850. // module and hence into the
  2851. // engine's internal data buffer.
  2852. // Writing to each of the registers
  2853. // triggers a corresponding 32-bit
  2854. // write enable to the internal
  2855. // buffer. Note: The host may only
  2856. // write the input data buffer when
  2857. // the rfd_in bit of the
  2858. // HASH_IO_BUF_CTRL register is
  2859. // high. If the rfd_in bit is 0,
  2860. // the engine is busy with
  2861. // processing. During processing,
  2862. // it is not allowed to write new
  2863. // input data. For message lengths
  2864. // larger than 64 bytes, multiple
  2865. // blocks of data are written to
  2866. // this input buffer using a
  2867. // handshake through flags of the
  2868. // HASH_IO_BUF_CTRL register. All
  2869. // blocks except the last are
  2870. // required to be 512 bits in size.
  2871. // If the last block is not 512
  2872. // bits long, only the least
  2873. // significant bits of data must be
  2874. // written, but they must be padded
  2875. // with 0s to the next 32-bit
  2876. // boundary. Host read operations
  2877. // from these register addresses
  2878. // return 0s.
  2879. #define AES_HASH_DATA_IN_6_HASH_DATA_IN_S 0
  2880. //*****************************************************************************
  2881. //
  2882. // The following are defines for the bit fields in the
  2883. // AES_HASH_DATA_IN_7 register.
  2884. //
  2885. //*****************************************************************************
  2886. #define AES_HASH_DATA_IN_7_HASH_DATA_IN_M \
  2887. 0xFFFFFFFF // HASH_DATA_IN[255:224] These
  2888. // registers must be written with
  2889. // the 512-bit input data. The data
  2890. // lines are connected directly to
  2891. // the data input of the hash
  2892. // module and hence into the
  2893. // engine's internal data buffer.
  2894. // Writing to each of the registers
  2895. // triggers a corresponding 32-bit
  2896. // write enable to the internal
  2897. // buffer. Note: The host may only
  2898. // write the input data buffer when
  2899. // the rfd_in bit of the
  2900. // HASH_IO_BUF_CTRL register is
  2901. // high. If the rfd_in bit is 0,
  2902. // the engine is busy with
  2903. // processing. During processing,
  2904. // it is not allowed to write new
  2905. // input data. For message lengths
  2906. // larger than 64 bytes, multiple
  2907. // blocks of data are written to
  2908. // this input buffer using a
  2909. // handshake through flags of the
  2910. // HASH_IO_BUF_CTRL register. All
  2911. // blocks except the last are
  2912. // required to be 512 bits in size.
  2913. // If the last block is not 512
  2914. // bits long, only the least
  2915. // significant bits of data must be
  2916. // written, but they must be padded
  2917. // with 0s to the next 32-bit
  2918. // boundary. Host read operations
  2919. // from these register addresses
  2920. // return 0s.
  2921. #define AES_HASH_DATA_IN_7_HASH_DATA_IN_S 0
  2922. //*****************************************************************************
  2923. //
  2924. // The following are defines for the bit fields in the
  2925. // AES_HASH_DATA_IN_8 register.
  2926. //
  2927. //*****************************************************************************
  2928. #define AES_HASH_DATA_IN_8_HASH_DATA_IN_M \
  2929. 0xFFFFFFFF // HASH_DATA_IN[287:256] These
  2930. // registers must be written with
  2931. // the 512-bit input data. The data
  2932. // lines are connected directly to
  2933. // the data input of the hash
  2934. // module and hence into the
  2935. // engine's internal data buffer.
  2936. // Writing to each of the registers
  2937. // triggers a corresponding 32-bit
  2938. // write enable to the internal
  2939. // buffer. Note: The host may only
  2940. // write the input data buffer when
  2941. // the rfd_in bit of the
  2942. // HASH_IO_BUF_CTRL register is
  2943. // high. If the rfd_in bit is 0,
  2944. // the engine is busy with
  2945. // processing. During processing,
  2946. // it is not allowed to write new
  2947. // input data. For message lengths
  2948. // larger than 64 bytes, multiple
  2949. // blocks of data are written to
  2950. // this input buffer using a
  2951. // handshake through flags of the
  2952. // HASH_IO_BUF_CTRL register. All
  2953. // blocks except the last are
  2954. // required to be 512 bits in size.
  2955. // If the last block is not 512
  2956. // bits long, only the least
  2957. // significant bits of data must be
  2958. // written, but they must be padded
  2959. // with 0s to the next 32-bit
  2960. // boundary. Host read operations
  2961. // from these register addresses
  2962. // return 0s.
  2963. #define AES_HASH_DATA_IN_8_HASH_DATA_IN_S 0
  2964. //*****************************************************************************
  2965. //
  2966. // The following are defines for the bit fields in the
  2967. // AES_HASH_DATA_IN_9 register.
  2968. //
  2969. //*****************************************************************************
  2970. #define AES_HASH_DATA_IN_9_HASH_DATA_IN_M \
  2971. 0xFFFFFFFF // HASH_DATA_IN[319:288] These
  2972. // registers must be written with
  2973. // the 512-bit input data. The data
  2974. // lines are connected directly to
  2975. // the data input of the hash
  2976. // module and hence into the
  2977. // engine's internal data buffer.
  2978. // Writing to each of the registers
  2979. // triggers a corresponding 32-bit
  2980. // write enable to the internal
  2981. // buffer. Note: The host may only
  2982. // write the input data buffer when
  2983. // the rfd_in bit of the
  2984. // HASH_IO_BUF_CTRL register is
  2985. // high. If the rfd_in bit is 0,
  2986. // the engine is busy with
  2987. // processing. During processing,
  2988. // it is not allowed to write new
  2989. // input data. For message lengths
  2990. // larger than 64 bytes, multiple
  2991. // blocks of data are written to
  2992. // this input buffer using a
  2993. // handshake through flags of the
  2994. // HASH_IO_BUF_CTRL register. All
  2995. // blocks except the last are
  2996. // required to be 512 bits in size.
  2997. // If the last block is not 512
  2998. // bits long, only the least
  2999. // significant bits of data must be
  3000. // written, but they must be padded
  3001. // with 0s to the next 32-bit
  3002. // boundary. Host read operations
  3003. // from these register addresses
  3004. // return 0s.
  3005. #define AES_HASH_DATA_IN_9_HASH_DATA_IN_S 0
  3006. //*****************************************************************************
  3007. //
  3008. // The following are defines for the bit fields in the
  3009. // AES_HASH_DATA_IN_10 register.
  3010. //
  3011. //*****************************************************************************
  3012. #define AES_HASH_DATA_IN_10_HASH_DATA_IN_M \
  3013. 0xFFFFFFFF // HASH_DATA_IN[351:320] These
  3014. // registers must be written with
  3015. // the 512-bit input data. The data
  3016. // lines are connected directly to
  3017. // the data input of the hash
  3018. // module and hence into the
  3019. // engine's internal data buffer.
  3020. // Writing to each of the registers
  3021. // triggers a corresponding 32-bit
  3022. // write enable to the internal
  3023. // buffer. Note: The host may only
  3024. // write the input data buffer when
  3025. // the rfd_in bit of the
  3026. // HASH_IO_BUF_CTRL register is
  3027. // high. If the rfd_in bit is 0,
  3028. // the engine is busy with
  3029. // processing. During processing,
  3030. // it is not allowed to write new
  3031. // input data. For message lengths
  3032. // larger than 64 bytes, multiple
  3033. // blocks of data are written to
  3034. // this input buffer using a
  3035. // handshake through flags of the
  3036. // HASH_IO_BUF_CTRL register. All
  3037. // blocks except the last are
  3038. // required to be 512 bits in size.
  3039. // If the last block is not 512
  3040. // bits long, only the least
  3041. // significant bits of data must be
  3042. // written, but they must be padded
  3043. // with 0s to the next 32-bit
  3044. // boundary. Host read operations
  3045. // from these register addresses
  3046. // return 0s.
  3047. #define AES_HASH_DATA_IN_10_HASH_DATA_IN_S 0
  3048. //*****************************************************************************
  3049. //
  3050. // The following are defines for the bit fields in the
  3051. // AES_HASH_DATA_IN_11 register.
  3052. //
  3053. //*****************************************************************************
  3054. #define AES_HASH_DATA_IN_11_HASH_DATA_IN_M \
  3055. 0xFFFFFFFF // HASH_DATA_IN[383:352] These
  3056. // registers must be written with
  3057. // the 512-bit input data. The data
  3058. // lines are connected directly to
  3059. // the data input of the hash
  3060. // module and hence into the
  3061. // engine's internal data buffer.
  3062. // Writing to each of the registers
  3063. // triggers a corresponding 32-bit
  3064. // write enable to the internal
  3065. // buffer. Note: The host may only
  3066. // write the input data buffer when
  3067. // the rfd_in bit of the
  3068. // HASH_IO_BUF_CTRL register is
  3069. // high. If the rfd_in bit is 0,
  3070. // the engine is busy with
  3071. // processing. During processing,
  3072. // it is not allowed to write new
  3073. // input data. For message lengths
  3074. // larger than 64 bytes, multiple
  3075. // blocks of data are written to
  3076. // this input buffer using a
  3077. // handshake through flags of the
  3078. // HASH_IO_BUF_CTRL register. All
  3079. // blocks except the last are
  3080. // required to be 512 bits in size.
  3081. // If the last block is not 512
  3082. // bits long, only the least
  3083. // significant bits of data must be
  3084. // written, but they must be padded
  3085. // with 0s to the next 32-bit
  3086. // boundary. Host read operations
  3087. // from these register addresses
  3088. // return 0s.
  3089. #define AES_HASH_DATA_IN_11_HASH_DATA_IN_S 0
  3090. //*****************************************************************************
  3091. //
  3092. // The following are defines for the bit fields in the
  3093. // AES_HASH_DATA_IN_12 register.
  3094. //
  3095. //*****************************************************************************
  3096. #define AES_HASH_DATA_IN_12_HASH_DATA_IN_M \
  3097. 0xFFFFFFFF // HASH_DATA_IN[415:384] These
  3098. // registers must be written with
  3099. // the 512-bit input data. The data
  3100. // lines are connected directly to
  3101. // the data input of the hash
  3102. // module and hence into the
  3103. // engine's internal data buffer.
  3104. // Writing to each of the registers
  3105. // triggers a corresponding 32-bit
  3106. // write enable to the internal
  3107. // buffer. Note: The host may only
  3108. // write the input data buffer when
  3109. // the rfd_in bit of the
  3110. // HASH_IO_BUF_CTRL register is
  3111. // high. If the rfd_in bit is 0,
  3112. // the engine is busy with
  3113. // processing. During processing,
  3114. // it is not allowed to write new
  3115. // input data. For message lengths
  3116. // larger than 64 bytes, multiple
  3117. // blocks of data are written to
  3118. // this input buffer using a
  3119. // handshake through flags of the
  3120. // HASH_IO_BUF_CTRL register. All
  3121. // blocks except the last are
  3122. // required to be 512 bits in size.
  3123. // If the last block is not 512
  3124. // bits long, only the least
  3125. // significant bits of data must be
  3126. // written, but they must be padded
  3127. // with 0s to the next 32-bit
  3128. // boundary. Host read operations
  3129. // from these register addresses
  3130. // return 0s.
  3131. #define AES_HASH_DATA_IN_12_HASH_DATA_IN_S 0
  3132. //*****************************************************************************
  3133. //
  3134. // The following are defines for the bit fields in the
  3135. // AES_HASH_DATA_IN_13 register.
  3136. //
  3137. //*****************************************************************************
  3138. #define AES_HASH_DATA_IN_13_HASH_DATA_IN_M \
  3139. 0xFFFFFFFF // HASH_DATA_IN[447:416] These
  3140. // registers must be written with
  3141. // the 512-bit input data. The data
  3142. // lines are connected directly to
  3143. // the data input of the hash
  3144. // module and hence into the
  3145. // engine's internal data buffer.
  3146. // Writing to each of the registers
  3147. // triggers a corresponding 32-bit
  3148. // write enable to the internal
  3149. // buffer. Note: The host may only
  3150. // write the input data buffer when
  3151. // the rfd_in bit of the
  3152. // HASH_IO_BUF_CTRL register is
  3153. // high. If the rfd_in bit is 0,
  3154. // the engine is busy with
  3155. // processing. During processing,
  3156. // it is not allowed to write new
  3157. // input data. For message lengths
  3158. // larger than 64 bytes, multiple
  3159. // blocks of data are written to
  3160. // this input buffer using a
  3161. // handshake through flags of the
  3162. // HASH_IO_BUF_CTRL register. All
  3163. // blocks except the last are
  3164. // required to be 512 bits in size.
  3165. // If the last block is not 512
  3166. // bits long, only the least
  3167. // significant bits of data must be
  3168. // written, but they must be padded
  3169. // with 0s to the next 32-bit
  3170. // boundary. Host read operations
  3171. // from these register addresses
  3172. // return 0s.
  3173. #define AES_HASH_DATA_IN_13_HASH_DATA_IN_S 0
  3174. //*****************************************************************************
  3175. //
  3176. // The following are defines for the bit fields in the
  3177. // AES_HASH_DATA_IN_14 register.
  3178. //
  3179. //*****************************************************************************
  3180. #define AES_HASH_DATA_IN_14_HASH_DATA_IN_M \
  3181. 0xFFFFFFFF // HASH_DATA_IN[479:448] These
  3182. // registers must be written with
  3183. // the 512-bit input data. The data
  3184. // lines are connected directly to
  3185. // the data input of the hash
  3186. // module and hence into the
  3187. // engine's internal data buffer.
  3188. // Writing to each of the registers
  3189. // triggers a corresponding 32-bit
  3190. // write enable to the internal
  3191. // buffer. Note: The host may only
  3192. // write the input data buffer when
  3193. // the rfd_in bit of the
  3194. // HASH_IO_BUF_CTRL register is
  3195. // high. If the rfd_in bit is 0,
  3196. // the engine is busy with
  3197. // processing. During processing,
  3198. // it is not allowed to write new
  3199. // input data. For message lengths
  3200. // larger than 64 bytes, multiple
  3201. // blocks of data are written to
  3202. // this input buffer using a
  3203. // handshake through flags of the
  3204. // HASH_IO_BUF_CTRL register. All
  3205. // blocks except the last are
  3206. // required to be 512 bits in size.
  3207. // If the last block is not 512
  3208. // bits long, only the least
  3209. // significant bits of data must be
  3210. // written, but they must be padded
  3211. // with 0s to the next 32-bit
  3212. // boundary. Host read operations
  3213. // from these register addresses
  3214. // return 0s.
  3215. #define AES_HASH_DATA_IN_14_HASH_DATA_IN_S 0
  3216. //*****************************************************************************
  3217. //
  3218. // The following are defines for the bit fields in the
  3219. // AES_HASH_DATA_IN_15 register.
  3220. //
  3221. //*****************************************************************************
  3222. #define AES_HASH_DATA_IN_15_HASH_DATA_IN_M \
  3223. 0xFFFFFFFF // HASH_DATA_IN[511:480] These
  3224. // registers must be written with
  3225. // the 512-bit input data. The data
  3226. // lines are connected directly to
  3227. // the data input of the hash
  3228. // module and hence into the
  3229. // engine's internal data buffer.
  3230. // Writing to each of the registers
  3231. // triggers a corresponding 32-bit
  3232. // write enable to the internal
  3233. // buffer. Note: The host may only
  3234. // write the input data buffer when
  3235. // the rfd_in bit of the
  3236. // HASH_IO_BUF_CTRL register is
  3237. // high. If the rfd_in bit is 0,
  3238. // the engine is busy with
  3239. // processing. During processing,
  3240. // it is not allowed to write new
  3241. // input data. For message lengths
  3242. // larger than 64 bytes, multiple
  3243. // blocks of data are written to
  3244. // this input buffer using a
  3245. // handshake through flags of the
  3246. // HASH_IO_BUF_CTRL register. All
  3247. // blocks except the last are
  3248. // required to be 512 bits in size.
  3249. // If the last block is not 512
  3250. // bits long, only the least
  3251. // significant bits of data must be
  3252. // written, but they must be padded
  3253. // with 0s to the next 32-bit
  3254. // boundary. Host read operations
  3255. // from these register addresses
  3256. // return 0s.
  3257. #define AES_HASH_DATA_IN_15_HASH_DATA_IN_S 0
  3258. //*****************************************************************************
  3259. //
  3260. // The following are defines for the bit fields in the
  3261. // AES_HASH_IO_BUF_CTRL register.
  3262. //
  3263. //*****************************************************************************
  3264. #define AES_HASH_IO_BUF_CTRL_PAD_DMA_MESSAGE \
  3265. 0x00000080 // Note: This bit must only be
  3266. // used when data is supplied
  3267. // through the DMA. It should not
  3268. // be used when data is supplied
  3269. // through the slave interface.
  3270. // This bit indicates whether the
  3271. // hash engine has to pad the
  3272. // message, received through the
  3273. // DMA and finalize the hash. When
  3274. // set to 1, the hash engine pads
  3275. // the last block using the
  3276. // programmed length. After
  3277. // padding, the final hash result
  3278. // is calculated. When set to 0,
  3279. // the hash engine treats the last
  3280. // written block as block-size
  3281. // aligned and calculates the
  3282. // intermediate digest. This bit is
  3283. // automatically cleared when the
  3284. // last DMA data block is arrived
  3285. // in the hash engine.
  3286. #define AES_HASH_IO_BUF_CTRL_PAD_DMA_MESSAGE_M \
  3287. 0x00000080
  3288. #define AES_HASH_IO_BUF_CTRL_PAD_DMA_MESSAGE_S 7
  3289. #define AES_HASH_IO_BUF_CTRL_GET_DIGEST \
  3290. 0x00000040 // Note: The bit description below
  3291. // is only applicable when data is
  3292. // sent through the slave
  3293. // interface. This bit must be set
  3294. // to 0 when data is received
  3295. // through the DMA. This bit
  3296. // indicates whether the hash
  3297. // engine should provide the hash
  3298. // digest. When provided
  3299. // simultaneously with data_in_av,
  3300. // the hash digest is provided
  3301. // after processing the data that
  3302. // is currently in the HASH_DATA_IN
  3303. // register. When provided without
  3304. // data_in_av, the current internal
  3305. // digest buffer value is copied to
  3306. // the HASH_DIGEST_n registers. The
  3307. // host must write a 1 to this bit
  3308. // to make the intermediate hash
  3309. // digest available. Writing 0 to
  3310. // this bit has no effect. This bit
  3311. // is automatically cleared (that
  3312. // is, reads 0) when the hash
  3313. // engine has processed the
  3314. // contents of the HASH_DATA_IN
  3315. // register. In the period between
  3316. // this bit is set by the host and
  3317. // the actual HASH_DATA_IN
  3318. // processing, this bit reads 1.
  3319. #define AES_HASH_IO_BUF_CTRL_GET_DIGEST_M \
  3320. 0x00000040
  3321. #define AES_HASH_IO_BUF_CTRL_GET_DIGEST_S 6
  3322. #define AES_HASH_IO_BUF_CTRL_PAD_MESSAGE \
  3323. 0x00000020 // Note: The bit description below
  3324. // is only applicable when data is
  3325. // sent through the slave
  3326. // interface. This bit must be set
  3327. // to 0 when data is received
  3328. // through the DMA. This bit
  3329. // indicates that the HASH_DATA_IN
  3330. // registers hold the last data of
  3331. // the message and hash padding
  3332. // must be applied. The host must
  3333. // write this bit to 1 in order to
  3334. // indicate to the hash engine that
  3335. // the HASH_DATA_IN register
  3336. // currently holds the last data of
  3337. // the message. When pad_message is
  3338. // set to 1, the hash engine will
  3339. // add padding bits to the data
  3340. // currently in the HASH_DATA_IN
  3341. // register. When the last message
  3342. // block is smaller than 512 bits,
  3343. // the pad_message bit must be set
  3344. // to 1 together with the
  3345. // data_in_av bit. When the last
  3346. // message block is equal to 512
  3347. // bits, pad_message may be set
  3348. // together with data_in_av. In
  3349. // this case the pad_message bit
  3350. // may also be set after the last
  3351. // data block has been written to
  3352. // the hash engine (so when the
  3353. // rfd_in bit has become 1 again
  3354. // after writing the last data
  3355. // block). Writing 0 to this bit
  3356. // has no effect. This bit is
  3357. // automatically cleared (i.e.
  3358. // reads 0) by the hash engine.
  3359. // This bit reads 1 between the
  3360. // time it was set by the host and
  3361. // the hash engine interpreted its
  3362. // value.
  3363. #define AES_HASH_IO_BUF_CTRL_PAD_MESSAGE_M \
  3364. 0x00000020
  3365. #define AES_HASH_IO_BUF_CTRL_PAD_MESSAGE_S 5
  3366. #define AES_HASH_IO_BUF_CTRL_RFD_IN \
  3367. 0x00000004 // Note: The bit description below
  3368. // is only applicable when data is
  3369. // sent through the slave
  3370. // interface. This bit can be
  3371. // ignored when data is received
  3372. // through the DMA. Read-only
  3373. // status of the input buffer of
  3374. // the hash engine. When 1, the
  3375. // input buffer of the hash engine
  3376. // can accept new data; the
  3377. // HASH_DATA_IN registers can
  3378. // safely be populated with new
  3379. // data. When 0, the input buffer
  3380. // of the hash engine is processing
  3381. // the data that is currently in
  3382. // HASH_DATA_IN; writing new data
  3383. // to these registers is not
  3384. // allowed.
  3385. #define AES_HASH_IO_BUF_CTRL_RFD_IN_M \
  3386. 0x00000004
  3387. #define AES_HASH_IO_BUF_CTRL_RFD_IN_S 2
  3388. #define AES_HASH_IO_BUF_CTRL_DATA_IN_AV \
  3389. 0x00000002 // Note: The bit description below
  3390. // is only applicable when data is
  3391. // sent through the slave
  3392. // interface. This bit must be set
  3393. // to 0 when data is received
  3394. // through the DMA. This bit
  3395. // indicates that the HASH_DATA_IN
  3396. // registers contain new input data
  3397. // for processing. The host must
  3398. // write a 1 to this bit to start
  3399. // processing the data in
  3400. // HASH_DATA_IN; the hash engine
  3401. // will process the new data as
  3402. // soon as it is ready for it
  3403. // (rfd_in bit is 1). Writing 0 to
  3404. // this bit has no effect. This bit
  3405. // is automatically cleared (i.e.
  3406. // reads as 0) when the hash engine
  3407. // starts processing the
  3408. // HASH_DATA_IN contents. This bit
  3409. // reads 1 between the time it was
  3410. // set by the host and the hash
  3411. // engine actually starts
  3412. // processing the input data block.
  3413. #define AES_HASH_IO_BUF_CTRL_DATA_IN_AV_M \
  3414. 0x00000002
  3415. #define AES_HASH_IO_BUF_CTRL_DATA_IN_AV_S 1
  3416. #define AES_HASH_IO_BUF_CTRL_OUTPUT_FULL \
  3417. 0x00000001 // Indicates that the output
  3418. // buffer registers (HASH_DIGEST_n)
  3419. // are available for reading by the
  3420. // host. When this bit reads 0, the
  3421. // output buffer registers are
  3422. // released; the hash engine is
  3423. // allowed to write new data to it.
  3424. // In this case, the registers
  3425. // should not be read by the host.
  3426. // When this bit reads 1, the hash
  3427. // engine has stored the result of
  3428. // the latest hash operation in the
  3429. // output buffer registers. As long
  3430. // as this bit reads 1, the host
  3431. // may read output buffer registers
  3432. // and the hash engine is prevented
  3433. // from writing new data to the
  3434. // output buffer. After retrieving
  3435. // the hash result data from the
  3436. // output buffer, the host must
  3437. // write a 1 to this bit to clear
  3438. // it. This makes the digest output
  3439. // buffer available for the hash
  3440. // engine to store new hash
  3441. // results. Writing 0 to this bit
  3442. // has no effect. Note: If this bit
  3443. // is asserted (1) no new operation
  3444. // should be started before the
  3445. // digest is retrieved from the
  3446. // hash engine and this bit is
  3447. // cleared (0).
  3448. #define AES_HASH_IO_BUF_CTRL_OUTPUT_FULL_M \
  3449. 0x00000001
  3450. #define AES_HASH_IO_BUF_CTRL_OUTPUT_FULL_S 0
  3451. //*****************************************************************************
  3452. //
  3453. // The following are defines for the bit fields in the
  3454. // AES_HASH_MODE_IN register.
  3455. //
  3456. //*****************************************************************************
  3457. #define AES_HASH_MODE_IN_SHA256_MODE \
  3458. 0x00000008 // The host must write this bit
  3459. // with 1 before processing a hash
  3460. // session.
  3461. #define AES_HASH_MODE_IN_SHA256_MODE_M \
  3462. 0x00000008
  3463. #define AES_HASH_MODE_IN_SHA256_MODE_S 3
  3464. #define AES_HASH_MODE_IN_NEW_HASH \
  3465. 0x00000001 // When set to 1, it indicates
  3466. // that the hash engine must start
  3467. // processing a new hash session.
  3468. // The HASH_DIGEST_n registers will
  3469. // automatically be loaded with the
  3470. // initial hash algorithm constants
  3471. // of the selected hash algorithm.
  3472. // When this bit is 0 while the
  3473. // hash processing is started, the
  3474. // initial hash algorithm constants
  3475. // are not loaded in the
  3476. // HASH_DIGEST_n registers. The
  3477. // hash engine will start
  3478. // processing with the digest that
  3479. // is currently in its internal
  3480. // HASH_DIGEST_n registers. This
  3481. // bit is automatically cleared
  3482. // when hash processing is started.
  3483. #define AES_HASH_MODE_IN_NEW_HASH_M \
  3484. 0x00000001
  3485. #define AES_HASH_MODE_IN_NEW_HASH_S 0
  3486. //*****************************************************************************
  3487. //
  3488. // The following are defines for the bit fields in the
  3489. // AES_HASH_LENGTH_IN_L register.
  3490. //
  3491. //*****************************************************************************
  3492. #define AES_HASH_LENGTH_IN_L_LENGTH_IN_M \
  3493. 0xFFFFFFFF // LENGTH_IN[31:0] Message length
  3494. // registers. The content of these
  3495. // registers is used by the hash
  3496. // engine during the message
  3497. // padding phase of the hash
  3498. // session. The data lines of this
  3499. // registers are directly connected
  3500. // to the interface of the hash
  3501. // engine. For a write operation by
  3502. // the host, these registers should
  3503. // be written with the message
  3504. // length in bits. Final hash
  3505. // operations: The total input data
  3506. // length must be programmed for
  3507. // new hash operations that require
  3508. // finalization (padding). The
  3509. // input data must be provided
  3510. // through the slave or DMA
  3511. // interface. Continued hash
  3512. // operations (finalized): For
  3513. // continued hash operations that
  3514. // require finalization, the total
  3515. // message length must be
  3516. // programmed, including the length
  3517. // of previously hashed data that
  3518. // corresponds to the written input
  3519. // digest. Non-final hash
  3520. // operations: For hash operations
  3521. // that do not require finalization
  3522. // (input data length is multiple
  3523. // of 512-bits which is SHA-256
  3524. // data block size), the length
  3525. // field does not need to be
  3526. // programmed since not used by the
  3527. // operation. If the message length
  3528. // in bits is below (2^32-1), then
  3529. // only HASH_LENGTH_IN_L needs to
  3530. // be written. The hardware
  3531. // automatically sets
  3532. // HASH_LENGTH_IN_H to 0s in this
  3533. // case. The host may write the
  3534. // length register at any time
  3535. // during the hash session when the
  3536. // rfd_in bit of the
  3537. // HASH_IO_BUF_CTRL is high. The
  3538. // length register must be written
  3539. // before the last data of the
  3540. // active hash session is written
  3541. // into the hash engine. host read
  3542. // operations from these register
  3543. // locations will return 0s. Note:
  3544. // When getting data from DMA, this
  3545. // register must be programmed
  3546. // before DMA is programmed to
  3547. // start.
  3548. #define AES_HASH_LENGTH_IN_L_LENGTH_IN_S 0
  3549. //*****************************************************************************
  3550. //
  3551. // The following are defines for the bit fields in the
  3552. // AES_HASH_LENGTH_IN_H register.
  3553. //
  3554. //*****************************************************************************
  3555. #define AES_HASH_LENGTH_IN_H_LENGTH_IN_M \
  3556. 0xFFFFFFFF // LENGTH_IN[63:32] Message length
  3557. // registers. The content of these
  3558. // registers is used by the hash
  3559. // engine during the message
  3560. // padding phase of the hash
  3561. // session. The data lines of this
  3562. // registers are directly connected
  3563. // to the interface of the hash
  3564. // engine. For a write operation by
  3565. // the host, these registers should
  3566. // be written with the message
  3567. // length in bits. Final hash
  3568. // operations: The total input data
  3569. // length must be programmed for
  3570. // new hash operations that require
  3571. // finalization (padding). The
  3572. // input data must be provided
  3573. // through the slave or DMA
  3574. // interface. Continued hash
  3575. // operations (finalized): For
  3576. // continued hash operations that
  3577. // require finalization, the total
  3578. // message length must be
  3579. // programmed, including the length
  3580. // of previously hashed data that
  3581. // corresponds to the written input
  3582. // digest. Non-final hash
  3583. // operations: For hash operations
  3584. // that do not require finalization
  3585. // (input data length is multiple
  3586. // of 512-bits which is SHA-256
  3587. // data block size), the length
  3588. // field does not need to be
  3589. // programmed since not used by the
  3590. // operation. If the message length
  3591. // in bits is below (2^32-1), then
  3592. // only HASH_LENGTH_IN_L needs to
  3593. // be written. The hardware
  3594. // automatically sets
  3595. // HASH_LENGTH_IN_H to 0s in this
  3596. // case. The host may write the
  3597. // length register at any time
  3598. // during the hash session when the
  3599. // rfd_in bit of the
  3600. // HASH_IO_BUF_CTRL is high. The
  3601. // length register must be written
  3602. // before the last data of the
  3603. // active hash session is written
  3604. // into the hash engine. host read
  3605. // operations from these register
  3606. // locations will return 0s. Note:
  3607. // When getting data from DMA, this
  3608. // register must be programmed
  3609. // before DMA is programmed to
  3610. // start.
  3611. #define AES_HASH_LENGTH_IN_H_LENGTH_IN_S 0
  3612. //*****************************************************************************
  3613. //
  3614. // The following are defines for the bit fields in the
  3615. // AES_HASH_DIGEST_A register.
  3616. //
  3617. //*****************************************************************************
  3618. #define AES_HASH_DIGEST_A_HASH_DIGEST_M \
  3619. 0xFFFFFFFF // HASH_DIGEST[31:0] Hash digest
  3620. // registers Write operation:
  3621. // Continued hash: These registers
  3622. // should be written with the
  3623. // context data, before the start
  3624. // of a resumed hash session (the
  3625. // new_hash bit in the HASH_MODE
  3626. // register is 0 when starting a
  3627. // hash session). New hash: When
  3628. // initiating a new hash session
  3629. // (the new_hash bit in the
  3630. // HASH_MODE register is high), the
  3631. // internal digest registers are
  3632. // automatically set to the SHA-256
  3633. // algorithm constant and these
  3634. // register should not be written.
  3635. // Reading from these registers
  3636. // provides the intermediate hash
  3637. // result (non-final hash
  3638. // operation) or the final hash
  3639. // result (final hash operation)
  3640. // after data processing.
  3641. #define AES_HASH_DIGEST_A_HASH_DIGEST_S 0
  3642. //*****************************************************************************
  3643. //
  3644. // The following are defines for the bit fields in the
  3645. // AES_HASH_DIGEST_B register.
  3646. //
  3647. //*****************************************************************************
  3648. #define AES_HASH_DIGEST_B_HASH_DIGEST_M \
  3649. 0xFFFFFFFF // HASH_DIGEST[63:32] Hash digest
  3650. // registers Write operation:
  3651. // Continued hash: These registers
  3652. // should be written with the
  3653. // context data, before the start
  3654. // of a resumed hash session (the
  3655. // new_hash bit in the HASH_MODE
  3656. // register is 0 when starting a
  3657. // hash session). New hash: When
  3658. // initiating a new hash session
  3659. // (the new_hash bit in the
  3660. // HASH_MODE register is high), the
  3661. // internal digest registers are
  3662. // automatically set to the SHA-256
  3663. // algorithm constant and these
  3664. // register should not be written.
  3665. // Reading from these registers
  3666. // provides the intermediate hash
  3667. // result (non-final hash
  3668. // operation) or the final hash
  3669. // result (final hash operation)
  3670. // after data processing.
  3671. #define AES_HASH_DIGEST_B_HASH_DIGEST_S 0
  3672. //*****************************************************************************
  3673. //
  3674. // The following are defines for the bit fields in the
  3675. // AES_HASH_DIGEST_C register.
  3676. //
  3677. //*****************************************************************************
  3678. #define AES_HASH_DIGEST_C_HASH_DIGEST_M \
  3679. 0xFFFFFFFF // HASH_DIGEST[95:64] Hash digest
  3680. // registers Write operation:
  3681. // Continued hash: These registers
  3682. // should be written with the
  3683. // context data, before the start
  3684. // of a resumed hash session (the
  3685. // new_hash bit in the HASH_MODE
  3686. // register is 0 when starting a
  3687. // hash session). New hash: When
  3688. // initiating a new hash session
  3689. // (the new_hash bit in the
  3690. // HASH_MODE register is high), the
  3691. // internal digest registers are
  3692. // automatically set to the SHA-256
  3693. // algorithm constant and these
  3694. // register should not be written.
  3695. // Reading from these registers
  3696. // provides the intermediate hash
  3697. // result (non-final hash
  3698. // operation) or the final hash
  3699. // result (final hash operation)
  3700. // after data processing.
  3701. #define AES_HASH_DIGEST_C_HASH_DIGEST_S 0
  3702. //*****************************************************************************
  3703. //
  3704. // The following are defines for the bit fields in the
  3705. // AES_HASH_DIGEST_D register.
  3706. //
  3707. //*****************************************************************************
  3708. #define AES_HASH_DIGEST_D_HASH_DIGEST_M \
  3709. 0xFFFFFFFF // HASH_DIGEST[127:96] Hash digest
  3710. // registers Write operation:
  3711. // Continued hash: These registers
  3712. // should be written with the
  3713. // context data, before the start
  3714. // of a resumed hash session (the
  3715. // new_hash bit in the HASH_MODE
  3716. // register is 0 when starting a
  3717. // hash session). New hash: When
  3718. // initiating a new hash session
  3719. // (the new_hash bit in the
  3720. // HASH_MODE register is high), the
  3721. // internal digest registers are
  3722. // automatically set to the SHA-256
  3723. // algorithm constant and these
  3724. // register should not be written.
  3725. // Reading from these registers
  3726. // provides the intermediate hash
  3727. // result (non-final hash
  3728. // operation) or the final hash
  3729. // result (final hash operation)
  3730. // after data processing.
  3731. #define AES_HASH_DIGEST_D_HASH_DIGEST_S 0
  3732. //*****************************************************************************
  3733. //
  3734. // The following are defines for the bit fields in the
  3735. // AES_HASH_DIGEST_E register.
  3736. //
  3737. //*****************************************************************************
  3738. #define AES_HASH_DIGEST_E_HASH_DIGEST_M \
  3739. 0xFFFFFFFF // HASH_DIGEST[159:128] Hash
  3740. // digest registers Write
  3741. // operation: Continued hash: These
  3742. // registers should be written with
  3743. // the context data, before the
  3744. // start of a resumed hash session
  3745. // (the new_hash bit in the
  3746. // HASH_MODE register is 0 when
  3747. // starting a hash session). New
  3748. // hash: When initiating a new hash
  3749. // session (the new_hash bit in the
  3750. // HASH_MODE register is high), the
  3751. // internal digest registers are
  3752. // automatically set to the SHA-256
  3753. // algorithm constant and these
  3754. // register should not be written.
  3755. // Reading from these registers
  3756. // provides the intermediate hash
  3757. // result (non-final hash
  3758. // operation) or the final hash
  3759. // result (final hash operation)
  3760. // after data processing.
  3761. #define AES_HASH_DIGEST_E_HASH_DIGEST_S 0
  3762. //*****************************************************************************
  3763. //
  3764. // The following are defines for the bit fields in the
  3765. // AES_HASH_DIGEST_F register.
  3766. //
  3767. //*****************************************************************************
  3768. #define AES_HASH_DIGEST_F_HASH_DIGEST_M \
  3769. 0xFFFFFFFF // HASH_DIGEST[191:160] Hash
  3770. // digest registers Write
  3771. // operation: Continued hash: These
  3772. // registers should be written with
  3773. // the context data, before the
  3774. // start of a resumed hash session
  3775. // (the new_hash bit in the
  3776. // HASH_MODE register is 0 when
  3777. // starting a hash session). New
  3778. // hash: When initiating a new hash
  3779. // session (the new_hash bit in the
  3780. // HASH_MODE register is high), the
  3781. // internal digest registers are
  3782. // automatically set to the SHA-256
  3783. // algorithm constant and these
  3784. // register should not be written.
  3785. // Reading from these registers
  3786. // provides the intermediate hash
  3787. // result (non-final hash
  3788. // operation) or the final hash
  3789. // result (final hash operation)
  3790. // after data processing.
  3791. #define AES_HASH_DIGEST_F_HASH_DIGEST_S 0
  3792. //*****************************************************************************
  3793. //
  3794. // The following are defines for the bit fields in the
  3795. // AES_HASH_DIGEST_G register.
  3796. //
  3797. //*****************************************************************************
  3798. #define AES_HASH_DIGEST_G_HASH_DIGEST_M \
  3799. 0xFFFFFFFF // HASH_DIGEST[223:192] Hash
  3800. // digest registers Write
  3801. // operation: Continued hash: These
  3802. // registers should be written with
  3803. // the context data, before the
  3804. // start of a resumed hash session
  3805. // (the new_hash bit in the
  3806. // HASH_MODE register is 0 when
  3807. // starting a hash session). New
  3808. // hash: When initiating a new hash
  3809. // session (the new_hash bit in the
  3810. // HASH_MODE register is high), the
  3811. // internal digest registers are
  3812. // automatically set to the SHA-256
  3813. // algorithm constant and these
  3814. // register should not be written.
  3815. // Reading from these registers
  3816. // provides the intermediate hash
  3817. // result (non-final hash
  3818. // operation) or the final hash
  3819. // result (final hash operation)
  3820. // after data processing.
  3821. #define AES_HASH_DIGEST_G_HASH_DIGEST_S 0
  3822. //*****************************************************************************
  3823. //
  3824. // The following are defines for the bit fields in the
  3825. // AES_HASH_DIGEST_H register.
  3826. //
  3827. //*****************************************************************************
  3828. #define AES_HASH_DIGEST_H_HASH_DIGEST_M \
  3829. 0xFFFFFFFF // HASH_DIGEST[255:224] Hash
  3830. // digest registers Write
  3831. // operation: Continued hash: These
  3832. // registers should be written with
  3833. // the context data, before the
  3834. // start of a resumed hash session
  3835. // (the new_hash bit in the
  3836. // HASH_MODE register is 0 when
  3837. // starting a hash session). New
  3838. // hash: When initiating a new hash
  3839. // session (the new_hash bit in the
  3840. // HASH_MODE register is high), the
  3841. // internal digest registers are
  3842. // automatically set to the SHA-256
  3843. // algorithm constant and these
  3844. // register should not be written.
  3845. // Reading from these registers
  3846. // provides the intermediate hash
  3847. // result (non-final hash
  3848. // operation) or the final hash
  3849. // result (final hash operation)
  3850. // after data processing.
  3851. #define AES_HASH_DIGEST_H_HASH_DIGEST_S 0
  3852. //*****************************************************************************
  3853. //
  3854. // The following are defines for the bit fields in the
  3855. // AES_CTRL_ALG_SEL register.
  3856. //
  3857. //*****************************************************************************
  3858. #define AES_CTRL_ALG_SEL_TAG 0x80000000 // If this bit is cleared to 0,
  3859. // the DMA operation involves only
  3860. // data. If this bit is set, the
  3861. // DMA operation includes a TAG
  3862. // (Authentication Result /
  3863. // Digest). For SHA-256 operation,
  3864. // a DMA must be set up for both
  3865. // input data and TAG. For any
  3866. // other selected module, setting
  3867. // this bit only allows a DMA that
  3868. // reads the TAG. No data allowed
  3869. // to be transferred to or from the
  3870. // selected module via the DMA.
  3871. #define AES_CTRL_ALG_SEL_TAG_M 0x80000000
  3872. #define AES_CTRL_ALG_SEL_TAG_S 31
  3873. #define AES_CTRL_ALG_SEL_HASH 0x00000004 // If set to one, selects the hash
  3874. // engine as destination for the
  3875. // DMA The maximum transfer size to
  3876. // DMA engine is set to 64 bytes
  3877. // for reading and 32 bytes for
  3878. // writing (the latter is only
  3879. // applicable if the hash result is
  3880. // written out through the DMA).
  3881. #define AES_CTRL_ALG_SEL_HASH_M 0x00000004
  3882. #define AES_CTRL_ALG_SEL_HASH_S 2
  3883. #define AES_CTRL_ALG_SEL_AES 0x00000002 // If set to one, selects the AES
  3884. // engine as source/destination for
  3885. // the DMA The read and write
  3886. // maximum transfer size to the DMA
  3887. // engine is set to 16 bytes.
  3888. #define AES_CTRL_ALG_SEL_AES_M 0x00000002
  3889. #define AES_CTRL_ALG_SEL_AES_S 1
  3890. #define AES_CTRL_ALG_SEL_KEYSTORE \
  3891. 0x00000001 // If set to one, selects the Key
  3892. // Store as destination for the DMA
  3893. // The maximum transfer size to DMA
  3894. // engine is set to 32 bytes
  3895. // (however transfers of 16, 24 and
  3896. // 32 bytes are allowed)
  3897. #define AES_CTRL_ALG_SEL_KEYSTORE_M \
  3898. 0x00000001
  3899. #define AES_CTRL_ALG_SEL_KEYSTORE_S 0
  3900. //*****************************************************************************
  3901. //
  3902. // The following are defines for the bit fields in the
  3903. // AES_CTRL_PROT_EN register.
  3904. //
  3905. //*****************************************************************************
  3906. #define AES_CTRL_PROT_EN_PROT_EN \
  3907. 0x00000001 // If this bit is cleared to 0,
  3908. // m_h_prot[1] on the AHB mater
  3909. // interface always remains 0. If
  3910. // this bit is set to one, the
  3911. // m_h_prot[1] signal on the master
  3912. // AHB bus is asserted to 1 if an
  3913. // AHB read operation is performed,
  3914. // using DMA, with the key store
  3915. // module as destination.
  3916. #define AES_CTRL_PROT_EN_PROT_EN_M \
  3917. 0x00000001
  3918. #define AES_CTRL_PROT_EN_PROT_EN_S 0
  3919. //*****************************************************************************
  3920. //
  3921. // The following are defines for the bit fields in the
  3922. // AES_CTRL_SW_RESET register.
  3923. //
  3924. //*****************************************************************************
  3925. #define AES_CTRL_SW_RESET_SW_RESET \
  3926. 0x00000001 // If this bit is set to 1, the
  3927. // following modules are reset: -
  3928. // Master control internal state is
  3929. // reset. That includes interrupt,
  3930. // error status register, and
  3931. // result available interrupt
  3932. // generation FSM. - Key store
  3933. // module state is reset. That
  3934. // includes clearing the written
  3935. // area flags; therefore, the keys
  3936. // must be reloaded to the key
  3937. // store module. Writing 0 has no
  3938. // effect. The bit is self cleared
  3939. // after executing the reset.
  3940. #define AES_CTRL_SW_RESET_SW_RESET_M \
  3941. 0x00000001
  3942. #define AES_CTRL_SW_RESET_SW_RESET_S 0
  3943. //*****************************************************************************
  3944. //
  3945. // The following are defines for the bit fields in the
  3946. // AES_CTRL_INT_CFG register.
  3947. //
  3948. //*****************************************************************************
  3949. #define AES_CTRL_INT_CFG_LEVEL 0x00000001 // If this bit is 0, the interrupt
  3950. // output is a pulse. If this bit
  3951. // is set to 1, the interrupt is a
  3952. // level interrupt that must be
  3953. // cleared by writing the interrupt
  3954. // clear register. This bit is
  3955. // applicable for both interrupt
  3956. // output signals.
  3957. #define AES_CTRL_INT_CFG_LEVEL_M \
  3958. 0x00000001
  3959. #define AES_CTRL_INT_CFG_LEVEL_S 0
  3960. //*****************************************************************************
  3961. //
  3962. // The following are defines for the bit fields in the
  3963. // AES_CTRL_INT_EN register.
  3964. //
  3965. //*****************************************************************************
  3966. #define AES_CTRL_INT_EN_DMA_IN_DONE \
  3967. 0x00000002 // If this bit is set to 0, the
  3968. // DMA input done (irq_dma_in_done)
  3969. // interrupt output is disabled and
  3970. // remains 0. If this bit is set to
  3971. // 1, the DMA input done interrupt
  3972. // output is enabled.
  3973. #define AES_CTRL_INT_EN_DMA_IN_DONE_M \
  3974. 0x00000002
  3975. #define AES_CTRL_INT_EN_DMA_IN_DONE_S 1
  3976. #define AES_CTRL_INT_EN_RESULT_AV \
  3977. 0x00000001 // If this bit is set to 0, the
  3978. // result available (irq_result_av)
  3979. // interrupt output is disabled and
  3980. // remains 0. If this bit is set to
  3981. // 1, the result available
  3982. // interrupt output is enabled.
  3983. #define AES_CTRL_INT_EN_RESULT_AV_M \
  3984. 0x00000001
  3985. #define AES_CTRL_INT_EN_RESULT_AV_S 0
  3986. //*****************************************************************************
  3987. //
  3988. // The following are defines for the bit fields in the
  3989. // AES_CTRL_INT_CLR register.
  3990. //
  3991. //*****************************************************************************
  3992. #define AES_CTRL_INT_CLR_DMA_BUS_ERR \
  3993. 0x80000000 // If 1 is written to this bit,
  3994. // the DMA bus error status is
  3995. // cleared. Writing 0 has no
  3996. // effect.
  3997. #define AES_CTRL_INT_CLR_DMA_BUS_ERR_M \
  3998. 0x80000000
  3999. #define AES_CTRL_INT_CLR_DMA_BUS_ERR_S 31
  4000. #define AES_CTRL_INT_CLR_KEY_ST_WR_ERR \
  4001. 0x40000000 // If 1 is written to this bit,
  4002. // the key store write error status
  4003. // is cleared. Writing 0 has no
  4004. // effect.
  4005. #define AES_CTRL_INT_CLR_KEY_ST_WR_ERR_M \
  4006. 0x40000000
  4007. #define AES_CTRL_INT_CLR_KEY_ST_WR_ERR_S 30
  4008. #define AES_CTRL_INT_CLR_KEY_ST_RD_ERR \
  4009. 0x20000000 // If 1 is written to this bit,
  4010. // the key store read error status
  4011. // is cleared. Writing 0 has no
  4012. // effect.
  4013. #define AES_CTRL_INT_CLR_KEY_ST_RD_ERR_M \
  4014. 0x20000000
  4015. #define AES_CTRL_INT_CLR_KEY_ST_RD_ERR_S 29
  4016. #define AES_CTRL_INT_CLR_DMA_IN_DONE \
  4017. 0x00000002 // If 1 is written to this bit,
  4018. // the DMA in done
  4019. // (irq_dma_in_done) interrupt
  4020. // output is cleared. Writing 0 has
  4021. // no effect. Note that clearing an
  4022. // interrupt makes sense only if
  4023. // the interrupt output is
  4024. // programmed as level (refer to
  4025. // CTRL_INT_CFG).
  4026. #define AES_CTRL_INT_CLR_DMA_IN_DONE_M \
  4027. 0x00000002
  4028. #define AES_CTRL_INT_CLR_DMA_IN_DONE_S 1
  4029. #define AES_CTRL_INT_CLR_RESULT_AV \
  4030. 0x00000001 // If 1 is written to this bit,
  4031. // the result available
  4032. // (irq_result_av) interrupt output
  4033. // is cleared. Writing 0 has no
  4034. // effect. Note that clearing an
  4035. // interrupt makes sense only if
  4036. // the interrupt output is
  4037. // programmed as level (refer to
  4038. // CTRL_INT_CFG).
  4039. #define AES_CTRL_INT_CLR_RESULT_AV_M \
  4040. 0x00000001
  4041. #define AES_CTRL_INT_CLR_RESULT_AV_S 0
  4042. //*****************************************************************************
  4043. //
  4044. // The following are defines for the bit fields in the
  4045. // AES_CTRL_INT_SET register.
  4046. //
  4047. //*****************************************************************************
  4048. #define AES_CTRL_INT_SET_DMA_IN_DONE \
  4049. 0x00000002 // If 1 is written to this bit,
  4050. // the DMA data in done
  4051. // (irq_dma_in_done) interrupt
  4052. // output is set to one. Writing 0
  4053. // has no effect. If the interrupt
  4054. // configuration register is
  4055. // programmed to pulse, clearing
  4056. // the DMA data in done
  4057. // (irq_dma_in_done) interrupt is
  4058. // not needed. If it is programmed
  4059. // to level, clearing the interrupt
  4060. // output should be done by writing
  4061. // the interrupt clear register
  4062. // (CTRL_INT_CLR).
  4063. #define AES_CTRL_INT_SET_DMA_IN_DONE_M \
  4064. 0x00000002
  4065. #define AES_CTRL_INT_SET_DMA_IN_DONE_S 1
  4066. #define AES_CTRL_INT_SET_RESULT_AV \
  4067. 0x00000001 // If 1 is written to this bit,
  4068. // the result available
  4069. // (irq_result_av) interrupt output
  4070. // is set to one. Writing 0 has no
  4071. // effect. If the interrupt
  4072. // configuration register is
  4073. // programmed to pulse, clearing
  4074. // the result available
  4075. // (irq_result_av) interrupt is not
  4076. // needed. If it is programmed to
  4077. // level, clearing the interrupt
  4078. // output should be done by writing
  4079. // the interrupt clear register
  4080. // (CTRL_INT_CLR).
  4081. #define AES_CTRL_INT_SET_RESULT_AV_M \
  4082. 0x00000001
  4083. #define AES_CTRL_INT_SET_RESULT_AV_S 0
  4084. //*****************************************************************************
  4085. //
  4086. // The following are defines for the bit fields in the
  4087. // AES_CTRL_INT_STAT register.
  4088. //
  4089. //*****************************************************************************
  4090. #define AES_CTRL_INT_STAT_DMA_BUS_ERR \
  4091. 0x80000000 // This bit is set when a DMA bus
  4092. // error is detected during a DMA
  4093. // operation. The value of this
  4094. // register is held until it is
  4095. // cleared through the CTRL_INT_CLR
  4096. // register. Note: This error is
  4097. // asserted if an error is detected
  4098. // on the AHB master interface
  4099. // during a DMA operation.
  4100. #define AES_CTRL_INT_STAT_DMA_BUS_ERR_M \
  4101. 0x80000000
  4102. #define AES_CTRL_INT_STAT_DMA_BUS_ERR_S 31
  4103. #define AES_CTRL_INT_STAT_KEY_ST_WR_ERR \
  4104. 0x40000000 // This bit is set when a write
  4105. // error is detected during the DMA
  4106. // write operation to the key store
  4107. // memory. The value of this
  4108. // register is held until it is
  4109. // cleared through the CTRL_INT_CLR
  4110. // register. Note: This error is
  4111. // asserted if a DMA operation does
  4112. // not cover a full key area or
  4113. // more areas are written than
  4114. // expected.
  4115. #define AES_CTRL_INT_STAT_KEY_ST_WR_ERR_M \
  4116. 0x40000000
  4117. #define AES_CTRL_INT_STAT_KEY_ST_WR_ERR_S 30
  4118. #define AES_CTRL_INT_STAT_KEY_ST_RD_ERR \
  4119. 0x20000000 // This bit is set when a read
  4120. // error is detected during the
  4121. // read of a key from the key
  4122. // store, while copying it to the
  4123. // AES core. The value of this
  4124. // register is held until it is
  4125. // cleared through the CTRL_INT_CLR
  4126. // register. Note: This error is
  4127. // asserted if a key location is
  4128. // selected in the key store that
  4129. // is not available.
  4130. #define AES_CTRL_INT_STAT_KEY_ST_RD_ERR_M \
  4131. 0x20000000
  4132. #define AES_CTRL_INT_STAT_KEY_ST_RD_ERR_S 29
  4133. #define AES_CTRL_INT_STAT_DMA_IN_DONE \
  4134. 0x00000002 // This read only bit returns the
  4135. // actual DMA data in done
  4136. // (irq_data_in_done) interrupt
  4137. // status of the DMA data in done
  4138. // interrupt output pin
  4139. // (irq_data_in_done).
  4140. #define AES_CTRL_INT_STAT_DMA_IN_DONE_M \
  4141. 0x00000002
  4142. #define AES_CTRL_INT_STAT_DMA_IN_DONE_S 1
  4143. #define AES_CTRL_INT_STAT_RESULT_AV \
  4144. 0x00000001 // This read only bit returns the
  4145. // actual result available
  4146. // (irq_result_av) interrupt status
  4147. // of the result available
  4148. // interrupt output pin
  4149. // (irq_result_av).
  4150. #define AES_CTRL_INT_STAT_RESULT_AV_M \
  4151. 0x00000001
  4152. #define AES_CTRL_INT_STAT_RESULT_AV_S 0
  4153. //*****************************************************************************
  4154. //
  4155. // The following are defines for the bit fields in the
  4156. // AES_CTRL_OPTIONS register.
  4157. //
  4158. //*****************************************************************************
  4159. #define AES_CTRL_OPTIONS_TYPE_M 0xFF000000 // This field is 0x01 for the
  4160. // TYPE1 device.
  4161. #define AES_CTRL_OPTIONS_TYPE_S 24
  4162. #define AES_CTRL_OPTIONS_AHBINTERFACE \
  4163. 0x00010000 // AHB interface is available If
  4164. // this bit is 0, the EIP-120t has
  4165. // a TCM interface.
  4166. #define AES_CTRL_OPTIONS_AHBINTERFACE_M \
  4167. 0x00010000
  4168. #define AES_CTRL_OPTIONS_AHBINTERFACE_S 16
  4169. #define AES_CTRL_OPTIONS_SHA_256 \
  4170. 0x00000100 // The HASH core supports SHA-256.
  4171. #define AES_CTRL_OPTIONS_SHA_256_M \
  4172. 0x00000100
  4173. #define AES_CTRL_OPTIONS_SHA_256_S 8
  4174. #define AES_CTRL_OPTIONS_AES_CCM \
  4175. 0x00000080 // AES-CCM is available as a
  4176. // single operation.
  4177. #define AES_CTRL_OPTIONS_AES_CCM_M \
  4178. 0x00000080
  4179. #define AES_CTRL_OPTIONS_AES_CCM_S 7
  4180. #define AES_CTRL_OPTIONS_AES_GCM \
  4181. 0x00000040 // AES-GCM is available as a
  4182. // single operation.
  4183. #define AES_CTRL_OPTIONS_AES_GCM_M \
  4184. 0x00000040
  4185. #define AES_CTRL_OPTIONS_AES_GCM_S 6
  4186. #define AES_CTRL_OPTIONS_AES_256 \
  4187. 0x00000020 // AES core supports 256-bit keys
  4188. // Note: If both AES-128 and
  4189. // AES-256 are set to one, the AES
  4190. // core supports 192-bit keys as
  4191. // well.
  4192. #define AES_CTRL_OPTIONS_AES_256_M \
  4193. 0x00000020
  4194. #define AES_CTRL_OPTIONS_AES_256_S 5
  4195. #define AES_CTRL_OPTIONS_AES_128 \
  4196. 0x00000010 // AES core supports 128-bit keys.
  4197. #define AES_CTRL_OPTIONS_AES_128_M \
  4198. 0x00000010
  4199. #define AES_CTRL_OPTIONS_AES_128_S 4
  4200. #define AES_CTRL_OPTIONS_HASH 0x00000004 // HASH Core is available.
  4201. #define AES_CTRL_OPTIONS_HASH_M 0x00000004
  4202. #define AES_CTRL_OPTIONS_HASH_S 2
  4203. #define AES_CTRL_OPTIONS_AES 0x00000002 // AES core is available.
  4204. #define AES_CTRL_OPTIONS_AES_M 0x00000002
  4205. #define AES_CTRL_OPTIONS_AES_S 1
  4206. #define AES_CTRL_OPTIONS_KEYSTORE \
  4207. 0x00000001 // KEY STORE is available.
  4208. #define AES_CTRL_OPTIONS_KEYSTORE_M \
  4209. 0x00000001
  4210. #define AES_CTRL_OPTIONS_KEYSTORE_S 0
  4211. //*****************************************************************************
  4212. //
  4213. // The following are defines for the bit fields in the
  4214. // AES_CTRL_VERSION register.
  4215. //
  4216. //*****************************************************************************
  4217. #define AES_CTRL_VERSION_MAJOR_VERSION_M \
  4218. 0x0F000000 // Major version number
  4219. #define AES_CTRL_VERSION_MAJOR_VERSION_S 24
  4220. #define AES_CTRL_VERSION_MINOR_VERSION_M \
  4221. 0x00F00000 // Minor version number
  4222. #define AES_CTRL_VERSION_MINOR_VERSION_S 20
  4223. #define AES_CTRL_VERSION_PATCH_LEVEL_M \
  4224. 0x000F0000 // Patch level Starts at 0 at
  4225. // first delivery of this version
  4226. #define AES_CTRL_VERSION_PATCH_LEVEL_S 16
  4227. #define AES_CTRL_VERSION_EIP_NUMBER_COMPL_M \
  4228. 0x0000FF00 // These bits simply contain the
  4229. // complement of bits [7:0] (0x87),
  4230. // used by a driver to ascertain
  4231. // that the EIP-120t register is
  4232. // indeed read.
  4233. #define AES_CTRL_VERSION_EIP_NUMBER_COMPL_S 8
  4234. #define AES_CTRL_VERSION_EIP_NUMBER_M \
  4235. 0x000000FF // These bits encode the EIP
  4236. // number for the EIP-120t, this
  4237. // field contains the value 120
  4238. // (decimal) or 0x78.
  4239. #define AES_CTRL_VERSION_EIP_NUMBER_S 0
  4240. #endif // __HW_AES_H__