regsusdhc.h 358 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074
  1. /*
  2. * Copyright (C) 2012, Freescale Semiconductor, Inc. All Rights Reserved
  3. * THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
  4. * BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
  5. * Freescale Semiconductor, Inc.
  6. */
  7. #ifndef __HW_USDHC_REGISTERS_H__
  8. #define __HW_USDHC_REGISTERS_H__
  9. #include "regs.h"
  10. /*
  11. * i.MX6UL USDHC registers defined in this header file.
  12. *
  13. * - HW_USDHC_DS_ADDR - DMA System Address
  14. * - HW_USDHC_BLK_ATT - Block Attributes
  15. * - HW_USDHC_CMD_ARG - Command Argument
  16. * - HW_USDHC_CMD_XFR_TYP - Command Transfer Type
  17. * - HW_USDHC_CMD_RSP0 - Command Response0
  18. * - HW_USDHC_CMD_RSP1 - Command Response1
  19. * - HW_USDHC_CMD_RSP2 - Command Response2
  20. * - HW_USDHC_CMD_RSP3 - Command Response3
  21. * - HW_USDHC_DATA_BUFF_ACC_PORT - Data Buffer Access Port
  22. * - HW_USDHC_PRES_STATE - Present State
  23. * - HW_USDHC_PROT_CTRL - Protocol Control
  24. * - HW_USDHC_SYS_CTRL - System Control
  25. * - HW_USDHC_INT_STATUS - Interrupt Status
  26. * - HW_USDHC_INT_STATUS_EN - Interrupt Status Enable
  27. * - HW_USDHC_INT_SIGNAL_EN - Interrupt Signal Enable
  28. * - HW_USDHC_AUTOCMD12_ERR_STATUS - Auto CMD12 Error Status
  29. * - HW_USDHC_HOST_CTRL_CAP - Host Controller Capabilities
  30. * - HW_USDHC_WTMK_LVL - Watermark Level
  31. * - HW_USDHC_MIX_CTRL - Mixer Control
  32. * - HW_USDHC_FORCE_EVENT - Force Event
  33. * - HW_USDHC_ADMA_ERR_STATUS - ADMA Error Status Register
  34. * - HW_USDHC_ADMA_SYS_ADDR - ADMA System Address
  35. * - HW_USDHC_DLL_CTRL - DLL (Delay Line) Control
  36. * - HW_USDHC_DLL_STATUS - DLL Status
  37. * - HW_USDHC_CLK_TUNE_CTRL_STATUS - CLK Tuning Control and Status
  38. * - HW_USDHC_VEND_SPEC - Vendor Specific Register
  39. * - HW_USDHC_MMC_BOOT - MMC Boot Register
  40. * - HW_USDHC_VEND_SPEC2 - Vendor Specific 2 Register
  41. * - HW_USDHC_HOST_CTRL_VER - Host Controller Version
  42. *
  43. * - hw_usdhc_t - Struct containing all module registers.
  44. */
  45. //! @name Module base addresses
  46. //@{
  47. #ifndef REGS_USDHC_BASE
  48. #define HW_USDHC_INSTANCE_COUNT (4) //!< Number of instances of the USDHC module.
  49. #define HW_USDHC1 (1) //!< Instance number for USDHC1.
  50. #define HW_USDHC2 (2) //!< Instance number for USDHC2.
  51. #define HW_USDHC3 (3) //!< Instance number for USDHC3.
  52. #define HW_USDHC4 (4) //!< Instance number for USDHC4.
  53. #define REGS_USDHC1_BASE (0x02190000) //!< Base address for USDHC instance number 1.
  54. #define REGS_USDHC2_BASE (0x02194000) //!< Base address for USDHC instance number 2.
  55. #define REGS_USDHC3_BASE (0x02198000) //!< Base address for USDHC instance number 3.
  56. #define REGS_USDHC4_BASE (0x0219c000) //!< Base address for USDHC instance number 4.
  57. //! @brief Get the base address of USDHC by instance number.
  58. //! @param x USDHC instance number, from 1 through 4.
  59. #define REGS_USDHC_BASE(x) ( (x) == HW_USDHC1 ? REGS_USDHC1_BASE : (x) == HW_USDHC2 ? REGS_USDHC2_BASE : (x) == HW_USDHC3 ? REGS_USDHC3_BASE : (x) == HW_USDHC4 ? REGS_USDHC4_BASE : 0x00d00000)
  60. //! @brief Get the instance number given a base address.
  61. //! @param b Base address for an instance of USDHC.
  62. #define REGS_USDHC_INSTANCE(b) ( (b) == REGS_USDHC1_BASE ? HW_USDHC1 : (b) == REGS_USDHC2_BASE ? HW_USDHC2 : (b) == REGS_USDHC3_BASE ? HW_USDHC3 : (b) == REGS_USDHC4_BASE ? HW_USDHC4 : 0)
  63. #endif
  64. //@}
  65. //-------------------------------------------------------------------------------------------
  66. // HW_USDHC_DS_ADDR - DMA System Address
  67. //-------------------------------------------------------------------------------------------
  68. #ifndef __LANGUAGE_ASM__
  69. /*!
  70. * @brief HW_USDHC_DS_ADDR - DMA System Address (RW)
  71. *
  72. * Reset value: 0x00000000
  73. *
  74. * This register contains the physical system memory address used for DMA transfers.
  75. */
  76. typedef union _hw_usdhc_ds_addr
  77. {
  78. reg32_t U;
  79. struct _hw_usdhc_ds_addr_bitfields
  80. {
  81. unsigned RESERVED0 : 2; //!< [1:0] Reserved
  82. unsigned DS_ADDR : 30; //!< [31:2] DMA System Address: This register contains the 32-bit system memory address for a DMA transfer.
  83. } B;
  84. } hw_usdhc_ds_addr_t;
  85. #endif
  86. /*
  87. * constants & macros for entire multi-block USDHC_DS_ADDR register
  88. */
  89. #define HW_USDHC_DS_ADDR_ADDR(x) (REGS_USDHC_BASE(x) + 0x0)
  90. #ifndef __LANGUAGE_ASM__
  91. #define HW_USDHC_DS_ADDR(x) (*(volatile hw_usdhc_ds_addr_t *) HW_USDHC_DS_ADDR_ADDR(x))
  92. #define HW_USDHC_DS_ADDR_RD(x) (HW_USDHC_DS_ADDR(x).U)
  93. #define HW_USDHC_DS_ADDR_WR(x, v) (HW_USDHC_DS_ADDR(x).U = (v))
  94. #define HW_USDHC_DS_ADDR_SET(x, v) (HW_USDHC_DS_ADDR_WR(x, HW_USDHC_DS_ADDR_RD(x) | (v)))
  95. #define HW_USDHC_DS_ADDR_CLR(x, v) (HW_USDHC_DS_ADDR_WR(x, HW_USDHC_DS_ADDR_RD(x) & ~(v)))
  96. #define HW_USDHC_DS_ADDR_TOG(x, v) (HW_USDHC_DS_ADDR_WR(x, HW_USDHC_DS_ADDR_RD(x) ^ (v)))
  97. #endif
  98. /*
  99. * constants & macros for individual USDHC_DS_ADDR bitfields
  100. */
  101. /* --- Register HW_USDHC_DS_ADDR, field DS_ADDR[31:2] (RW)
  102. *
  103. * DMA System Address: This register contains the 32-bit system memory address for a DMA transfer.
  104. * Since the address must be word (4 bytes) align, the least 2 bits are reserved, always 0. When the
  105. * uSDHC stops a DMA transfer, this register points to the system address of the next contiguous
  106. * data position. It can be accessed only when no transaction is executing (i.e. after a transaction
  107. * has stopped). Read operation during transfers may return an invalid value. The Host Driver shall
  108. * initialize this register before starting a DMA transaction. After DMA has stopped, the system
  109. * address of the next contiguous data position can be read from this register. This register is
  110. * protected during a data transfer. When data lines are active, write to this register is ignored.
  111. * The Host driver shall wait, until the DLA bit in the Present State register is cleared, before
  112. * writing to this register. The uSDHC internal DMA does not support a virtual memory system. It
  113. * only supports continuous physical memory access. And due to AHB burst limitations, if the burst
  114. * must cross the 1 KB boundary, uSDHC will automatically change SEQ burst type to NSEQ. Since this
  115. * register supports dynamic address reflecting, when TC bit is set, it automatically alters the
  116. * value of internal address counter, so SW cannot change this register when TC bit is set. Such
  117. * restriction is also listed in .
  118. */
  119. #define BP_USDHC_DS_ADDR_DS_ADDR (2) //!< Bit position for USDHC_DS_ADDR_DS_ADDR.
  120. #define BM_USDHC_DS_ADDR_DS_ADDR (0xfffffffc) //!< Bit mask for USDHC_DS_ADDR_DS_ADDR.
  121. //! @brief Get value of USDHC_DS_ADDR_DS_ADDR from a register value.
  122. #define BG_USDHC_DS_ADDR_DS_ADDR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DS_ADDR_DS_ADDR) >> BP_USDHC_DS_ADDR_DS_ADDR)
  123. //! @brief Format value for bitfield USDHC_DS_ADDR_DS_ADDR.
  124. #define BF_USDHC_DS_ADDR_DS_ADDR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DS_ADDR_DS_ADDR) & BM_USDHC_DS_ADDR_DS_ADDR)
  125. #ifndef __LANGUAGE_ASM__
  126. //! @brief Set the DS_ADDR field to a new value.
  127. #define BW_USDHC_DS_ADDR_DS_ADDR(x, v) (HW_USDHC_DS_ADDR_WR(x, (HW_USDHC_DS_ADDR_RD(x) & ~BM_USDHC_DS_ADDR_DS_ADDR) | BF_USDHC_DS_ADDR_DS_ADDR(v)))
  128. #endif
  129. //-------------------------------------------------------------------------------------------
  130. // HW_USDHC_BLK_ATT - Block Attributes
  131. //-------------------------------------------------------------------------------------------
  132. #ifndef __LANGUAGE_ASM__
  133. /*!
  134. * @brief HW_USDHC_BLK_ATT - Block Attributes (RW)
  135. *
  136. * Reset value: 0x00000000
  137. *
  138. * This register is used to configure the number of data blocks and the number of bytes in each
  139. * block.
  140. */
  141. typedef union _hw_usdhc_blk_att
  142. {
  143. reg32_t U;
  144. struct _hw_usdhc_blk_att_bitfields
  145. {
  146. unsigned BLKSIZE : 13; //!< [12:0] Transfer Block Size: This register specifies the block size for block data transfers.
  147. unsigned RESERVED0 : 3; //!< [15:13] Reserved
  148. unsigned BLKCNT : 16; //!< [31:16] Blocks Count For Current Transfer: This register is enabled when the Block Count Enable bit in the Transfer Mode register is set to 1 and is valid only for multiple block transfers.
  149. } B;
  150. } hw_usdhc_blk_att_t;
  151. #endif
  152. /*
  153. * constants & macros for entire multi-block USDHC_BLK_ATT register
  154. */
  155. #define HW_USDHC_BLK_ATT_ADDR(x) (REGS_USDHC_BASE(x) + 0x4)
  156. #ifndef __LANGUAGE_ASM__
  157. #define HW_USDHC_BLK_ATT(x) (*(volatile hw_usdhc_blk_att_t *) HW_USDHC_BLK_ATT_ADDR(x))
  158. #define HW_USDHC_BLK_ATT_RD(x) (HW_USDHC_BLK_ATT(x).U)
  159. #define HW_USDHC_BLK_ATT_WR(x, v) (HW_USDHC_BLK_ATT(x).U = (v))
  160. #define HW_USDHC_BLK_ATT_SET(x, v) (HW_USDHC_BLK_ATT_WR(x, HW_USDHC_BLK_ATT_RD(x) | (v)))
  161. #define HW_USDHC_BLK_ATT_CLR(x, v) (HW_USDHC_BLK_ATT_WR(x, HW_USDHC_BLK_ATT_RD(x) & ~(v)))
  162. #define HW_USDHC_BLK_ATT_TOG(x, v) (HW_USDHC_BLK_ATT_WR(x, HW_USDHC_BLK_ATT_RD(x) ^ (v)))
  163. #endif
  164. /*
  165. * constants & macros for individual USDHC_BLK_ATT bitfields
  166. */
  167. /* --- Register HW_USDHC_BLK_ATT, field BLKSIZE[12:0] (RW)
  168. *
  169. * Transfer Block Size: This register specifies the block size for block data transfers. Values
  170. * ranging from 1 byte up to the maximum buffer size can be set. It can be accessed only when no
  171. * transaction is executing (i.e. after a transaction has stopped). Read operations during transfers
  172. * may return an invalid value, and write operations will be ignored.
  173. *
  174. * Values:
  175. * 000 - No data transfer
  176. * 001 - 1 Byte
  177. * 002 - 2 Bytes
  178. * 003 - 3 Bytes
  179. * 004 - 4 Bytes
  180. * 200 - 512 Bytes
  181. * 1FF - 511 Bytes
  182. * 800 - 2048 Bytes
  183. * 1000 - 4096 Bytes
  184. */
  185. #define BP_USDHC_BLK_ATT_BLKSIZE (0) //!< Bit position for USDHC_BLK_ATT_BLKSIZE.
  186. #define BM_USDHC_BLK_ATT_BLKSIZE (0x00001fff) //!< Bit mask for USDHC_BLK_ATT_BLKSIZE.
  187. //! @brief Get value of USDHC_BLK_ATT_BLKSIZE from a register value.
  188. #define BG_USDHC_BLK_ATT_BLKSIZE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_BLK_ATT_BLKSIZE) >> BP_USDHC_BLK_ATT_BLKSIZE)
  189. //! @brief Format value for bitfield USDHC_BLK_ATT_BLKSIZE.
  190. #define BF_USDHC_BLK_ATT_BLKSIZE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_BLK_ATT_BLKSIZE) & BM_USDHC_BLK_ATT_BLKSIZE)
  191. #ifndef __LANGUAGE_ASM__
  192. //! @brief Set the BLKSIZE field to a new value.
  193. #define BW_USDHC_BLK_ATT_BLKSIZE(x, v) (HW_USDHC_BLK_ATT_WR(x, (HW_USDHC_BLK_ATT_RD(x) & ~BM_USDHC_BLK_ATT_BLKSIZE) | BF_USDHC_BLK_ATT_BLKSIZE(v)))
  194. #endif
  195. /* --- Register HW_USDHC_BLK_ATT, field BLKCNT[31:16] (RW)
  196. *
  197. * Blocks Count For Current Transfer: This register is enabled when the Block Count Enable bit in
  198. * the Transfer Mode register is set to 1 and is valid only for multiple block transfers. For single
  199. * block transfer, this register will always read as 1. The Host Driver shall set this register to a
  200. * value between 1 and the maximum block count. The uSDHC decrements the block count after each
  201. * block transfer and stops when the count reaches zero. Setting the block count to 0 results in no
  202. * data blocks being transferred. This register should be accessed only when no transaction is
  203. * executing (i.e. after transactions are stopped). During data transfer, read operations on this
  204. * register may return an invalid value and write operations are ignored. When saving transfer
  205. * content as a result of a Suspend command, the number of blocks yet to be transferred can be
  206. * determined by reading this register. The reading of this register should be applied after
  207. * transfer is paused by stop at block gap operation and before sending the command marked as
  208. * suspend. This is because when Suspend command is sent out, uSDHC will regard the current transfer
  209. * is aborted and change BLKCNT register back to its original value instead of keeping the dynamical
  210. * indicator of remained block count. When restoring transfer content prior to issuing a Resume
  211. * command, the Host Driver shall restore the previously saved block count. Although the BLKCNT
  212. * field is 0 after reset, the read of reset value is 0x1. This is because when MSBSEL bit is 鈥?鈥?
  213. * indicating a single block transfer, the read value of BLKCNT is always 1.
  214. *
  215. * Values:
  216. * 0000 - Stop Count
  217. * 0001 - 1 block
  218. * 0002 - 2 blocks
  219. * FFFF - 65535 blocks
  220. */
  221. #define BP_USDHC_BLK_ATT_BLKCNT (16) //!< Bit position for USDHC_BLK_ATT_BLKCNT.
  222. #define BM_USDHC_BLK_ATT_BLKCNT (0xffff0000) //!< Bit mask for USDHC_BLK_ATT_BLKCNT.
  223. //! @brief Get value of USDHC_BLK_ATT_BLKCNT from a register value.
  224. #define BG_USDHC_BLK_ATT_BLKCNT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_BLK_ATT_BLKCNT) >> BP_USDHC_BLK_ATT_BLKCNT)
  225. //! @brief Format value for bitfield USDHC_BLK_ATT_BLKCNT.
  226. #define BF_USDHC_BLK_ATT_BLKCNT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_BLK_ATT_BLKCNT) & BM_USDHC_BLK_ATT_BLKCNT)
  227. #ifndef __LANGUAGE_ASM__
  228. //! @brief Set the BLKCNT field to a new value.
  229. #define BW_USDHC_BLK_ATT_BLKCNT(x, v) (HW_USDHC_BLK_ATT_WR(x, (HW_USDHC_BLK_ATT_RD(x) & ~BM_USDHC_BLK_ATT_BLKCNT) | BF_USDHC_BLK_ATT_BLKCNT(v)))
  230. #endif
  231. //-------------------------------------------------------------------------------------------
  232. // HW_USDHC_CMD_ARG - Command Argument
  233. //-------------------------------------------------------------------------------------------
  234. #ifndef __LANGUAGE_ASM__
  235. /*!
  236. * @brief HW_USDHC_CMD_ARG - Command Argument (RW)
  237. *
  238. * Reset value: 0x00000000
  239. *
  240. * This register contains the SD/MMC Command Argument. .
  241. */
  242. typedef union _hw_usdhc_cmd_arg
  243. {
  244. reg32_t U;
  245. struct _hw_usdhc_cmd_arg_bitfields
  246. {
  247. unsigned CMDARG : 32; //!< [31:0] Command Argument: The SD/MMC Command Argument is specified as bits 39-8 of the Command Format in the SD or MMC Specification.This register is write protected when the Command Inhibit (CMD) bit in the Present State register is set.
  248. } B;
  249. } hw_usdhc_cmd_arg_t;
  250. #endif
  251. /*
  252. * constants & macros for entire multi-block USDHC_CMD_ARG register
  253. */
  254. #define HW_USDHC_CMD_ARG_ADDR(x) (REGS_USDHC_BASE(x) + 0x8)
  255. #ifndef __LANGUAGE_ASM__
  256. #define HW_USDHC_CMD_ARG(x) (*(volatile hw_usdhc_cmd_arg_t *) HW_USDHC_CMD_ARG_ADDR(x))
  257. #define HW_USDHC_CMD_ARG_RD(x) (HW_USDHC_CMD_ARG(x).U)
  258. #define HW_USDHC_CMD_ARG_WR(x, v) (HW_USDHC_CMD_ARG(x).U = (v))
  259. #define HW_USDHC_CMD_ARG_SET(x, v) (HW_USDHC_CMD_ARG_WR(x, HW_USDHC_CMD_ARG_RD(x) | (v)))
  260. #define HW_USDHC_CMD_ARG_CLR(x, v) (HW_USDHC_CMD_ARG_WR(x, HW_USDHC_CMD_ARG_RD(x) & ~(v)))
  261. #define HW_USDHC_CMD_ARG_TOG(x, v) (HW_USDHC_CMD_ARG_WR(x, HW_USDHC_CMD_ARG_RD(x) ^ (v)))
  262. #endif
  263. /*
  264. * constants & macros for individual USDHC_CMD_ARG bitfields
  265. */
  266. /* --- Register HW_USDHC_CMD_ARG, field CMDARG[31:0] (RW)
  267. *
  268. * Command Argument: The SD/MMC Command Argument is specified as bits 39-8 of the Command Format in
  269. * the SD or MMC Specification.This register is write protected when the Command Inhibit (CMD) bit
  270. * in the Present State register is set.
  271. */
  272. #define BP_USDHC_CMD_ARG_CMDARG (0) //!< Bit position for USDHC_CMD_ARG_CMDARG.
  273. #define BM_USDHC_CMD_ARG_CMDARG (0xffffffff) //!< Bit mask for USDHC_CMD_ARG_CMDARG.
  274. //! @brief Get value of USDHC_CMD_ARG_CMDARG from a register value.
  275. #define BG_USDHC_CMD_ARG_CMDARG(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_ARG_CMDARG) >> BP_USDHC_CMD_ARG_CMDARG)
  276. //! @brief Format value for bitfield USDHC_CMD_ARG_CMDARG.
  277. #define BF_USDHC_CMD_ARG_CMDARG(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_ARG_CMDARG) & BM_USDHC_CMD_ARG_CMDARG)
  278. #ifndef __LANGUAGE_ASM__
  279. //! @brief Set the CMDARG field to a new value.
  280. #define BW_USDHC_CMD_ARG_CMDARG(x, v) (HW_USDHC_CMD_ARG_WR(x, (HW_USDHC_CMD_ARG_RD(x) & ~BM_USDHC_CMD_ARG_CMDARG) | BF_USDHC_CMD_ARG_CMDARG(v)))
  281. #endif
  282. //-------------------------------------------------------------------------------------------
  283. // HW_USDHC_CMD_XFR_TYP - Command Transfer Type
  284. //-------------------------------------------------------------------------------------------
  285. #ifndef __LANGUAGE_ASM__
  286. /*!
  287. * @brief HW_USDHC_CMD_XFR_TYP - Command Transfer Type (RW)
  288. *
  289. * Reset value: 0x00000000
  290. *
  291. * This register is used to control the operation of data transfers. The Host Driver shall set this
  292. * register before issuing a command followed by a data transfer, or before issuing a Resume
  293. * command. To prevent data loss, the uSDHC prevents writing to the bits, that are involved in the
  294. * data transfer of this register, when data transfer is active. These bits are DPSEL, MBSEL,
  295. * DTDSEL, AC12EN, BCEN and DMAEN. The Host Driver shall check the Command Inhibit DAT bit (CDIHB)
  296. * and the Command Inhibit CMD bit (CIHB) in the Present State register before writing to this
  297. * register. When the CDIHB bit in the Present State register is set, any attempt to send a command
  298. * with data by writing to this register is ignored; when the CIHB bit is set, any write to this
  299. * register is ignored. On sending commands with data transfer invovled, it is mandatory that the
  300. * block size is non-zero. Besides, block count must also be non-zero, or indicated as single block
  301. * transfer (bit 5 of this register is '0' when written), or block count is disabled (bit 1 of this
  302. * register is '0' when written), otherwise uSDHC will ignore the sending of this command and do
  303. * nothing. For write command, with all above restrictions, it is also mandatory that the write
  304. * protect switch is not active (WPSPL bit of Present State Register is '1), otherwise uSDHC will
  305. * also ignore the command. If the commands with data transfer does not receive the response in 64
  306. * clock cycles, i.e., response time-out, uSDHC will regard the external device does not accept the
  307. * command and abort the data transfer. In this scenario, the driver should issue the command again
  308. * to re-try the transfer. It is also possible that for some reason the card responds the command
  309. * but uSDHC does not receive the response, and if it is internal DMA (either simple DMA or ADMA)
  310. * read operation, the external system memory is over-written by the internal DMA with data sent
  311. * back from the card. The table below shows the summary of how register settings determine the
  312. * type of data transfer. Transfer Type Register Setting for Various Transfer Types
  313. * Multi/Single Block Select Block Count Enable Block Count Function 0 Don't Care
  314. * Don't Care Single Transfer 1 0 Don't Care Infinite Transfer 1 1
  315. * Positive Number Multiple Transfer 1 1 Zero No Data Transfer The table
  316. * belowshows the relationship between the Command Index Check Enable and the Command CRC Check
  317. * Enable, in regards to the Response Type bits as well as the name of the response type.
  318. * Relationship Between Parameters and the Name of the Response Type Response Type Index
  319. * Check Enable CRC Check Enable Name of Response Type 00 0 0 No Response
  320. * 01 0 1 R2 10 0 0 R3,R4 10 1 1 R1,R5,R6 11 1 1
  321. * R1b,R5b In the SDIO specification, response type notation for R5b is not defined. R5
  322. * includes R5b in the SDIO specification. But R5b is defined in this specification to specify that
  323. * the uSDHC will check the busy status after receiving a response. For example, usually CMD52 is
  324. * used with R5, but the I/O abort command shall be used with R5b. The CRC field for R3 and R4 is
  325. * expected to be all 1 bits. The CRC check shall be disabled for these response types.
  326. */
  327. typedef union _hw_usdhc_cmd_xfr_typ
  328. {
  329. reg32_t U;
  330. struct _hw_usdhc_cmd_xfr_typ_bitfields
  331. {
  332. unsigned RESERVED0 : 16; //!< [15:0] Reserved
  333. unsigned RSPTYP : 2; //!< [17:16] Response Type Select:
  334. unsigned RESERVED1 : 1; //!< [18] Reserved
  335. unsigned CCCEN : 1; //!< [19] Command CRC Check Enable: If this bit is set to 1, the uSDHC shall check the CRC field in the response.
  336. unsigned CICEN : 1; //!< [20] Command Index Check Enable: If this bit is set to 1, the uSDHC will check the Index field in the response to see if it has the same value as the command index.
  337. unsigned DPSEL : 1; //!< [21] Data Present Select: This bit is set to 1 to indicate that data is present and shall be transferred using the DAT line.
  338. unsigned CMDTYP : 2; //!< [23:22] Command Type: There are three types of special commands: Suspend, Resume and Abort.
  339. unsigned CMDINX : 6; //!< [29:24] Command Index: These bits shall be set to the command number that is specified in bits 45-40 of the Command-Format in the SD Memory Card Physical Layer Specification and SDIO Card Specification.
  340. unsigned RESERVED2 : 2; //!< [31:30] Reserved
  341. } B;
  342. } hw_usdhc_cmd_xfr_typ_t;
  343. #endif
  344. /*
  345. * constants & macros for entire multi-block USDHC_CMD_XFR_TYP register
  346. */
  347. #define HW_USDHC_CMD_XFR_TYP_ADDR(x) (REGS_USDHC_BASE(x) + 0xc)
  348. #ifndef __LANGUAGE_ASM__
  349. #define HW_USDHC_CMD_XFR_TYP(x) (*(volatile hw_usdhc_cmd_xfr_typ_t *) HW_USDHC_CMD_XFR_TYP_ADDR(x))
  350. #define HW_USDHC_CMD_XFR_TYP_RD(x) (HW_USDHC_CMD_XFR_TYP(x).U)
  351. #define HW_USDHC_CMD_XFR_TYP_WR(x, v) (HW_USDHC_CMD_XFR_TYP(x).U = (v))
  352. #define HW_USDHC_CMD_XFR_TYP_SET(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, HW_USDHC_CMD_XFR_TYP_RD(x) | (v)))
  353. #define HW_USDHC_CMD_XFR_TYP_CLR(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, HW_USDHC_CMD_XFR_TYP_RD(x) & ~(v)))
  354. #define HW_USDHC_CMD_XFR_TYP_TOG(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, HW_USDHC_CMD_XFR_TYP_RD(x) ^ (v)))
  355. #endif
  356. /*
  357. * constants & macros for individual USDHC_CMD_XFR_TYP bitfields
  358. */
  359. /* --- Register HW_USDHC_CMD_XFR_TYP, field RSPTYP[17:16] (RW)
  360. *
  361. * Response Type Select:
  362. *
  363. * Values:
  364. * 00 - No Response
  365. * 01 - Response Length 136
  366. * 10 - Response Length 48
  367. * 11 - Response Length 48, check Busy after response
  368. */
  369. #define BP_USDHC_CMD_XFR_TYP_RSPTYP (16) //!< Bit position for USDHC_CMD_XFR_TYP_RSPTYP.
  370. #define BM_USDHC_CMD_XFR_TYP_RSPTYP (0x00030000) //!< Bit mask for USDHC_CMD_XFR_TYP_RSPTYP.
  371. //! @brief Get value of USDHC_CMD_XFR_TYP_RSPTYP from a register value.
  372. #define BG_USDHC_CMD_XFR_TYP_RSPTYP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_XFR_TYP_RSPTYP) >> BP_USDHC_CMD_XFR_TYP_RSPTYP)
  373. //! @brief Format value for bitfield USDHC_CMD_XFR_TYP_RSPTYP.
  374. #define BF_USDHC_CMD_XFR_TYP_RSPTYP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_XFR_TYP_RSPTYP) & BM_USDHC_CMD_XFR_TYP_RSPTYP)
  375. #ifndef __LANGUAGE_ASM__
  376. //! @brief Set the RSPTYP field to a new value.
  377. #define BW_USDHC_CMD_XFR_TYP_RSPTYP(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, (HW_USDHC_CMD_XFR_TYP_RD(x) & ~BM_USDHC_CMD_XFR_TYP_RSPTYP) | BF_USDHC_CMD_XFR_TYP_RSPTYP(v)))
  378. #endif
  379. /* --- Register HW_USDHC_CMD_XFR_TYP, field CCCEN[19] (RW)
  380. *
  381. * Command CRC Check Enable: If this bit is set to 1, the uSDHC shall check the CRC field in the
  382. * response. If an error is detected, it is reported as a Command CRC Error. If this bit is set to
  383. * 0, the CRC field is not checked. The number of bits checked by the CRC field value changes
  384. * according to the length of the response. (Refer to RSPTYP[1:0] and .)
  385. *
  386. * Values:
  387. * 0 - Disable
  388. * 1 - Enable
  389. */
  390. #define BP_USDHC_CMD_XFR_TYP_CCCEN (19) //!< Bit position for USDHC_CMD_XFR_TYP_CCCEN.
  391. #define BM_USDHC_CMD_XFR_TYP_CCCEN (0x00080000) //!< Bit mask for USDHC_CMD_XFR_TYP_CCCEN.
  392. //! @brief Get value of USDHC_CMD_XFR_TYP_CCCEN from a register value.
  393. #define BG_USDHC_CMD_XFR_TYP_CCCEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_XFR_TYP_CCCEN) >> BP_USDHC_CMD_XFR_TYP_CCCEN)
  394. //! @brief Format value for bitfield USDHC_CMD_XFR_TYP_CCCEN.
  395. #define BF_USDHC_CMD_XFR_TYP_CCCEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_XFR_TYP_CCCEN) & BM_USDHC_CMD_XFR_TYP_CCCEN)
  396. #ifndef __LANGUAGE_ASM__
  397. //! @brief Set the CCCEN field to a new value.
  398. #define BW_USDHC_CMD_XFR_TYP_CCCEN(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, (HW_USDHC_CMD_XFR_TYP_RD(x) & ~BM_USDHC_CMD_XFR_TYP_CCCEN) | BF_USDHC_CMD_XFR_TYP_CCCEN(v)))
  399. #endif
  400. /* --- Register HW_USDHC_CMD_XFR_TYP, field CICEN[20] (RW)
  401. *
  402. * Command Index Check Enable: If this bit is set to 1, the uSDHC will check the Index field in the
  403. * response to see if it has the same value as the command index. If it is not, it is reported as a
  404. * Command Index Error. If this bit is set to 0, the Index field is not checked.
  405. *
  406. * Values:
  407. * 0 - Disable
  408. * 1 - Enable
  409. */
  410. #define BP_USDHC_CMD_XFR_TYP_CICEN (20) //!< Bit position for USDHC_CMD_XFR_TYP_CICEN.
  411. #define BM_USDHC_CMD_XFR_TYP_CICEN (0x00100000) //!< Bit mask for USDHC_CMD_XFR_TYP_CICEN.
  412. //! @brief Get value of USDHC_CMD_XFR_TYP_CICEN from a register value.
  413. #define BG_USDHC_CMD_XFR_TYP_CICEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_XFR_TYP_CICEN) >> BP_USDHC_CMD_XFR_TYP_CICEN)
  414. //! @brief Format value for bitfield USDHC_CMD_XFR_TYP_CICEN.
  415. #define BF_USDHC_CMD_XFR_TYP_CICEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_XFR_TYP_CICEN) & BM_USDHC_CMD_XFR_TYP_CICEN)
  416. #ifndef __LANGUAGE_ASM__
  417. //! @brief Set the CICEN field to a new value.
  418. #define BW_USDHC_CMD_XFR_TYP_CICEN(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, (HW_USDHC_CMD_XFR_TYP_RD(x) & ~BM_USDHC_CMD_XFR_TYP_CICEN) | BF_USDHC_CMD_XFR_TYP_CICEN(v)))
  419. #endif
  420. /* --- Register HW_USDHC_CMD_XFR_TYP, field DPSEL[21] (RW)
  421. *
  422. * Data Present Select: This bit is set to 1 to indicate that data is present and shall be
  423. * transferred using the DAT line. It is set to 0 for the following: Commands using only the CMD
  424. * line (e.g. CMD52). Commands with no data transfer, but using the busy signal on DAT[0] line (R1b
  425. * or R5b e.g. CMD38) Note: In resume command, this bit shall be set, and other bits in this
  426. * register shall be set the same as when the transfer was initially launched. When the Write
  427. * Protect switch is on, (i.e. the WPSPL bit is active as '0'), any command with a write operation
  428. * will be ignored. That is to say, when this bit is set, while the DTDSEL bit is 0, writes to the
  429. * register Transfer Type are ignored.
  430. *
  431. * Values:
  432. * 0 - No Data Present
  433. * 1 - Data Present
  434. */
  435. #define BP_USDHC_CMD_XFR_TYP_DPSEL (21) //!< Bit position for USDHC_CMD_XFR_TYP_DPSEL.
  436. #define BM_USDHC_CMD_XFR_TYP_DPSEL (0x00200000) //!< Bit mask for USDHC_CMD_XFR_TYP_DPSEL.
  437. //! @brief Get value of USDHC_CMD_XFR_TYP_DPSEL from a register value.
  438. #define BG_USDHC_CMD_XFR_TYP_DPSEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_XFR_TYP_DPSEL) >> BP_USDHC_CMD_XFR_TYP_DPSEL)
  439. //! @brief Format value for bitfield USDHC_CMD_XFR_TYP_DPSEL.
  440. #define BF_USDHC_CMD_XFR_TYP_DPSEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_XFR_TYP_DPSEL) & BM_USDHC_CMD_XFR_TYP_DPSEL)
  441. #ifndef __LANGUAGE_ASM__
  442. //! @brief Set the DPSEL field to a new value.
  443. #define BW_USDHC_CMD_XFR_TYP_DPSEL(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, (HW_USDHC_CMD_XFR_TYP_RD(x) & ~BM_USDHC_CMD_XFR_TYP_DPSEL) | BF_USDHC_CMD_XFR_TYP_DPSEL(v)))
  444. #endif
  445. /* --- Register HW_USDHC_CMD_XFR_TYP, field CMDTYP[23:22] (RW)
  446. *
  447. * Command Type: There are three types of special commands: Suspend, Resume and Abort. These bits
  448. * shall be set to 00b for all other commands. Suspend Command: If the Suspend command succeeds, the
  449. * uSDHC shall assume that the card bus has been released and that it is possible to issue the next
  450. * command which uses the DAT line. Since the uSDHC does not monitor the content of command
  451. * response, it does not know if the Suspend command succeeded or not. It is the Host Driver's
  452. * responsibility to check the status of the Suspend command and send another command marked as
  453. * Suspend to inform the uSDHC that a Suspend command was successfully issued. Refer to for more
  454. * details. After the end bit of command is sent, the uSDHC de-asserts Read Wait for read
  455. * transactions and stops checking busy for write transactions. In 4-bit mode, the interrupt cycle
  456. * starts. If the Suspend command fails, the uSDHC will maintain its current state, and the Host
  457. * Driver shall restart the transfer by setting the Continue Request bit in the Protocol Control
  458. * register. Resume Command: The Host Driver re-starts the data transfer by restoring the registers
  459. * saved before sending the Suspend Command and then sends the Resume Command. The uSDHC will check
  460. * for a pending busy state before starting write transfers. Abort Command: If this command is set
  461. * when executing a read transfer, the uSDHC will stop reads to the buffer. If this command is set
  462. * when executing a write transfer, the uSDHC will stop driving the DAT line. After issuing the
  463. * Abort command, the Host Driver should issue a software reset (Abort Transaction).
  464. *
  465. * Values:
  466. * 00 - Normal Other commands
  467. * 01 - Suspend CMD52 for writing Bus Suspend in CCCR
  468. * 10 - Resume CMD52 for writing Function Select in CCCR
  469. * 11 - Abort CMD12, CMD52 for writing I/O Abort in CCCR
  470. */
  471. #define BP_USDHC_CMD_XFR_TYP_CMDTYP (22) //!< Bit position for USDHC_CMD_XFR_TYP_CMDTYP.
  472. #define BM_USDHC_CMD_XFR_TYP_CMDTYP (0x00c00000) //!< Bit mask for USDHC_CMD_XFR_TYP_CMDTYP.
  473. //! @brief Get value of USDHC_CMD_XFR_TYP_CMDTYP from a register value.
  474. #define BG_USDHC_CMD_XFR_TYP_CMDTYP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_XFR_TYP_CMDTYP) >> BP_USDHC_CMD_XFR_TYP_CMDTYP)
  475. //! @brief Format value for bitfield USDHC_CMD_XFR_TYP_CMDTYP.
  476. #define BF_USDHC_CMD_XFR_TYP_CMDTYP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_XFR_TYP_CMDTYP) & BM_USDHC_CMD_XFR_TYP_CMDTYP)
  477. #ifndef __LANGUAGE_ASM__
  478. //! @brief Set the CMDTYP field to a new value.
  479. #define BW_USDHC_CMD_XFR_TYP_CMDTYP(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, (HW_USDHC_CMD_XFR_TYP_RD(x) & ~BM_USDHC_CMD_XFR_TYP_CMDTYP) | BF_USDHC_CMD_XFR_TYP_CMDTYP(v)))
  480. #endif
  481. /* --- Register HW_USDHC_CMD_XFR_TYP, field CMDINX[29:24] (RW)
  482. *
  483. * Command Index: These bits shall be set to the command number that is specified in bits 45-40 of
  484. * the Command-Format in the SD Memory Card Physical Layer Specification and SDIO Card
  485. * Specification.
  486. */
  487. #define BP_USDHC_CMD_XFR_TYP_CMDINX (24) //!< Bit position for USDHC_CMD_XFR_TYP_CMDINX.
  488. #define BM_USDHC_CMD_XFR_TYP_CMDINX (0x3f000000) //!< Bit mask for USDHC_CMD_XFR_TYP_CMDINX.
  489. //! @brief Get value of USDHC_CMD_XFR_TYP_CMDINX from a register value.
  490. #define BG_USDHC_CMD_XFR_TYP_CMDINX(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_XFR_TYP_CMDINX) >> BP_USDHC_CMD_XFR_TYP_CMDINX)
  491. //! @brief Format value for bitfield USDHC_CMD_XFR_TYP_CMDINX.
  492. #define BF_USDHC_CMD_XFR_TYP_CMDINX(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CMD_XFR_TYP_CMDINX) & BM_USDHC_CMD_XFR_TYP_CMDINX)
  493. #ifndef __LANGUAGE_ASM__
  494. //! @brief Set the CMDINX field to a new value.
  495. #define BW_USDHC_CMD_XFR_TYP_CMDINX(x, v) (HW_USDHC_CMD_XFR_TYP_WR(x, (HW_USDHC_CMD_XFR_TYP_RD(x) & ~BM_USDHC_CMD_XFR_TYP_CMDINX) | BF_USDHC_CMD_XFR_TYP_CMDINX(v)))
  496. #endif
  497. //-------------------------------------------------------------------------------------------
  498. // HW_USDHC_CMD_RSP0 - Command Response0
  499. //-------------------------------------------------------------------------------------------
  500. #ifndef __LANGUAGE_ASM__
  501. /*!
  502. * @brief HW_USDHC_CMD_RSP0 - Command Response0 (RO)
  503. *
  504. * Reset value: 0x00000000
  505. *
  506. * This register is used to store part 0 of the response bits from the card.
  507. */
  508. typedef union _hw_usdhc_cmd_rsp0
  509. {
  510. reg32_t U;
  511. struct _hw_usdhc_cmd_rsp0_bitfields
  512. {
  513. unsigned CMDRSP0 : 32; //!< [31:0] Command Response 0: Refer to for the mapping of command responses from the SD Bus to this register for each response type.
  514. } B;
  515. } hw_usdhc_cmd_rsp0_t;
  516. #endif
  517. /*
  518. * constants & macros for entire multi-block USDHC_CMD_RSP0 register
  519. */
  520. #define HW_USDHC_CMD_RSP0_ADDR(x) (REGS_USDHC_BASE(x) + 0x10)
  521. #ifndef __LANGUAGE_ASM__
  522. #define HW_USDHC_CMD_RSP0(x) (*(volatile hw_usdhc_cmd_rsp0_t *) HW_USDHC_CMD_RSP0_ADDR(x))
  523. #define HW_USDHC_CMD_RSP0_RD(x) (HW_USDHC_CMD_RSP0(x).U)
  524. #endif
  525. /*
  526. * constants & macros for individual USDHC_CMD_RSP0 bitfields
  527. */
  528. /* --- Register HW_USDHC_CMD_RSP0, field CMDRSP0[31:0] (RO)
  529. *
  530. * Command Response 0: Refer to for the mapping of command responses from the SD Bus to this
  531. * register for each response type.
  532. */
  533. #define BP_USDHC_CMD_RSP0_CMDRSP0 (0) //!< Bit position for USDHC_CMD_RSP0_CMDRSP0.
  534. #define BM_USDHC_CMD_RSP0_CMDRSP0 (0xffffffff) //!< Bit mask for USDHC_CMD_RSP0_CMDRSP0.
  535. //! @brief Get value of USDHC_CMD_RSP0_CMDRSP0 from a register value.
  536. #define BG_USDHC_CMD_RSP0_CMDRSP0(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_RSP0_CMDRSP0) >> BP_USDHC_CMD_RSP0_CMDRSP0)
  537. //-------------------------------------------------------------------------------------------
  538. // HW_USDHC_CMD_RSP1 - Command Response1
  539. //-------------------------------------------------------------------------------------------
  540. #ifndef __LANGUAGE_ASM__
  541. /*!
  542. * @brief HW_USDHC_CMD_RSP1 - Command Response1 (RO)
  543. *
  544. * Reset value: 0x00000000
  545. *
  546. * This register is used to store part 1 of the response bits from the card.
  547. */
  548. typedef union _hw_usdhc_cmd_rsp1
  549. {
  550. reg32_t U;
  551. struct _hw_usdhc_cmd_rsp1_bitfields
  552. {
  553. unsigned CMDRSP1 : 32; //!< [31:0] Command Response 1: Refer to for the mapping of command responses from the SD Bus to this register for each response type.
  554. } B;
  555. } hw_usdhc_cmd_rsp1_t;
  556. #endif
  557. /*
  558. * constants & macros for entire multi-block USDHC_CMD_RSP1 register
  559. */
  560. #define HW_USDHC_CMD_RSP1_ADDR(x) (REGS_USDHC_BASE(x) + 0x14)
  561. #ifndef __LANGUAGE_ASM__
  562. #define HW_USDHC_CMD_RSP1(x) (*(volatile hw_usdhc_cmd_rsp1_t *) HW_USDHC_CMD_RSP1_ADDR(x))
  563. #define HW_USDHC_CMD_RSP1_RD(x) (HW_USDHC_CMD_RSP1(x).U)
  564. #endif
  565. /*
  566. * constants & macros for individual USDHC_CMD_RSP1 bitfields
  567. */
  568. /* --- Register HW_USDHC_CMD_RSP1, field CMDRSP1[31:0] (RO)
  569. *
  570. * Command Response 1: Refer to for the mapping of command responses from the SD Bus to this
  571. * register for each response type.
  572. */
  573. #define BP_USDHC_CMD_RSP1_CMDRSP1 (0) //!< Bit position for USDHC_CMD_RSP1_CMDRSP1.
  574. #define BM_USDHC_CMD_RSP1_CMDRSP1 (0xffffffff) //!< Bit mask for USDHC_CMD_RSP1_CMDRSP1.
  575. //! @brief Get value of USDHC_CMD_RSP1_CMDRSP1 from a register value.
  576. #define BG_USDHC_CMD_RSP1_CMDRSP1(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_RSP1_CMDRSP1) >> BP_USDHC_CMD_RSP1_CMDRSP1)
  577. //-------------------------------------------------------------------------------------------
  578. // HW_USDHC_CMD_RSP2 - Command Response2
  579. //-------------------------------------------------------------------------------------------
  580. #ifndef __LANGUAGE_ASM__
  581. /*!
  582. * @brief HW_USDHC_CMD_RSP2 - Command Response2 (RO)
  583. *
  584. * Reset value: 0x00000000
  585. *
  586. * This register is used to store part 2 of the response bits from the card.
  587. */
  588. typedef union _hw_usdhc_cmd_rsp2
  589. {
  590. reg32_t U;
  591. struct _hw_usdhc_cmd_rsp2_bitfields
  592. {
  593. unsigned CMDRSP2 : 32; //!< [31:0] Command Response 2: Refer to for the mapping of command responses from the SD Bus to this register for each response type.
  594. } B;
  595. } hw_usdhc_cmd_rsp2_t;
  596. #endif
  597. /*
  598. * constants & macros for entire multi-block USDHC_CMD_RSP2 register
  599. */
  600. #define HW_USDHC_CMD_RSP2_ADDR(x) (REGS_USDHC_BASE(x) + 0x18)
  601. #ifndef __LANGUAGE_ASM__
  602. #define HW_USDHC_CMD_RSP2(x) (*(volatile hw_usdhc_cmd_rsp2_t *) HW_USDHC_CMD_RSP2_ADDR(x))
  603. #define HW_USDHC_CMD_RSP2_RD(x) (HW_USDHC_CMD_RSP2(x).U)
  604. #endif
  605. /*
  606. * constants & macros for individual USDHC_CMD_RSP2 bitfields
  607. */
  608. /* --- Register HW_USDHC_CMD_RSP2, field CMDRSP2[31:0] (RO)
  609. *
  610. * Command Response 2: Refer to for the mapping of command responses from the SD Bus to this
  611. * register for each response type.
  612. */
  613. #define BP_USDHC_CMD_RSP2_CMDRSP2 (0) //!< Bit position for USDHC_CMD_RSP2_CMDRSP2.
  614. #define BM_USDHC_CMD_RSP2_CMDRSP2 (0xffffffff) //!< Bit mask for USDHC_CMD_RSP2_CMDRSP2.
  615. //! @brief Get value of USDHC_CMD_RSP2_CMDRSP2 from a register value.
  616. #define BG_USDHC_CMD_RSP2_CMDRSP2(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_RSP2_CMDRSP2) >> BP_USDHC_CMD_RSP2_CMDRSP2)
  617. //-------------------------------------------------------------------------------------------
  618. // HW_USDHC_CMD_RSP3 - Command Response3
  619. //-------------------------------------------------------------------------------------------
  620. #ifndef __LANGUAGE_ASM__
  621. /*!
  622. * @brief HW_USDHC_CMD_RSP3 - Command Response3 (RO)
  623. *
  624. * Reset value: 0x00000000
  625. *
  626. * This register is used to store part 3 of the response bits from the card. The table below
  627. * describes the mapping of command responses from the SD Bus to Command Response registers for each
  628. * response type. In the table, R[ ] refers to a bit range within the response data as transmitted
  629. * on the SD Bus. Response Bit Definition for Each Response Type Response Type Meaning
  630. * of Response Response Field Response Register R1,R1b (normal response) Card Status
  631. * R[39:8] CMDRSP0 R1b (Auto CMD12 response) Card Status for Auto CMD12 R[39:8]
  632. * CMDRSP3 R2 (CID, CSD register) CID/CSD register [127:8] R[127:8] {CMDRSP3[23:0],
  633. * CMDRSP2, CMDRSP1, CMDRSP0} R3 (OCR register) OCR register for memory R[39:8]
  634. * CMDRSP0 R4 (OCR register) OCR register for I/O etc. R[39:8] CMDRSP0 R5, R5b
  635. * SDIO response R[39:8] CMDRSP0 R6 (Publish RCA) New Published RCA[31:16] and card
  636. * status[15:0] R[39:9] CMDRSP0 This table shows that most responses with a length of 48
  637. * (R[47:0]) have 32-bits of the response data (R[39:8]) stored in the CMDRSP0 register. Responses
  638. * of type R1b (Auto CMD12 responses) have response data bits (R[39:8]) stored in the CMDRSP3
  639. * register. Responses with length 136 (R[135:0]) have 120-bits of the response data (R[127:8])
  640. * stored in the CMDRSP0, 1, 2, and 3 registers. To be able to read the response status
  641. * efficiently, the uSDHC only stores part of the response data in the Command Response registers.
  642. * This enables the Host Driver to efficiently read 32-bits of response data in one read cycle on a
  643. * 32-bit bus system. Parts of the response, the Index field and the CRC, are checked by the uSDHC
  644. * (as specified by the Command Index Check Enable and the Command CRC Check Enable bits in the
  645. * Transfer Type register) and generate an error interrupt if any error is detected. The bit range
  646. * for the CRC check depends on the response length. If the response length is 48, the uSDHC will
  647. * check R[47:1], and if the response length is 136 the uSDHC will check R[119:1]. Since the uSDHC
  648. * may have a multiple block data transfer executing concurrently with a CMD_wo_DAT command, the
  649. * uSDHC stores the Auto CMD12 response in the CMDRSP3 register. The CMD_wo_DAT response is stored
  650. * in CMDRSP0. This allows the uSDHC to avoid overwriting the Auto CMD12 response with the
  651. * CMD_wo_DAT and vice versa. When the uSDHC modifies part of the Command Response registers, as
  652. * shown in the table above, it preserves the unmodified bits.
  653. */
  654. typedef union _hw_usdhc_cmd_rsp3
  655. {
  656. reg32_t U;
  657. struct _hw_usdhc_cmd_rsp3_bitfields
  658. {
  659. unsigned CMDRSP3 : 32; //!< [31:0] Command Response 3: Refer to for the mapping of command responses from the SD Bus to this register for each response type.
  660. } B;
  661. } hw_usdhc_cmd_rsp3_t;
  662. #endif
  663. /*
  664. * constants & macros for entire multi-block USDHC_CMD_RSP3 register
  665. */
  666. #define HW_USDHC_CMD_RSP3_ADDR(x) (REGS_USDHC_BASE(x) + 0x1c)
  667. #ifndef __LANGUAGE_ASM__
  668. #define HW_USDHC_CMD_RSP3(x) (*(volatile hw_usdhc_cmd_rsp3_t *) HW_USDHC_CMD_RSP3_ADDR(x))
  669. #define HW_USDHC_CMD_RSP3_RD(x) (HW_USDHC_CMD_RSP3(x).U)
  670. #endif
  671. /*
  672. * constants & macros for individual USDHC_CMD_RSP3 bitfields
  673. */
  674. /* --- Register HW_USDHC_CMD_RSP3, field CMDRSP3[31:0] (RO)
  675. *
  676. * Command Response 3: Refer to for the mapping of command responses from the SD Bus to this
  677. * register for each response type.
  678. */
  679. #define BP_USDHC_CMD_RSP3_CMDRSP3 (0) //!< Bit position for USDHC_CMD_RSP3_CMDRSP3.
  680. #define BM_USDHC_CMD_RSP3_CMDRSP3 (0xffffffff) //!< Bit mask for USDHC_CMD_RSP3_CMDRSP3.
  681. //! @brief Get value of USDHC_CMD_RSP3_CMDRSP3 from a register value.
  682. #define BG_USDHC_CMD_RSP3_CMDRSP3(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CMD_RSP3_CMDRSP3) >> BP_USDHC_CMD_RSP3_CMDRSP3)
  683. //-------------------------------------------------------------------------------------------
  684. // HW_USDHC_DATA_BUFF_ACC_PORT - Data Buffer Access Port
  685. //-------------------------------------------------------------------------------------------
  686. #ifndef __LANGUAGE_ASM__
  687. /*!
  688. * @brief HW_USDHC_DATA_BUFF_ACC_PORT - Data Buffer Access Port (RW)
  689. *
  690. * Reset value: 0x00000000
  691. *
  692. * This is a 32-bit data port register used to access the internal buffer.
  693. */
  694. typedef union _hw_usdhc_data_buff_acc_port
  695. {
  696. reg32_t U;
  697. struct _hw_usdhc_data_buff_acc_port_bitfields
  698. {
  699. unsigned DATCONT : 32; //!< [31:0] Data Content: The Buffer Data Port register is for 32-bit data access by the ARM platform or the external DMA.
  700. } B;
  701. } hw_usdhc_data_buff_acc_port_t;
  702. #endif
  703. /*
  704. * constants & macros for entire multi-block USDHC_DATA_BUFF_ACC_PORT register
  705. */
  706. #define HW_USDHC_DATA_BUFF_ACC_PORT_ADDR(x) (REGS_USDHC_BASE(x) + 0x20)
  707. #ifndef __LANGUAGE_ASM__
  708. #define HW_USDHC_DATA_BUFF_ACC_PORT(x) (*(volatile hw_usdhc_data_buff_acc_port_t *) HW_USDHC_DATA_BUFF_ACC_PORT_ADDR(x))
  709. #define HW_USDHC_DATA_BUFF_ACC_PORT_RD(x) (HW_USDHC_DATA_BUFF_ACC_PORT(x).U)
  710. #define HW_USDHC_DATA_BUFF_ACC_PORT_WR(x, v) (HW_USDHC_DATA_BUFF_ACC_PORT(x).U = (v))
  711. #define HW_USDHC_DATA_BUFF_ACC_PORT_SET(x, v) (HW_USDHC_DATA_BUFF_ACC_PORT_WR(x, HW_USDHC_DATA_BUFF_ACC_PORT_RD(x) | (v)))
  712. #define HW_USDHC_DATA_BUFF_ACC_PORT_CLR(x, v) (HW_USDHC_DATA_BUFF_ACC_PORT_WR(x, HW_USDHC_DATA_BUFF_ACC_PORT_RD(x) & ~(v)))
  713. #define HW_USDHC_DATA_BUFF_ACC_PORT_TOG(x, v) (HW_USDHC_DATA_BUFF_ACC_PORT_WR(x, HW_USDHC_DATA_BUFF_ACC_PORT_RD(x) ^ (v)))
  714. #endif
  715. /*
  716. * constants & macros for individual USDHC_DATA_BUFF_ACC_PORT bitfields
  717. */
  718. /* --- Register HW_USDHC_DATA_BUFF_ACC_PORT, field DATCONT[31:0] (RW)
  719. *
  720. * Data Content: The Buffer Data Port register is for 32-bit data access by the ARM platform or the
  721. * external DMA. When the internal DMA is enabled, any write to this register is ignored, and any
  722. * read from this register will always yield 0s.
  723. */
  724. #define BP_USDHC_DATA_BUFF_ACC_PORT_DATCONT (0) //!< Bit position for USDHC_DATA_BUFF_ACC_PORT_DATCONT.
  725. #define BM_USDHC_DATA_BUFF_ACC_PORT_DATCONT (0xffffffff) //!< Bit mask for USDHC_DATA_BUFF_ACC_PORT_DATCONT.
  726. //! @brief Get value of USDHC_DATA_BUFF_ACC_PORT_DATCONT from a register value.
  727. #define BG_USDHC_DATA_BUFF_ACC_PORT_DATCONT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DATA_BUFF_ACC_PORT_DATCONT) >> BP_USDHC_DATA_BUFF_ACC_PORT_DATCONT)
  728. //! @brief Format value for bitfield USDHC_DATA_BUFF_ACC_PORT_DATCONT.
  729. #define BF_USDHC_DATA_BUFF_ACC_PORT_DATCONT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DATA_BUFF_ACC_PORT_DATCONT) & BM_USDHC_DATA_BUFF_ACC_PORT_DATCONT)
  730. #ifndef __LANGUAGE_ASM__
  731. //! @brief Set the DATCONT field to a new value.
  732. #define BW_USDHC_DATA_BUFF_ACC_PORT_DATCONT(x, v) (HW_USDHC_DATA_BUFF_ACC_PORT_WR(x, (HW_USDHC_DATA_BUFF_ACC_PORT_RD(x) & ~BM_USDHC_DATA_BUFF_ACC_PORT_DATCONT) | BF_USDHC_DATA_BUFF_ACC_PORT_DATCONT(v)))
  733. #endif
  734. //-------------------------------------------------------------------------------------------
  735. // HW_USDHC_PRES_STATE - Present State
  736. //-------------------------------------------------------------------------------------------
  737. #ifndef __LANGUAGE_ASM__
  738. /*!
  739. * @brief HW_USDHC_PRES_STATE - Present State (RO)
  740. *
  741. * Reset value: 0x00000000
  742. *
  743. * The Host Driver can get status of the uSDHC from this 32-bit read only register. The Host
  744. * Driver can issue CMD0, CMD12, CMD13 (for memory) and CMD52 (for SDIO) when the DAT lines are busy
  745. * during a data transfer. These commands can be issued when Command Inhibit (CMD) is set to zero.
  746. * Other commands shall be issued when Command Inhibit (DAT) is set to zero. Possible changes to the
  747. * SD Physical Specification may add other commands to this list in the future. Note: the reset
  748. * value of Present State Register depend on testbench connectivity.
  749. */
  750. typedef union _hw_usdhc_pres_state
  751. {
  752. reg32_t U;
  753. struct _hw_usdhc_pres_state_bitfields
  754. {
  755. unsigned CIHB : 1; //!< [0] Command Inhibit (CMD): If this status bit is 0, it indicates that the CMD line is not in use and the uSDHC can issue a SD/MMC Command using the CMD line.
  756. unsigned CDIHB : 1; //!< [1] Command Inhibit (DAT): This status bit is generated if either the DAT Line Active or the Read Transfer Active is set to 1.
  757. unsigned DLA : 1; //!< [2] Data Line Active This status bit indicates whether one of the DAT lines on the SD Bus is in use.
  758. unsigned SDSTB : 1; //!< [3] SD Clock Stable This status bit indicates that the internal card clock is stable.
  759. unsigned IPGOFF : 1; //!< [4] ipg_clk Gated Off Internally: This status bit indicates that the ipg_clk is internally gated off.
  760. unsigned HCKOFF : 1; //!< [5] hclk Gated Off Internally: This status bit indicates that the hclk is internally gated off.
  761. unsigned PEROFF : 1; //!< [6] ipg_perclk Gated Off Internally: This status bit indicates that the ipg_perclk is internally gated off.
  762. unsigned SDOFF : 1; //!< [7] SD Clock Gated Off Internally: This status bit indicates that the SD Clock is internally gated off, because of buffer over/under-run or read pause without read wait assertion, or the driver set FRC_SDCLK_ON bit is 0 to stop the SD clock in idle status.
  763. unsigned WTA : 1; //!< [8] Write Transfer Active: This status bit indicates a write transfer is active.
  764. unsigned RTA : 1; //!< [9] Read Transfer Active: This status bit is used for detecting completion of a read transfer.
  765. unsigned BWEN : 1; //!< [10] Buffer Write Enable: This status bit is used for non-DMA write transfers.
  766. unsigned BREN : 1; //!< [11] Buffer Read Enable: This status bit is used for non-DMA read transfers.
  767. unsigned RTR : 1; //!< [12] Re-Tuning Request: (only for SD3.0 SDR104 mode) Host Controller may request Host Driver to execute re-tuning sequence by setting this bit when the data window is shifted by temperature drift and a tuned sampling point does not have a good margin to receive correct data.
  768. unsigned RESERVED0 : 3; //!< [15:13] Reserved
  769. unsigned CINST : 1; //!< [16] Card Inserted: This bit indicates whether a card has been inserted.
  770. unsigned RESERVED1 : 1; //!< [17] Reserved
  771. unsigned CDPL : 1; //!< [18] Card Detect Pin Level: This bit reflects the inverse value of the CD# pin for the card socket.
  772. unsigned WPSPL : 1; //!< [19] Write Protect Switch Pin Level: The Write Protect Switch is supported for memory and combo cards.This bit reflects the inverted value of the WP pin of the card socket.
  773. unsigned RESERVED2 : 3; //!< [22:20] Reserved
  774. unsigned CLSL : 1; //!< [23] CMD Line Signal Level: This status is used to check the CMD line level to recover from errors, and for debugging.
  775. unsigned DLSL : 8; //!< [31:24] DAT[7:0] Line Signal Level: This status is used to check the DAT line level to recover from errors, and for debugging.This is especially useful in detecting the busy signal level from DAT[0].
  776. } B;
  777. } hw_usdhc_pres_state_t;
  778. #endif
  779. /*
  780. * constants & macros for entire multi-block USDHC_PRES_STATE register
  781. */
  782. #define HW_USDHC_PRES_STATE_ADDR(x) (REGS_USDHC_BASE(x) + 0x24)
  783. #ifndef __LANGUAGE_ASM__
  784. #define HW_USDHC_PRES_STATE(x) (*(volatile hw_usdhc_pres_state_t *) HW_USDHC_PRES_STATE_ADDR(x))
  785. #define HW_USDHC_PRES_STATE_RD(x) (HW_USDHC_PRES_STATE(x).U)
  786. #endif
  787. /*
  788. * constants & macros for individual USDHC_PRES_STATE bitfields
  789. */
  790. /* --- Register HW_USDHC_PRES_STATE, field CIHB[0] (RO)
  791. *
  792. * Command Inhibit (CMD): If this status bit is 0, it indicates that the CMD line is not in use and
  793. * the uSDHC can issue a SD/MMC Command using the CMD line. This bit is set also immediately after
  794. * the Transfer Type register is written. This bit is cleared when the command response is received.
  795. * Even if the Command Inhibit (DAT) is set to 1, Commands using only the CMD line can be issued if
  796. * this bit is 0. Changing from 1 to 0 generates a Command Complete interrupt in the Interrupt
  797. * Status register. If the uSDHC cannot issue the command because of a command conflict error (Refer
  798. * to Command CRC Error) or because of a Command Not Issued By Auto CMD12 Error, this bit will
  799. * remain 1 and the Command Complete is not set. The Status of issuing an Auto CMD12 does not show
  800. * on this bit.
  801. *
  802. * Values:
  803. * 0 - Can issue command using only CMD line
  804. * 1 - Cannot issue command
  805. */
  806. #define BP_USDHC_PRES_STATE_CIHB (0) //!< Bit position for USDHC_PRES_STATE_CIHB.
  807. #define BM_USDHC_PRES_STATE_CIHB (0x00000001) //!< Bit mask for USDHC_PRES_STATE_CIHB.
  808. //! @brief Get value of USDHC_PRES_STATE_CIHB from a register value.
  809. #define BG_USDHC_PRES_STATE_CIHB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_CIHB) >> BP_USDHC_PRES_STATE_CIHB)
  810. /* --- Register HW_USDHC_PRES_STATE, field CDIHB[1] (RO)
  811. *
  812. * Command Inhibit (DAT): This status bit is generated if either the DAT Line Active or the Read
  813. * Transfer Active is set to 1. If this bit is 0, it indicates that the uSDHC can issue the next
  814. * SD/MMC Command. Commands with a busy signal belong to Command Inhibit (DAT) (e.g. R1b, R5b type).
  815. * Except in the case when the command busy is finished, changing from 1 to 0 generates a Transfer
  816. * Complete interrupt in the Interrupt Status register. Note: The SD Host Driver can save registers
  817. * for a suspend transaction after this bit has changed from 1 to 0.
  818. *
  819. * Values:
  820. * 0 - Can issue command which uses the DAT line
  821. * 1 - Cannot issue command which uses the DAT line
  822. */
  823. #define BP_USDHC_PRES_STATE_CDIHB (1) //!< Bit position for USDHC_PRES_STATE_CDIHB.
  824. #define BM_USDHC_PRES_STATE_CDIHB (0x00000002) //!< Bit mask for USDHC_PRES_STATE_CDIHB.
  825. //! @brief Get value of USDHC_PRES_STATE_CDIHB from a register value.
  826. #define BG_USDHC_PRES_STATE_CDIHB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_CDIHB) >> BP_USDHC_PRES_STATE_CDIHB)
  827. /* --- Register HW_USDHC_PRES_STATE, field DLA[2] (RO)
  828. *
  829. * Data Line Active This status bit indicates whether one of the DAT lines on the SD Bus is in use.
  830. * In the case of read transactions: This status indicates if a read transfer is executing on the SD
  831. * Bus. Changes in this value from 1 to 0, between data blocks, generates a Block Gap Event
  832. * interrupt in the Interrupt Status register. This bit will be set in either of the following
  833. * cases: After the end bit of the read command. When writing a 1 to the Continue Request bit in the
  834. * Protocol Control register to restart a read transfer. This bit will be cleared in either of the
  835. * following cases: (1) When the end bit of the last data block is sent from the SD Bus to the
  836. * uSDHC. (2) When the Read Wait state is stopped by a Suspend command and the DAT2 line is
  837. * released. The uSDHC will wait at the next block gap by driving Read Wait at the start of the
  838. * interrupt cycle. If the Read Wait signal is already driven (data buffer cannot receive data), the
  839. * uSDHC can wait for a current block gap by continuing to drive the Read Wait signal. It is
  840. * necessary to support Read Wait in order to use the suspend / resume function. This bit will
  841. * remain 1 during Read Wait. In the case of write transactions: This status indicates that a write
  842. * transfer is executing on the SD Bus. Changes in this value from 1 to 0 generate a Transfer
  843. * Complete interrupt in the Interrupt Status register. This bit will be set in either of the
  844. * following cases: After the end bit of the write command. When writing to 1 to the Continue
  845. * Request bit in the Protocol Control register to continue a write transfer. This bit will be
  846. * cleared in either of the following cases: When the SD card releases Write Busy of the last data
  847. * block, the uSDHC will also detect if the output is not busy. If the SD card does not drive the
  848. * busy signal after the CRC status is received, the uSDHC shall assume the card drive "Not Busy".
  849. * When the SD card releases write busy, prior to waiting for write transfer, and as a result of a
  850. * Stop At Block Gap Request. In the case of command with busy pending: This status indicates that a
  851. * busy state follows the command and the data line is in use. This bit will be cleared when the
  852. * DAT0 line is released.
  853. *
  854. * Values:
  855. * 0 - DAT Line Inactive
  856. * 1 - DAT Line Active
  857. */
  858. #define BP_USDHC_PRES_STATE_DLA (2) //!< Bit position for USDHC_PRES_STATE_DLA.
  859. #define BM_USDHC_PRES_STATE_DLA (0x00000004) //!< Bit mask for USDHC_PRES_STATE_DLA.
  860. //! @brief Get value of USDHC_PRES_STATE_DLA from a register value.
  861. #define BG_USDHC_PRES_STATE_DLA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_DLA) >> BP_USDHC_PRES_STATE_DLA)
  862. /* --- Register HW_USDHC_PRES_STATE, field SDSTB[3] (RO)
  863. *
  864. * SD Clock Stable This status bit indicates that the internal card clock is stable. This bit is for
  865. * the Host Driver to poll clock status when changing the clock frequency. It is recommended to
  866. * clear FRC_SDCLK_ON bit in System Control register to remove glitch on the card clock when the
  867. * frequency is changing. Before changing clock divisor value(SDCLKFS or DVS), Host Driver should
  868. * make sure the SDSTB bit is high.
  869. *
  870. * Values:
  871. * 0 - clock is changing frequency and not stable
  872. * 1 - clock is stable
  873. */
  874. #define BP_USDHC_PRES_STATE_SDSTB (3) //!< Bit position for USDHC_PRES_STATE_SDSTB.
  875. #define BM_USDHC_PRES_STATE_SDSTB (0x00000008) //!< Bit mask for USDHC_PRES_STATE_SDSTB.
  876. //! @brief Get value of USDHC_PRES_STATE_SDSTB from a register value.
  877. #define BG_USDHC_PRES_STATE_SDSTB(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_SDSTB) >> BP_USDHC_PRES_STATE_SDSTB)
  878. /* --- Register HW_USDHC_PRES_STATE, field IPGOFF[4] (RO)
  879. *
  880. * ipg_clk Gated Off Internally: This status bit indicates that the ipg_clk is internally gated off.
  881. * This bit is for the Host Driver to debug.
  882. *
  883. * Values:
  884. * 0 - ipg_clk is active
  885. * 1 - ipg_clk is gated off
  886. */
  887. #define BP_USDHC_PRES_STATE_IPGOFF (4) //!< Bit position for USDHC_PRES_STATE_IPGOFF.
  888. #define BM_USDHC_PRES_STATE_IPGOFF (0x00000010) //!< Bit mask for USDHC_PRES_STATE_IPGOFF.
  889. //! @brief Get value of USDHC_PRES_STATE_IPGOFF from a register value.
  890. #define BG_USDHC_PRES_STATE_IPGOFF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_IPGOFF) >> BP_USDHC_PRES_STATE_IPGOFF)
  891. /* --- Register HW_USDHC_PRES_STATE, field HCKOFF[5] (RO)
  892. *
  893. * hclk Gated Off Internally: This status bit indicates that the hclk is internally gated off. This
  894. * bit is for the Host Driver to debug during a data transfer.
  895. *
  896. * Values:
  897. * 0 - hclk is active
  898. * 1 - hclk is gated off
  899. */
  900. #define BP_USDHC_PRES_STATE_HCKOFF (5) //!< Bit position for USDHC_PRES_STATE_HCKOFF.
  901. #define BM_USDHC_PRES_STATE_HCKOFF (0x00000020) //!< Bit mask for USDHC_PRES_STATE_HCKOFF.
  902. //! @brief Get value of USDHC_PRES_STATE_HCKOFF from a register value.
  903. #define BG_USDHC_PRES_STATE_HCKOFF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_HCKOFF) >> BP_USDHC_PRES_STATE_HCKOFF)
  904. /* --- Register HW_USDHC_PRES_STATE, field PEROFF[6] (RO)
  905. *
  906. * ipg_perclk Gated Off Internally: This status bit indicates that the ipg_perclk is internally
  907. * gated off. This bit is for the Host Driver to debug transaction on the SD bus. When
  908. * IPG_CLK_SOFT_EN is cleared, ipg_perclk will be gated off, otherwise ipg_perclk will be always
  909. * active.
  910. *
  911. * Values:
  912. * 0 - ipg_perclk is active
  913. * 1 - ipg_perclk is gated off
  914. */
  915. #define BP_USDHC_PRES_STATE_PEROFF (6) //!< Bit position for USDHC_PRES_STATE_PEROFF.
  916. #define BM_USDHC_PRES_STATE_PEROFF (0x00000040) //!< Bit mask for USDHC_PRES_STATE_PEROFF.
  917. //! @brief Get value of USDHC_PRES_STATE_PEROFF from a register value.
  918. #define BG_USDHC_PRES_STATE_PEROFF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_PEROFF) >> BP_USDHC_PRES_STATE_PEROFF)
  919. /* --- Register HW_USDHC_PRES_STATE, field SDOFF[7] (RO)
  920. *
  921. * SD Clock Gated Off Internally: This status bit indicates that the SD Clock is internally gated
  922. * off, because of buffer over/under-run or read pause without read wait assertion, or the driver
  923. * set FRC_SDCLK_ON bit is 0 to stop the SD clock in idle status. Set IPG_PERCLK_SOFT_EN and
  924. * CARD_CLK_SOFT_EN to 0 also gate off SD clock. This bit is for the Host Driver to debug data
  925. * transaction on the SD bus.
  926. *
  927. * Values:
  928. * 0 - SD Clock is active
  929. * 1 - SD Clock is gated off
  930. */
  931. #define BP_USDHC_PRES_STATE_SDOFF (7) //!< Bit position for USDHC_PRES_STATE_SDOFF.
  932. #define BM_USDHC_PRES_STATE_SDOFF (0x00000080) //!< Bit mask for USDHC_PRES_STATE_SDOFF.
  933. //! @brief Get value of USDHC_PRES_STATE_SDOFF from a register value.
  934. #define BG_USDHC_PRES_STATE_SDOFF(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_SDOFF) >> BP_USDHC_PRES_STATE_SDOFF)
  935. /* --- Register HW_USDHC_PRES_STATE, field WTA[8] (RO)
  936. *
  937. * Write Transfer Active: This status bit indicates a write transfer is active. If this bit is 0, it
  938. * means no valid write data exists in the uSDHC. This bit is set in either of the following cases:
  939. * After the end bit of the write command. When writing 1 to the Continue Request bit in the
  940. * Protocol Control register to restart a write transfer. This bit is cleared in either of the
  941. * following cases: After getting the CRC status of the last data block as specified by the transfer
  942. * count (Single and Multiple). After getting the CRC status of any block where data transmission is
  943. * about to be stopped by a Stop At Block Gap Request. During a write transaction, a Block Gap Event
  944. * interrupt is generated when this bit is changed to 0, as result of the Stop At Block Gap Request
  945. * being set. This status is useful for the Host Driver in determining when to issue commands during
  946. * Write Busy state.
  947. *
  948. * Values:
  949. * 0 - No valid data
  950. * 1 - Transferring data
  951. */
  952. #define BP_USDHC_PRES_STATE_WTA (8) //!< Bit position for USDHC_PRES_STATE_WTA.
  953. #define BM_USDHC_PRES_STATE_WTA (0x00000100) //!< Bit mask for USDHC_PRES_STATE_WTA.
  954. //! @brief Get value of USDHC_PRES_STATE_WTA from a register value.
  955. #define BG_USDHC_PRES_STATE_WTA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_WTA) >> BP_USDHC_PRES_STATE_WTA)
  956. /* --- Register HW_USDHC_PRES_STATE, field RTA[9] (RO)
  957. *
  958. * Read Transfer Active: This status bit is used for detecting completion of a read transfer. This
  959. * bit is set for either of the following conditions: After the end bit of the read command. When
  960. * writing a 1 to the Continue Request bit in the Protocol Control register to restart a read
  961. * transfer. A Transfer Complete interrupt is generated when this bit changes to 0. This bit is
  962. * cleared for either of the following conditions: When the last data block as specified by block
  963. * length is transferred to the System, i.e. all data are read away from uSDHC internal buffer. When
  964. * all valid data blocks have been transferred from uSDHC internal buffer to the System and no
  965. * current block transfers are being sent as a result of the Stop At Block Gap Request being set to
  966. * 1.
  967. *
  968. * Values:
  969. * 0 - No valid data
  970. * 1 - Transferring data
  971. */
  972. #define BP_USDHC_PRES_STATE_RTA (9) //!< Bit position for USDHC_PRES_STATE_RTA.
  973. #define BM_USDHC_PRES_STATE_RTA (0x00000200) //!< Bit mask for USDHC_PRES_STATE_RTA.
  974. //! @brief Get value of USDHC_PRES_STATE_RTA from a register value.
  975. #define BG_USDHC_PRES_STATE_RTA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_RTA) >> BP_USDHC_PRES_STATE_RTA)
  976. /* --- Register HW_USDHC_PRES_STATE, field BWEN[10] (RO)
  977. *
  978. * Buffer Write Enable: This status bit is used for non-DMA write transfers. The uSDHC implements an
  979. * internal buffer to transfer data efficiently. This read only flag indicates if space is available
  980. * for write data. If this bit is 1, valid data greater than the watermark level can be written to
  981. * the buffer. A change of this bit from 1 to 0 occurs when some writes to the buffer(write
  982. * DATPORT(Base + 0x20)) are made and the buffer hasn't valid space greater than the watermake
  983. * level. . A change of this bit from 0 to 1 occurs when the buffer can hold valid data greater than
  984. * the write watermark level and the Buffer Write Ready interrupt is generated and enabled.
  985. *
  986. * Values:
  987. * 0 - Write disable
  988. * 1 - Write enable
  989. */
  990. #define BP_USDHC_PRES_STATE_BWEN (10) //!< Bit position for USDHC_PRES_STATE_BWEN.
  991. #define BM_USDHC_PRES_STATE_BWEN (0x00000400) //!< Bit mask for USDHC_PRES_STATE_BWEN.
  992. //! @brief Get value of USDHC_PRES_STATE_BWEN from a register value.
  993. #define BG_USDHC_PRES_STATE_BWEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_BWEN) >> BP_USDHC_PRES_STATE_BWEN)
  994. /* --- Register HW_USDHC_PRES_STATE, field BREN[11] (RO)
  995. *
  996. * Buffer Read Enable: This status bit is used for non-DMA read transfers. The uSDHC implements an
  997. * internal buffer to transfer data efficiently. This read only flag indicates that valid data
  998. * exists in the host side buffer. If this bit is high, valid data greater than the watermark level
  999. * exist in the buffer. A change of this bit from 1 to 0 occurs when some reads from the buffer(read
  1000. * DATPORT(Base + 0x20)) are made and the buffer hasn't valid data greater than the watermake level.
  1001. * A change of this bit from 0 to1 occurs when there is enough valid data ready in the buffer and
  1002. * the Buffer Read Ready interrupt has been generated and enabled.
  1003. *
  1004. * Values:
  1005. * 0 - Read disable
  1006. * 1 - Read enable
  1007. */
  1008. #define BP_USDHC_PRES_STATE_BREN (11) //!< Bit position for USDHC_PRES_STATE_BREN.
  1009. #define BM_USDHC_PRES_STATE_BREN (0x00000800) //!< Bit mask for USDHC_PRES_STATE_BREN.
  1010. //! @brief Get value of USDHC_PRES_STATE_BREN from a register value.
  1011. #define BG_USDHC_PRES_STATE_BREN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_BREN) >> BP_USDHC_PRES_STATE_BREN)
  1012. /* --- Register HW_USDHC_PRES_STATE, field RTR[12] (RO)
  1013. *
  1014. * Re-Tuning Request: (only for SD3.0 SDR104 mode) Host Controller may request Host Driver to
  1015. * execute re-tuning sequence by setting this bit when the data window is shifted by temperature
  1016. * drift and a tuned sampling point does not have a good margin to receive correct data. This bit is
  1017. * cleared when a command is issued with setting Execute Tuning bit in MIXER_CTRL register. Changing
  1018. * of this bit from 0 to 1 generates Re-Tuning Event. Refer to Interrupt status registers for more
  1019. * delail. This bit isn't set to 1 if Sampling Clock Select in the MIXER_CTRL register is set to 0
  1020. * (using fixed sampling clock).
  1021. *
  1022. * Values:
  1023. * 0 - Fixed or well tuned sampling clock
  1024. * 1 - Sampling clock needs re-tuning
  1025. */
  1026. #define BP_USDHC_PRES_STATE_RTR (12) //!< Bit position for USDHC_PRES_STATE_RTR.
  1027. #define BM_USDHC_PRES_STATE_RTR (0x00001000) //!< Bit mask for USDHC_PRES_STATE_RTR.
  1028. //! @brief Get value of USDHC_PRES_STATE_RTR from a register value.
  1029. #define BG_USDHC_PRES_STATE_RTR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_RTR) >> BP_USDHC_PRES_STATE_RTR)
  1030. /* --- Register HW_USDHC_PRES_STATE, field CINST[16] (RO)
  1031. *
  1032. * Card Inserted: This bit indicates whether a card has been inserted. The uSDHC debounces this
  1033. * signal so that the Host Driver will not need to wait for it to stabilize. Changing from a 0 to 1
  1034. * generates a Card Insertion interrupt in the Interrupt Status register. Changing from a 1 to 0
  1035. * generates a Card Removal interrupt in the Interrupt Status register. A write to the Force Event
  1036. * Register does not effect this bit. The Software Reset For All in the System Control register does
  1037. * not effect this bit.A software reset does not effect this bit.
  1038. *
  1039. * Values:
  1040. * 0 - Power on Reset or No Card
  1041. * 1 - Card Inserted
  1042. */
  1043. #define BP_USDHC_PRES_STATE_CINST (16) //!< Bit position for USDHC_PRES_STATE_CINST.
  1044. #define BM_USDHC_PRES_STATE_CINST (0x00010000) //!< Bit mask for USDHC_PRES_STATE_CINST.
  1045. //! @brief Get value of USDHC_PRES_STATE_CINST from a register value.
  1046. #define BG_USDHC_PRES_STATE_CINST(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_CINST) >> BP_USDHC_PRES_STATE_CINST)
  1047. /* --- Register HW_USDHC_PRES_STATE, field CDPL[18] (RO)
  1048. *
  1049. * Card Detect Pin Level: This bit reflects the inverse value of the CD# pin for the card socket.
  1050. * Debouncing is not performed on this bit. This bit may be valid, but is not guaranteed, because of
  1051. * propagation delay. Use of this bit is limited to testing since it must be debounced by software.
  1052. * A software reset does not effect this bit. A write to the Force Event Register does not effect
  1053. * this bit. The reset value is effected by the external card detection pin. This bit shows the
  1054. * value on the CD# pin (i.e. when a card is inserted in the socket, it is 0 on the CD# input, and
  1055. * consequently the CDPL reads 1.)
  1056. *
  1057. * Values:
  1058. * 0 - No card present (CD#=1)
  1059. * 1 - Card present (CD#=0)
  1060. */
  1061. #define BP_USDHC_PRES_STATE_CDPL (18) //!< Bit position for USDHC_PRES_STATE_CDPL.
  1062. #define BM_USDHC_PRES_STATE_CDPL (0x00040000) //!< Bit mask for USDHC_PRES_STATE_CDPL.
  1063. //! @brief Get value of USDHC_PRES_STATE_CDPL from a register value.
  1064. #define BG_USDHC_PRES_STATE_CDPL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_CDPL) >> BP_USDHC_PRES_STATE_CDPL)
  1065. /* --- Register HW_USDHC_PRES_STATE, field WPSPL[19] (RO)
  1066. *
  1067. * Write Protect Switch Pin Level: The Write Protect Switch is supported for memory and combo
  1068. * cards.This bit reflects the inverted value of the WP pin of the card socket. A software reset
  1069. * does not affect this bit. The reset value is effected by the external write protect switch. If
  1070. * the WP pin is not used, it should be tied low, so that the reset value of this bit is high and
  1071. * write is enabled.
  1072. *
  1073. * Values:
  1074. * 0 - Write protected (WP=1)
  1075. * 1 - Write enabled (WP=0)
  1076. */
  1077. #define BP_USDHC_PRES_STATE_WPSPL (19) //!< Bit position for USDHC_PRES_STATE_WPSPL.
  1078. #define BM_USDHC_PRES_STATE_WPSPL (0x00080000) //!< Bit mask for USDHC_PRES_STATE_WPSPL.
  1079. //! @brief Get value of USDHC_PRES_STATE_WPSPL from a register value.
  1080. #define BG_USDHC_PRES_STATE_WPSPL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_WPSPL) >> BP_USDHC_PRES_STATE_WPSPL)
  1081. /* --- Register HW_USDHC_PRES_STATE, field CLSL[23] (RO)
  1082. *
  1083. * CMD Line Signal Level: This status is used to check the CMD line level to recover from errors,
  1084. * and for debugging. The reset value is effected by the external pull-up/pull-down resistor, by
  1085. * default, the read value of this bit after reset is 1'b1, when the command line is pulled up.
  1086. */
  1087. #define BP_USDHC_PRES_STATE_CLSL (23) //!< Bit position for USDHC_PRES_STATE_CLSL.
  1088. #define BM_USDHC_PRES_STATE_CLSL (0x00800000) //!< Bit mask for USDHC_PRES_STATE_CLSL.
  1089. //! @brief Get value of USDHC_PRES_STATE_CLSL from a register value.
  1090. #define BG_USDHC_PRES_STATE_CLSL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_CLSL) >> BP_USDHC_PRES_STATE_CLSL)
  1091. /* --- Register HW_USDHC_PRES_STATE, field DLSL[31:24] (RO)
  1092. *
  1093. * DAT[7:0] Line Signal Level: This status is used to check the DAT line level to recover from
  1094. * errors, and for debugging.This is especially useful in detecting the busy signal level from
  1095. * DAT[0]. The reset value is effected by the external pull-up/pull-down resistors. By default, the
  1096. * read value of this bit field after reset is 8'b11110111, when DAT[3] is pulled down and the other
  1097. * lines are pulled up. DAT[7]: Data 7 line signal level DAT[6]: Data 6 line signal level DAT[5]:
  1098. * Data 5 line signal level DAT[4]: Data 4 line signal level DAT[3]: Data 3 line signal level
  1099. * DAT[2]: Data 2 line signal level DAT[1]: Data 1 line signal level DAT[0]: Data 0 line signal
  1100. * level
  1101. */
  1102. #define BP_USDHC_PRES_STATE_DLSL (24) //!< Bit position for USDHC_PRES_STATE_DLSL.
  1103. #define BM_USDHC_PRES_STATE_DLSL (0xff000000) //!< Bit mask for USDHC_PRES_STATE_DLSL.
  1104. //! @brief Get value of USDHC_PRES_STATE_DLSL from a register value.
  1105. #define BG_USDHC_PRES_STATE_DLSL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PRES_STATE_DLSL) >> BP_USDHC_PRES_STATE_DLSL)
  1106. //-------------------------------------------------------------------------------------------
  1107. // HW_USDHC_PROT_CTRL - Protocol Control
  1108. //-------------------------------------------------------------------------------------------
  1109. #ifndef __LANGUAGE_ASM__
  1110. /*!
  1111. * @brief HW_USDHC_PROT_CTRL - Protocol Control (RW)
  1112. *
  1113. * Reset value: 0x08800020
  1114. *
  1115. * There are three cases to restart the transfer after stop at the block gap. Which case is
  1116. * appropriate depends on whether the uSDHC issues a Suspend command or the SD card accepts the
  1117. * Suspend command. If the Host Driver does not issue a Suspend command, the Continue Request
  1118. * shall be used to restart the transfer. If the Host Driver issues a Suspend command and the SD
  1119. * card accepts it, a Resume command shall be used to restart the transfer. If the Host Driver
  1120. * issues a Suspend command and the SD card does not accept it, the Continue Request shall be used
  1121. * to restart the transfer. Any time Stop At Block Gap Request stops the data transfer, the Host
  1122. * Driver shall wait for a Transfer Complete (in the Interrupt Status register), before attempting
  1123. * to restart the transfer. When restarting the data transfer by Continue Request, the Host Driver
  1124. * shall clear the Stop At Block Gap Request before or simultaneously.
  1125. */
  1126. typedef union _hw_usdhc_prot_ctrl
  1127. {
  1128. reg32_t U;
  1129. struct _hw_usdhc_prot_ctrl_bitfields
  1130. {
  1131. unsigned LCTL : 1; //!< [0] LED Control: This bit, fully controlled by the Host Driver, is used to caution the user not to remove the card while the card is being accessed.
  1132. unsigned DTW : 2; //!< [2:1] Data Transfer Width: This bit selects the data width of the SD bus for a data transfer.
  1133. unsigned D3CD : 1; //!< [3] DAT3 as Card Detection Pin: If this bit is set, DAT3 should be pulled down to act as a card detection pin.
  1134. unsigned EMODE : 2; //!< [5:4] Endian Mode: The uSDHC supports all four endian modes in data transfer.
  1135. unsigned CDTL : 1; //!< [6] Card Detect Test Level: This is bit is enabled while the Card Detection Signal Selection is set to 1 and it indicates card insertion.
  1136. unsigned CDSS : 1; //!< [7] Card Detect Signal Selection: This bit selects the source for the card detection.
  1137. unsigned DMASEL : 2; //!< [9:8] DMA Select: This field is valid while DMA (SDMA or ADMA) is enabled and selects the DMA operation.
  1138. unsigned RESERVED0 : 6; //!< [15:10] Reserved
  1139. unsigned SABGREQ : 1; //!< [16] Stop At Block Gap Request: This bit is used to stop executing a transaction at the next block gap for both DMA and non-DMA transfers.
  1140. unsigned CREQ : 1; //!< [17] Continue Request: This bit is used to restart a transaction which was stopped using the Stop At Block Gap Request.
  1141. unsigned RWCTL : 1; //!< [18] Read Wait Control: The read wait function is optional for SDIO cards.
  1142. unsigned IABG : 1; //!< [19] Interrupt At Block Gap: This bit is valid only in 4-bit mode, of the SDIO card, and selects a sample point in the interrupt cycle.
  1143. unsigned RD_DONE_NO_8CLK : 1; //!< [20] Read done no 8 clock: According to the SD/MMC spec, for read data transaction, 8 clocks are needed after the end bit of the last data block.
  1144. unsigned RD_WAIT_POINT : 3; //!< [23:21] Read wait point : This is only for debug purpose.
  1145. unsigned WECINT : 1; //!< [24] Wakeup Event Enable On Card Interrupt: This bit enables a wakeup event, via a Card Interrupt, in the Interrupt Status register.
  1146. unsigned WECINS : 1; //!< [25] Wakeup Event Enable On SD Card Insertion: This bit enables a wakeup event, via a Card Insertion, in the Interrupt Status register.
  1147. unsigned WECRM : 1; //!< [26] Wakeup Event Enable On SD Card Removal: This bit enables a wakeup event, via a Card Removal, in the Interrupt Status register.
  1148. unsigned BURST_LEN_EN : 3; //!< [29:27] BURST length enable for INCR, INCR4/INCR8/INCR16, INCR4-WRAP/INCR8-WRAP/INCR16-WRAP This is used to enable/disable the burst length for the external AHB2AXI bridge.
  1149. unsigned NON_EXACT_BLK_RD : 1; //!< [30] Current block read is non-exact block read.
  1150. unsigned RD_NO8CLK_EN : 1; //!< [31] Only for debug.
  1151. } B;
  1152. } hw_usdhc_prot_ctrl_t;
  1153. #endif
  1154. /*
  1155. * constants & macros for entire multi-block USDHC_PROT_CTRL register
  1156. */
  1157. #define HW_USDHC_PROT_CTRL_ADDR(x) (REGS_USDHC_BASE(x) + 0x28)
  1158. #ifndef __LANGUAGE_ASM__
  1159. #define HW_USDHC_PROT_CTRL(x) (*(volatile hw_usdhc_prot_ctrl_t *) HW_USDHC_PROT_CTRL_ADDR(x))
  1160. #define HW_USDHC_PROT_CTRL_RD(x) (HW_USDHC_PROT_CTRL(x).U)
  1161. #define HW_USDHC_PROT_CTRL_WR(x, v) (HW_USDHC_PROT_CTRL(x).U = (v))
  1162. #define HW_USDHC_PROT_CTRL_SET(x, v) (HW_USDHC_PROT_CTRL_WR(x, HW_USDHC_PROT_CTRL_RD(x) | (v)))
  1163. #define HW_USDHC_PROT_CTRL_CLR(x, v) (HW_USDHC_PROT_CTRL_WR(x, HW_USDHC_PROT_CTRL_RD(x) & ~(v)))
  1164. #define HW_USDHC_PROT_CTRL_TOG(x, v) (HW_USDHC_PROT_CTRL_WR(x, HW_USDHC_PROT_CTRL_RD(x) ^ (v)))
  1165. #endif
  1166. /*
  1167. * constants & macros for individual USDHC_PROT_CTRL bitfields
  1168. */
  1169. /* --- Register HW_USDHC_PROT_CTRL, field LCTL[0] (RW)
  1170. *
  1171. * LED Control: This bit, fully controlled by the Host Driver, is used to caution the user not to
  1172. * remove the card while the card is being accessed. If the software is going to issue multiple SD
  1173. * commands, this bit can be set during all these transactions. It is not necessary to change for
  1174. * each transaction. When the software issues multiple SD commands, setting the bit once before the
  1175. * first command is sufficient: it is not necessary to reset the bit between commands.
  1176. *
  1177. * Values:
  1178. * 0 - LED off
  1179. * 1 - LED on
  1180. */
  1181. #define BP_USDHC_PROT_CTRL_LCTL (0) //!< Bit position for USDHC_PROT_CTRL_LCTL.
  1182. #define BM_USDHC_PROT_CTRL_LCTL (0x00000001) //!< Bit mask for USDHC_PROT_CTRL_LCTL.
  1183. //! @brief Get value of USDHC_PROT_CTRL_LCTL from a register value.
  1184. #define BG_USDHC_PROT_CTRL_LCTL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_LCTL) >> BP_USDHC_PROT_CTRL_LCTL)
  1185. //! @brief Format value for bitfield USDHC_PROT_CTRL_LCTL.
  1186. #define BF_USDHC_PROT_CTRL_LCTL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_LCTL) & BM_USDHC_PROT_CTRL_LCTL)
  1187. #ifndef __LANGUAGE_ASM__
  1188. //! @brief Set the LCTL field to a new value.
  1189. #define BW_USDHC_PROT_CTRL_LCTL(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_LCTL) | BF_USDHC_PROT_CTRL_LCTL(v)))
  1190. #endif
  1191. /* --- Register HW_USDHC_PROT_CTRL, field DTW[2:1] (RW)
  1192. *
  1193. * Data Transfer Width: This bit selects the data width of the SD bus for a data transfer. The Host
  1194. * Driver shall set it to match the data width of the card. Possible Data transfer Width is 1-bit,
  1195. * 4-bits or 8-bits.
  1196. *
  1197. * Values:
  1198. * 00 - 1-bit mode
  1199. * 01 - 4-bit mode
  1200. * 10 - 8-bit mode
  1201. * 11 - Reserved
  1202. */
  1203. #define BP_USDHC_PROT_CTRL_DTW (1) //!< Bit position for USDHC_PROT_CTRL_DTW.
  1204. #define BM_USDHC_PROT_CTRL_DTW (0x00000006) //!< Bit mask for USDHC_PROT_CTRL_DTW.
  1205. //! @brief Get value of USDHC_PROT_CTRL_DTW from a register value.
  1206. #define BG_USDHC_PROT_CTRL_DTW(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_DTW) >> BP_USDHC_PROT_CTRL_DTW)
  1207. //! @brief Format value for bitfield USDHC_PROT_CTRL_DTW.
  1208. #define BF_USDHC_PROT_CTRL_DTW(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_DTW) & BM_USDHC_PROT_CTRL_DTW)
  1209. #ifndef __LANGUAGE_ASM__
  1210. //! @brief Set the DTW field to a new value.
  1211. #define BW_USDHC_PROT_CTRL_DTW(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_DTW) | BF_USDHC_PROT_CTRL_DTW(v)))
  1212. #endif
  1213. /* --- Register HW_USDHC_PROT_CTRL, field D3CD[3] (RW)
  1214. *
  1215. * DAT3 as Card Detection Pin: If this bit is set, DAT3 should be pulled down to act as a card
  1216. * detection pin. Be cautious when using this feature, because DAT3 is also a chip-select for the
  1217. * SPI mode. A pull-down on this pin and CMD0 may set the card into the SPI mode, which the uSDHC
  1218. * does not support.
  1219. *
  1220. * Values:
  1221. * 0 - DAT3 does not monitor Card Insertion
  1222. * 1 - DAT3 as Card Detection Pin
  1223. */
  1224. #define BP_USDHC_PROT_CTRL_D3CD (3) //!< Bit position for USDHC_PROT_CTRL_D3CD.
  1225. #define BM_USDHC_PROT_CTRL_D3CD (0x00000008) //!< Bit mask for USDHC_PROT_CTRL_D3CD.
  1226. //! @brief Get value of USDHC_PROT_CTRL_D3CD from a register value.
  1227. #define BG_USDHC_PROT_CTRL_D3CD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_D3CD) >> BP_USDHC_PROT_CTRL_D3CD)
  1228. //! @brief Format value for bitfield USDHC_PROT_CTRL_D3CD.
  1229. #define BF_USDHC_PROT_CTRL_D3CD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_D3CD) & BM_USDHC_PROT_CTRL_D3CD)
  1230. #ifndef __LANGUAGE_ASM__
  1231. //! @brief Set the D3CD field to a new value.
  1232. #define BW_USDHC_PROT_CTRL_D3CD(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_D3CD) | BF_USDHC_PROT_CTRL_D3CD(v)))
  1233. #endif
  1234. /* --- Register HW_USDHC_PROT_CTRL, field EMODE[5:4] (RW)
  1235. *
  1236. * Endian Mode: The uSDHC supports all four endian modes in data transfer. Refer to " for more
  1237. * details.
  1238. *
  1239. * Values:
  1240. * 00 - Big Endian Mode
  1241. * 01 - Half Word Big Endian Mode
  1242. * 10 - Little Endian Mode
  1243. * 11 - Reserved
  1244. */
  1245. #define BP_USDHC_PROT_CTRL_EMODE (4) //!< Bit position for USDHC_PROT_CTRL_EMODE.
  1246. #define BM_USDHC_PROT_CTRL_EMODE (0x00000030) //!< Bit mask for USDHC_PROT_CTRL_EMODE.
  1247. //! @brief Get value of USDHC_PROT_CTRL_EMODE from a register value.
  1248. #define BG_USDHC_PROT_CTRL_EMODE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_EMODE) >> BP_USDHC_PROT_CTRL_EMODE)
  1249. //! @brief Format value for bitfield USDHC_PROT_CTRL_EMODE.
  1250. #define BF_USDHC_PROT_CTRL_EMODE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_EMODE) & BM_USDHC_PROT_CTRL_EMODE)
  1251. #ifndef __LANGUAGE_ASM__
  1252. //! @brief Set the EMODE field to a new value.
  1253. #define BW_USDHC_PROT_CTRL_EMODE(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_EMODE) | BF_USDHC_PROT_CTRL_EMODE(v)))
  1254. #endif
  1255. /* --- Register HW_USDHC_PROT_CTRL, field CDTL[6] (RW)
  1256. *
  1257. * Card Detect Test Level: This is bit is enabled while the Card Detection Signal Selection is set
  1258. * to 1 and it indicates card insertion.
  1259. *
  1260. * Values:
  1261. * 0 - Card Detect Test Level is 0, no card inserted
  1262. * 1 - Card Detect Test Level is 1, card inserted
  1263. */
  1264. #define BP_USDHC_PROT_CTRL_CDTL (6) //!< Bit position for USDHC_PROT_CTRL_CDTL.
  1265. #define BM_USDHC_PROT_CTRL_CDTL (0x00000040) //!< Bit mask for USDHC_PROT_CTRL_CDTL.
  1266. //! @brief Get value of USDHC_PROT_CTRL_CDTL from a register value.
  1267. #define BG_USDHC_PROT_CTRL_CDTL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_CDTL) >> BP_USDHC_PROT_CTRL_CDTL)
  1268. //! @brief Format value for bitfield USDHC_PROT_CTRL_CDTL.
  1269. #define BF_USDHC_PROT_CTRL_CDTL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_CDTL) & BM_USDHC_PROT_CTRL_CDTL)
  1270. #ifndef __LANGUAGE_ASM__
  1271. //! @brief Set the CDTL field to a new value.
  1272. #define BW_USDHC_PROT_CTRL_CDTL(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_CDTL) | BF_USDHC_PROT_CTRL_CDTL(v)))
  1273. #endif
  1274. /* --- Register HW_USDHC_PROT_CTRL, field CDSS[7] (RW)
  1275. *
  1276. * Card Detect Signal Selection: This bit selects the source for the card detection.
  1277. *
  1278. * Values:
  1279. * 0 - Card Detection Level is selected (for normal purpose)
  1280. * 1 - Card Detection Test Level is selected (for test purpose)
  1281. */
  1282. #define BP_USDHC_PROT_CTRL_CDSS (7) //!< Bit position for USDHC_PROT_CTRL_CDSS.
  1283. #define BM_USDHC_PROT_CTRL_CDSS (0x00000080) //!< Bit mask for USDHC_PROT_CTRL_CDSS.
  1284. //! @brief Get value of USDHC_PROT_CTRL_CDSS from a register value.
  1285. #define BG_USDHC_PROT_CTRL_CDSS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_CDSS) >> BP_USDHC_PROT_CTRL_CDSS)
  1286. //! @brief Format value for bitfield USDHC_PROT_CTRL_CDSS.
  1287. #define BF_USDHC_PROT_CTRL_CDSS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_CDSS) & BM_USDHC_PROT_CTRL_CDSS)
  1288. #ifndef __LANGUAGE_ASM__
  1289. //! @brief Set the CDSS field to a new value.
  1290. #define BW_USDHC_PROT_CTRL_CDSS(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_CDSS) | BF_USDHC_PROT_CTRL_CDSS(v)))
  1291. #endif
  1292. /* --- Register HW_USDHC_PROT_CTRL, field DMASEL[9:8] (RW)
  1293. *
  1294. * DMA Select: This field is valid while DMA (SDMA or ADMA) is enabled and selects the DMA
  1295. * operation.
  1296. *
  1297. * Values:
  1298. * 00 - No DMA or Simple DMA is selected
  1299. * 01 - ADMA1 is selected
  1300. * 10 - ADMA2 is selected
  1301. * 11 - reserved
  1302. */
  1303. #define BP_USDHC_PROT_CTRL_DMASEL (8) //!< Bit position for USDHC_PROT_CTRL_DMASEL.
  1304. #define BM_USDHC_PROT_CTRL_DMASEL (0x00000300) //!< Bit mask for USDHC_PROT_CTRL_DMASEL.
  1305. //! @brief Get value of USDHC_PROT_CTRL_DMASEL from a register value.
  1306. #define BG_USDHC_PROT_CTRL_DMASEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_DMASEL) >> BP_USDHC_PROT_CTRL_DMASEL)
  1307. //! @brief Format value for bitfield USDHC_PROT_CTRL_DMASEL.
  1308. #define BF_USDHC_PROT_CTRL_DMASEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_DMASEL) & BM_USDHC_PROT_CTRL_DMASEL)
  1309. #ifndef __LANGUAGE_ASM__
  1310. //! @brief Set the DMASEL field to a new value.
  1311. #define BW_USDHC_PROT_CTRL_DMASEL(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_DMASEL) | BF_USDHC_PROT_CTRL_DMASEL(v)))
  1312. #endif
  1313. /* --- Register HW_USDHC_PROT_CTRL, field SABGREQ[16] (RW)
  1314. *
  1315. * Stop At Block Gap Request: This bit is used to stop executing a transaction at the next block gap
  1316. * for both DMA and non-DMA transfers. Until the Transfer Complete is set to 1, indicating a
  1317. * transfer completion, the Host Driver shall leave this bit set to 1. Clearing both the Stop At
  1318. * Block Gap Request and Continue Request does not cause the transaction to restart. Read Wait is
  1319. * used to stop the read transaction at the block gap. The uSDHC will honor the Stop At Block Gap
  1320. * Request for write transfers, but for read transfers it requires that the SDIO card support Read
  1321. * Wait. Therefore, the Host Driver shall not set this bit during read transfers unless the SDIO
  1322. * card supports Read Wait and has set the Read Wait Control to 1, otherwise the uSDHC will stop the
  1323. * SD bus clock to pause the read operation during block gap. In the case of write transfers in
  1324. * which the Host Driver writes data to the Data Port register, the Host Driver shall set this bit
  1325. * after all block data is written. If this bit is set to 1, the Host Driver shall not write data to
  1326. * the Data Port register after a block is sent. Once this bit is set, the Host Driver shall not
  1327. * clear this bit before the Transfer Complete bit in Interrupt Status Register is set, otherwise
  1328. * the uSDHCs behavior is undefined. This bit effects Read Transfer Active, Write Transfer Active,
  1329. * DAT Line Active and Command Inhibit (DAT) in the Present State register.
  1330. *
  1331. * Values:
  1332. * 0 - Transfer
  1333. * 1 - Stop
  1334. */
  1335. #define BP_USDHC_PROT_CTRL_SABGREQ (16) //!< Bit position for USDHC_PROT_CTRL_SABGREQ.
  1336. #define BM_USDHC_PROT_CTRL_SABGREQ (0x00010000) //!< Bit mask for USDHC_PROT_CTRL_SABGREQ.
  1337. //! @brief Get value of USDHC_PROT_CTRL_SABGREQ from a register value.
  1338. #define BG_USDHC_PROT_CTRL_SABGREQ(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_SABGREQ) >> BP_USDHC_PROT_CTRL_SABGREQ)
  1339. //! @brief Format value for bitfield USDHC_PROT_CTRL_SABGREQ.
  1340. #define BF_USDHC_PROT_CTRL_SABGREQ(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_SABGREQ) & BM_USDHC_PROT_CTRL_SABGREQ)
  1341. #ifndef __LANGUAGE_ASM__
  1342. //! @brief Set the SABGREQ field to a new value.
  1343. #define BW_USDHC_PROT_CTRL_SABGREQ(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_SABGREQ) | BF_USDHC_PROT_CTRL_SABGREQ(v)))
  1344. #endif
  1345. /* --- Register HW_USDHC_PROT_CTRL, field CREQ[17] (RW)
  1346. *
  1347. * Continue Request: This bit is used to restart a transaction which was stopped using the Stop At
  1348. * Block Gap Request. When a Suspend operation is not accepted by the card, it is also by setting
  1349. * this bit to restart the paused transfer. To cancel stop at the block gap, set Stop At Block Gap
  1350. * Request to 0 and set this bit to 1 to restart the transfer. The uSDHC automatically clears this
  1351. * bit, therefore it is not necessary for the Host Driver to set this bit to 0. If both Stop At
  1352. * Block Gap Request and this bit are 1, the continue request is ignored.
  1353. *
  1354. * Values:
  1355. * 0 - No effect
  1356. * 1 - Restart
  1357. */
  1358. #define BP_USDHC_PROT_CTRL_CREQ (17) //!< Bit position for USDHC_PROT_CTRL_CREQ.
  1359. #define BM_USDHC_PROT_CTRL_CREQ (0x00020000) //!< Bit mask for USDHC_PROT_CTRL_CREQ.
  1360. //! @brief Get value of USDHC_PROT_CTRL_CREQ from a register value.
  1361. #define BG_USDHC_PROT_CTRL_CREQ(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_CREQ) >> BP_USDHC_PROT_CTRL_CREQ)
  1362. //! @brief Format value for bitfield USDHC_PROT_CTRL_CREQ.
  1363. #define BF_USDHC_PROT_CTRL_CREQ(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_CREQ) & BM_USDHC_PROT_CTRL_CREQ)
  1364. #ifndef __LANGUAGE_ASM__
  1365. //! @brief Set the CREQ field to a new value.
  1366. #define BW_USDHC_PROT_CTRL_CREQ(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_CREQ) | BF_USDHC_PROT_CTRL_CREQ(v)))
  1367. #endif
  1368. /* --- Register HW_USDHC_PROT_CTRL, field RWCTL[18] (RW)
  1369. *
  1370. * Read Wait Control: The read wait function is optional for SDIO cards. If the card supports read
  1371. * wait, set this bit to enable use of the read wait protocol to stop read data using the DAT[2]
  1372. * line. Otherwise the uSDHC has to stop the SD Clock to hold read data, which restricts commands
  1373. * generation. When the Host Driver detects an SDIO card insertion, it shall set this bit according
  1374. * to the CCCR of the card. If the card does not support read wait, this bit shall never be set to
  1375. * 1, otherwise DAT line conflicts may occur. If this bit is set to 0, stop at block gap during read
  1376. * operation is also supported, but the uSDHC will stop the SD Clock to pause reading operation.
  1377. *
  1378. * Values:
  1379. * 0 - Disable Read Wait Control, and stop SD Clock at block gap when SABGREQ bit is set
  1380. * 1 - Enable Read Wait Control, and assert Read Wait without stopping SD Clock at block gap when SABGREQ
  1381. * bit is set
  1382. */
  1383. #define BP_USDHC_PROT_CTRL_RWCTL (18) //!< Bit position for USDHC_PROT_CTRL_RWCTL.
  1384. #define BM_USDHC_PROT_CTRL_RWCTL (0x00040000) //!< Bit mask for USDHC_PROT_CTRL_RWCTL.
  1385. //! @brief Get value of USDHC_PROT_CTRL_RWCTL from a register value.
  1386. #define BG_USDHC_PROT_CTRL_RWCTL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_RWCTL) >> BP_USDHC_PROT_CTRL_RWCTL)
  1387. //! @brief Format value for bitfield USDHC_PROT_CTRL_RWCTL.
  1388. #define BF_USDHC_PROT_CTRL_RWCTL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_RWCTL) & BM_USDHC_PROT_CTRL_RWCTL)
  1389. #ifndef __LANGUAGE_ASM__
  1390. //! @brief Set the RWCTL field to a new value.
  1391. #define BW_USDHC_PROT_CTRL_RWCTL(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_RWCTL) | BF_USDHC_PROT_CTRL_RWCTL(v)))
  1392. #endif
  1393. /* --- Register HW_USDHC_PROT_CTRL, field IABG[19] (RW)
  1394. *
  1395. * Interrupt At Block Gap: This bit is valid only in 4-bit mode, of the SDIO card, and selects a
  1396. * sample point in the interrupt cycle. Setting to 1 enables interrupt detection at the block gap
  1397. * for a multiple block transfer. Setting to 0 disables interrupt detection during a multiple block
  1398. * transfer. If the SDIO card can't signal an interrupt during a multiple block transfer, this bit
  1399. * should be set to 0 to avoid an inadvertent interrupt. When the Host Driver detects an SDIO card
  1400. * insertion, it shall set this bit according to the CCCR of the card.
  1401. *
  1402. * Values:
  1403. * 0 - Disabled
  1404. * 1 - Enabled
  1405. */
  1406. #define BP_USDHC_PROT_CTRL_IABG (19) //!< Bit position for USDHC_PROT_CTRL_IABG.
  1407. #define BM_USDHC_PROT_CTRL_IABG (0x00080000) //!< Bit mask for USDHC_PROT_CTRL_IABG.
  1408. //! @brief Get value of USDHC_PROT_CTRL_IABG from a register value.
  1409. #define BG_USDHC_PROT_CTRL_IABG(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_IABG) >> BP_USDHC_PROT_CTRL_IABG)
  1410. //! @brief Format value for bitfield USDHC_PROT_CTRL_IABG.
  1411. #define BF_USDHC_PROT_CTRL_IABG(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_IABG) & BM_USDHC_PROT_CTRL_IABG)
  1412. #ifndef __LANGUAGE_ASM__
  1413. //! @brief Set the IABG field to a new value.
  1414. #define BW_USDHC_PROT_CTRL_IABG(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_IABG) | BF_USDHC_PROT_CTRL_IABG(v)))
  1415. #endif
  1416. /* --- Register HW_USDHC_PROT_CTRL, field RD_DONE_NO_8CLK[20] (RW)
  1417. *
  1418. * Read done no 8 clock: According to the SD/MMC spec, for read data transaction, 8 clocks are
  1419. * needed after the end bit of the last data block. So, by default(RD_DONE_NO_8CLK=0), 8 clocks will
  1420. * be active after the end bit of the last read data transaction. However, this 8 clocks should not
  1421. * be active if user wants to use stop at block gap(include the auto stop at block gap in boot mode)
  1422. * feature for read and the RWCTL bit(bit18) is not enabled. In this case, software should set
  1423. * RD_DONE_NO_8CLK to avoid this 8 clocks. Otherwise, the device may send extra data to uSDHC while
  1424. * uSDHC ignores these data. In a summary, this bit should be set only if the use case needs to use
  1425. * stop at block gap feature while the device can't support the read wait feature.
  1426. */
  1427. #define BP_USDHC_PROT_CTRL_RD_DONE_NO_8CLK (20) //!< Bit position for USDHC_PROT_CTRL_RD_DONE_NO_8CLK.
  1428. #define BM_USDHC_PROT_CTRL_RD_DONE_NO_8CLK (0x00100000) //!< Bit mask for USDHC_PROT_CTRL_RD_DONE_NO_8CLK.
  1429. //! @brief Get value of USDHC_PROT_CTRL_RD_DONE_NO_8CLK from a register value.
  1430. #define BG_USDHC_PROT_CTRL_RD_DONE_NO_8CLK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_RD_DONE_NO_8CLK) >> BP_USDHC_PROT_CTRL_RD_DONE_NO_8CLK)
  1431. //! @brief Format value for bitfield USDHC_PROT_CTRL_RD_DONE_NO_8CLK.
  1432. #define BF_USDHC_PROT_CTRL_RD_DONE_NO_8CLK(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_RD_DONE_NO_8CLK) & BM_USDHC_PROT_CTRL_RD_DONE_NO_8CLK)
  1433. #ifndef __LANGUAGE_ASM__
  1434. //! @brief Set the RD_DONE_NO_8CLK field to a new value.
  1435. #define BW_USDHC_PROT_CTRL_RD_DONE_NO_8CLK(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_RD_DONE_NO_8CLK) | BF_USDHC_PROT_CTRL_RD_DONE_NO_8CLK(v)))
  1436. #endif
  1437. /* --- Register HW_USDHC_PROT_CTRL, field RD_WAIT_POINT[23:21] (RW)
  1438. *
  1439. * Read wait point : This is only for debug purpose. As a Host controller, uSDHC should pause the
  1440. * SDHC_CLK or assert the DAT[2](if read wait feature is supported by the device) to avoid the
  1441. * device to send extra data. The SDHC_CLK should be paused or the DAT[2] should be asserted in two
  1442. * clock cycles after the end bit of the last transaction. Meanwhile, because the uSDHC controller
  1443. * has async FIFO between the card interface and the internal state machine, we need this "Read wait
  1444. * point" configuration to overcome the latency which is introduced by this async FIFO. The default
  1445. * value is 0x4, which should be accurately overcome the latency.
  1446. */
  1447. #define BP_USDHC_PROT_CTRL_RD_WAIT_POINT (21) //!< Bit position for USDHC_PROT_CTRL_RD_WAIT_POINT.
  1448. #define BM_USDHC_PROT_CTRL_RD_WAIT_POINT (0x00e00000) //!< Bit mask for USDHC_PROT_CTRL_RD_WAIT_POINT.
  1449. //! @brief Get value of USDHC_PROT_CTRL_RD_WAIT_POINT from a register value.
  1450. #define BG_USDHC_PROT_CTRL_RD_WAIT_POINT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_RD_WAIT_POINT) >> BP_USDHC_PROT_CTRL_RD_WAIT_POINT)
  1451. //! @brief Format value for bitfield USDHC_PROT_CTRL_RD_WAIT_POINT.
  1452. #define BF_USDHC_PROT_CTRL_RD_WAIT_POINT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_RD_WAIT_POINT) & BM_USDHC_PROT_CTRL_RD_WAIT_POINT)
  1453. #ifndef __LANGUAGE_ASM__
  1454. //! @brief Set the RD_WAIT_POINT field to a new value.
  1455. #define BW_USDHC_PROT_CTRL_RD_WAIT_POINT(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_RD_WAIT_POINT) | BF_USDHC_PROT_CTRL_RD_WAIT_POINT(v)))
  1456. #endif
  1457. /* --- Register HW_USDHC_PROT_CTRL, field WECINT[24] (RW)
  1458. *
  1459. * Wakeup Event Enable On Card Interrupt: This bit enables a wakeup event, via a Card Interrupt, in
  1460. * the Interrupt Status register. This bit can be set to 1 if FN_WUS (Wake Up Support) in CIS is set
  1461. * to 1. When this bit is set, the Card Interrupt Status and the uSDHC interrupt can be asserted
  1462. * without CLK toggling. When the wakeup feature is not enabled, the CLK must be active in order to
  1463. * assert the Card Interrupt Status and the uSDHC interrupt.
  1464. *
  1465. * Values:
  1466. * 0 - Disable
  1467. * 1 - Enable
  1468. */
  1469. #define BP_USDHC_PROT_CTRL_WECINT (24) //!< Bit position for USDHC_PROT_CTRL_WECINT.
  1470. #define BM_USDHC_PROT_CTRL_WECINT (0x01000000) //!< Bit mask for USDHC_PROT_CTRL_WECINT.
  1471. //! @brief Get value of USDHC_PROT_CTRL_WECINT from a register value.
  1472. #define BG_USDHC_PROT_CTRL_WECINT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_WECINT) >> BP_USDHC_PROT_CTRL_WECINT)
  1473. //! @brief Format value for bitfield USDHC_PROT_CTRL_WECINT.
  1474. #define BF_USDHC_PROT_CTRL_WECINT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_WECINT) & BM_USDHC_PROT_CTRL_WECINT)
  1475. #ifndef __LANGUAGE_ASM__
  1476. //! @brief Set the WECINT field to a new value.
  1477. #define BW_USDHC_PROT_CTRL_WECINT(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_WECINT) | BF_USDHC_PROT_CTRL_WECINT(v)))
  1478. #endif
  1479. /* --- Register HW_USDHC_PROT_CTRL, field WECINS[25] (RW)
  1480. *
  1481. * Wakeup Event Enable On SD Card Insertion: This bit enables a wakeup event, via a Card Insertion,
  1482. * in the Interrupt Status register. FN_WUS (Wake Up Support) in CIS does not effect this bit. When
  1483. * this bit is set, the Card Insertion Status and the uSDHC interrupt can be asserted without CLK
  1484. * toggling. When the wakeup feature is not enabled, the CLK must be active in order to assert the
  1485. * Card Insertion Status and the uSDHC interrupt.
  1486. *
  1487. * Values:
  1488. * 0 - Disable
  1489. * 1 - Enable
  1490. */
  1491. #define BP_USDHC_PROT_CTRL_WECINS (25) //!< Bit position for USDHC_PROT_CTRL_WECINS.
  1492. #define BM_USDHC_PROT_CTRL_WECINS (0x02000000) //!< Bit mask for USDHC_PROT_CTRL_WECINS.
  1493. //! @brief Get value of USDHC_PROT_CTRL_WECINS from a register value.
  1494. #define BG_USDHC_PROT_CTRL_WECINS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_WECINS) >> BP_USDHC_PROT_CTRL_WECINS)
  1495. //! @brief Format value for bitfield USDHC_PROT_CTRL_WECINS.
  1496. #define BF_USDHC_PROT_CTRL_WECINS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_WECINS) & BM_USDHC_PROT_CTRL_WECINS)
  1497. #ifndef __LANGUAGE_ASM__
  1498. //! @brief Set the WECINS field to a new value.
  1499. #define BW_USDHC_PROT_CTRL_WECINS(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_WECINS) | BF_USDHC_PROT_CTRL_WECINS(v)))
  1500. #endif
  1501. /* --- Register HW_USDHC_PROT_CTRL, field WECRM[26] (RW)
  1502. *
  1503. * Wakeup Event Enable On SD Card Removal: This bit enables a wakeup event, via a Card Removal, in
  1504. * the Interrupt Status register. FN_WUS (Wake Up Support) in CIS does not effect this bit. When
  1505. * this bit is set, the Card Removal Status and the uSDHC interrupt can be asserted without CLK
  1506. * toggling. When the wakeup feature is not enabled, the CLK must be active in order to assert the
  1507. * Card Removal Status and the uSDHC interrupt.
  1508. *
  1509. * Values:
  1510. * 0 - Disable
  1511. * 1 - Enable
  1512. */
  1513. #define BP_USDHC_PROT_CTRL_WECRM (26) //!< Bit position for USDHC_PROT_CTRL_WECRM.
  1514. #define BM_USDHC_PROT_CTRL_WECRM (0x04000000) //!< Bit mask for USDHC_PROT_CTRL_WECRM.
  1515. //! @brief Get value of USDHC_PROT_CTRL_WECRM from a register value.
  1516. #define BG_USDHC_PROT_CTRL_WECRM(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_WECRM) >> BP_USDHC_PROT_CTRL_WECRM)
  1517. //! @brief Format value for bitfield USDHC_PROT_CTRL_WECRM.
  1518. #define BF_USDHC_PROT_CTRL_WECRM(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_WECRM) & BM_USDHC_PROT_CTRL_WECRM)
  1519. #ifndef __LANGUAGE_ASM__
  1520. //! @brief Set the WECRM field to a new value.
  1521. #define BW_USDHC_PROT_CTRL_WECRM(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_WECRM) | BF_USDHC_PROT_CTRL_WECRM(v)))
  1522. #endif
  1523. /* --- Register HW_USDHC_PROT_CTRL, field BURST_LEN_EN[29:27] (RW)
  1524. *
  1525. * BURST length enable for INCR, INCR4/INCR8/INCR16, INCR4-WRAP/INCR8-WRAP/INCR16-WRAP This is used
  1526. * to enable/disable the burst length for the external AHB2AXI bridge. It's useful especially for
  1527. * INCR transfer because without burst length indicator, the AHB2AXI bridge doesn't know the burst
  1528. * length in advance. Without burst length indicator, AHB INCR transfers can only be converted to
  1529. * SINGLEs in AXI side.
  1530. *
  1531. * Values:
  1532. * xx1 - Burst length is enabled for INCR
  1533. * x1x - Burst length is enabled for INCR4/INCR8/INCR16
  1534. * 1xx - Burst length is enabled for INCR4-WRAP/INCR8-WRAP/INCR16-WRAP
  1535. */
  1536. #define BP_USDHC_PROT_CTRL_BURST_LEN_EN (27) //!< Bit position for USDHC_PROT_CTRL_BURST_LEN_EN.
  1537. #define BM_USDHC_PROT_CTRL_BURST_LEN_EN (0x38000000) //!< Bit mask for USDHC_PROT_CTRL_BURST_LEN_EN.
  1538. //! @brief Get value of USDHC_PROT_CTRL_BURST_LEN_EN from a register value.
  1539. #define BG_USDHC_PROT_CTRL_BURST_LEN_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_BURST_LEN_EN) >> BP_USDHC_PROT_CTRL_BURST_LEN_EN)
  1540. //! @brief Format value for bitfield USDHC_PROT_CTRL_BURST_LEN_EN.
  1541. #define BF_USDHC_PROT_CTRL_BURST_LEN_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_BURST_LEN_EN) & BM_USDHC_PROT_CTRL_BURST_LEN_EN)
  1542. #ifndef __LANGUAGE_ASM__
  1543. //! @brief Set the BURST_LEN_EN field to a new value.
  1544. #define BW_USDHC_PROT_CTRL_BURST_LEN_EN(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_BURST_LEN_EN) | BF_USDHC_PROT_CTRL_BURST_LEN_EN(v)))
  1545. #endif
  1546. /* --- Register HW_USDHC_PROT_CTRL, field NON_EXACT_BLK_RD[30] (RW)
  1547. *
  1548. * Current block read is non-exact block read. It's only used for SDIO.
  1549. *
  1550. * Values:
  1551. * 0 - The block read is exact block read. Host driver doesn't need to issue abort command to terminate
  1552. * this multi-block read.
  1553. * 1 - The block read is non-exact block read. Host driver needs to issue abort command to terminate this
  1554. * multi-block read.
  1555. */
  1556. #define BP_USDHC_PROT_CTRL_NON_EXACT_BLK_RD (30) //!< Bit position for USDHC_PROT_CTRL_NON_EXACT_BLK_RD.
  1557. #define BM_USDHC_PROT_CTRL_NON_EXACT_BLK_RD (0x40000000) //!< Bit mask for USDHC_PROT_CTRL_NON_EXACT_BLK_RD.
  1558. //! @brief Get value of USDHC_PROT_CTRL_NON_EXACT_BLK_RD from a register value.
  1559. #define BG_USDHC_PROT_CTRL_NON_EXACT_BLK_RD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_NON_EXACT_BLK_RD) >> BP_USDHC_PROT_CTRL_NON_EXACT_BLK_RD)
  1560. //! @brief Format value for bitfield USDHC_PROT_CTRL_NON_EXACT_BLK_RD.
  1561. #define BF_USDHC_PROT_CTRL_NON_EXACT_BLK_RD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_NON_EXACT_BLK_RD) & BM_USDHC_PROT_CTRL_NON_EXACT_BLK_RD)
  1562. #ifndef __LANGUAGE_ASM__
  1563. //! @brief Set the NON_EXACT_BLK_RD field to a new value.
  1564. #define BW_USDHC_PROT_CTRL_NON_EXACT_BLK_RD(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_NON_EXACT_BLK_RD) | BF_USDHC_PROT_CTRL_NON_EXACT_BLK_RD(v)))
  1565. #endif
  1566. /* --- Register HW_USDHC_PROT_CTRL, field RD_NO8CLK_EN[31] (RW)
  1567. *
  1568. * Only for debug. enable S/W RD_DONE_NO_8CLK bit
  1569. *
  1570. * Values:
  1571. * 0 - Disable S/W RD_DONE_NO_8CLK, uSHDC determines if 8 clocks are needed automatically.
  1572. * 1 - S/W RD_DONE_NO_8CLK is enabled
  1573. */
  1574. #define BP_USDHC_PROT_CTRL_RD_NO8CLK_EN (31) //!< Bit position for USDHC_PROT_CTRL_RD_NO8CLK_EN.
  1575. #define BM_USDHC_PROT_CTRL_RD_NO8CLK_EN (0x80000000) //!< Bit mask for USDHC_PROT_CTRL_RD_NO8CLK_EN.
  1576. //! @brief Get value of USDHC_PROT_CTRL_RD_NO8CLK_EN from a register value.
  1577. #define BG_USDHC_PROT_CTRL_RD_NO8CLK_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_PROT_CTRL_RD_NO8CLK_EN) >> BP_USDHC_PROT_CTRL_RD_NO8CLK_EN)
  1578. //! @brief Format value for bitfield USDHC_PROT_CTRL_RD_NO8CLK_EN.
  1579. #define BF_USDHC_PROT_CTRL_RD_NO8CLK_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_PROT_CTRL_RD_NO8CLK_EN) & BM_USDHC_PROT_CTRL_RD_NO8CLK_EN)
  1580. #ifndef __LANGUAGE_ASM__
  1581. //! @brief Set the RD_NO8CLK_EN field to a new value.
  1582. #define BW_USDHC_PROT_CTRL_RD_NO8CLK_EN(x, v) (HW_USDHC_PROT_CTRL_WR(x, (HW_USDHC_PROT_CTRL_RD(x) & ~BM_USDHC_PROT_CTRL_RD_NO8CLK_EN) | BF_USDHC_PROT_CTRL_RD_NO8CLK_EN(v)))
  1583. #endif
  1584. //-------------------------------------------------------------------------------------------
  1585. // HW_USDHC_SYS_CTRL - System Control
  1586. //-------------------------------------------------------------------------------------------
  1587. #ifndef __LANGUAGE_ASM__
  1588. /*!
  1589. * @brief HW_USDHC_SYS_CTRL - System Control (RW)
  1590. *
  1591. * Reset value: 0x0080800f
  1592. *
  1593. */
  1594. typedef union _hw_usdhc_sys_ctrl
  1595. {
  1596. reg32_t U;
  1597. struct _hw_usdhc_sys_ctrl_bitfields
  1598. {
  1599. unsigned IPGEN : 1; //!< [0] IPG Clock Enable: It's not implemented in uSDHC IP.
  1600. unsigned HCKEN : 1; //!< [1] HCLK Enable: It's not implemented in uSDHC IP.
  1601. unsigned PEREN : 1; //!< [2] Perpherial Clock Enable It's not implemented in uSDHC IP.
  1602. unsigned SDCLKEN : 1; //!< [3] SD Clock Enable It's not implemented in uSDHC IP.
  1603. unsigned DVS : 4; //!< [7:4] Divisor: This register is used to provide a more exact divisor to generate the desired SD clock frequency.
  1604. unsigned SDCLKFS : 8; //!< [15:8] SDCLK Frequency Select: This register is used to select the frequency of the SDCLK pin.
  1605. unsigned DTOCV : 4; //!< [19:16] Data Timeout Counter Value: This value determines the interval by which DAT line timeouts are detected.
  1606. unsigned RESERVED0 : 2; //!< [21:20] Reserved
  1607. unsigned RST_FIFO : 1; //!< [22] Reset the Async FIFO: Reset the Async FIFO between card interface and the internal logic.
  1608. unsigned IPP_RST_N : 1; //!< [23] This register's value will be output to CARD from pad directly for hardware reset of the card if card support this feature.
  1609. unsigned RSTA : 1; //!< [24] Software Reset For ALL: This reset effects the entire Host Controller except for the card detection circuit.
  1610. unsigned RSTC : 1; //!< [25] Software Reset For CMD Line: Only part of the command circuit is reset.
  1611. unsigned RSTD : 1; //!< [26] Software Reset For DAT Line: Only part of the data circuit is reset.
  1612. unsigned INITA : 1; //!< [27] Initialization Active: When this bit is set, 80 SD-Clocks are sent to the card.
  1613. unsigned RESERVED1 : 4; //!< [31:28] Reserved
  1614. } B;
  1615. } hw_usdhc_sys_ctrl_t;
  1616. #endif
  1617. /*
  1618. * constants & macros for entire multi-block USDHC_SYS_CTRL register
  1619. */
  1620. #define HW_USDHC_SYS_CTRL_ADDR(x) (REGS_USDHC_BASE(x) + 0x2c)
  1621. #ifndef __LANGUAGE_ASM__
  1622. #define HW_USDHC_SYS_CTRL(x) (*(volatile hw_usdhc_sys_ctrl_t *) HW_USDHC_SYS_CTRL_ADDR(x))
  1623. #define HW_USDHC_SYS_CTRL_RD(x) (HW_USDHC_SYS_CTRL(x).U)
  1624. #define HW_USDHC_SYS_CTRL_WR(x, v) (HW_USDHC_SYS_CTRL(x).U = (v))
  1625. #define HW_USDHC_SYS_CTRL_SET(x, v) (HW_USDHC_SYS_CTRL_WR(x, HW_USDHC_SYS_CTRL_RD(x) | (v)))
  1626. #define HW_USDHC_SYS_CTRL_CLR(x, v) (HW_USDHC_SYS_CTRL_WR(x, HW_USDHC_SYS_CTRL_RD(x) & ~(v)))
  1627. #define HW_USDHC_SYS_CTRL_TOG(x, v) (HW_USDHC_SYS_CTRL_WR(x, HW_USDHC_SYS_CTRL_RD(x) ^ (v)))
  1628. #endif
  1629. /*
  1630. * constants & macros for individual USDHC_SYS_CTRL bitfields
  1631. */
  1632. /* --- Register HW_USDHC_SYS_CTRL, field IPGEN[0] (RW)
  1633. *
  1634. * IPG Clock Enable: It's not implemented in uSDHC IP.
  1635. */
  1636. #define BP_USDHC_SYS_CTRL_IPGEN (0) //!< Bit position for USDHC_SYS_CTRL_IPGEN.
  1637. #define BM_USDHC_SYS_CTRL_IPGEN (0x00000001) //!< Bit mask for USDHC_SYS_CTRL_IPGEN.
  1638. //! @brief Get value of USDHC_SYS_CTRL_IPGEN from a register value.
  1639. #define BG_USDHC_SYS_CTRL_IPGEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_IPGEN) >> BP_USDHC_SYS_CTRL_IPGEN)
  1640. //! @brief Format value for bitfield USDHC_SYS_CTRL_IPGEN.
  1641. #define BF_USDHC_SYS_CTRL_IPGEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_IPGEN) & BM_USDHC_SYS_CTRL_IPGEN)
  1642. #ifndef __LANGUAGE_ASM__
  1643. //! @brief Set the IPGEN field to a new value.
  1644. #define BW_USDHC_SYS_CTRL_IPGEN(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_IPGEN) | BF_USDHC_SYS_CTRL_IPGEN(v)))
  1645. #endif
  1646. /* --- Register HW_USDHC_SYS_CTRL, field HCKEN[1] (RW)
  1647. *
  1648. * HCLK Enable: It's not implemented in uSDHC IP.
  1649. */
  1650. #define BP_USDHC_SYS_CTRL_HCKEN (1) //!< Bit position for USDHC_SYS_CTRL_HCKEN.
  1651. #define BM_USDHC_SYS_CTRL_HCKEN (0x00000002) //!< Bit mask for USDHC_SYS_CTRL_HCKEN.
  1652. //! @brief Get value of USDHC_SYS_CTRL_HCKEN from a register value.
  1653. #define BG_USDHC_SYS_CTRL_HCKEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_HCKEN) >> BP_USDHC_SYS_CTRL_HCKEN)
  1654. //! @brief Format value for bitfield USDHC_SYS_CTRL_HCKEN.
  1655. #define BF_USDHC_SYS_CTRL_HCKEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_HCKEN) & BM_USDHC_SYS_CTRL_HCKEN)
  1656. #ifndef __LANGUAGE_ASM__
  1657. //! @brief Set the HCKEN field to a new value.
  1658. #define BW_USDHC_SYS_CTRL_HCKEN(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_HCKEN) | BF_USDHC_SYS_CTRL_HCKEN(v)))
  1659. #endif
  1660. /* --- Register HW_USDHC_SYS_CTRL, field PEREN[2] (RW)
  1661. *
  1662. * Perpherial Clock Enable It's not implemented in uSDHC IP.
  1663. */
  1664. #define BP_USDHC_SYS_CTRL_PEREN (2) //!< Bit position for USDHC_SYS_CTRL_PEREN.
  1665. #define BM_USDHC_SYS_CTRL_PEREN (0x00000004) //!< Bit mask for USDHC_SYS_CTRL_PEREN.
  1666. //! @brief Get value of USDHC_SYS_CTRL_PEREN from a register value.
  1667. #define BG_USDHC_SYS_CTRL_PEREN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_PEREN) >> BP_USDHC_SYS_CTRL_PEREN)
  1668. //! @brief Format value for bitfield USDHC_SYS_CTRL_PEREN.
  1669. #define BF_USDHC_SYS_CTRL_PEREN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_PEREN) & BM_USDHC_SYS_CTRL_PEREN)
  1670. #ifndef __LANGUAGE_ASM__
  1671. //! @brief Set the PEREN field to a new value.
  1672. #define BW_USDHC_SYS_CTRL_PEREN(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_PEREN) | BF_USDHC_SYS_CTRL_PEREN(v)))
  1673. #endif
  1674. /* --- Register HW_USDHC_SYS_CTRL, field SDCLKEN[3] (RW)
  1675. *
  1676. * SD Clock Enable It's not implemented in uSDHC IP.
  1677. */
  1678. #define BP_USDHC_SYS_CTRL_SDCLKEN (3) //!< Bit position for USDHC_SYS_CTRL_SDCLKEN.
  1679. #define BM_USDHC_SYS_CTRL_SDCLKEN (0x00000008) //!< Bit mask for USDHC_SYS_CTRL_SDCLKEN.
  1680. //! @brief Get value of USDHC_SYS_CTRL_SDCLKEN from a register value.
  1681. #define BG_USDHC_SYS_CTRL_SDCLKEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_SDCLKEN) >> BP_USDHC_SYS_CTRL_SDCLKEN)
  1682. //! @brief Format value for bitfield USDHC_SYS_CTRL_SDCLKEN.
  1683. #define BF_USDHC_SYS_CTRL_SDCLKEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_SDCLKEN) & BM_USDHC_SYS_CTRL_SDCLKEN)
  1684. #ifndef __LANGUAGE_ASM__
  1685. //! @brief Set the SDCLKEN field to a new value.
  1686. #define BW_USDHC_SYS_CTRL_SDCLKEN(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_SDCLKEN) | BF_USDHC_SYS_CTRL_SDCLKEN(v)))
  1687. #endif
  1688. /* --- Register HW_USDHC_SYS_CTRL, field DVS[7:4] (RW)
  1689. *
  1690. * Divisor: This register is used to provide a more exact divisor to generate the desired SD clock
  1691. * frequency. Note the divider can even support odd divisor without deterioration of duty cycle.
  1692. * Before changing clock divisor value(SDCLKFS or DVS), Host Driver should make sure the SDSTB bit
  1693. * is high. The setting are as following:
  1694. *
  1695. * Values:
  1696. * 0 - Divisor by 1
  1697. * 1 - Divisor by 2
  1698. * e - Divisor by 15
  1699. * f - Divisor by 16
  1700. */
  1701. #define BP_USDHC_SYS_CTRL_DVS (4) //!< Bit position for USDHC_SYS_CTRL_DVS.
  1702. #define BM_USDHC_SYS_CTRL_DVS (0x000000f0) //!< Bit mask for USDHC_SYS_CTRL_DVS.
  1703. //! @brief Get value of USDHC_SYS_CTRL_DVS from a register value.
  1704. #define BG_USDHC_SYS_CTRL_DVS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_DVS) >> BP_USDHC_SYS_CTRL_DVS)
  1705. //! @brief Format value for bitfield USDHC_SYS_CTRL_DVS.
  1706. #define BF_USDHC_SYS_CTRL_DVS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_DVS) & BM_USDHC_SYS_CTRL_DVS)
  1707. #ifndef __LANGUAGE_ASM__
  1708. //! @brief Set the DVS field to a new value.
  1709. #define BW_USDHC_SYS_CTRL_DVS(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_DVS) | BF_USDHC_SYS_CTRL_DVS(v)))
  1710. #endif
  1711. /* --- Register HW_USDHC_SYS_CTRL, field SDCLKFS[15:8] (RW)
  1712. *
  1713. * SDCLK Frequency Select: This register is used to select the frequency of the SDCLK pin. The
  1714. * frequency is not programmed directly, rather this register holds the prescaler (this register)
  1715. * and divisor (next register) of the Base Clock Frequency register. I n Single Data Rate
  1716. * mode(DDR_EN bit of MIXERCTRL is '0') Only the following settings are allowed: 80h) Base clock
  1717. * divided by 256 40h) Base clock divided by 128 20h) Base clock divided by 64 10h) Base clock
  1718. * divided by 32 08h) Base clock divided by 16 04h) Base clock divided by 8 02h) Base clock divided
  1719. * by 4 01h) Base clock divided by 2 00h) Base clock divided by 1 W hile in Dual Data Rate
  1720. * mode(DDR_EN bit of MIXERCTRL is '1') Only the following settings are allowed: 80h) Base clock
  1721. * divided by 512 40h) Base clock divided by 256 20h) Base clock divided by 128 10h) Base clock
  1722. * divided by 64 08h) Base clock divided by 32 04h) Base clock divided by 16 02h) Base clock divided
  1723. * by 8 01h) Base clock divided by 4 00h) Base clock divided by 2 W hen S/W changes the DDR_EN bit,
  1724. * SDCLKFS may need to be changed also ! In Single Data Rate mode, setting 00h bypasses the
  1725. * frequency prescaler of the SD Clock. Multiple bits must not be set, or the behavior of this
  1726. * prescaler is undefined. The two default divider values can be calculated by the frequency of
  1727. * ipg_perclk and the following Divisor bits. The frequency of SDCLK is set by the following
  1728. * formula: Clock Frequency = (Base Clock) / (prescaler x divisor) For example, in Single Data Rate
  1729. * mode, if the Base Clock Frequency is 96 MHz, and the target frequency is 25 MHz, then choosing
  1730. * the prescaler value of 01h and divisor value of 1h will yield 24 MHz, which is the nearest
  1731. * frequency less than or equal to the target. Similarly, to approach a clock value of 400 kHz, the
  1732. * prescaler value of 08h and divisor value of eh yields the exact clock value of 400 kHz. The reset
  1733. * value of this bit field is 80h, so if the input Base Clock (ipg_perclk) is about 96 MHz, the
  1734. * default SD Clock after reset is 375 kHz. According to the SD Physical Specification Version 1.1
  1735. * and the SDIO Card Specification Version 1.2, the maximum SD Clock frequency is 50 MHz and shall
  1736. * never exceed this limit. B efore changing clock divisor value(SDCLKFS or DVS), Host Driver should
  1737. * make sure the SDSTB bit is high. If setting SDCLKFS and DVS can generate same clock
  1738. * frequency,(For example, in SDR mode, SDCLKFS = 01h is same as DVS = 01h.) SDCLKFS is highly
  1739. * recommended.
  1740. */
  1741. #define BP_USDHC_SYS_CTRL_SDCLKFS (8) //!< Bit position for USDHC_SYS_CTRL_SDCLKFS.
  1742. #define BM_USDHC_SYS_CTRL_SDCLKFS (0x0000ff00) //!< Bit mask for USDHC_SYS_CTRL_SDCLKFS.
  1743. //! @brief Get value of USDHC_SYS_CTRL_SDCLKFS from a register value.
  1744. #define BG_USDHC_SYS_CTRL_SDCLKFS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_SDCLKFS) >> BP_USDHC_SYS_CTRL_SDCLKFS)
  1745. //! @brief Format value for bitfield USDHC_SYS_CTRL_SDCLKFS.
  1746. #define BF_USDHC_SYS_CTRL_SDCLKFS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_SDCLKFS) & BM_USDHC_SYS_CTRL_SDCLKFS)
  1747. #ifndef __LANGUAGE_ASM__
  1748. //! @brief Set the SDCLKFS field to a new value.
  1749. #define BW_USDHC_SYS_CTRL_SDCLKFS(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_SDCLKFS) | BF_USDHC_SYS_CTRL_SDCLKFS(v)))
  1750. #endif
  1751. /* --- Register HW_USDHC_SYS_CTRL, field DTOCV[19:16] (RW)
  1752. *
  1753. * Data Timeout Counter Value: This value determines the interval by which DAT line timeouts are
  1754. * detected. Refer to the Data Timeout Error bit in the Interrupt Status register for information on
  1755. * factors that dictate time-out generation. Time-out clock frequency will be generated by dividing
  1756. * the base clock SDCLK value by this value. The Host Driver can clear the Data Timeout Error Status
  1757. * Enable (in the Interrupt Status Enable register) to prevent inadvertent time-out events.
  1758. *
  1759. * Values:
  1760. * 0000 - SDCLK x 2 1 3
  1761. * 0001 - SDCLK x 2 14
  1762. * 1110 - SDCLK x 2 2 7
  1763. * 1111 - SDCLK x 2 28
  1764. */
  1765. #define BP_USDHC_SYS_CTRL_DTOCV (16) //!< Bit position for USDHC_SYS_CTRL_DTOCV.
  1766. #define BM_USDHC_SYS_CTRL_DTOCV (0x000f0000) //!< Bit mask for USDHC_SYS_CTRL_DTOCV.
  1767. //! @brief Get value of USDHC_SYS_CTRL_DTOCV from a register value.
  1768. #define BG_USDHC_SYS_CTRL_DTOCV(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_DTOCV) >> BP_USDHC_SYS_CTRL_DTOCV)
  1769. //! @brief Format value for bitfield USDHC_SYS_CTRL_DTOCV.
  1770. #define BF_USDHC_SYS_CTRL_DTOCV(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_DTOCV) & BM_USDHC_SYS_CTRL_DTOCV)
  1771. #ifndef __LANGUAGE_ASM__
  1772. //! @brief Set the DTOCV field to a new value.
  1773. #define BW_USDHC_SYS_CTRL_DTOCV(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_DTOCV) | BF_USDHC_SYS_CTRL_DTOCV(v)))
  1774. #endif
  1775. /* --- Register HW_USDHC_SYS_CTRL, field RST_FIFO[22] (WORZ)
  1776. *
  1777. * Reset the Async FIFO: Reset the Async FIFO between card interface and the internal logic. It's
  1778. * only used for debugging. Software should not tough it.
  1779. */
  1780. #define BP_USDHC_SYS_CTRL_RST_FIFO (22) //!< Bit position for USDHC_SYS_CTRL_RST_FIFO.
  1781. #define BM_USDHC_SYS_CTRL_RST_FIFO (0x00400000) //!< Bit mask for USDHC_SYS_CTRL_RST_FIFO.
  1782. //! @brief Get value of USDHC_SYS_CTRL_RST_FIFO from a register value.
  1783. #define BG_USDHC_SYS_CTRL_RST_FIFO(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_RST_FIFO) >> BP_USDHC_SYS_CTRL_RST_FIFO)
  1784. //! @brief Format value for bitfield USDHC_SYS_CTRL_RST_FIFO.
  1785. #define BF_USDHC_SYS_CTRL_RST_FIFO(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_RST_FIFO) & BM_USDHC_SYS_CTRL_RST_FIFO)
  1786. /* --- Register HW_USDHC_SYS_CTRL, field IPP_RST_N[23] (RW)
  1787. *
  1788. * This register's value will be output to CARD from pad directly for hardware reset of the card if
  1789. * card support this feature.
  1790. */
  1791. #define BP_USDHC_SYS_CTRL_IPP_RST_N (23) //!< Bit position for USDHC_SYS_CTRL_IPP_RST_N.
  1792. #define BM_USDHC_SYS_CTRL_IPP_RST_N (0x00800000) //!< Bit mask for USDHC_SYS_CTRL_IPP_RST_N.
  1793. //! @brief Get value of USDHC_SYS_CTRL_IPP_RST_N from a register value.
  1794. #define BG_USDHC_SYS_CTRL_IPP_RST_N(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_IPP_RST_N) >> BP_USDHC_SYS_CTRL_IPP_RST_N)
  1795. //! @brief Format value for bitfield USDHC_SYS_CTRL_IPP_RST_N.
  1796. #define BF_USDHC_SYS_CTRL_IPP_RST_N(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_IPP_RST_N) & BM_USDHC_SYS_CTRL_IPP_RST_N)
  1797. #ifndef __LANGUAGE_ASM__
  1798. //! @brief Set the IPP_RST_N field to a new value.
  1799. #define BW_USDHC_SYS_CTRL_IPP_RST_N(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_IPP_RST_N) | BF_USDHC_SYS_CTRL_IPP_RST_N(v)))
  1800. #endif
  1801. /* --- Register HW_USDHC_SYS_CTRL, field RSTA[24] (WORZ)
  1802. *
  1803. * Software Reset For ALL: This reset effects the entire Host Controller except for the card
  1804. * detection circuit. Register bits of type ROC, RW, RW1C, RWAC are cleared. During its
  1805. * initialization, the Host Driver shall set this bit to 1 to reset the uSDHC. The uSDHC shall reset
  1806. * this bit to 0 when the capabilities registers are valid and the Host Driver can read them.
  1807. * Additional use of Software Reset For All does not affect the value of the Capabilities registers.
  1808. * After this bit is set, it is recommended that the Host Driver reset the external card and re-
  1809. * initialize it.
  1810. *
  1811. * Values:
  1812. * 0 - No Reset
  1813. * 1 - Reset
  1814. */
  1815. #define BP_USDHC_SYS_CTRL_RSTA (24) //!< Bit position for USDHC_SYS_CTRL_RSTA.
  1816. #define BM_USDHC_SYS_CTRL_RSTA (0x01000000) //!< Bit mask for USDHC_SYS_CTRL_RSTA.
  1817. //! @brief Get value of USDHC_SYS_CTRL_RSTA from a register value.
  1818. #define BG_USDHC_SYS_CTRL_RSTA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_RSTA) >> BP_USDHC_SYS_CTRL_RSTA)
  1819. //! @brief Format value for bitfield USDHC_SYS_CTRL_RSTA.
  1820. #define BF_USDHC_SYS_CTRL_RSTA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_RSTA) & BM_USDHC_SYS_CTRL_RSTA)
  1821. /* --- Register HW_USDHC_SYS_CTRL, field RSTC[25] (WORZ)
  1822. *
  1823. * Software Reset For CMD Line: Only part of the command circuit is reset. The following registers
  1824. * and bits are cleared by this bit: Present State register Command Inhibit (CMD) Interrupt Status
  1825. * register Command Complete
  1826. *
  1827. * Values:
  1828. * 0 - No Reset
  1829. * 1 - Reset
  1830. */
  1831. #define BP_USDHC_SYS_CTRL_RSTC (25) //!< Bit position for USDHC_SYS_CTRL_RSTC.
  1832. #define BM_USDHC_SYS_CTRL_RSTC (0x02000000) //!< Bit mask for USDHC_SYS_CTRL_RSTC.
  1833. //! @brief Get value of USDHC_SYS_CTRL_RSTC from a register value.
  1834. #define BG_USDHC_SYS_CTRL_RSTC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_RSTC) >> BP_USDHC_SYS_CTRL_RSTC)
  1835. //! @brief Format value for bitfield USDHC_SYS_CTRL_RSTC.
  1836. #define BF_USDHC_SYS_CTRL_RSTC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_RSTC) & BM_USDHC_SYS_CTRL_RSTC)
  1837. /* --- Register HW_USDHC_SYS_CTRL, field RSTD[26] (WORZ)
  1838. *
  1839. * Software Reset For DAT Line: Only part of the data circuit is reset. DMA circuit is also reset.
  1840. * The following registers and bits are cleared by this bit: Data Port register Buffer is cleared
  1841. * and initialized.Present State register Buffer Read Enable Buffer Write Enable Read Transfer
  1842. * Active Write Transfer Active DAT Line Active Command Inhibit (DAT) Protocol Control register
  1843. * Continue Request Stop At Block Gap Request Interrupt Status register Buffer Read Ready Buffer
  1844. * Write Ready DMA Interrupt Block Gap Event Transfer Complete
  1845. *
  1846. * Values:
  1847. * 0 - No Reset
  1848. * 1 - Reset
  1849. */
  1850. #define BP_USDHC_SYS_CTRL_RSTD (26) //!< Bit position for USDHC_SYS_CTRL_RSTD.
  1851. #define BM_USDHC_SYS_CTRL_RSTD (0x04000000) //!< Bit mask for USDHC_SYS_CTRL_RSTD.
  1852. //! @brief Get value of USDHC_SYS_CTRL_RSTD from a register value.
  1853. #define BG_USDHC_SYS_CTRL_RSTD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_RSTD) >> BP_USDHC_SYS_CTRL_RSTD)
  1854. //! @brief Format value for bitfield USDHC_SYS_CTRL_RSTD.
  1855. #define BF_USDHC_SYS_CTRL_RSTD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_RSTD) & BM_USDHC_SYS_CTRL_RSTD)
  1856. /* --- Register HW_USDHC_SYS_CTRL, field INITA[27] (RW)
  1857. *
  1858. * Initialization Active: When this bit is set, 80 SD-Clocks are sent to the card. After the 80
  1859. * clocks are sent, this bit is self cleared. This bit is very useful during the card power-up
  1860. * period when 74 SD-Clocks are needed and the clock auto gating feature is enabled. Writing 1 to
  1861. * this bit when this bit is already 1 has no effect. Writing 0 to this bit at any time has no
  1862. * effect. When either of the CIHB and CDIHB bits in the Present State Register are set, writing 1
  1863. * to this bit is ignored (i.e. when command line or data lines are active, write to this bit is not
  1864. * allowed). On the otherhand, when this bit is set, i.e., during intialization active period, it is
  1865. * allowed to issue command, and the command bit stream will appear on the CMD pad after all 80
  1866. * clock cycles are done. So when this command ends, the driver can make sure the 80 clock cycles
  1867. * are sent out. This is very useful when the driver needs send 80 cycles to the card and does not
  1868. * want to wait till this bit is self cleared.
  1869. */
  1870. #define BP_USDHC_SYS_CTRL_INITA (27) //!< Bit position for USDHC_SYS_CTRL_INITA.
  1871. #define BM_USDHC_SYS_CTRL_INITA (0x08000000) //!< Bit mask for USDHC_SYS_CTRL_INITA.
  1872. //! @brief Get value of USDHC_SYS_CTRL_INITA from a register value.
  1873. #define BG_USDHC_SYS_CTRL_INITA(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_SYS_CTRL_INITA) >> BP_USDHC_SYS_CTRL_INITA)
  1874. //! @brief Format value for bitfield USDHC_SYS_CTRL_INITA.
  1875. #define BF_USDHC_SYS_CTRL_INITA(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_SYS_CTRL_INITA) & BM_USDHC_SYS_CTRL_INITA)
  1876. #ifndef __LANGUAGE_ASM__
  1877. //! @brief Set the INITA field to a new value.
  1878. #define BW_USDHC_SYS_CTRL_INITA(x, v) (HW_USDHC_SYS_CTRL_WR(x, (HW_USDHC_SYS_CTRL_RD(x) & ~BM_USDHC_SYS_CTRL_INITA) | BF_USDHC_SYS_CTRL_INITA(v)))
  1879. #endif
  1880. //-------------------------------------------------------------------------------------------
  1881. // HW_USDHC_INT_STATUS - Interrupt Status
  1882. //-------------------------------------------------------------------------------------------
  1883. #ifndef __LANGUAGE_ASM__
  1884. /*!
  1885. * @brief HW_USDHC_INT_STATUS - Interrupt Status (W1C)
  1886. *
  1887. * Reset value: 0x00000000
  1888. *
  1889. * An interrupt is generated when the Normal Interrupt Signal Enable is enabled and at least one of
  1890. * the status bits is set to 1. For all bits, writing 1 to a bit clears it; writing to 0 keeps the
  1891. * bit unchanged. More than one status can be cleared with a single register write. For Card
  1892. * Interrupt, before writing 1 to clear, it is required that the card stops asserting the interrupt,
  1893. * meaning that when the Card Driver services the interrupt condition, otherwise the CINT bit will
  1894. * be asserted again. The table below shows the relationship between the Command Timeout Error and
  1895. * the Command Complete. uSDHC Status for Command Timeout Error/Command Complete Bit Combinations
  1896. * Command Complete Command Timeout Error Meaning of the Status 0 0 X X 1
  1897. * Response not received within 64 SDCLK cycles 1 0 Response received The table
  1898. * below shows the relationship between the Transfer Complete and the Data Timeout Error. uSDHC
  1899. * Status for Data Timeout Error/Transfer Complete Bit Combinations Transfer Complete
  1900. * Data Timeout Error Meaning of the Status 0 0 X 0 1 Timeout occurred
  1901. * during transfer 1 X Data Transfer Complete The table below shows the
  1902. * relationship between the Command CRC Error and Command Timeout Error. uSDHC Status for Command
  1903. * CRC Error/Command Timeout Error Bit Combinations Command Complete Command Timeout
  1904. * Error Meaning of the Status 0 0 No error 0 1 Response Timeout Error
  1905. * 1 0 Response CRC Error 1 1 CMD line conflict
  1906. */
  1907. typedef union _hw_usdhc_int_status
  1908. {
  1909. reg32_t U;
  1910. struct _hw_usdhc_int_status_bitfields
  1911. {
  1912. unsigned CC : 1; //!< [0] Command Complete: This bit is set when you receive the end bit of the command response (except Auto CMD12).
  1913. unsigned TC : 1; //!< [1] Transfer Complete: This bit is set when a read or write transfer is completed.
  1914. unsigned BGE : 1; //!< [2] Block Gap Event: If the Stop At Block Gap Request bit in the Protocol Control register is set, this bit is set when a read or write transaction is stopped at a block gap.
  1915. unsigned DINT : 1; //!< [3] DMA Interrupt: Occurs only when the internal DMA finishes the data transfer successfully.
  1916. unsigned BWR : 1; //!< [4] Buffer Write Ready: This status bit is set if the Buffer Write Enable bit, in the Present State register, changes from 0 to 1.
  1917. unsigned BRR : 1; //!< [5] Buffer Read Ready: This status bit is set if the Buffer Read Enable bit, in the Present State register, changes from 0 to 1.
  1918. unsigned CINS : 1; //!< [6] Card Insertion: This status bit is set if the Card Inserted bit in the Present State register changes from 0 to 1.
  1919. unsigned CRM : 1; //!< [7] Card Removal: This status bit is set if the Card Inserted bit in the Present State register changes from 1 to 0.
  1920. unsigned CINT : 1; //!< [8] Card Interrupt: This status bit is set when an interrupt signal is detected from the external card.
  1921. unsigned RESERVED0 : 3; //!< [11:9] Reserved
  1922. unsigned RTE : 1; //!< [12] Re-Tuning Event: (only for SD3.0 SDR104 mode) This status is set if Re-Tuning Request in the Present State register changes from 0 to 1.
  1923. unsigned RESERVED1 : 1; //!< [13] Reserved
  1924. unsigned TP : 1; //!< [14] Tuning Pass:(only for SD3.0 SDR104 mode) Current CMD19 transfer is done successfully.
  1925. unsigned RESERVED2 : 1; //!< [15] Reserved
  1926. unsigned CTOE : 1; //!< [16] Command Timeout Error: Occurs only if no response is returned within 64 SDCLK cycles from the end bit of the command.
  1927. unsigned CCE : 1; //!< [17] Command CRC Error: Command CRC Error is generated in two cases.
  1928. unsigned CEBE : 1; //!< [18] Command End Bit Error: Occurs when detecting that the end bit of a command response is 0.
  1929. unsigned CIE : 1; //!< [19] Command Index Error: Occurs if a Command Index error occurs in the command response.
  1930. unsigned DTOE : 1; //!< [20] Data Timeout Error: Occurs when detecting one of following time-out conditions.
  1931. unsigned DCE : 1; //!< [21] Data CRC Error: Occurs when detecting a CRC error when transferring read data, which uses the DAT line, or when detecting the Write CRC status having a value other than 010.
  1932. unsigned DEBE : 1; //!< [22] Data End Bit Error: Occurs either when detecting 0 at the end bit position of read data, which uses the DAT line, or at the end bit position of the CRC.
  1933. unsigned RESERVED3 : 1; //!< [23] Reserved
  1934. unsigned AC12E : 1; //!< [24] Auto CMD12 Error: Occurs when detecting that one of the bits in the Auto CMD12 Error Status register has changed from 0 to 1.
  1935. unsigned RESERVED4 : 1; //!< [25] Reserved
  1936. unsigned TNE : 1; //!< [26] Tuning Error: (only for SD3.0 SDR104 mode) This bit is set when an unrecoverable error is detected in a tuning circuit.
  1937. unsigned RESERVED5 : 1; //!< [27] Reserved
  1938. unsigned DMAE : 1; //!< [28] DMA Error: Occurs when an Internal DMA transfer has failed.
  1939. unsigned RESERVED6 : 3; //!< [31:29] Reserved
  1940. } B;
  1941. } hw_usdhc_int_status_t;
  1942. #endif
  1943. /*
  1944. * constants & macros for entire multi-block USDHC_INT_STATUS register
  1945. */
  1946. #define HW_USDHC_INT_STATUS_ADDR(x) (REGS_USDHC_BASE(x) + 0x30)
  1947. #ifndef __LANGUAGE_ASM__
  1948. #define HW_USDHC_INT_STATUS(x) (*(volatile hw_usdhc_int_status_t *) HW_USDHC_INT_STATUS_ADDR(x))
  1949. #define HW_USDHC_INT_STATUS_RD(x) (HW_USDHC_INT_STATUS(x).U)
  1950. #define HW_USDHC_INT_STATUS_WR(x, v) (HW_USDHC_INT_STATUS(x).U = (v))
  1951. #define HW_USDHC_INT_STATUS_SET(x, v) (HW_USDHC_INT_STATUS_WR(x, HW_USDHC_INT_STATUS_RD(x) | (v)))
  1952. #define HW_USDHC_INT_STATUS_CLR(x, v) (HW_USDHC_INT_STATUS_WR(x, HW_USDHC_INT_STATUS_RD(x) & ~(v)))
  1953. #define HW_USDHC_INT_STATUS_TOG(x, v) (HW_USDHC_INT_STATUS_WR(x, HW_USDHC_INT_STATUS_RD(x) ^ (v)))
  1954. #endif
  1955. /*
  1956. * constants & macros for individual USDHC_INT_STATUS bitfields
  1957. */
  1958. /* --- Register HW_USDHC_INT_STATUS, field CC[0] (W1C)
  1959. *
  1960. * Command Complete: This bit is set when you receive the end bit of the command response (except
  1961. * Auto CMD12). Refer to the Command Inhibit (CMD) in the Present State register.
  1962. *
  1963. * Values:
  1964. * 0 - Command not complete
  1965. * 1 - Command complete
  1966. */
  1967. #define BP_USDHC_INT_STATUS_CC (0) //!< Bit position for USDHC_INT_STATUS_CC.
  1968. #define BM_USDHC_INT_STATUS_CC (0x00000001) //!< Bit mask for USDHC_INT_STATUS_CC.
  1969. //! @brief Get value of USDHC_INT_STATUS_CC from a register value.
  1970. #define BG_USDHC_INT_STATUS_CC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CC) >> BP_USDHC_INT_STATUS_CC)
  1971. //! @brief Format value for bitfield USDHC_INT_STATUS_CC.
  1972. #define BF_USDHC_INT_STATUS_CC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CC) & BM_USDHC_INT_STATUS_CC)
  1973. #ifndef __LANGUAGE_ASM__
  1974. //! @brief Set the CC field to a new value.
  1975. #define BW_USDHC_INT_STATUS_CC(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CC) | BF_USDHC_INT_STATUS_CC(v)))
  1976. #endif
  1977. /* --- Register HW_USDHC_INT_STATUS, field TC[1] (W1C)
  1978. *
  1979. * Transfer Complete: This bit is set when a read or write transfer is completed. In the case of a
  1980. * Read Transaction: This bit is set at the falling edge of the Read Transfer Active Status. There
  1981. * are two cases in which this interrupt is generated. The first is when a data transfer is
  1982. * completed as specified by the data length (after the last data has been read to the Host System).
  1983. * The second is when data has stopped at the block gap and completed the data transfer by setting
  1984. * the Stop At Block Gap Request bit in the Protocol Control register (after valid data has been
  1985. * read to the Host System). In the case of a Write Transaction: This bit is set at the falling edge
  1986. * of the DAT Line Active Status. There are two cases in which this interrupt is generated. The
  1987. * first is when the last data is written to the SD card as specified by the data length and the
  1988. * busy signal is released. The second is when data transfers are stopped at the block gap, by
  1989. * setting the Stop At Block Gap Request bit in the Protocol Control register, and the data
  1990. * transfers are completed. (after valid data is written to the SD card and the busy signal
  1991. * released).
  1992. *
  1993. * Values:
  1994. * 0 - Transfer not complete
  1995. * 1 - Transfer complete
  1996. */
  1997. #define BP_USDHC_INT_STATUS_TC (1) //!< Bit position for USDHC_INT_STATUS_TC.
  1998. #define BM_USDHC_INT_STATUS_TC (0x00000002) //!< Bit mask for USDHC_INT_STATUS_TC.
  1999. //! @brief Get value of USDHC_INT_STATUS_TC from a register value.
  2000. #define BG_USDHC_INT_STATUS_TC(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_TC) >> BP_USDHC_INT_STATUS_TC)
  2001. //! @brief Format value for bitfield USDHC_INT_STATUS_TC.
  2002. #define BF_USDHC_INT_STATUS_TC(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_TC) & BM_USDHC_INT_STATUS_TC)
  2003. #ifndef __LANGUAGE_ASM__
  2004. //! @brief Set the TC field to a new value.
  2005. #define BW_USDHC_INT_STATUS_TC(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_TC) | BF_USDHC_INT_STATUS_TC(v)))
  2006. #endif
  2007. /* --- Register HW_USDHC_INT_STATUS, field BGE[2] (W1C)
  2008. *
  2009. * Block Gap Event: If the Stop At Block Gap Request bit in the Protocol Control register is set,
  2010. * this bit is set when a read or write transaction is stopped at a block gap. If Stop At Block Gap
  2011. * Request is not set to 1, this bit is not set to 1. In the case of a Read Transaction: This bit is
  2012. * set at the falling edge of the DAT Line Active Status (When the transaction is stopped at SD Bus
  2013. * timing). The Read Wait must be supported in order to use this function. In the case of Write
  2014. * Transaction: This bit is set at the falling edge of Write Transfer Active Status (After getting
  2015. * CRC status at SD Bus timing).
  2016. *
  2017. * Values:
  2018. * 0 - No block gap event
  2019. * 1 - Transaction stopped at block gap
  2020. */
  2021. #define BP_USDHC_INT_STATUS_BGE (2) //!< Bit position for USDHC_INT_STATUS_BGE.
  2022. #define BM_USDHC_INT_STATUS_BGE (0x00000004) //!< Bit mask for USDHC_INT_STATUS_BGE.
  2023. //! @brief Get value of USDHC_INT_STATUS_BGE from a register value.
  2024. #define BG_USDHC_INT_STATUS_BGE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_BGE) >> BP_USDHC_INT_STATUS_BGE)
  2025. //! @brief Format value for bitfield USDHC_INT_STATUS_BGE.
  2026. #define BF_USDHC_INT_STATUS_BGE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_BGE) & BM_USDHC_INT_STATUS_BGE)
  2027. #ifndef __LANGUAGE_ASM__
  2028. //! @brief Set the BGE field to a new value.
  2029. #define BW_USDHC_INT_STATUS_BGE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_BGE) | BF_USDHC_INT_STATUS_BGE(v)))
  2030. #endif
  2031. /* --- Register HW_USDHC_INT_STATUS, field DINT[3] (W1C)
  2032. *
  2033. * DMA Interrupt: Occurs only when the internal DMA finishes the data transfer successfully.
  2034. * Whenever errors occur during data transfer, this bit will not be set. Instead, the DMAE bit will
  2035. * be set. Either Simple DMA or ADMA finishes data transferring, this bit will be set.
  2036. *
  2037. * Values:
  2038. * 0 - No DMA Interrupt
  2039. * 1 - DMA Interrupt is generated
  2040. */
  2041. #define BP_USDHC_INT_STATUS_DINT (3) //!< Bit position for USDHC_INT_STATUS_DINT.
  2042. #define BM_USDHC_INT_STATUS_DINT (0x00000008) //!< Bit mask for USDHC_INT_STATUS_DINT.
  2043. //! @brief Get value of USDHC_INT_STATUS_DINT from a register value.
  2044. #define BG_USDHC_INT_STATUS_DINT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_DINT) >> BP_USDHC_INT_STATUS_DINT)
  2045. //! @brief Format value for bitfield USDHC_INT_STATUS_DINT.
  2046. #define BF_USDHC_INT_STATUS_DINT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_DINT) & BM_USDHC_INT_STATUS_DINT)
  2047. #ifndef __LANGUAGE_ASM__
  2048. //! @brief Set the DINT field to a new value.
  2049. #define BW_USDHC_INT_STATUS_DINT(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_DINT) | BF_USDHC_INT_STATUS_DINT(v)))
  2050. #endif
  2051. /* --- Register HW_USDHC_INT_STATUS, field BWR[4] (W1C)
  2052. *
  2053. * Buffer Write Ready: This status bit is set if the Buffer Write Enable bit, in the Present State
  2054. * register, changes from 0 to 1. Refer to the Buffer Write Enable bit in the Present State register
  2055. * for additional information.
  2056. *
  2057. * Values:
  2058. * 0 - Not ready to write buffer
  2059. * 1 - Ready to write buffer:
  2060. */
  2061. #define BP_USDHC_INT_STATUS_BWR (4) //!< Bit position for USDHC_INT_STATUS_BWR.
  2062. #define BM_USDHC_INT_STATUS_BWR (0x00000010) //!< Bit mask for USDHC_INT_STATUS_BWR.
  2063. //! @brief Get value of USDHC_INT_STATUS_BWR from a register value.
  2064. #define BG_USDHC_INT_STATUS_BWR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_BWR) >> BP_USDHC_INT_STATUS_BWR)
  2065. //! @brief Format value for bitfield USDHC_INT_STATUS_BWR.
  2066. #define BF_USDHC_INT_STATUS_BWR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_BWR) & BM_USDHC_INT_STATUS_BWR)
  2067. #ifndef __LANGUAGE_ASM__
  2068. //! @brief Set the BWR field to a new value.
  2069. #define BW_USDHC_INT_STATUS_BWR(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_BWR) | BF_USDHC_INT_STATUS_BWR(v)))
  2070. #endif
  2071. /* --- Register HW_USDHC_INT_STATUS, field BRR[5] (W1C)
  2072. *
  2073. * Buffer Read Ready: This status bit is set if the Buffer Read Enable bit, in the Present State
  2074. * register, changes from 0 to 1. Refer to the Buffer Read Enable bit in the Present State register
  2075. * for additional information.
  2076. *
  2077. * Values:
  2078. * 0 - Not ready to read buffer
  2079. * 1 - Ready to read buffer
  2080. */
  2081. #define BP_USDHC_INT_STATUS_BRR (5) //!< Bit position for USDHC_INT_STATUS_BRR.
  2082. #define BM_USDHC_INT_STATUS_BRR (0x00000020) //!< Bit mask for USDHC_INT_STATUS_BRR.
  2083. //! @brief Get value of USDHC_INT_STATUS_BRR from a register value.
  2084. #define BG_USDHC_INT_STATUS_BRR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_BRR) >> BP_USDHC_INT_STATUS_BRR)
  2085. //! @brief Format value for bitfield USDHC_INT_STATUS_BRR.
  2086. #define BF_USDHC_INT_STATUS_BRR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_BRR) & BM_USDHC_INT_STATUS_BRR)
  2087. #ifndef __LANGUAGE_ASM__
  2088. //! @brief Set the BRR field to a new value.
  2089. #define BW_USDHC_INT_STATUS_BRR(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_BRR) | BF_USDHC_INT_STATUS_BRR(v)))
  2090. #endif
  2091. /* --- Register HW_USDHC_INT_STATUS, field CINS[6] (W1C)
  2092. *
  2093. * Card Insertion: This status bit is set if the Card Inserted bit in the Present State register
  2094. * changes from 0 to 1. When the Host Driver writes this bit to 1 to clear this status, the status
  2095. * of the Card Inserted in the Present State register should be confirmed. Because the card state
  2096. * may possibly be changed when the Host Driver clears this bit and the interrupt event may not be
  2097. * generated. When this bit is cleared, it will be set again if a card is inserted. In order to
  2098. * leave it cleared, clear the Card Inserted Status Enable bit in Interrupt Status Enable register.
  2099. *
  2100. * Values:
  2101. * 0 - Card state unstable or removed
  2102. * 1 - Card inserted
  2103. */
  2104. #define BP_USDHC_INT_STATUS_CINS (6) //!< Bit position for USDHC_INT_STATUS_CINS.
  2105. #define BM_USDHC_INT_STATUS_CINS (0x00000040) //!< Bit mask for USDHC_INT_STATUS_CINS.
  2106. //! @brief Get value of USDHC_INT_STATUS_CINS from a register value.
  2107. #define BG_USDHC_INT_STATUS_CINS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CINS) >> BP_USDHC_INT_STATUS_CINS)
  2108. //! @brief Format value for bitfield USDHC_INT_STATUS_CINS.
  2109. #define BF_USDHC_INT_STATUS_CINS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CINS) & BM_USDHC_INT_STATUS_CINS)
  2110. #ifndef __LANGUAGE_ASM__
  2111. //! @brief Set the CINS field to a new value.
  2112. #define BW_USDHC_INT_STATUS_CINS(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CINS) | BF_USDHC_INT_STATUS_CINS(v)))
  2113. #endif
  2114. /* --- Register HW_USDHC_INT_STATUS, field CRM[7] (W1C)
  2115. *
  2116. * Card Removal: This status bit is set if the Card Inserted bit in the Present State register
  2117. * changes from 1 to 0. When the Host Driver writes this bit to 1 to clear this status, the status
  2118. * of the Card Inserted in the Present State register should be confirmed. Because the card state
  2119. * may possibly be changed when the Host Driver clears this bit and the interrupt event may not be
  2120. * generated. When this bit is cleared, it will be set again if no card is inserted. In order to
  2121. * leave it cleared, clear the Card Removal Status Enable bit in Interrupt Status Enable register.
  2122. *
  2123. * Values:
  2124. * 0 - Card state unstable or inserted
  2125. * 1 - Card removed
  2126. */
  2127. #define BP_USDHC_INT_STATUS_CRM (7) //!< Bit position for USDHC_INT_STATUS_CRM.
  2128. #define BM_USDHC_INT_STATUS_CRM (0x00000080) //!< Bit mask for USDHC_INT_STATUS_CRM.
  2129. //! @brief Get value of USDHC_INT_STATUS_CRM from a register value.
  2130. #define BG_USDHC_INT_STATUS_CRM(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CRM) >> BP_USDHC_INT_STATUS_CRM)
  2131. //! @brief Format value for bitfield USDHC_INT_STATUS_CRM.
  2132. #define BF_USDHC_INT_STATUS_CRM(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CRM) & BM_USDHC_INT_STATUS_CRM)
  2133. #ifndef __LANGUAGE_ASM__
  2134. //! @brief Set the CRM field to a new value.
  2135. #define BW_USDHC_INT_STATUS_CRM(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CRM) | BF_USDHC_INT_STATUS_CRM(v)))
  2136. #endif
  2137. /* --- Register HW_USDHC_INT_STATUS, field CINT[8] (W1C)
  2138. *
  2139. * Card Interrupt: This status bit is set when an interrupt signal is detected from the external
  2140. * card. In 1-bit mode, the uSDHC will detect the Card Interrupt without the SD Clock to support
  2141. * wakeup. In 4-bit mode, the card interrupt signal is sampled during the interrupt cycle, so the
  2142. * interrupt from card can only be sampled during interrupt cycle, introducing some delay between
  2143. * the interrupt signal from the SDIO card and the interrupt to the Host System. Writing this bit to
  2144. * 1 can clear this bit, but as the interrupt factor from the SDIO card does not clear, this bit is
  2145. * set again. In order to clear this bit, it is required to reset the interrupt factor from the
  2146. * external card followed by a writing 1 to this bit. When this status has been set, and the Host
  2147. * Driver needs to service this interrupt, the Card Interrupt Signal Enable in the Interrupt Signal
  2148. * Enable register should be 0 to stop driving the interrupt signal to the Host System. After
  2149. * completion of the card interrupt service (It should reset the interrupt factors in the SDIO card
  2150. * and the interrupt signal may not be asserted), write 1 to clear this bit, set the Card Interrupt
  2151. * Signal Enable to 1, and start sampling the interrupt signal again.
  2152. *
  2153. * Values:
  2154. * 0 - No Card Interrupt
  2155. * 1 - Generate Card Interrupt
  2156. */
  2157. #define BP_USDHC_INT_STATUS_CINT (8) //!< Bit position for USDHC_INT_STATUS_CINT.
  2158. #define BM_USDHC_INT_STATUS_CINT (0x00000100) //!< Bit mask for USDHC_INT_STATUS_CINT.
  2159. //! @brief Get value of USDHC_INT_STATUS_CINT from a register value.
  2160. #define BG_USDHC_INT_STATUS_CINT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CINT) >> BP_USDHC_INT_STATUS_CINT)
  2161. //! @brief Format value for bitfield USDHC_INT_STATUS_CINT.
  2162. #define BF_USDHC_INT_STATUS_CINT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CINT) & BM_USDHC_INT_STATUS_CINT)
  2163. #ifndef __LANGUAGE_ASM__
  2164. //! @brief Set the CINT field to a new value.
  2165. #define BW_USDHC_INT_STATUS_CINT(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CINT) | BF_USDHC_INT_STATUS_CINT(v)))
  2166. #endif
  2167. /* --- Register HW_USDHC_INT_STATUS, field RTE[12] (W1C)
  2168. *
  2169. * Re-Tuning Event: (only for SD3.0 SDR104 mode) This status is set if Re-Tuning Request in the
  2170. * Present State register changes from 0 to 1. Host Controller requests Host Driver to perform re-
  2171. * tuning for next data transfer. Current data transfer (not large block count) can be completed
  2172. * without re-tuning.
  2173. *
  2174. * Values:
  2175. * 0 - Re-Tuning is not required
  2176. * 1 - Re-Tuning should be performed
  2177. */
  2178. #define BP_USDHC_INT_STATUS_RTE (12) //!< Bit position for USDHC_INT_STATUS_RTE.
  2179. #define BM_USDHC_INT_STATUS_RTE (0x00001000) //!< Bit mask for USDHC_INT_STATUS_RTE.
  2180. //! @brief Get value of USDHC_INT_STATUS_RTE from a register value.
  2181. #define BG_USDHC_INT_STATUS_RTE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_RTE) >> BP_USDHC_INT_STATUS_RTE)
  2182. //! @brief Format value for bitfield USDHC_INT_STATUS_RTE.
  2183. #define BF_USDHC_INT_STATUS_RTE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_RTE) & BM_USDHC_INT_STATUS_RTE)
  2184. #ifndef __LANGUAGE_ASM__
  2185. //! @brief Set the RTE field to a new value.
  2186. #define BW_USDHC_INT_STATUS_RTE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_RTE) | BF_USDHC_INT_STATUS_RTE(v)))
  2187. #endif
  2188. /* --- Register HW_USDHC_INT_STATUS, field TP[14] (W1C)
  2189. *
  2190. * Tuning Pass:(only for SD3.0 SDR104 mode) Current CMD19 transfer is done successfully. That is,
  2191. * current sampling point is correct.
  2192. */
  2193. #define BP_USDHC_INT_STATUS_TP (14) //!< Bit position for USDHC_INT_STATUS_TP.
  2194. #define BM_USDHC_INT_STATUS_TP (0x00004000) //!< Bit mask for USDHC_INT_STATUS_TP.
  2195. //! @brief Get value of USDHC_INT_STATUS_TP from a register value.
  2196. #define BG_USDHC_INT_STATUS_TP(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_TP) >> BP_USDHC_INT_STATUS_TP)
  2197. //! @brief Format value for bitfield USDHC_INT_STATUS_TP.
  2198. #define BF_USDHC_INT_STATUS_TP(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_TP) & BM_USDHC_INT_STATUS_TP)
  2199. #ifndef __LANGUAGE_ASM__
  2200. //! @brief Set the TP field to a new value.
  2201. #define BW_USDHC_INT_STATUS_TP(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_TP) | BF_USDHC_INT_STATUS_TP(v)))
  2202. #endif
  2203. /* --- Register HW_USDHC_INT_STATUS, field CTOE[16] (W1C)
  2204. *
  2205. * Command Timeout Error: Occurs only if no response is returned within 64 SDCLK cycles from the end
  2206. * bit of the command. If the uSDHC detects a CMD line conflict, in which case a Command CRC Error
  2207. * shall also be set (as shown in ), this bit shall be set without waiting for 64 SDCLK cycles. This
  2208. * is because the command will be aborted by the uSDHC.
  2209. *
  2210. * Values:
  2211. * 0 - No Error
  2212. * 1 - Time out
  2213. */
  2214. #define BP_USDHC_INT_STATUS_CTOE (16) //!< Bit position for USDHC_INT_STATUS_CTOE.
  2215. #define BM_USDHC_INT_STATUS_CTOE (0x00010000) //!< Bit mask for USDHC_INT_STATUS_CTOE.
  2216. //! @brief Get value of USDHC_INT_STATUS_CTOE from a register value.
  2217. #define BG_USDHC_INT_STATUS_CTOE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CTOE) >> BP_USDHC_INT_STATUS_CTOE)
  2218. //! @brief Format value for bitfield USDHC_INT_STATUS_CTOE.
  2219. #define BF_USDHC_INT_STATUS_CTOE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CTOE) & BM_USDHC_INT_STATUS_CTOE)
  2220. #ifndef __LANGUAGE_ASM__
  2221. //! @brief Set the CTOE field to a new value.
  2222. #define BW_USDHC_INT_STATUS_CTOE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CTOE) | BF_USDHC_INT_STATUS_CTOE(v)))
  2223. #endif
  2224. /* --- Register HW_USDHC_INT_STATUS, field CCE[17] (W1C)
  2225. *
  2226. * Command CRC Error: Command CRC Error is generated in two cases. If a response is returned and the
  2227. * Command Timeout Error is set to 0 (indicating no time-out), this bit is set when detecting a CRC
  2228. * error in the command response. The uSDHC detects a CMD line conflict by monitoring the CMD line
  2229. * when a command is issued. If the uSDHC drives the CMD line to 1, but detects 0 on the CMD line at
  2230. * the next SDCLK edge, then the uSDHC shall abort the command (Stop driving CMD line) and set this
  2231. * bit to 1. The Command Timeout Error shall also be set to 1 to distinguish CMD line conflict.
  2232. *
  2233. * Values:
  2234. * 0 - No Error
  2235. * 1 - CRC Error Generated.
  2236. */
  2237. #define BP_USDHC_INT_STATUS_CCE (17) //!< Bit position for USDHC_INT_STATUS_CCE.
  2238. #define BM_USDHC_INT_STATUS_CCE (0x00020000) //!< Bit mask for USDHC_INT_STATUS_CCE.
  2239. //! @brief Get value of USDHC_INT_STATUS_CCE from a register value.
  2240. #define BG_USDHC_INT_STATUS_CCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CCE) >> BP_USDHC_INT_STATUS_CCE)
  2241. //! @brief Format value for bitfield USDHC_INT_STATUS_CCE.
  2242. #define BF_USDHC_INT_STATUS_CCE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CCE) & BM_USDHC_INT_STATUS_CCE)
  2243. #ifndef __LANGUAGE_ASM__
  2244. //! @brief Set the CCE field to a new value.
  2245. #define BW_USDHC_INT_STATUS_CCE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CCE) | BF_USDHC_INT_STATUS_CCE(v)))
  2246. #endif
  2247. /* --- Register HW_USDHC_INT_STATUS, field CEBE[18] (W1C)
  2248. *
  2249. * Command End Bit Error: Occurs when detecting that the end bit of a command response is 0.
  2250. *
  2251. * Values:
  2252. * 0 - No Error
  2253. * 1 - End Bit Error Generated
  2254. */
  2255. #define BP_USDHC_INT_STATUS_CEBE (18) //!< Bit position for USDHC_INT_STATUS_CEBE.
  2256. #define BM_USDHC_INT_STATUS_CEBE (0x00040000) //!< Bit mask for USDHC_INT_STATUS_CEBE.
  2257. //! @brief Get value of USDHC_INT_STATUS_CEBE from a register value.
  2258. #define BG_USDHC_INT_STATUS_CEBE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CEBE) >> BP_USDHC_INT_STATUS_CEBE)
  2259. //! @brief Format value for bitfield USDHC_INT_STATUS_CEBE.
  2260. #define BF_USDHC_INT_STATUS_CEBE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CEBE) & BM_USDHC_INT_STATUS_CEBE)
  2261. #ifndef __LANGUAGE_ASM__
  2262. //! @brief Set the CEBE field to a new value.
  2263. #define BW_USDHC_INT_STATUS_CEBE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CEBE) | BF_USDHC_INT_STATUS_CEBE(v)))
  2264. #endif
  2265. /* --- Register HW_USDHC_INT_STATUS, field CIE[19] (W1C)
  2266. *
  2267. * Command Index Error: Occurs if a Command Index error occurs in the command response.
  2268. *
  2269. * Values:
  2270. * 0 - No Error
  2271. * 1 - Error
  2272. */
  2273. #define BP_USDHC_INT_STATUS_CIE (19) //!< Bit position for USDHC_INT_STATUS_CIE.
  2274. #define BM_USDHC_INT_STATUS_CIE (0x00080000) //!< Bit mask for USDHC_INT_STATUS_CIE.
  2275. //! @brief Get value of USDHC_INT_STATUS_CIE from a register value.
  2276. #define BG_USDHC_INT_STATUS_CIE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_CIE) >> BP_USDHC_INT_STATUS_CIE)
  2277. //! @brief Format value for bitfield USDHC_INT_STATUS_CIE.
  2278. #define BF_USDHC_INT_STATUS_CIE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_CIE) & BM_USDHC_INT_STATUS_CIE)
  2279. #ifndef __LANGUAGE_ASM__
  2280. //! @brief Set the CIE field to a new value.
  2281. #define BW_USDHC_INT_STATUS_CIE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_CIE) | BF_USDHC_INT_STATUS_CIE(v)))
  2282. #endif
  2283. /* --- Register HW_USDHC_INT_STATUS, field DTOE[20] (W1C)
  2284. *
  2285. * Data Timeout Error: Occurs when detecting one of following time-out conditions. Busy time-out for
  2286. * R1b,R5b type Busy time-out after Write CRC status Read Data time-out.
  2287. *
  2288. * Values:
  2289. * 0 - No Error
  2290. * 1 - Time out
  2291. */
  2292. #define BP_USDHC_INT_STATUS_DTOE (20) //!< Bit position for USDHC_INT_STATUS_DTOE.
  2293. #define BM_USDHC_INT_STATUS_DTOE (0x00100000) //!< Bit mask for USDHC_INT_STATUS_DTOE.
  2294. //! @brief Get value of USDHC_INT_STATUS_DTOE from a register value.
  2295. #define BG_USDHC_INT_STATUS_DTOE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_DTOE) >> BP_USDHC_INT_STATUS_DTOE)
  2296. //! @brief Format value for bitfield USDHC_INT_STATUS_DTOE.
  2297. #define BF_USDHC_INT_STATUS_DTOE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_DTOE) & BM_USDHC_INT_STATUS_DTOE)
  2298. #ifndef __LANGUAGE_ASM__
  2299. //! @brief Set the DTOE field to a new value.
  2300. #define BW_USDHC_INT_STATUS_DTOE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_DTOE) | BF_USDHC_INT_STATUS_DTOE(v)))
  2301. #endif
  2302. /* --- Register HW_USDHC_INT_STATUS, field DCE[21] (W1C)
  2303. *
  2304. * Data CRC Error: Occurs when detecting a CRC error when transferring read data, which uses the DAT
  2305. * line, or when detecting the Write CRC status having a value other than 010.
  2306. *
  2307. * Values:
  2308. * 0 - No Error
  2309. * 1 - Error
  2310. */
  2311. #define BP_USDHC_INT_STATUS_DCE (21) //!< Bit position for USDHC_INT_STATUS_DCE.
  2312. #define BM_USDHC_INT_STATUS_DCE (0x00200000) //!< Bit mask for USDHC_INT_STATUS_DCE.
  2313. //! @brief Get value of USDHC_INT_STATUS_DCE from a register value.
  2314. #define BG_USDHC_INT_STATUS_DCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_DCE) >> BP_USDHC_INT_STATUS_DCE)
  2315. //! @brief Format value for bitfield USDHC_INT_STATUS_DCE.
  2316. #define BF_USDHC_INT_STATUS_DCE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_DCE) & BM_USDHC_INT_STATUS_DCE)
  2317. #ifndef __LANGUAGE_ASM__
  2318. //! @brief Set the DCE field to a new value.
  2319. #define BW_USDHC_INT_STATUS_DCE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_DCE) | BF_USDHC_INT_STATUS_DCE(v)))
  2320. #endif
  2321. /* --- Register HW_USDHC_INT_STATUS, field DEBE[22] (W1C)
  2322. *
  2323. * Data End Bit Error: Occurs either when detecting 0 at the end bit position of read data, which
  2324. * uses the DAT line, or at the end bit position of the CRC.
  2325. *
  2326. * Values:
  2327. * 0 - No Error
  2328. * 1 - Error
  2329. */
  2330. #define BP_USDHC_INT_STATUS_DEBE (22) //!< Bit position for USDHC_INT_STATUS_DEBE.
  2331. #define BM_USDHC_INT_STATUS_DEBE (0x00400000) //!< Bit mask for USDHC_INT_STATUS_DEBE.
  2332. //! @brief Get value of USDHC_INT_STATUS_DEBE from a register value.
  2333. #define BG_USDHC_INT_STATUS_DEBE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_DEBE) >> BP_USDHC_INT_STATUS_DEBE)
  2334. //! @brief Format value for bitfield USDHC_INT_STATUS_DEBE.
  2335. #define BF_USDHC_INT_STATUS_DEBE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_DEBE) & BM_USDHC_INT_STATUS_DEBE)
  2336. #ifndef __LANGUAGE_ASM__
  2337. //! @brief Set the DEBE field to a new value.
  2338. #define BW_USDHC_INT_STATUS_DEBE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_DEBE) | BF_USDHC_INT_STATUS_DEBE(v)))
  2339. #endif
  2340. /* --- Register HW_USDHC_INT_STATUS, field AC12E[24] (W1C)
  2341. *
  2342. * Auto CMD12 Error: Occurs when detecting that one of the bits in the Auto CMD12 Error Status
  2343. * register has changed from 0 to 1. This bit is set to 1, not only when the errors in Auto CMD12
  2344. * occur, but also when the Auto CMD12 is not executed due to the previous command error.
  2345. *
  2346. * Values:
  2347. * 0 - No Error
  2348. * 1 - Error
  2349. */
  2350. #define BP_USDHC_INT_STATUS_AC12E (24) //!< Bit position for USDHC_INT_STATUS_AC12E.
  2351. #define BM_USDHC_INT_STATUS_AC12E (0x01000000) //!< Bit mask for USDHC_INT_STATUS_AC12E.
  2352. //! @brief Get value of USDHC_INT_STATUS_AC12E from a register value.
  2353. #define BG_USDHC_INT_STATUS_AC12E(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_AC12E) >> BP_USDHC_INT_STATUS_AC12E)
  2354. //! @brief Format value for bitfield USDHC_INT_STATUS_AC12E.
  2355. #define BF_USDHC_INT_STATUS_AC12E(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_AC12E) & BM_USDHC_INT_STATUS_AC12E)
  2356. #ifndef __LANGUAGE_ASM__
  2357. //! @brief Set the AC12E field to a new value.
  2358. #define BW_USDHC_INT_STATUS_AC12E(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_AC12E) | BF_USDHC_INT_STATUS_AC12E(v)))
  2359. #endif
  2360. /* --- Register HW_USDHC_INT_STATUS, field TNE[26] (W1C)
  2361. *
  2362. * Tuning Error: (only for SD3.0 SDR104 mode) This bit is set when an unrecoverable error is
  2363. * detected in a tuning circuit. By detecting Tuning Error, Host Driver needs to abort a command
  2364. * executeing and perform tuning.
  2365. */
  2366. #define BP_USDHC_INT_STATUS_TNE (26) //!< Bit position for USDHC_INT_STATUS_TNE.
  2367. #define BM_USDHC_INT_STATUS_TNE (0x04000000) //!< Bit mask for USDHC_INT_STATUS_TNE.
  2368. //! @brief Get value of USDHC_INT_STATUS_TNE from a register value.
  2369. #define BG_USDHC_INT_STATUS_TNE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_TNE) >> BP_USDHC_INT_STATUS_TNE)
  2370. //! @brief Format value for bitfield USDHC_INT_STATUS_TNE.
  2371. #define BF_USDHC_INT_STATUS_TNE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_TNE) & BM_USDHC_INT_STATUS_TNE)
  2372. #ifndef __LANGUAGE_ASM__
  2373. //! @brief Set the TNE field to a new value.
  2374. #define BW_USDHC_INT_STATUS_TNE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_TNE) | BF_USDHC_INT_STATUS_TNE(v)))
  2375. #endif
  2376. /* --- Register HW_USDHC_INT_STATUS, field DMAE[28] (W1C)
  2377. *
  2378. * DMA Error: Occurs when an Internal DMA transfer has failed. This bit is set to 1, when some error
  2379. * occurs in the data transfer. This error can be caused by either Simple DMA or ADMA, depending on
  2380. * which DMA is in use. The value in DMA System Address register is the next fetch address where the
  2381. * error occurs. Since any error corrupts the whole data block, the Host Driver shall re-start the
  2382. * transfer from the corrupted block boundary. The address of the block boundary can be calculated
  2383. * either from the current DS_ADDR value or from the remaining number of blocks and the block size.
  2384. *
  2385. * Values:
  2386. * 0 - No Error
  2387. * 1 - Error
  2388. */
  2389. #define BP_USDHC_INT_STATUS_DMAE (28) //!< Bit position for USDHC_INT_STATUS_DMAE.
  2390. #define BM_USDHC_INT_STATUS_DMAE (0x10000000) //!< Bit mask for USDHC_INT_STATUS_DMAE.
  2391. //! @brief Get value of USDHC_INT_STATUS_DMAE from a register value.
  2392. #define BG_USDHC_INT_STATUS_DMAE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_DMAE) >> BP_USDHC_INT_STATUS_DMAE)
  2393. //! @brief Format value for bitfield USDHC_INT_STATUS_DMAE.
  2394. #define BF_USDHC_INT_STATUS_DMAE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_DMAE) & BM_USDHC_INT_STATUS_DMAE)
  2395. #ifndef __LANGUAGE_ASM__
  2396. //! @brief Set the DMAE field to a new value.
  2397. #define BW_USDHC_INT_STATUS_DMAE(x, v) (HW_USDHC_INT_STATUS_WR(x, (HW_USDHC_INT_STATUS_RD(x) & ~BM_USDHC_INT_STATUS_DMAE) | BF_USDHC_INT_STATUS_DMAE(v)))
  2398. #endif
  2399. //-------------------------------------------------------------------------------------------
  2400. // HW_USDHC_INT_STATUS_EN - Interrupt Status Enable
  2401. //-------------------------------------------------------------------------------------------
  2402. #ifndef __LANGUAGE_ASM__
  2403. /*!
  2404. * @brief HW_USDHC_INT_STATUS_EN - Interrupt Status Enable (RW)
  2405. *
  2406. * Reset value: 0x157f413f
  2407. *
  2408. * Setting the bits in this register to 1 enables the corresponding Interrupt Status to be set by
  2409. * the specified event. If any bit is cleared, the corresponding Interrupt Status bit is also
  2410. * cleared (i.e. when the bit in this register is cleared, the corresponding bit in Interrupt Status
  2411. * Register is always 0). Depending on IABG bit setting, uSDHC may be programmed to sample the
  2412. * card interrupt signal during the interrupt period and hold its value in the flip-flop. There will
  2413. * be some delays on the Card Interrupt, asserted from the card, to the time the Host System is
  2414. * informed. To detect a CMD line conflict, the Host Driver must set both Command Timeout Error
  2415. * Status Enable and Command CRC Error Status Enable to 1.
  2416. */
  2417. typedef union _hw_usdhc_int_status_en
  2418. {
  2419. reg32_t U;
  2420. struct _hw_usdhc_int_status_en_bitfields
  2421. {
  2422. unsigned CCSEN : 1; //!< [0] Command Complete Status Enable: 1 Enabled 0 Masked
  2423. unsigned TCSEN : 1; //!< [1] Transfer Complete Status Enable:
  2424. unsigned BGESEN : 1; //!< [2] Block Gap Event Status Enable:
  2425. unsigned DINTSEN : 1; //!< [3] DMA Interrupt Status Enable:
  2426. unsigned BWRSEN : 1; //!< [4] Buffer Write Ready Status Enable:
  2427. unsigned BRRSEN : 1; //!< [5] Buffer Read Ready Status Enable:
  2428. unsigned CINSSEN : 1; //!< [6] Card Insertion Status Enable:
  2429. unsigned CRMSEN : 1; //!< [7] Card Removal Status Enable:
  2430. unsigned CINTSEN : 1; //!< [8] Card Interrupt Status Enable: If this bit is set to 0, the uSDHC will clear the interrupt request to the System.
  2431. unsigned RESERVED0 : 3; //!< [11:9] Reserved
  2432. unsigned RTESEN : 1; //!< [12] Re-Tuning Event Status Enable
  2433. unsigned RESERVED1 : 1; //!< [13] Reserved
  2434. unsigned TPSEN : 1; //!< [14] Tuning Pass Status Enable
  2435. unsigned RESERVED2 : 1; //!< [15] Reserved
  2436. unsigned CTOESEN : 1; //!< [16] Command Timeout Error Status Enable:
  2437. unsigned CCESEN : 1; //!< [17] Command CRC Error Status Enable:
  2438. unsigned CEBESEN : 1; //!< [18] Command End Bit Error Status Enable:
  2439. unsigned CIESEN : 1; //!< [19] Command Index Error Status Enable:
  2440. unsigned DTOESEN : 1; //!< [20] Data Timeout Error Status Enable:
  2441. unsigned DCESEN : 1; //!< [21] Data CRC Error Status Enable:
  2442. unsigned DEBESEN : 1; //!< [22] Data End Bit Error Status Enable:
  2443. unsigned RESERVED3 : 1; //!< [23] Reserved
  2444. unsigned AC12ESEN : 1; //!< [24] Auto CMD12 Error Status Enable:
  2445. unsigned RESERVED4 : 1; //!< [25] Reserved
  2446. unsigned TNESEN : 1; //!< [26] Tuning Error Status Enable:
  2447. unsigned RESERVED5 : 1; //!< [27] Reserved
  2448. unsigned DMAESEN : 1; //!< [28] DMA Error Status Enable:
  2449. unsigned RESERVED6 : 3; //!< [31:29] Reserved
  2450. } B;
  2451. } hw_usdhc_int_status_en_t;
  2452. #endif
  2453. /*
  2454. * constants & macros for entire multi-block USDHC_INT_STATUS_EN register
  2455. */
  2456. #define HW_USDHC_INT_STATUS_EN_ADDR(x) (REGS_USDHC_BASE(x) + 0x34)
  2457. #ifndef __LANGUAGE_ASM__
  2458. #define HW_USDHC_INT_STATUS_EN(x) (*(volatile hw_usdhc_int_status_en_t *) HW_USDHC_INT_STATUS_EN_ADDR(x))
  2459. #define HW_USDHC_INT_STATUS_EN_RD(x) (HW_USDHC_INT_STATUS_EN(x).U)
  2460. #define HW_USDHC_INT_STATUS_EN_WR(x, v) (HW_USDHC_INT_STATUS_EN(x).U = (v))
  2461. #define HW_USDHC_INT_STATUS_EN_SET(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, HW_USDHC_INT_STATUS_EN_RD(x) | (v)))
  2462. #define HW_USDHC_INT_STATUS_EN_CLR(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, HW_USDHC_INT_STATUS_EN_RD(x) & ~(v)))
  2463. #define HW_USDHC_INT_STATUS_EN_TOG(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, HW_USDHC_INT_STATUS_EN_RD(x) ^ (v)))
  2464. #endif
  2465. /*
  2466. * constants & macros for individual USDHC_INT_STATUS_EN bitfields
  2467. */
  2468. /* --- Register HW_USDHC_INT_STATUS_EN, field CCSEN[0] (RW)
  2469. *
  2470. * Command Complete Status Enable: 1 Enabled 0 Masked
  2471. */
  2472. #define BP_USDHC_INT_STATUS_EN_CCSEN (0) //!< Bit position for USDHC_INT_STATUS_EN_CCSEN.
  2473. #define BM_USDHC_INT_STATUS_EN_CCSEN (0x00000001) //!< Bit mask for USDHC_INT_STATUS_EN_CCSEN.
  2474. //! @brief Get value of USDHC_INT_STATUS_EN_CCSEN from a register value.
  2475. #define BG_USDHC_INT_STATUS_EN_CCSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CCSEN) >> BP_USDHC_INT_STATUS_EN_CCSEN)
  2476. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CCSEN.
  2477. #define BF_USDHC_INT_STATUS_EN_CCSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CCSEN) & BM_USDHC_INT_STATUS_EN_CCSEN)
  2478. #ifndef __LANGUAGE_ASM__
  2479. //! @brief Set the CCSEN field to a new value.
  2480. #define BW_USDHC_INT_STATUS_EN_CCSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CCSEN) | BF_USDHC_INT_STATUS_EN_CCSEN(v)))
  2481. #endif
  2482. /* --- Register HW_USDHC_INT_STATUS_EN, field TCSEN[1] (RW)
  2483. *
  2484. * Transfer Complete Status Enable:
  2485. *
  2486. * Values:
  2487. * 0 - Masked
  2488. * 1 - Enabled
  2489. */
  2490. #define BP_USDHC_INT_STATUS_EN_TCSEN (1) //!< Bit position for USDHC_INT_STATUS_EN_TCSEN.
  2491. #define BM_USDHC_INT_STATUS_EN_TCSEN (0x00000002) //!< Bit mask for USDHC_INT_STATUS_EN_TCSEN.
  2492. //! @brief Get value of USDHC_INT_STATUS_EN_TCSEN from a register value.
  2493. #define BG_USDHC_INT_STATUS_EN_TCSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_TCSEN) >> BP_USDHC_INT_STATUS_EN_TCSEN)
  2494. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_TCSEN.
  2495. #define BF_USDHC_INT_STATUS_EN_TCSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_TCSEN) & BM_USDHC_INT_STATUS_EN_TCSEN)
  2496. #ifndef __LANGUAGE_ASM__
  2497. //! @brief Set the TCSEN field to a new value.
  2498. #define BW_USDHC_INT_STATUS_EN_TCSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_TCSEN) | BF_USDHC_INT_STATUS_EN_TCSEN(v)))
  2499. #endif
  2500. /* --- Register HW_USDHC_INT_STATUS_EN, field BGESEN[2] (RW)
  2501. *
  2502. * Block Gap Event Status Enable:
  2503. *
  2504. * Values:
  2505. * 0 - Masked
  2506. * 1 - Enabled
  2507. */
  2508. #define BP_USDHC_INT_STATUS_EN_BGESEN (2) //!< Bit position for USDHC_INT_STATUS_EN_BGESEN.
  2509. #define BM_USDHC_INT_STATUS_EN_BGESEN (0x00000004) //!< Bit mask for USDHC_INT_STATUS_EN_BGESEN.
  2510. //! @brief Get value of USDHC_INT_STATUS_EN_BGESEN from a register value.
  2511. #define BG_USDHC_INT_STATUS_EN_BGESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_BGESEN) >> BP_USDHC_INT_STATUS_EN_BGESEN)
  2512. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_BGESEN.
  2513. #define BF_USDHC_INT_STATUS_EN_BGESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_BGESEN) & BM_USDHC_INT_STATUS_EN_BGESEN)
  2514. #ifndef __LANGUAGE_ASM__
  2515. //! @brief Set the BGESEN field to a new value.
  2516. #define BW_USDHC_INT_STATUS_EN_BGESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_BGESEN) | BF_USDHC_INT_STATUS_EN_BGESEN(v)))
  2517. #endif
  2518. /* --- Register HW_USDHC_INT_STATUS_EN, field DINTSEN[3] (RW)
  2519. *
  2520. * DMA Interrupt Status Enable:
  2521. *
  2522. * Values:
  2523. * 0 - Masked
  2524. * 1 - Enabled
  2525. */
  2526. #define BP_USDHC_INT_STATUS_EN_DINTSEN (3) //!< Bit position for USDHC_INT_STATUS_EN_DINTSEN.
  2527. #define BM_USDHC_INT_STATUS_EN_DINTSEN (0x00000008) //!< Bit mask for USDHC_INT_STATUS_EN_DINTSEN.
  2528. //! @brief Get value of USDHC_INT_STATUS_EN_DINTSEN from a register value.
  2529. #define BG_USDHC_INT_STATUS_EN_DINTSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_DINTSEN) >> BP_USDHC_INT_STATUS_EN_DINTSEN)
  2530. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_DINTSEN.
  2531. #define BF_USDHC_INT_STATUS_EN_DINTSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_DINTSEN) & BM_USDHC_INT_STATUS_EN_DINTSEN)
  2532. #ifndef __LANGUAGE_ASM__
  2533. //! @brief Set the DINTSEN field to a new value.
  2534. #define BW_USDHC_INT_STATUS_EN_DINTSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_DINTSEN) | BF_USDHC_INT_STATUS_EN_DINTSEN(v)))
  2535. #endif
  2536. /* --- Register HW_USDHC_INT_STATUS_EN, field BWRSEN[4] (RW)
  2537. *
  2538. * Buffer Write Ready Status Enable:
  2539. *
  2540. * Values:
  2541. * 0 - Masked
  2542. * 1 - Enabled
  2543. */
  2544. #define BP_USDHC_INT_STATUS_EN_BWRSEN (4) //!< Bit position for USDHC_INT_STATUS_EN_BWRSEN.
  2545. #define BM_USDHC_INT_STATUS_EN_BWRSEN (0x00000010) //!< Bit mask for USDHC_INT_STATUS_EN_BWRSEN.
  2546. //! @brief Get value of USDHC_INT_STATUS_EN_BWRSEN from a register value.
  2547. #define BG_USDHC_INT_STATUS_EN_BWRSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_BWRSEN) >> BP_USDHC_INT_STATUS_EN_BWRSEN)
  2548. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_BWRSEN.
  2549. #define BF_USDHC_INT_STATUS_EN_BWRSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_BWRSEN) & BM_USDHC_INT_STATUS_EN_BWRSEN)
  2550. #ifndef __LANGUAGE_ASM__
  2551. //! @brief Set the BWRSEN field to a new value.
  2552. #define BW_USDHC_INT_STATUS_EN_BWRSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_BWRSEN) | BF_USDHC_INT_STATUS_EN_BWRSEN(v)))
  2553. #endif
  2554. /* --- Register HW_USDHC_INT_STATUS_EN, field BRRSEN[5] (RW)
  2555. *
  2556. * Buffer Read Ready Status Enable:
  2557. *
  2558. * Values:
  2559. * 0 - Masked
  2560. * 1 - Enabled
  2561. */
  2562. #define BP_USDHC_INT_STATUS_EN_BRRSEN (5) //!< Bit position for USDHC_INT_STATUS_EN_BRRSEN.
  2563. #define BM_USDHC_INT_STATUS_EN_BRRSEN (0x00000020) //!< Bit mask for USDHC_INT_STATUS_EN_BRRSEN.
  2564. //! @brief Get value of USDHC_INT_STATUS_EN_BRRSEN from a register value.
  2565. #define BG_USDHC_INT_STATUS_EN_BRRSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_BRRSEN) >> BP_USDHC_INT_STATUS_EN_BRRSEN)
  2566. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_BRRSEN.
  2567. #define BF_USDHC_INT_STATUS_EN_BRRSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_BRRSEN) & BM_USDHC_INT_STATUS_EN_BRRSEN)
  2568. #ifndef __LANGUAGE_ASM__
  2569. //! @brief Set the BRRSEN field to a new value.
  2570. #define BW_USDHC_INT_STATUS_EN_BRRSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_BRRSEN) | BF_USDHC_INT_STATUS_EN_BRRSEN(v)))
  2571. #endif
  2572. /* --- Register HW_USDHC_INT_STATUS_EN, field CINSSEN[6] (RW)
  2573. *
  2574. * Card Insertion Status Enable:
  2575. *
  2576. * Values:
  2577. * 0 - Masked
  2578. * 1 - Enabled
  2579. */
  2580. #define BP_USDHC_INT_STATUS_EN_CINSSEN (6) //!< Bit position for USDHC_INT_STATUS_EN_CINSSEN.
  2581. #define BM_USDHC_INT_STATUS_EN_CINSSEN (0x00000040) //!< Bit mask for USDHC_INT_STATUS_EN_CINSSEN.
  2582. //! @brief Get value of USDHC_INT_STATUS_EN_CINSSEN from a register value.
  2583. #define BG_USDHC_INT_STATUS_EN_CINSSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CINSSEN) >> BP_USDHC_INT_STATUS_EN_CINSSEN)
  2584. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CINSSEN.
  2585. #define BF_USDHC_INT_STATUS_EN_CINSSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CINSSEN) & BM_USDHC_INT_STATUS_EN_CINSSEN)
  2586. #ifndef __LANGUAGE_ASM__
  2587. //! @brief Set the CINSSEN field to a new value.
  2588. #define BW_USDHC_INT_STATUS_EN_CINSSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CINSSEN) | BF_USDHC_INT_STATUS_EN_CINSSEN(v)))
  2589. #endif
  2590. /* --- Register HW_USDHC_INT_STATUS_EN, field CRMSEN[7] (RW)
  2591. *
  2592. * Card Removal Status Enable:
  2593. *
  2594. * Values:
  2595. * 0 - Masked
  2596. * 1 - Enabled
  2597. */
  2598. #define BP_USDHC_INT_STATUS_EN_CRMSEN (7) //!< Bit position for USDHC_INT_STATUS_EN_CRMSEN.
  2599. #define BM_USDHC_INT_STATUS_EN_CRMSEN (0x00000080) //!< Bit mask for USDHC_INT_STATUS_EN_CRMSEN.
  2600. //! @brief Get value of USDHC_INT_STATUS_EN_CRMSEN from a register value.
  2601. #define BG_USDHC_INT_STATUS_EN_CRMSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CRMSEN) >> BP_USDHC_INT_STATUS_EN_CRMSEN)
  2602. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CRMSEN.
  2603. #define BF_USDHC_INT_STATUS_EN_CRMSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CRMSEN) & BM_USDHC_INT_STATUS_EN_CRMSEN)
  2604. #ifndef __LANGUAGE_ASM__
  2605. //! @brief Set the CRMSEN field to a new value.
  2606. #define BW_USDHC_INT_STATUS_EN_CRMSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CRMSEN) | BF_USDHC_INT_STATUS_EN_CRMSEN(v)))
  2607. #endif
  2608. /* --- Register HW_USDHC_INT_STATUS_EN, field CINTSEN[8] (RW)
  2609. *
  2610. * Card Interrupt Status Enable: If this bit is set to 0, the uSDHC will clear the interrupt request
  2611. * to the System. The Card Interrupt detection is stopped when this bit is cleared and restarted
  2612. * when this bit is set to 1. The Host Driver should clear the Card Interrupt Status Enable before
  2613. * servicing the Card Interrupt and should set this bit again after all interrupt requests from the
  2614. * card are cleared to prevent inadvertent interrupts.
  2615. *
  2616. * Values:
  2617. * 0 - Masked
  2618. * 1 - Enabled
  2619. */
  2620. #define BP_USDHC_INT_STATUS_EN_CINTSEN (8) //!< Bit position for USDHC_INT_STATUS_EN_CINTSEN.
  2621. #define BM_USDHC_INT_STATUS_EN_CINTSEN (0x00000100) //!< Bit mask for USDHC_INT_STATUS_EN_CINTSEN.
  2622. //! @brief Get value of USDHC_INT_STATUS_EN_CINTSEN from a register value.
  2623. #define BG_USDHC_INT_STATUS_EN_CINTSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CINTSEN) >> BP_USDHC_INT_STATUS_EN_CINTSEN)
  2624. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CINTSEN.
  2625. #define BF_USDHC_INT_STATUS_EN_CINTSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CINTSEN) & BM_USDHC_INT_STATUS_EN_CINTSEN)
  2626. #ifndef __LANGUAGE_ASM__
  2627. //! @brief Set the CINTSEN field to a new value.
  2628. #define BW_USDHC_INT_STATUS_EN_CINTSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CINTSEN) | BF_USDHC_INT_STATUS_EN_CINTSEN(v)))
  2629. #endif
  2630. /* --- Register HW_USDHC_INT_STATUS_EN, field RTESEN[12] (RW)
  2631. *
  2632. * Re-Tuning Event Status Enable
  2633. *
  2634. * Values:
  2635. * 0 - Masked
  2636. * 1 - Enabled
  2637. */
  2638. #define BP_USDHC_INT_STATUS_EN_RTESEN (12) //!< Bit position for USDHC_INT_STATUS_EN_RTESEN.
  2639. #define BM_USDHC_INT_STATUS_EN_RTESEN (0x00001000) //!< Bit mask for USDHC_INT_STATUS_EN_RTESEN.
  2640. //! @brief Get value of USDHC_INT_STATUS_EN_RTESEN from a register value.
  2641. #define BG_USDHC_INT_STATUS_EN_RTESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_RTESEN) >> BP_USDHC_INT_STATUS_EN_RTESEN)
  2642. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_RTESEN.
  2643. #define BF_USDHC_INT_STATUS_EN_RTESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_RTESEN) & BM_USDHC_INT_STATUS_EN_RTESEN)
  2644. #ifndef __LANGUAGE_ASM__
  2645. //! @brief Set the RTESEN field to a new value.
  2646. #define BW_USDHC_INT_STATUS_EN_RTESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_RTESEN) | BF_USDHC_INT_STATUS_EN_RTESEN(v)))
  2647. #endif
  2648. /* --- Register HW_USDHC_INT_STATUS_EN, field TPSEN[14] (RW)
  2649. *
  2650. * Tuning Pass Status Enable
  2651. *
  2652. * Values:
  2653. * 0 - Masked
  2654. * 1 - Enabled
  2655. */
  2656. #define BP_USDHC_INT_STATUS_EN_TPSEN (14) //!< Bit position for USDHC_INT_STATUS_EN_TPSEN.
  2657. #define BM_USDHC_INT_STATUS_EN_TPSEN (0x00004000) //!< Bit mask for USDHC_INT_STATUS_EN_TPSEN.
  2658. //! @brief Get value of USDHC_INT_STATUS_EN_TPSEN from a register value.
  2659. #define BG_USDHC_INT_STATUS_EN_TPSEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_TPSEN) >> BP_USDHC_INT_STATUS_EN_TPSEN)
  2660. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_TPSEN.
  2661. #define BF_USDHC_INT_STATUS_EN_TPSEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_TPSEN) & BM_USDHC_INT_STATUS_EN_TPSEN)
  2662. #ifndef __LANGUAGE_ASM__
  2663. //! @brief Set the TPSEN field to a new value.
  2664. #define BW_USDHC_INT_STATUS_EN_TPSEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_TPSEN) | BF_USDHC_INT_STATUS_EN_TPSEN(v)))
  2665. #endif
  2666. /* --- Register HW_USDHC_INT_STATUS_EN, field CTOESEN[16] (RW)
  2667. *
  2668. * Command Timeout Error Status Enable:
  2669. *
  2670. * Values:
  2671. * 0 - Masked
  2672. * 1 - Enabled
  2673. */
  2674. #define BP_USDHC_INT_STATUS_EN_CTOESEN (16) //!< Bit position for USDHC_INT_STATUS_EN_CTOESEN.
  2675. #define BM_USDHC_INT_STATUS_EN_CTOESEN (0x00010000) //!< Bit mask for USDHC_INT_STATUS_EN_CTOESEN.
  2676. //! @brief Get value of USDHC_INT_STATUS_EN_CTOESEN from a register value.
  2677. #define BG_USDHC_INT_STATUS_EN_CTOESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CTOESEN) >> BP_USDHC_INT_STATUS_EN_CTOESEN)
  2678. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CTOESEN.
  2679. #define BF_USDHC_INT_STATUS_EN_CTOESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CTOESEN) & BM_USDHC_INT_STATUS_EN_CTOESEN)
  2680. #ifndef __LANGUAGE_ASM__
  2681. //! @brief Set the CTOESEN field to a new value.
  2682. #define BW_USDHC_INT_STATUS_EN_CTOESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CTOESEN) | BF_USDHC_INT_STATUS_EN_CTOESEN(v)))
  2683. #endif
  2684. /* --- Register HW_USDHC_INT_STATUS_EN, field CCESEN[17] (RW)
  2685. *
  2686. * Command CRC Error Status Enable:
  2687. *
  2688. * Values:
  2689. * 0 - Masked
  2690. * 1 - Enabled
  2691. */
  2692. #define BP_USDHC_INT_STATUS_EN_CCESEN (17) //!< Bit position for USDHC_INT_STATUS_EN_CCESEN.
  2693. #define BM_USDHC_INT_STATUS_EN_CCESEN (0x00020000) //!< Bit mask for USDHC_INT_STATUS_EN_CCESEN.
  2694. //! @brief Get value of USDHC_INT_STATUS_EN_CCESEN from a register value.
  2695. #define BG_USDHC_INT_STATUS_EN_CCESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CCESEN) >> BP_USDHC_INT_STATUS_EN_CCESEN)
  2696. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CCESEN.
  2697. #define BF_USDHC_INT_STATUS_EN_CCESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CCESEN) & BM_USDHC_INT_STATUS_EN_CCESEN)
  2698. #ifndef __LANGUAGE_ASM__
  2699. //! @brief Set the CCESEN field to a new value.
  2700. #define BW_USDHC_INT_STATUS_EN_CCESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CCESEN) | BF_USDHC_INT_STATUS_EN_CCESEN(v)))
  2701. #endif
  2702. /* --- Register HW_USDHC_INT_STATUS_EN, field CEBESEN[18] (RW)
  2703. *
  2704. * Command End Bit Error Status Enable:
  2705. *
  2706. * Values:
  2707. * 0 - Masked
  2708. * 1 - Enabled
  2709. */
  2710. #define BP_USDHC_INT_STATUS_EN_CEBESEN (18) //!< Bit position for USDHC_INT_STATUS_EN_CEBESEN.
  2711. #define BM_USDHC_INT_STATUS_EN_CEBESEN (0x00040000) //!< Bit mask for USDHC_INT_STATUS_EN_CEBESEN.
  2712. //! @brief Get value of USDHC_INT_STATUS_EN_CEBESEN from a register value.
  2713. #define BG_USDHC_INT_STATUS_EN_CEBESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CEBESEN) >> BP_USDHC_INT_STATUS_EN_CEBESEN)
  2714. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CEBESEN.
  2715. #define BF_USDHC_INT_STATUS_EN_CEBESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CEBESEN) & BM_USDHC_INT_STATUS_EN_CEBESEN)
  2716. #ifndef __LANGUAGE_ASM__
  2717. //! @brief Set the CEBESEN field to a new value.
  2718. #define BW_USDHC_INT_STATUS_EN_CEBESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CEBESEN) | BF_USDHC_INT_STATUS_EN_CEBESEN(v)))
  2719. #endif
  2720. /* --- Register HW_USDHC_INT_STATUS_EN, field CIESEN[19] (RW)
  2721. *
  2722. * Command Index Error Status Enable:
  2723. *
  2724. * Values:
  2725. * 0 - Masked
  2726. * 1 - Enabled
  2727. */
  2728. #define BP_USDHC_INT_STATUS_EN_CIESEN (19) //!< Bit position for USDHC_INT_STATUS_EN_CIESEN.
  2729. #define BM_USDHC_INT_STATUS_EN_CIESEN (0x00080000) //!< Bit mask for USDHC_INT_STATUS_EN_CIESEN.
  2730. //! @brief Get value of USDHC_INT_STATUS_EN_CIESEN from a register value.
  2731. #define BG_USDHC_INT_STATUS_EN_CIESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_CIESEN) >> BP_USDHC_INT_STATUS_EN_CIESEN)
  2732. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_CIESEN.
  2733. #define BF_USDHC_INT_STATUS_EN_CIESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_CIESEN) & BM_USDHC_INT_STATUS_EN_CIESEN)
  2734. #ifndef __LANGUAGE_ASM__
  2735. //! @brief Set the CIESEN field to a new value.
  2736. #define BW_USDHC_INT_STATUS_EN_CIESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_CIESEN) | BF_USDHC_INT_STATUS_EN_CIESEN(v)))
  2737. #endif
  2738. /* --- Register HW_USDHC_INT_STATUS_EN, field DTOESEN[20] (RW)
  2739. *
  2740. * Data Timeout Error Status Enable:
  2741. *
  2742. * Values:
  2743. * 0 - Masked
  2744. * 1 - Enabled
  2745. */
  2746. #define BP_USDHC_INT_STATUS_EN_DTOESEN (20) //!< Bit position for USDHC_INT_STATUS_EN_DTOESEN.
  2747. #define BM_USDHC_INT_STATUS_EN_DTOESEN (0x00100000) //!< Bit mask for USDHC_INT_STATUS_EN_DTOESEN.
  2748. //! @brief Get value of USDHC_INT_STATUS_EN_DTOESEN from a register value.
  2749. #define BG_USDHC_INT_STATUS_EN_DTOESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_DTOESEN) >> BP_USDHC_INT_STATUS_EN_DTOESEN)
  2750. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_DTOESEN.
  2751. #define BF_USDHC_INT_STATUS_EN_DTOESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_DTOESEN) & BM_USDHC_INT_STATUS_EN_DTOESEN)
  2752. #ifndef __LANGUAGE_ASM__
  2753. //! @brief Set the DTOESEN field to a new value.
  2754. #define BW_USDHC_INT_STATUS_EN_DTOESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_DTOESEN) | BF_USDHC_INT_STATUS_EN_DTOESEN(v)))
  2755. #endif
  2756. /* --- Register HW_USDHC_INT_STATUS_EN, field DCESEN[21] (RW)
  2757. *
  2758. * Data CRC Error Status Enable:
  2759. *
  2760. * Values:
  2761. * 0 - Masked
  2762. * 1 - Enabled
  2763. */
  2764. #define BP_USDHC_INT_STATUS_EN_DCESEN (21) //!< Bit position for USDHC_INT_STATUS_EN_DCESEN.
  2765. #define BM_USDHC_INT_STATUS_EN_DCESEN (0x00200000) //!< Bit mask for USDHC_INT_STATUS_EN_DCESEN.
  2766. //! @brief Get value of USDHC_INT_STATUS_EN_DCESEN from a register value.
  2767. #define BG_USDHC_INT_STATUS_EN_DCESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_DCESEN) >> BP_USDHC_INT_STATUS_EN_DCESEN)
  2768. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_DCESEN.
  2769. #define BF_USDHC_INT_STATUS_EN_DCESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_DCESEN) & BM_USDHC_INT_STATUS_EN_DCESEN)
  2770. #ifndef __LANGUAGE_ASM__
  2771. //! @brief Set the DCESEN field to a new value.
  2772. #define BW_USDHC_INT_STATUS_EN_DCESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_DCESEN) | BF_USDHC_INT_STATUS_EN_DCESEN(v)))
  2773. #endif
  2774. /* --- Register HW_USDHC_INT_STATUS_EN, field DEBESEN[22] (RW)
  2775. *
  2776. * Data End Bit Error Status Enable:
  2777. *
  2778. * Values:
  2779. * 0 - Masked
  2780. * 1 - Enabled
  2781. */
  2782. #define BP_USDHC_INT_STATUS_EN_DEBESEN (22) //!< Bit position for USDHC_INT_STATUS_EN_DEBESEN.
  2783. #define BM_USDHC_INT_STATUS_EN_DEBESEN (0x00400000) //!< Bit mask for USDHC_INT_STATUS_EN_DEBESEN.
  2784. //! @brief Get value of USDHC_INT_STATUS_EN_DEBESEN from a register value.
  2785. #define BG_USDHC_INT_STATUS_EN_DEBESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_DEBESEN) >> BP_USDHC_INT_STATUS_EN_DEBESEN)
  2786. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_DEBESEN.
  2787. #define BF_USDHC_INT_STATUS_EN_DEBESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_DEBESEN) & BM_USDHC_INT_STATUS_EN_DEBESEN)
  2788. #ifndef __LANGUAGE_ASM__
  2789. //! @brief Set the DEBESEN field to a new value.
  2790. #define BW_USDHC_INT_STATUS_EN_DEBESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_DEBESEN) | BF_USDHC_INT_STATUS_EN_DEBESEN(v)))
  2791. #endif
  2792. /* --- Register HW_USDHC_INT_STATUS_EN, field AC12ESEN[24] (RW)
  2793. *
  2794. * Auto CMD12 Error Status Enable:
  2795. *
  2796. * Values:
  2797. * 0 - Masked
  2798. * 1 - Enabled
  2799. */
  2800. #define BP_USDHC_INT_STATUS_EN_AC12ESEN (24) //!< Bit position for USDHC_INT_STATUS_EN_AC12ESEN.
  2801. #define BM_USDHC_INT_STATUS_EN_AC12ESEN (0x01000000) //!< Bit mask for USDHC_INT_STATUS_EN_AC12ESEN.
  2802. //! @brief Get value of USDHC_INT_STATUS_EN_AC12ESEN from a register value.
  2803. #define BG_USDHC_INT_STATUS_EN_AC12ESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_AC12ESEN) >> BP_USDHC_INT_STATUS_EN_AC12ESEN)
  2804. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_AC12ESEN.
  2805. #define BF_USDHC_INT_STATUS_EN_AC12ESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_AC12ESEN) & BM_USDHC_INT_STATUS_EN_AC12ESEN)
  2806. #ifndef __LANGUAGE_ASM__
  2807. //! @brief Set the AC12ESEN field to a new value.
  2808. #define BW_USDHC_INT_STATUS_EN_AC12ESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_AC12ESEN) | BF_USDHC_INT_STATUS_EN_AC12ESEN(v)))
  2809. #endif
  2810. /* --- Register HW_USDHC_INT_STATUS_EN, field TNESEN[26] (RW)
  2811. *
  2812. * Tuning Error Status Enable:
  2813. *
  2814. * Values:
  2815. * 0 - Masked
  2816. * 1 - Enabled
  2817. */
  2818. #define BP_USDHC_INT_STATUS_EN_TNESEN (26) //!< Bit position for USDHC_INT_STATUS_EN_TNESEN.
  2819. #define BM_USDHC_INT_STATUS_EN_TNESEN (0x04000000) //!< Bit mask for USDHC_INT_STATUS_EN_TNESEN.
  2820. //! @brief Get value of USDHC_INT_STATUS_EN_TNESEN from a register value.
  2821. #define BG_USDHC_INT_STATUS_EN_TNESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_TNESEN) >> BP_USDHC_INT_STATUS_EN_TNESEN)
  2822. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_TNESEN.
  2823. #define BF_USDHC_INT_STATUS_EN_TNESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_TNESEN) & BM_USDHC_INT_STATUS_EN_TNESEN)
  2824. #ifndef __LANGUAGE_ASM__
  2825. //! @brief Set the TNESEN field to a new value.
  2826. #define BW_USDHC_INT_STATUS_EN_TNESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_TNESEN) | BF_USDHC_INT_STATUS_EN_TNESEN(v)))
  2827. #endif
  2828. /* --- Register HW_USDHC_INT_STATUS_EN, field DMAESEN[28] (RW)
  2829. *
  2830. * DMA Error Status Enable:
  2831. *
  2832. * Values:
  2833. * 0 - Masked
  2834. * 1 - Enabled
  2835. */
  2836. #define BP_USDHC_INT_STATUS_EN_DMAESEN (28) //!< Bit position for USDHC_INT_STATUS_EN_DMAESEN.
  2837. #define BM_USDHC_INT_STATUS_EN_DMAESEN (0x10000000) //!< Bit mask for USDHC_INT_STATUS_EN_DMAESEN.
  2838. //! @brief Get value of USDHC_INT_STATUS_EN_DMAESEN from a register value.
  2839. #define BG_USDHC_INT_STATUS_EN_DMAESEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_STATUS_EN_DMAESEN) >> BP_USDHC_INT_STATUS_EN_DMAESEN)
  2840. //! @brief Format value for bitfield USDHC_INT_STATUS_EN_DMAESEN.
  2841. #define BF_USDHC_INT_STATUS_EN_DMAESEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_STATUS_EN_DMAESEN) & BM_USDHC_INT_STATUS_EN_DMAESEN)
  2842. #ifndef __LANGUAGE_ASM__
  2843. //! @brief Set the DMAESEN field to a new value.
  2844. #define BW_USDHC_INT_STATUS_EN_DMAESEN(x, v) (HW_USDHC_INT_STATUS_EN_WR(x, (HW_USDHC_INT_STATUS_EN_RD(x) & ~BM_USDHC_INT_STATUS_EN_DMAESEN) | BF_USDHC_INT_STATUS_EN_DMAESEN(v)))
  2845. #endif
  2846. //-------------------------------------------------------------------------------------------
  2847. // HW_USDHC_INT_SIGNAL_EN - Interrupt Signal Enable
  2848. //-------------------------------------------------------------------------------------------
  2849. #ifndef __LANGUAGE_ASM__
  2850. /*!
  2851. * @brief HW_USDHC_INT_SIGNAL_EN - Interrupt Signal Enable (RW)
  2852. *
  2853. * Reset value: 0x00000000
  2854. *
  2855. * This register is used to select which interrupt status is indicated to the Host System as the
  2856. * interrupt. These status bits all share the same interrupt line. Setting any of these bits to 1
  2857. * enables interrupt generation. The corresponding Status register bit will generate an interrupt
  2858. * when the corresponding interrupt signal enable bit is set.
  2859. */
  2860. typedef union _hw_usdhc_int_signal_en
  2861. {
  2862. reg32_t U;
  2863. struct _hw_usdhc_int_signal_en_bitfields
  2864. {
  2865. unsigned CCIEN : 1; //!< [0] Command Complete Interrupt Enable:
  2866. unsigned TCIEN : 1; //!< [1] Transfer Complete Interrupt Enable:
  2867. unsigned BGEIEN : 1; //!< [2] Block Gap Event Interrupt Enable:
  2868. unsigned DINTIEN : 1; //!< [3] DMA Interrupt Enable:
  2869. unsigned BWRIEN : 1; //!< [4] Buffer Write Ready Interrupt Enable:
  2870. unsigned BRRIEN : 1; //!< [5] Buffer Read Ready Interrupt Enable:
  2871. unsigned CINSIEN : 1; //!< [6] Card Insertion Interrupt Enable:
  2872. unsigned CRMIEN : 1; //!< [7] Card Removal Interrupt Enable:
  2873. unsigned CINTIEN : 1; //!< [8] Card Interrupt Interrupt Enable:
  2874. unsigned RESERVED0 : 3; //!< [11:9] Reserved
  2875. unsigned RTEIEN : 1; //!< [12] Re-Tuning Event Interrupt Enable
  2876. unsigned RESERVED1 : 1; //!< [13] Reserved
  2877. unsigned TPIEN : 1; //!< [14] Tuning Pass Interrupt Enable
  2878. unsigned RESERVED2 : 1; //!< [15] Reserved
  2879. unsigned CTOEIEN : 1; //!< [16] Command Timeout Error Interrupt Enable
  2880. unsigned CCEIEN : 1; //!< [17] Command CRC Error Interrupt Enable:
  2881. unsigned CEBEIEN : 1; //!< [18] Command End Bit Error Interrupt Enable:
  2882. unsigned CIEIEN : 1; //!< [19] Command Index Error Interrupt Enable:
  2883. unsigned DTOEIEN : 1; //!< [20] Data Timeout Error Interrupt Enable:
  2884. unsigned DCEIEN : 1; //!< [21] Data CRC Error Interrupt Enable:
  2885. unsigned DEBEIEN : 1; //!< [22] Data End Bit Error Interrupt Enable:
  2886. unsigned RESERVED3 : 1; //!< [23] Reserved
  2887. unsigned AC12EIEN : 1; //!< [24] Auto CMD12 Error Interrupt Enable:
  2888. unsigned RESERVED4 : 1; //!< [25] Reserved
  2889. unsigned TNEIEN : 1; //!< [26] Tuning Error Interrupt Enable
  2890. unsigned RESERVED5 : 1; //!< [27] Reserved
  2891. unsigned DMAEIEN : 1; //!< [28] DMA Error Interrupt Enable:
  2892. unsigned RESERVED6 : 3; //!< [31:29] Reserved
  2893. } B;
  2894. } hw_usdhc_int_signal_en_t;
  2895. #endif
  2896. /*
  2897. * constants & macros for entire multi-block USDHC_INT_SIGNAL_EN register
  2898. */
  2899. #define HW_USDHC_INT_SIGNAL_EN_ADDR(x) (REGS_USDHC_BASE(x) + 0x38)
  2900. #ifndef __LANGUAGE_ASM__
  2901. #define HW_USDHC_INT_SIGNAL_EN(x) (*(volatile hw_usdhc_int_signal_en_t *) HW_USDHC_INT_SIGNAL_EN_ADDR(x))
  2902. #define HW_USDHC_INT_SIGNAL_EN_RD(x) (HW_USDHC_INT_SIGNAL_EN(x).U)
  2903. #define HW_USDHC_INT_SIGNAL_EN_WR(x, v) (HW_USDHC_INT_SIGNAL_EN(x).U = (v))
  2904. #define HW_USDHC_INT_SIGNAL_EN_SET(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, HW_USDHC_INT_SIGNAL_EN_RD(x) | (v)))
  2905. #define HW_USDHC_INT_SIGNAL_EN_CLR(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, HW_USDHC_INT_SIGNAL_EN_RD(x) & ~(v)))
  2906. #define HW_USDHC_INT_SIGNAL_EN_TOG(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, HW_USDHC_INT_SIGNAL_EN_RD(x) ^ (v)))
  2907. #endif
  2908. /*
  2909. * constants & macros for individual USDHC_INT_SIGNAL_EN bitfields
  2910. */
  2911. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CCIEN[0] (RW)
  2912. *
  2913. * Command Complete Interrupt Enable:
  2914. *
  2915. * Values:
  2916. * 0 - Masked
  2917. * 1 - Enabled
  2918. */
  2919. #define BP_USDHC_INT_SIGNAL_EN_CCIEN (0) //!< Bit position for USDHC_INT_SIGNAL_EN_CCIEN.
  2920. #define BM_USDHC_INT_SIGNAL_EN_CCIEN (0x00000001) //!< Bit mask for USDHC_INT_SIGNAL_EN_CCIEN.
  2921. //! @brief Get value of USDHC_INT_SIGNAL_EN_CCIEN from a register value.
  2922. #define BG_USDHC_INT_SIGNAL_EN_CCIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CCIEN) >> BP_USDHC_INT_SIGNAL_EN_CCIEN)
  2923. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CCIEN.
  2924. #define BF_USDHC_INT_SIGNAL_EN_CCIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CCIEN) & BM_USDHC_INT_SIGNAL_EN_CCIEN)
  2925. #ifndef __LANGUAGE_ASM__
  2926. //! @brief Set the CCIEN field to a new value.
  2927. #define BW_USDHC_INT_SIGNAL_EN_CCIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CCIEN) | BF_USDHC_INT_SIGNAL_EN_CCIEN(v)))
  2928. #endif
  2929. /* --- Register HW_USDHC_INT_SIGNAL_EN, field TCIEN[1] (RW)
  2930. *
  2931. * Transfer Complete Interrupt Enable:
  2932. *
  2933. * Values:
  2934. * 0 - Masked
  2935. * 1 - Enabled
  2936. */
  2937. #define BP_USDHC_INT_SIGNAL_EN_TCIEN (1) //!< Bit position for USDHC_INT_SIGNAL_EN_TCIEN.
  2938. #define BM_USDHC_INT_SIGNAL_EN_TCIEN (0x00000002) //!< Bit mask for USDHC_INT_SIGNAL_EN_TCIEN.
  2939. //! @brief Get value of USDHC_INT_SIGNAL_EN_TCIEN from a register value.
  2940. #define BG_USDHC_INT_SIGNAL_EN_TCIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_TCIEN) >> BP_USDHC_INT_SIGNAL_EN_TCIEN)
  2941. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_TCIEN.
  2942. #define BF_USDHC_INT_SIGNAL_EN_TCIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_TCIEN) & BM_USDHC_INT_SIGNAL_EN_TCIEN)
  2943. #ifndef __LANGUAGE_ASM__
  2944. //! @brief Set the TCIEN field to a new value.
  2945. #define BW_USDHC_INT_SIGNAL_EN_TCIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_TCIEN) | BF_USDHC_INT_SIGNAL_EN_TCIEN(v)))
  2946. #endif
  2947. /* --- Register HW_USDHC_INT_SIGNAL_EN, field BGEIEN[2] (RW)
  2948. *
  2949. * Block Gap Event Interrupt Enable:
  2950. *
  2951. * Values:
  2952. * 0 - Masked
  2953. * 1 - Enabled
  2954. */
  2955. #define BP_USDHC_INT_SIGNAL_EN_BGEIEN (2) //!< Bit position for USDHC_INT_SIGNAL_EN_BGEIEN.
  2956. #define BM_USDHC_INT_SIGNAL_EN_BGEIEN (0x00000004) //!< Bit mask for USDHC_INT_SIGNAL_EN_BGEIEN.
  2957. //! @brief Get value of USDHC_INT_SIGNAL_EN_BGEIEN from a register value.
  2958. #define BG_USDHC_INT_SIGNAL_EN_BGEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_BGEIEN) >> BP_USDHC_INT_SIGNAL_EN_BGEIEN)
  2959. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_BGEIEN.
  2960. #define BF_USDHC_INT_SIGNAL_EN_BGEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_BGEIEN) & BM_USDHC_INT_SIGNAL_EN_BGEIEN)
  2961. #ifndef __LANGUAGE_ASM__
  2962. //! @brief Set the BGEIEN field to a new value.
  2963. #define BW_USDHC_INT_SIGNAL_EN_BGEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_BGEIEN) | BF_USDHC_INT_SIGNAL_EN_BGEIEN(v)))
  2964. #endif
  2965. /* --- Register HW_USDHC_INT_SIGNAL_EN, field DINTIEN[3] (RW)
  2966. *
  2967. * DMA Interrupt Enable:
  2968. *
  2969. * Values:
  2970. * 0 - Masked
  2971. * 1 - Enabled
  2972. */
  2973. #define BP_USDHC_INT_SIGNAL_EN_DINTIEN (3) //!< Bit position for USDHC_INT_SIGNAL_EN_DINTIEN.
  2974. #define BM_USDHC_INT_SIGNAL_EN_DINTIEN (0x00000008) //!< Bit mask for USDHC_INT_SIGNAL_EN_DINTIEN.
  2975. //! @brief Get value of USDHC_INT_SIGNAL_EN_DINTIEN from a register value.
  2976. #define BG_USDHC_INT_SIGNAL_EN_DINTIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_DINTIEN) >> BP_USDHC_INT_SIGNAL_EN_DINTIEN)
  2977. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_DINTIEN.
  2978. #define BF_USDHC_INT_SIGNAL_EN_DINTIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_DINTIEN) & BM_USDHC_INT_SIGNAL_EN_DINTIEN)
  2979. #ifndef __LANGUAGE_ASM__
  2980. //! @brief Set the DINTIEN field to a new value.
  2981. #define BW_USDHC_INT_SIGNAL_EN_DINTIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_DINTIEN) | BF_USDHC_INT_SIGNAL_EN_DINTIEN(v)))
  2982. #endif
  2983. /* --- Register HW_USDHC_INT_SIGNAL_EN, field BWRIEN[4] (RW)
  2984. *
  2985. * Buffer Write Ready Interrupt Enable:
  2986. *
  2987. * Values:
  2988. * 0 - Masked
  2989. * 1 - Enabled
  2990. */
  2991. #define BP_USDHC_INT_SIGNAL_EN_BWRIEN (4) //!< Bit position for USDHC_INT_SIGNAL_EN_BWRIEN.
  2992. #define BM_USDHC_INT_SIGNAL_EN_BWRIEN (0x00000010) //!< Bit mask for USDHC_INT_SIGNAL_EN_BWRIEN.
  2993. //! @brief Get value of USDHC_INT_SIGNAL_EN_BWRIEN from a register value.
  2994. #define BG_USDHC_INT_SIGNAL_EN_BWRIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_BWRIEN) >> BP_USDHC_INT_SIGNAL_EN_BWRIEN)
  2995. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_BWRIEN.
  2996. #define BF_USDHC_INT_SIGNAL_EN_BWRIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_BWRIEN) & BM_USDHC_INT_SIGNAL_EN_BWRIEN)
  2997. #ifndef __LANGUAGE_ASM__
  2998. //! @brief Set the BWRIEN field to a new value.
  2999. #define BW_USDHC_INT_SIGNAL_EN_BWRIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_BWRIEN) | BF_USDHC_INT_SIGNAL_EN_BWRIEN(v)))
  3000. #endif
  3001. /* --- Register HW_USDHC_INT_SIGNAL_EN, field BRRIEN[5] (RW)
  3002. *
  3003. * Buffer Read Ready Interrupt Enable:
  3004. *
  3005. * Values:
  3006. * 0 - Masked
  3007. * 1 - Enabled
  3008. */
  3009. #define BP_USDHC_INT_SIGNAL_EN_BRRIEN (5) //!< Bit position for USDHC_INT_SIGNAL_EN_BRRIEN.
  3010. #define BM_USDHC_INT_SIGNAL_EN_BRRIEN (0x00000020) //!< Bit mask for USDHC_INT_SIGNAL_EN_BRRIEN.
  3011. //! @brief Get value of USDHC_INT_SIGNAL_EN_BRRIEN from a register value.
  3012. #define BG_USDHC_INT_SIGNAL_EN_BRRIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_BRRIEN) >> BP_USDHC_INT_SIGNAL_EN_BRRIEN)
  3013. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_BRRIEN.
  3014. #define BF_USDHC_INT_SIGNAL_EN_BRRIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_BRRIEN) & BM_USDHC_INT_SIGNAL_EN_BRRIEN)
  3015. #ifndef __LANGUAGE_ASM__
  3016. //! @brief Set the BRRIEN field to a new value.
  3017. #define BW_USDHC_INT_SIGNAL_EN_BRRIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_BRRIEN) | BF_USDHC_INT_SIGNAL_EN_BRRIEN(v)))
  3018. #endif
  3019. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CINSIEN[6] (RW)
  3020. *
  3021. * Card Insertion Interrupt Enable:
  3022. *
  3023. * Values:
  3024. * 0 - Masked
  3025. * 1 - Enabled
  3026. */
  3027. #define BP_USDHC_INT_SIGNAL_EN_CINSIEN (6) //!< Bit position for USDHC_INT_SIGNAL_EN_CINSIEN.
  3028. #define BM_USDHC_INT_SIGNAL_EN_CINSIEN (0x00000040) //!< Bit mask for USDHC_INT_SIGNAL_EN_CINSIEN.
  3029. //! @brief Get value of USDHC_INT_SIGNAL_EN_CINSIEN from a register value.
  3030. #define BG_USDHC_INT_SIGNAL_EN_CINSIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CINSIEN) >> BP_USDHC_INT_SIGNAL_EN_CINSIEN)
  3031. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CINSIEN.
  3032. #define BF_USDHC_INT_SIGNAL_EN_CINSIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CINSIEN) & BM_USDHC_INT_SIGNAL_EN_CINSIEN)
  3033. #ifndef __LANGUAGE_ASM__
  3034. //! @brief Set the CINSIEN field to a new value.
  3035. #define BW_USDHC_INT_SIGNAL_EN_CINSIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CINSIEN) | BF_USDHC_INT_SIGNAL_EN_CINSIEN(v)))
  3036. #endif
  3037. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CRMIEN[7] (RW)
  3038. *
  3039. * Card Removal Interrupt Enable:
  3040. *
  3041. * Values:
  3042. * 0 - Masked
  3043. * 1 - Enabled
  3044. */
  3045. #define BP_USDHC_INT_SIGNAL_EN_CRMIEN (7) //!< Bit position for USDHC_INT_SIGNAL_EN_CRMIEN.
  3046. #define BM_USDHC_INT_SIGNAL_EN_CRMIEN (0x00000080) //!< Bit mask for USDHC_INT_SIGNAL_EN_CRMIEN.
  3047. //! @brief Get value of USDHC_INT_SIGNAL_EN_CRMIEN from a register value.
  3048. #define BG_USDHC_INT_SIGNAL_EN_CRMIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CRMIEN) >> BP_USDHC_INT_SIGNAL_EN_CRMIEN)
  3049. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CRMIEN.
  3050. #define BF_USDHC_INT_SIGNAL_EN_CRMIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CRMIEN) & BM_USDHC_INT_SIGNAL_EN_CRMIEN)
  3051. #ifndef __LANGUAGE_ASM__
  3052. //! @brief Set the CRMIEN field to a new value.
  3053. #define BW_USDHC_INT_SIGNAL_EN_CRMIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CRMIEN) | BF_USDHC_INT_SIGNAL_EN_CRMIEN(v)))
  3054. #endif
  3055. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CINTIEN[8] (RW)
  3056. *
  3057. * Card Interrupt Interrupt Enable:
  3058. *
  3059. * Values:
  3060. * 0 - Masked
  3061. * 1 - Enabled
  3062. */
  3063. #define BP_USDHC_INT_SIGNAL_EN_CINTIEN (8) //!< Bit position for USDHC_INT_SIGNAL_EN_CINTIEN.
  3064. #define BM_USDHC_INT_SIGNAL_EN_CINTIEN (0x00000100) //!< Bit mask for USDHC_INT_SIGNAL_EN_CINTIEN.
  3065. //! @brief Get value of USDHC_INT_SIGNAL_EN_CINTIEN from a register value.
  3066. #define BG_USDHC_INT_SIGNAL_EN_CINTIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CINTIEN) >> BP_USDHC_INT_SIGNAL_EN_CINTIEN)
  3067. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CINTIEN.
  3068. #define BF_USDHC_INT_SIGNAL_EN_CINTIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CINTIEN) & BM_USDHC_INT_SIGNAL_EN_CINTIEN)
  3069. #ifndef __LANGUAGE_ASM__
  3070. //! @brief Set the CINTIEN field to a new value.
  3071. #define BW_USDHC_INT_SIGNAL_EN_CINTIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CINTIEN) | BF_USDHC_INT_SIGNAL_EN_CINTIEN(v)))
  3072. #endif
  3073. /* --- Register HW_USDHC_INT_SIGNAL_EN, field RTEIEN[12] (RW)
  3074. *
  3075. * Re-Tuning Event Interrupt Enable
  3076. *
  3077. * Values:
  3078. * 0 - Masked
  3079. * 1 - Enabled
  3080. */
  3081. #define BP_USDHC_INT_SIGNAL_EN_RTEIEN (12) //!< Bit position for USDHC_INT_SIGNAL_EN_RTEIEN.
  3082. #define BM_USDHC_INT_SIGNAL_EN_RTEIEN (0x00001000) //!< Bit mask for USDHC_INT_SIGNAL_EN_RTEIEN.
  3083. //! @brief Get value of USDHC_INT_SIGNAL_EN_RTEIEN from a register value.
  3084. #define BG_USDHC_INT_SIGNAL_EN_RTEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_RTEIEN) >> BP_USDHC_INT_SIGNAL_EN_RTEIEN)
  3085. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_RTEIEN.
  3086. #define BF_USDHC_INT_SIGNAL_EN_RTEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_RTEIEN) & BM_USDHC_INT_SIGNAL_EN_RTEIEN)
  3087. #ifndef __LANGUAGE_ASM__
  3088. //! @brief Set the RTEIEN field to a new value.
  3089. #define BW_USDHC_INT_SIGNAL_EN_RTEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_RTEIEN) | BF_USDHC_INT_SIGNAL_EN_RTEIEN(v)))
  3090. #endif
  3091. /* --- Register HW_USDHC_INT_SIGNAL_EN, field TPIEN[14] (RW)
  3092. *
  3093. * Tuning Pass Interrupt Enable
  3094. *
  3095. * Values:
  3096. * 0 - Masked
  3097. * 1 - Enabled
  3098. */
  3099. #define BP_USDHC_INT_SIGNAL_EN_TPIEN (14) //!< Bit position for USDHC_INT_SIGNAL_EN_TPIEN.
  3100. #define BM_USDHC_INT_SIGNAL_EN_TPIEN (0x00004000) //!< Bit mask for USDHC_INT_SIGNAL_EN_TPIEN.
  3101. //! @brief Get value of USDHC_INT_SIGNAL_EN_TPIEN from a register value.
  3102. #define BG_USDHC_INT_SIGNAL_EN_TPIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_TPIEN) >> BP_USDHC_INT_SIGNAL_EN_TPIEN)
  3103. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_TPIEN.
  3104. #define BF_USDHC_INT_SIGNAL_EN_TPIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_TPIEN) & BM_USDHC_INT_SIGNAL_EN_TPIEN)
  3105. #ifndef __LANGUAGE_ASM__
  3106. //! @brief Set the TPIEN field to a new value.
  3107. #define BW_USDHC_INT_SIGNAL_EN_TPIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_TPIEN) | BF_USDHC_INT_SIGNAL_EN_TPIEN(v)))
  3108. #endif
  3109. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CTOEIEN[16] (RW)
  3110. *
  3111. * Command Timeout Error Interrupt Enable
  3112. *
  3113. * Values:
  3114. * 0 - Masked
  3115. * 1 - Enabled
  3116. */
  3117. #define BP_USDHC_INT_SIGNAL_EN_CTOEIEN (16) //!< Bit position for USDHC_INT_SIGNAL_EN_CTOEIEN.
  3118. #define BM_USDHC_INT_SIGNAL_EN_CTOEIEN (0x00010000) //!< Bit mask for USDHC_INT_SIGNAL_EN_CTOEIEN.
  3119. //! @brief Get value of USDHC_INT_SIGNAL_EN_CTOEIEN from a register value.
  3120. #define BG_USDHC_INT_SIGNAL_EN_CTOEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CTOEIEN) >> BP_USDHC_INT_SIGNAL_EN_CTOEIEN)
  3121. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CTOEIEN.
  3122. #define BF_USDHC_INT_SIGNAL_EN_CTOEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CTOEIEN) & BM_USDHC_INT_SIGNAL_EN_CTOEIEN)
  3123. #ifndef __LANGUAGE_ASM__
  3124. //! @brief Set the CTOEIEN field to a new value.
  3125. #define BW_USDHC_INT_SIGNAL_EN_CTOEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CTOEIEN) | BF_USDHC_INT_SIGNAL_EN_CTOEIEN(v)))
  3126. #endif
  3127. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CCEIEN[17] (RW)
  3128. *
  3129. * Command CRC Error Interrupt Enable:
  3130. *
  3131. * Values:
  3132. * 0 - Masked
  3133. * 1 - Enabled
  3134. */
  3135. #define BP_USDHC_INT_SIGNAL_EN_CCEIEN (17) //!< Bit position for USDHC_INT_SIGNAL_EN_CCEIEN.
  3136. #define BM_USDHC_INT_SIGNAL_EN_CCEIEN (0x00020000) //!< Bit mask for USDHC_INT_SIGNAL_EN_CCEIEN.
  3137. //! @brief Get value of USDHC_INT_SIGNAL_EN_CCEIEN from a register value.
  3138. #define BG_USDHC_INT_SIGNAL_EN_CCEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CCEIEN) >> BP_USDHC_INT_SIGNAL_EN_CCEIEN)
  3139. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CCEIEN.
  3140. #define BF_USDHC_INT_SIGNAL_EN_CCEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CCEIEN) & BM_USDHC_INT_SIGNAL_EN_CCEIEN)
  3141. #ifndef __LANGUAGE_ASM__
  3142. //! @brief Set the CCEIEN field to a new value.
  3143. #define BW_USDHC_INT_SIGNAL_EN_CCEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CCEIEN) | BF_USDHC_INT_SIGNAL_EN_CCEIEN(v)))
  3144. #endif
  3145. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CEBEIEN[18] (RW)
  3146. *
  3147. * Command End Bit Error Interrupt Enable:
  3148. *
  3149. * Values:
  3150. * 0 - Masked
  3151. * 1 - Enabled
  3152. */
  3153. #define BP_USDHC_INT_SIGNAL_EN_CEBEIEN (18) //!< Bit position for USDHC_INT_SIGNAL_EN_CEBEIEN.
  3154. #define BM_USDHC_INT_SIGNAL_EN_CEBEIEN (0x00040000) //!< Bit mask for USDHC_INT_SIGNAL_EN_CEBEIEN.
  3155. //! @brief Get value of USDHC_INT_SIGNAL_EN_CEBEIEN from a register value.
  3156. #define BG_USDHC_INT_SIGNAL_EN_CEBEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CEBEIEN) >> BP_USDHC_INT_SIGNAL_EN_CEBEIEN)
  3157. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CEBEIEN.
  3158. #define BF_USDHC_INT_SIGNAL_EN_CEBEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CEBEIEN) & BM_USDHC_INT_SIGNAL_EN_CEBEIEN)
  3159. #ifndef __LANGUAGE_ASM__
  3160. //! @brief Set the CEBEIEN field to a new value.
  3161. #define BW_USDHC_INT_SIGNAL_EN_CEBEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CEBEIEN) | BF_USDHC_INT_SIGNAL_EN_CEBEIEN(v)))
  3162. #endif
  3163. /* --- Register HW_USDHC_INT_SIGNAL_EN, field CIEIEN[19] (RW)
  3164. *
  3165. * Command Index Error Interrupt Enable:
  3166. *
  3167. * Values:
  3168. * 0 - Masked
  3169. * 1 - Enabled
  3170. */
  3171. #define BP_USDHC_INT_SIGNAL_EN_CIEIEN (19) //!< Bit position for USDHC_INT_SIGNAL_EN_CIEIEN.
  3172. #define BM_USDHC_INT_SIGNAL_EN_CIEIEN (0x00080000) //!< Bit mask for USDHC_INT_SIGNAL_EN_CIEIEN.
  3173. //! @brief Get value of USDHC_INT_SIGNAL_EN_CIEIEN from a register value.
  3174. #define BG_USDHC_INT_SIGNAL_EN_CIEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_CIEIEN) >> BP_USDHC_INT_SIGNAL_EN_CIEIEN)
  3175. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_CIEIEN.
  3176. #define BF_USDHC_INT_SIGNAL_EN_CIEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_CIEIEN) & BM_USDHC_INT_SIGNAL_EN_CIEIEN)
  3177. #ifndef __LANGUAGE_ASM__
  3178. //! @brief Set the CIEIEN field to a new value.
  3179. #define BW_USDHC_INT_SIGNAL_EN_CIEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_CIEIEN) | BF_USDHC_INT_SIGNAL_EN_CIEIEN(v)))
  3180. #endif
  3181. /* --- Register HW_USDHC_INT_SIGNAL_EN, field DTOEIEN[20] (RW)
  3182. *
  3183. * Data Timeout Error Interrupt Enable:
  3184. *
  3185. * Values:
  3186. * 0 - Masked
  3187. * 1 - Enabled
  3188. */
  3189. #define BP_USDHC_INT_SIGNAL_EN_DTOEIEN (20) //!< Bit position for USDHC_INT_SIGNAL_EN_DTOEIEN.
  3190. #define BM_USDHC_INT_SIGNAL_EN_DTOEIEN (0x00100000) //!< Bit mask for USDHC_INT_SIGNAL_EN_DTOEIEN.
  3191. //! @brief Get value of USDHC_INT_SIGNAL_EN_DTOEIEN from a register value.
  3192. #define BG_USDHC_INT_SIGNAL_EN_DTOEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_DTOEIEN) >> BP_USDHC_INT_SIGNAL_EN_DTOEIEN)
  3193. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_DTOEIEN.
  3194. #define BF_USDHC_INT_SIGNAL_EN_DTOEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_DTOEIEN) & BM_USDHC_INT_SIGNAL_EN_DTOEIEN)
  3195. #ifndef __LANGUAGE_ASM__
  3196. //! @brief Set the DTOEIEN field to a new value.
  3197. #define BW_USDHC_INT_SIGNAL_EN_DTOEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_DTOEIEN) | BF_USDHC_INT_SIGNAL_EN_DTOEIEN(v)))
  3198. #endif
  3199. /* --- Register HW_USDHC_INT_SIGNAL_EN, field DCEIEN[21] (RW)
  3200. *
  3201. * Data CRC Error Interrupt Enable:
  3202. *
  3203. * Values:
  3204. * 0 - Masked
  3205. * 1 - Enabled
  3206. */
  3207. #define BP_USDHC_INT_SIGNAL_EN_DCEIEN (21) //!< Bit position for USDHC_INT_SIGNAL_EN_DCEIEN.
  3208. #define BM_USDHC_INT_SIGNAL_EN_DCEIEN (0x00200000) //!< Bit mask for USDHC_INT_SIGNAL_EN_DCEIEN.
  3209. //! @brief Get value of USDHC_INT_SIGNAL_EN_DCEIEN from a register value.
  3210. #define BG_USDHC_INT_SIGNAL_EN_DCEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_DCEIEN) >> BP_USDHC_INT_SIGNAL_EN_DCEIEN)
  3211. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_DCEIEN.
  3212. #define BF_USDHC_INT_SIGNAL_EN_DCEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_DCEIEN) & BM_USDHC_INT_SIGNAL_EN_DCEIEN)
  3213. #ifndef __LANGUAGE_ASM__
  3214. //! @brief Set the DCEIEN field to a new value.
  3215. #define BW_USDHC_INT_SIGNAL_EN_DCEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_DCEIEN) | BF_USDHC_INT_SIGNAL_EN_DCEIEN(v)))
  3216. #endif
  3217. /* --- Register HW_USDHC_INT_SIGNAL_EN, field DEBEIEN[22] (RW)
  3218. *
  3219. * Data End Bit Error Interrupt Enable:
  3220. *
  3221. * Values:
  3222. * 0 - Masked
  3223. * 1 - Enabled
  3224. */
  3225. #define BP_USDHC_INT_SIGNAL_EN_DEBEIEN (22) //!< Bit position for USDHC_INT_SIGNAL_EN_DEBEIEN.
  3226. #define BM_USDHC_INT_SIGNAL_EN_DEBEIEN (0x00400000) //!< Bit mask for USDHC_INT_SIGNAL_EN_DEBEIEN.
  3227. //! @brief Get value of USDHC_INT_SIGNAL_EN_DEBEIEN from a register value.
  3228. #define BG_USDHC_INT_SIGNAL_EN_DEBEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_DEBEIEN) >> BP_USDHC_INT_SIGNAL_EN_DEBEIEN)
  3229. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_DEBEIEN.
  3230. #define BF_USDHC_INT_SIGNAL_EN_DEBEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_DEBEIEN) & BM_USDHC_INT_SIGNAL_EN_DEBEIEN)
  3231. #ifndef __LANGUAGE_ASM__
  3232. //! @brief Set the DEBEIEN field to a new value.
  3233. #define BW_USDHC_INT_SIGNAL_EN_DEBEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_DEBEIEN) | BF_USDHC_INT_SIGNAL_EN_DEBEIEN(v)))
  3234. #endif
  3235. /* --- Register HW_USDHC_INT_SIGNAL_EN, field AC12EIEN[24] (RW)
  3236. *
  3237. * Auto CMD12 Error Interrupt Enable:
  3238. *
  3239. * Values:
  3240. * 0 - Masked
  3241. * 1 - Enabled
  3242. */
  3243. #define BP_USDHC_INT_SIGNAL_EN_AC12EIEN (24) //!< Bit position for USDHC_INT_SIGNAL_EN_AC12EIEN.
  3244. #define BM_USDHC_INT_SIGNAL_EN_AC12EIEN (0x01000000) //!< Bit mask for USDHC_INT_SIGNAL_EN_AC12EIEN.
  3245. //! @brief Get value of USDHC_INT_SIGNAL_EN_AC12EIEN from a register value.
  3246. #define BG_USDHC_INT_SIGNAL_EN_AC12EIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_AC12EIEN) >> BP_USDHC_INT_SIGNAL_EN_AC12EIEN)
  3247. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_AC12EIEN.
  3248. #define BF_USDHC_INT_SIGNAL_EN_AC12EIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_AC12EIEN) & BM_USDHC_INT_SIGNAL_EN_AC12EIEN)
  3249. #ifndef __LANGUAGE_ASM__
  3250. //! @brief Set the AC12EIEN field to a new value.
  3251. #define BW_USDHC_INT_SIGNAL_EN_AC12EIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_AC12EIEN) | BF_USDHC_INT_SIGNAL_EN_AC12EIEN(v)))
  3252. #endif
  3253. /* --- Register HW_USDHC_INT_SIGNAL_EN, field TNEIEN[26] (RW)
  3254. *
  3255. * Tuning Error Interrupt Enable
  3256. *
  3257. * Values:
  3258. * 0 - Masked
  3259. * 1 - Enabled
  3260. */
  3261. #define BP_USDHC_INT_SIGNAL_EN_TNEIEN (26) //!< Bit position for USDHC_INT_SIGNAL_EN_TNEIEN.
  3262. #define BM_USDHC_INT_SIGNAL_EN_TNEIEN (0x04000000) //!< Bit mask for USDHC_INT_SIGNAL_EN_TNEIEN.
  3263. //! @brief Get value of USDHC_INT_SIGNAL_EN_TNEIEN from a register value.
  3264. #define BG_USDHC_INT_SIGNAL_EN_TNEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_TNEIEN) >> BP_USDHC_INT_SIGNAL_EN_TNEIEN)
  3265. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_TNEIEN.
  3266. #define BF_USDHC_INT_SIGNAL_EN_TNEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_TNEIEN) & BM_USDHC_INT_SIGNAL_EN_TNEIEN)
  3267. #ifndef __LANGUAGE_ASM__
  3268. //! @brief Set the TNEIEN field to a new value.
  3269. #define BW_USDHC_INT_SIGNAL_EN_TNEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_TNEIEN) | BF_USDHC_INT_SIGNAL_EN_TNEIEN(v)))
  3270. #endif
  3271. /* --- Register HW_USDHC_INT_SIGNAL_EN, field DMAEIEN[28] (RW)
  3272. *
  3273. * DMA Error Interrupt Enable:
  3274. *
  3275. * Values:
  3276. * 0 - Masked
  3277. * 1 - Enable
  3278. */
  3279. #define BP_USDHC_INT_SIGNAL_EN_DMAEIEN (28) //!< Bit position for USDHC_INT_SIGNAL_EN_DMAEIEN.
  3280. #define BM_USDHC_INT_SIGNAL_EN_DMAEIEN (0x10000000) //!< Bit mask for USDHC_INT_SIGNAL_EN_DMAEIEN.
  3281. //! @brief Get value of USDHC_INT_SIGNAL_EN_DMAEIEN from a register value.
  3282. #define BG_USDHC_INT_SIGNAL_EN_DMAEIEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_INT_SIGNAL_EN_DMAEIEN) >> BP_USDHC_INT_SIGNAL_EN_DMAEIEN)
  3283. //! @brief Format value for bitfield USDHC_INT_SIGNAL_EN_DMAEIEN.
  3284. #define BF_USDHC_INT_SIGNAL_EN_DMAEIEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_INT_SIGNAL_EN_DMAEIEN) & BM_USDHC_INT_SIGNAL_EN_DMAEIEN)
  3285. #ifndef __LANGUAGE_ASM__
  3286. //! @brief Set the DMAEIEN field to a new value.
  3287. #define BW_USDHC_INT_SIGNAL_EN_DMAEIEN(x, v) (HW_USDHC_INT_SIGNAL_EN_WR(x, (HW_USDHC_INT_SIGNAL_EN_RD(x) & ~BM_USDHC_INT_SIGNAL_EN_DMAEIEN) | BF_USDHC_INT_SIGNAL_EN_DMAEIEN(v)))
  3288. #endif
  3289. //-------------------------------------------------------------------------------------------
  3290. // HW_USDHC_AUTOCMD12_ERR_STATUS - Auto CMD12 Error Status
  3291. //-------------------------------------------------------------------------------------------
  3292. #ifndef __LANGUAGE_ASM__
  3293. /*!
  3294. * @brief HW_USDHC_AUTOCMD12_ERR_STATUS - Auto CMD12 Error Status (RO)
  3295. *
  3296. * Reset value: 0x00000000
  3297. *
  3298. * When the Auto CMD12 Error Status bit in the Status register is set, the Host Driver shall check
  3299. * this register to identify what kind of error the Auto CMD12 indicated. This register is valid
  3300. * only when the Auto CMD12 Error status bit is set. The table bwlow shows the relationship between
  3301. * the Auto CMGD12 CRC Error and the Auto CMD12 Command Timeout Error. Relationship Between
  3302. * Command CRC Error and Command Timeout Error for Auto CMD12 Auto CMD12 CRC Error Auto
  3303. * CMD12 Timeout Error Type of Error 0 0 No Error 0 1 Response Timeout
  3304. * Error 1 0 Response CRC Error 1 1 CMD line conflict Changes in Auto
  3305. * CMD12 Error Status register can be classified in three scenarios: When the uSDHC is going to
  3306. * issue an Auto CMD12. Set bit 0 to 1 if the Auto CMD12 can't be issued due to an error in the
  3307. * previous command Set bit 0 to 0 if the Auto CMD12 is issued At the end bit of an Auto CMD12
  3308. * response. Check errors correspond to bits 1-4. Set bits 1-4 corresponding to detected errors.
  3309. * Clear bits 1-4 corresponding to detected errors Before reading the Auto CMD12 Error Status bit
  3310. * 7. Set bit 7 to 1 if there is a command that can't be issued Clear bit 7 if there is no command
  3311. * to issue The timing for generating the Auto CMD12 Error and writing to the Command register
  3312. * are asynchronous. After that, bit 7 shall be sampled when the driver is not writing to the
  3313. * Command register. So it is suggested to read this register only when the AC12E bit in Interrupt
  3314. * Status register is set. An Auto CMD12 Error Interrupt is generated when one of the error bits
  3315. * (0-4) is set to 1. The Command Not Issued By Auto CMD12 Error does not generate an interrupt.
  3316. */
  3317. typedef union _hw_usdhc_autocmd12_err_status
  3318. {
  3319. reg32_t U;
  3320. struct _hw_usdhc_autocmd12_err_status_bitfields
  3321. {
  3322. unsigned AC12NE : 1; //!< [0] Auto CMD12 Not Executed: If memory multiple block data transfer is not started, due to a command error, this bit is not set because it is not necessary to issue an Auto CMD12.
  3323. unsigned AC12TOE : 1; //!< [1] Auto CMD12 Timeout Error: Occurs if no response is returned within 64 SDCLK cycles from the end bit of the command.
  3324. unsigned AC12EBE : 1; //!< [2] Auto CMD12 End Bit Error: Occurs when detecting that the end bit of command response is 0 which should be 1.
  3325. unsigned AC12CE : 1; //!< [3] Auto CMD12 CRC Error: Occurs when detecting a CRC error in the command response.
  3326. unsigned AC12IE : 1; //!< [4] Auto CMD12 Index Error: Occurs if the Command Index error occurs in response to a command.
  3327. unsigned RESERVED0 : 2; //!< [6:5] Reserved
  3328. unsigned CNIBAC12E : 1; //!< [7] Command Not Issued By Auto CMD12 Error: Setting this bit to 1 means CMD_wo_DAT is not executed due to an Auto CMD12 Error (D04-D01) in this register.
  3329. unsigned RESERVED1 : 24; //!< [31:8] Reserved
  3330. } B;
  3331. } hw_usdhc_autocmd12_err_status_t;
  3332. #endif
  3333. /*
  3334. * constants & macros for entire multi-block USDHC_AUTOCMD12_ERR_STATUS register
  3335. */
  3336. #define HW_USDHC_AUTOCMD12_ERR_STATUS_ADDR(x) (REGS_USDHC_BASE(x) + 0x3c)
  3337. #ifndef __LANGUAGE_ASM__
  3338. #define HW_USDHC_AUTOCMD12_ERR_STATUS(x) (*(volatile hw_usdhc_autocmd12_err_status_t *) HW_USDHC_AUTOCMD12_ERR_STATUS_ADDR(x))
  3339. #define HW_USDHC_AUTOCMD12_ERR_STATUS_RD(x) (HW_USDHC_AUTOCMD12_ERR_STATUS(x).U)
  3340. #endif
  3341. /*
  3342. * constants & macros for individual USDHC_AUTOCMD12_ERR_STATUS bitfields
  3343. */
  3344. /* --- Register HW_USDHC_AUTOCMD12_ERR_STATUS, field AC12NE[0] (RO)
  3345. *
  3346. * Auto CMD12 Not Executed: If memory multiple block data transfer is not started, due to a command
  3347. * error, this bit is not set because it is not necessary to issue an Auto CMD12. Setting this bit
  3348. * to 1 means the uSDHC cannot issue the Auto CMD12 to stop a memory multiple block data transfer
  3349. * due to some error. If this bit is set to 1, other error status bits (1-4) have no meaning.
  3350. *
  3351. * Values:
  3352. * 0 - Executed
  3353. * 1 - Not executed
  3354. */
  3355. #define BP_USDHC_AUTOCMD12_ERR_STATUS_AC12NE (0) //!< Bit position for USDHC_AUTOCMD12_ERR_STATUS_AC12NE.
  3356. #define BM_USDHC_AUTOCMD12_ERR_STATUS_AC12NE (0x00000001) //!< Bit mask for USDHC_AUTOCMD12_ERR_STATUS_AC12NE.
  3357. //! @brief Get value of USDHC_AUTOCMD12_ERR_STATUS_AC12NE from a register value.
  3358. #define BG_USDHC_AUTOCMD12_ERR_STATUS_AC12NE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_AUTOCMD12_ERR_STATUS_AC12NE) >> BP_USDHC_AUTOCMD12_ERR_STATUS_AC12NE)
  3359. /* --- Register HW_USDHC_AUTOCMD12_ERR_STATUS, field AC12TOE[1] (RO)
  3360. *
  3361. * Auto CMD12 Timeout Error: Occurs if no response is returned within 64 SDCLK cycles from the end
  3362. * bit of the command. If this bit is set to1, the other error status bits (2-4) have no meaning.
  3363. *
  3364. * Values:
  3365. * 0 - No error
  3366. * 1 - Time out
  3367. */
  3368. #define BP_USDHC_AUTOCMD12_ERR_STATUS_AC12TOE (1) //!< Bit position for USDHC_AUTOCMD12_ERR_STATUS_AC12TOE.
  3369. #define BM_USDHC_AUTOCMD12_ERR_STATUS_AC12TOE (0x00000002) //!< Bit mask for USDHC_AUTOCMD12_ERR_STATUS_AC12TOE.
  3370. //! @brief Get value of USDHC_AUTOCMD12_ERR_STATUS_AC12TOE from a register value.
  3371. #define BG_USDHC_AUTOCMD12_ERR_STATUS_AC12TOE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_AUTOCMD12_ERR_STATUS_AC12TOE) >> BP_USDHC_AUTOCMD12_ERR_STATUS_AC12TOE)
  3372. /* --- Register HW_USDHC_AUTOCMD12_ERR_STATUS, field AC12EBE[2] (RO)
  3373. *
  3374. * Auto CMD12 End Bit Error: Occurs when detecting that the end bit of command response is 0 which
  3375. * should be 1.
  3376. *
  3377. * Values:
  3378. * 0 - No error
  3379. * 1 - End Bit Error Generated
  3380. */
  3381. #define BP_USDHC_AUTOCMD12_ERR_STATUS_AC12EBE (2) //!< Bit position for USDHC_AUTOCMD12_ERR_STATUS_AC12EBE.
  3382. #define BM_USDHC_AUTOCMD12_ERR_STATUS_AC12EBE (0x00000004) //!< Bit mask for USDHC_AUTOCMD12_ERR_STATUS_AC12EBE.
  3383. //! @brief Get value of USDHC_AUTOCMD12_ERR_STATUS_AC12EBE from a register value.
  3384. #define BG_USDHC_AUTOCMD12_ERR_STATUS_AC12EBE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_AUTOCMD12_ERR_STATUS_AC12EBE) >> BP_USDHC_AUTOCMD12_ERR_STATUS_AC12EBE)
  3385. /* --- Register HW_USDHC_AUTOCMD12_ERR_STATUS, field AC12CE[3] (RO)
  3386. *
  3387. * Auto CMD12 CRC Error: Occurs when detecting a CRC error in the command response.
  3388. *
  3389. * Values:
  3390. * 0 - No CRC error
  3391. * 1 - CRC Error Met in Auto CMD12 Response
  3392. */
  3393. #define BP_USDHC_AUTOCMD12_ERR_STATUS_AC12CE (3) //!< Bit position for USDHC_AUTOCMD12_ERR_STATUS_AC12CE.
  3394. #define BM_USDHC_AUTOCMD12_ERR_STATUS_AC12CE (0x00000008) //!< Bit mask for USDHC_AUTOCMD12_ERR_STATUS_AC12CE.
  3395. //! @brief Get value of USDHC_AUTOCMD12_ERR_STATUS_AC12CE from a register value.
  3396. #define BG_USDHC_AUTOCMD12_ERR_STATUS_AC12CE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_AUTOCMD12_ERR_STATUS_AC12CE) >> BP_USDHC_AUTOCMD12_ERR_STATUS_AC12CE)
  3397. /* --- Register HW_USDHC_AUTOCMD12_ERR_STATUS, field AC12IE[4] (RO)
  3398. *
  3399. * Auto CMD12 Index Error: Occurs if the Command Index error occurs in response to a command.
  3400. *
  3401. * Values:
  3402. * 0 - No error
  3403. * 1 - Error, the CMD index in response is not CMD12
  3404. */
  3405. #define BP_USDHC_AUTOCMD12_ERR_STATUS_AC12IE (4) //!< Bit position for USDHC_AUTOCMD12_ERR_STATUS_AC12IE.
  3406. #define BM_USDHC_AUTOCMD12_ERR_STATUS_AC12IE (0x00000010) //!< Bit mask for USDHC_AUTOCMD12_ERR_STATUS_AC12IE.
  3407. //! @brief Get value of USDHC_AUTOCMD12_ERR_STATUS_AC12IE from a register value.
  3408. #define BG_USDHC_AUTOCMD12_ERR_STATUS_AC12IE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_AUTOCMD12_ERR_STATUS_AC12IE) >> BP_USDHC_AUTOCMD12_ERR_STATUS_AC12IE)
  3409. /* --- Register HW_USDHC_AUTOCMD12_ERR_STATUS, field CNIBAC12E[7] (RO)
  3410. *
  3411. * Command Not Issued By Auto CMD12 Error: Setting this bit to 1 means CMD_wo_DAT is not executed
  3412. * due to an Auto CMD12 Error (D04-D01) in this register.
  3413. *
  3414. * Values:
  3415. * 0 - No error
  3416. * 1 - Not Issued
  3417. */
  3418. #define BP_USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E (7) //!< Bit position for USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E.
  3419. #define BM_USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E (0x00000080) //!< Bit mask for USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E.
  3420. //! @brief Get value of USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E from a register value.
  3421. #define BG_USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E) >> BP_USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E)
  3422. //-------------------------------------------------------------------------------------------
  3423. // HW_USDHC_HOST_CTRL_CAP - Host Controller Capabilities
  3424. //-------------------------------------------------------------------------------------------
  3425. #ifndef __LANGUAGE_ASM__
  3426. /*!
  3427. * @brief HW_USDHC_HOST_CTRL_CAP - Host Controller Capabilities (RO)
  3428. *
  3429. * Reset value: 0x07f30000
  3430. *
  3431. * This register provides the Host Driver with information specific to the uSDHC implementation. The
  3432. * value in this register is the power-on-reset value, and does not change with a software reset.
  3433. * Any write to this register is ignored.
  3434. */
  3435. typedef union _hw_usdhc_host_ctrl_cap
  3436. {
  3437. reg32_t U;
  3438. struct _hw_usdhc_host_ctrl_cap_bitfields
  3439. {
  3440. unsigned RESERVED0 : 16; //!< [15:0] Reserved
  3441. unsigned MBL : 3; //!< [18:16] Max Block Length: This value indicates the maximum block size that the Host Driver can read and write to the buffer in the uSDHC.
  3442. unsigned RESERVED1 : 1; //!< [19] Reserved
  3443. unsigned ADMAS : 1; //!< [20] ADMA Support: This bit indicates whether the uSDHC supports the ADMA feature.
  3444. unsigned HSS : 1; //!< [21] High Speed Support: This bit indicates whether the uSDHC supports High Speed mode and the Host System can supply a SD Clock frequency from 25 MHz to 50 MHz.
  3445. unsigned DMAS : 1; //!< [22] DMA Support: This bit indicates whether the uSDHC is capable of using the internal DMA to transfer data between system memory and the data buffer directly.
  3446. unsigned SRS : 1; //!< [23] Suspend / Resume Support: This bit indicates whether the uSDHC supports Suspend / Resume functionality.
  3447. unsigned VS33 : 1; //!< [24] Voltage Support 3.3V: This bit shall depend on the Host System ability.
  3448. unsigned VS30 : 1; //!< [25] Voltage Support 3.0V: This bit shall depend on the Host System ability.
  3449. unsigned VS18 : 1; //!< [26] Voltage Support 1.8V: This bit shall depend on the Host System ability.
  3450. unsigned RESERVED2 : 5; //!< [31:27] Reserved
  3451. } B;
  3452. } hw_usdhc_host_ctrl_cap_t;
  3453. #endif
  3454. /*
  3455. * constants & macros for entire multi-block USDHC_HOST_CTRL_CAP register
  3456. */
  3457. #define HW_USDHC_HOST_CTRL_CAP_ADDR(x) (REGS_USDHC_BASE(x) + 0x40)
  3458. #ifndef __LANGUAGE_ASM__
  3459. #define HW_USDHC_HOST_CTRL_CAP(x) (*(volatile hw_usdhc_host_ctrl_cap_t *) HW_USDHC_HOST_CTRL_CAP_ADDR(x))
  3460. #define HW_USDHC_HOST_CTRL_CAP_RD(x) (HW_USDHC_HOST_CTRL_CAP(x).U)
  3461. #endif
  3462. /*
  3463. * constants & macros for individual USDHC_HOST_CTRL_CAP bitfields
  3464. */
  3465. /* --- Register HW_USDHC_HOST_CTRL_CAP, field MBL[18:16] (RO)
  3466. *
  3467. * Max Block Length: This value indicates the maximum block size that the Host Driver can read and
  3468. * write to the buffer in the uSDHC. The buffer shall transfer block size without wait cycles.
  3469. *
  3470. * Values:
  3471. * 000 - 512 bytes
  3472. * 001 - 1024 bytes
  3473. * 010 - 2048 bytes
  3474. * 011 - 4096 bytes
  3475. */
  3476. #define BP_USDHC_HOST_CTRL_CAP_MBL (16) //!< Bit position for USDHC_HOST_CTRL_CAP_MBL.
  3477. #define BM_USDHC_HOST_CTRL_CAP_MBL (0x00070000) //!< Bit mask for USDHC_HOST_CTRL_CAP_MBL.
  3478. //! @brief Get value of USDHC_HOST_CTRL_CAP_MBL from a register value.
  3479. #define BG_USDHC_HOST_CTRL_CAP_MBL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_MBL) >> BP_USDHC_HOST_CTRL_CAP_MBL)
  3480. /* --- Register HW_USDHC_HOST_CTRL_CAP, field ADMAS[20] (RO)
  3481. *
  3482. * ADMA Support: This bit indicates whether the uSDHC supports the ADMA feature.
  3483. *
  3484. * Values:
  3485. * 0 - Advanced DMA Not supported
  3486. * 1 - Advanced DMA Supported
  3487. */
  3488. #define BP_USDHC_HOST_CTRL_CAP_ADMAS (20) //!< Bit position for USDHC_HOST_CTRL_CAP_ADMAS.
  3489. #define BM_USDHC_HOST_CTRL_CAP_ADMAS (0x00100000) //!< Bit mask for USDHC_HOST_CTRL_CAP_ADMAS.
  3490. //! @brief Get value of USDHC_HOST_CTRL_CAP_ADMAS from a register value.
  3491. #define BG_USDHC_HOST_CTRL_CAP_ADMAS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_ADMAS) >> BP_USDHC_HOST_CTRL_CAP_ADMAS)
  3492. /* --- Register HW_USDHC_HOST_CTRL_CAP, field HSS[21] (RO)
  3493. *
  3494. * High Speed Support: This bit indicates whether the uSDHC supports High Speed mode and the Host
  3495. * System can supply a SD Clock frequency from 25 MHz to 50 MHz.
  3496. *
  3497. * Values:
  3498. * 0 - High Speed Not Supported
  3499. * 1 - High Speed Supported
  3500. */
  3501. #define BP_USDHC_HOST_CTRL_CAP_HSS (21) //!< Bit position for USDHC_HOST_CTRL_CAP_HSS.
  3502. #define BM_USDHC_HOST_CTRL_CAP_HSS (0x00200000) //!< Bit mask for USDHC_HOST_CTRL_CAP_HSS.
  3503. //! @brief Get value of USDHC_HOST_CTRL_CAP_HSS from a register value.
  3504. #define BG_USDHC_HOST_CTRL_CAP_HSS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_HSS) >> BP_USDHC_HOST_CTRL_CAP_HSS)
  3505. /* --- Register HW_USDHC_HOST_CTRL_CAP, field DMAS[22] (RO)
  3506. *
  3507. * DMA Support: This bit indicates whether the uSDHC is capable of using the internal DMA to
  3508. * transfer data between system memory and the data buffer directly.
  3509. *
  3510. * Values:
  3511. * 0 - DMA not supported
  3512. * 1 - DMA Supported
  3513. */
  3514. #define BP_USDHC_HOST_CTRL_CAP_DMAS (22) //!< Bit position for USDHC_HOST_CTRL_CAP_DMAS.
  3515. #define BM_USDHC_HOST_CTRL_CAP_DMAS (0x00400000) //!< Bit mask for USDHC_HOST_CTRL_CAP_DMAS.
  3516. //! @brief Get value of USDHC_HOST_CTRL_CAP_DMAS from a register value.
  3517. #define BG_USDHC_HOST_CTRL_CAP_DMAS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_DMAS) >> BP_USDHC_HOST_CTRL_CAP_DMAS)
  3518. /* --- Register HW_USDHC_HOST_CTRL_CAP, field SRS[23] (RO)
  3519. *
  3520. * Suspend / Resume Support: This bit indicates whether the uSDHC supports Suspend / Resume
  3521. * functionality. If this bit is 0, the Suspend and Resume mechanism, as well as the Read Wait, are
  3522. * not supported, and the Host Driver shall not issue either Suspend or Resume commands.
  3523. *
  3524. * Values:
  3525. * 0 - Not supported
  3526. * 1 - Supported
  3527. */
  3528. #define BP_USDHC_HOST_CTRL_CAP_SRS (23) //!< Bit position for USDHC_HOST_CTRL_CAP_SRS.
  3529. #define BM_USDHC_HOST_CTRL_CAP_SRS (0x00800000) //!< Bit mask for USDHC_HOST_CTRL_CAP_SRS.
  3530. //! @brief Get value of USDHC_HOST_CTRL_CAP_SRS from a register value.
  3531. #define BG_USDHC_HOST_CTRL_CAP_SRS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_SRS) >> BP_USDHC_HOST_CTRL_CAP_SRS)
  3532. /* --- Register HW_USDHC_HOST_CTRL_CAP, field VS33[24] (RO)
  3533. *
  3534. * Voltage Support 3.3V: This bit shall depend on the Host System ability.
  3535. *
  3536. * Values:
  3537. * 0 - 3.3V not supported
  3538. * 1 - 3.3V supported
  3539. */
  3540. #define BP_USDHC_HOST_CTRL_CAP_VS33 (24) //!< Bit position for USDHC_HOST_CTRL_CAP_VS33.
  3541. #define BM_USDHC_HOST_CTRL_CAP_VS33 (0x01000000) //!< Bit mask for USDHC_HOST_CTRL_CAP_VS33.
  3542. //! @brief Get value of USDHC_HOST_CTRL_CAP_VS33 from a register value.
  3543. #define BG_USDHC_HOST_CTRL_CAP_VS33(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_VS33) >> BP_USDHC_HOST_CTRL_CAP_VS33)
  3544. /* --- Register HW_USDHC_HOST_CTRL_CAP, field VS30[25] (RO)
  3545. *
  3546. * Voltage Support 3.0V: This bit shall depend on the Host System ability.
  3547. *
  3548. * Values:
  3549. * 0 - 3.0V not supported
  3550. * 1 - 3.0V supported
  3551. */
  3552. #define BP_USDHC_HOST_CTRL_CAP_VS30 (25) //!< Bit position for USDHC_HOST_CTRL_CAP_VS30.
  3553. #define BM_USDHC_HOST_CTRL_CAP_VS30 (0x02000000) //!< Bit mask for USDHC_HOST_CTRL_CAP_VS30.
  3554. //! @brief Get value of USDHC_HOST_CTRL_CAP_VS30 from a register value.
  3555. #define BG_USDHC_HOST_CTRL_CAP_VS30(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_VS30) >> BP_USDHC_HOST_CTRL_CAP_VS30)
  3556. /* --- Register HW_USDHC_HOST_CTRL_CAP, field VS18[26] (RO)
  3557. *
  3558. * Voltage Support 1.8V: This bit shall depend on the Host System ability.
  3559. *
  3560. * Values:
  3561. * 0 - 1.8V not supported
  3562. * 1 - 1.8V supported
  3563. */
  3564. #define BP_USDHC_HOST_CTRL_CAP_VS18 (26) //!< Bit position for USDHC_HOST_CTRL_CAP_VS18.
  3565. #define BM_USDHC_HOST_CTRL_CAP_VS18 (0x04000000) //!< Bit mask for USDHC_HOST_CTRL_CAP_VS18.
  3566. //! @brief Get value of USDHC_HOST_CTRL_CAP_VS18 from a register value.
  3567. #define BG_USDHC_HOST_CTRL_CAP_VS18(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_CAP_VS18) >> BP_USDHC_HOST_CTRL_CAP_VS18)
  3568. //-------------------------------------------------------------------------------------------
  3569. // HW_USDHC_WTMK_LVL - Watermark Level
  3570. //-------------------------------------------------------------------------------------------
  3571. #ifndef __LANGUAGE_ASM__
  3572. /*!
  3573. * @brief HW_USDHC_WTMK_LVL - Watermark Level (RW)
  3574. *
  3575. * Reset value: 0x08100810
  3576. *
  3577. * Both write and read watermark levels (FIFO threshold) are configurable. There value can range
  3578. * from 1 to 128 words. Both write and read burst lengths are also Configurable. There value can
  3579. * range from 1 to 31 words.
  3580. */
  3581. typedef union _hw_usdhc_wtmk_lvl
  3582. {
  3583. reg32_t U;
  3584. struct _hw_usdhc_wtmk_lvl_bitfields
  3585. {
  3586. unsigned RD_WML : 8; //!< [7:0] Read Watermark Level: The number of words used as the watermark level (FIFO threshold) in a DMA read operation.
  3587. unsigned RD_BRST_LEN : 5; //!< [12:8] Read Burst Length: Due to system restriction, the actual burst length may not exceed 16.
  3588. unsigned RESERVED0 : 3; //!< [15:13] Reserved
  3589. unsigned WR_WML : 8; //!< [23:16] Write Watermark Level: The number of words used as the watermark level (FIFO threshold) in a DMA write operation.
  3590. unsigned WR_BRST_LEN : 5; //!< [28:24] Write Burst Length: Due to system restriction, the actual burst length may not exceed 16.
  3591. unsigned RESERVED1 : 3; //!< [31:29] Reserved
  3592. } B;
  3593. } hw_usdhc_wtmk_lvl_t;
  3594. #endif
  3595. /*
  3596. * constants & macros for entire multi-block USDHC_WTMK_LVL register
  3597. */
  3598. #define HW_USDHC_WTMK_LVL_ADDR(x) (REGS_USDHC_BASE(x) + 0x44)
  3599. #ifndef __LANGUAGE_ASM__
  3600. #define HW_USDHC_WTMK_LVL(x) (*(volatile hw_usdhc_wtmk_lvl_t *) HW_USDHC_WTMK_LVL_ADDR(x))
  3601. #define HW_USDHC_WTMK_LVL_RD(x) (HW_USDHC_WTMK_LVL(x).U)
  3602. #define HW_USDHC_WTMK_LVL_WR(x, v) (HW_USDHC_WTMK_LVL(x).U = (v))
  3603. #define HW_USDHC_WTMK_LVL_SET(x, v) (HW_USDHC_WTMK_LVL_WR(x, HW_USDHC_WTMK_LVL_RD(x) | (v)))
  3604. #define HW_USDHC_WTMK_LVL_CLR(x, v) (HW_USDHC_WTMK_LVL_WR(x, HW_USDHC_WTMK_LVL_RD(x) & ~(v)))
  3605. #define HW_USDHC_WTMK_LVL_TOG(x, v) (HW_USDHC_WTMK_LVL_WR(x, HW_USDHC_WTMK_LVL_RD(x) ^ (v)))
  3606. #endif
  3607. /*
  3608. * constants & macros for individual USDHC_WTMK_LVL bitfields
  3609. */
  3610. /* --- Register HW_USDHC_WTMK_LVL, field RD_WML[7:0] (RW)
  3611. *
  3612. * Read Watermark Level: The number of words used as the watermark level (FIFO threshold) in a DMA
  3613. * read operation. Also the number of words as a sequence of read bursts in back-to-back mode. The
  3614. * maximum legal value for the read water mark level is 128.
  3615. */
  3616. #define BP_USDHC_WTMK_LVL_RD_WML (0) //!< Bit position for USDHC_WTMK_LVL_RD_WML.
  3617. #define BM_USDHC_WTMK_LVL_RD_WML (0x000000ff) //!< Bit mask for USDHC_WTMK_LVL_RD_WML.
  3618. //! @brief Get value of USDHC_WTMK_LVL_RD_WML from a register value.
  3619. #define BG_USDHC_WTMK_LVL_RD_WML(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_WTMK_LVL_RD_WML) >> BP_USDHC_WTMK_LVL_RD_WML)
  3620. //! @brief Format value for bitfield USDHC_WTMK_LVL_RD_WML.
  3621. #define BF_USDHC_WTMK_LVL_RD_WML(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_WTMK_LVL_RD_WML) & BM_USDHC_WTMK_LVL_RD_WML)
  3622. #ifndef __LANGUAGE_ASM__
  3623. //! @brief Set the RD_WML field to a new value.
  3624. #define BW_USDHC_WTMK_LVL_RD_WML(x, v) (HW_USDHC_WTMK_LVL_WR(x, (HW_USDHC_WTMK_LVL_RD(x) & ~BM_USDHC_WTMK_LVL_RD_WML) | BF_USDHC_WTMK_LVL_RD_WML(v)))
  3625. #endif
  3626. /* --- Register HW_USDHC_WTMK_LVL, field RD_BRST_LEN[12:8] (RW)
  3627. *
  3628. * Read Burst Length: Due to system restriction, the actual burst length may not exceed 16. The
  3629. * number of words the uSDHC reads in a single burst. The read burst length must be less than or
  3630. * equal to the read watermark level, and all bursts within a watermark level transfer will be in
  3631. * back-to-back mode. On reset, this field will be 8. Writing 0 to this field will result in '01000'
  3632. * (i.e. it is not able to clear this field).
  3633. */
  3634. #define BP_USDHC_WTMK_LVL_RD_BRST_LEN (8) //!< Bit position for USDHC_WTMK_LVL_RD_BRST_LEN.
  3635. #define BM_USDHC_WTMK_LVL_RD_BRST_LEN (0x00001f00) //!< Bit mask for USDHC_WTMK_LVL_RD_BRST_LEN.
  3636. //! @brief Get value of USDHC_WTMK_LVL_RD_BRST_LEN from a register value.
  3637. #define BG_USDHC_WTMK_LVL_RD_BRST_LEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_WTMK_LVL_RD_BRST_LEN) >> BP_USDHC_WTMK_LVL_RD_BRST_LEN)
  3638. //! @brief Format value for bitfield USDHC_WTMK_LVL_RD_BRST_LEN.
  3639. #define BF_USDHC_WTMK_LVL_RD_BRST_LEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_WTMK_LVL_RD_BRST_LEN) & BM_USDHC_WTMK_LVL_RD_BRST_LEN)
  3640. #ifndef __LANGUAGE_ASM__
  3641. //! @brief Set the RD_BRST_LEN field to a new value.
  3642. #define BW_USDHC_WTMK_LVL_RD_BRST_LEN(x, v) (HW_USDHC_WTMK_LVL_WR(x, (HW_USDHC_WTMK_LVL_RD(x) & ~BM_USDHC_WTMK_LVL_RD_BRST_LEN) | BF_USDHC_WTMK_LVL_RD_BRST_LEN(v)))
  3643. #endif
  3644. /* --- Register HW_USDHC_WTMK_LVL, field WR_WML[23:16] (RW)
  3645. *
  3646. * Write Watermark Level: The number of words used as the watermark level (FIFO threshold) in a DMA
  3647. * write operation. Also the number of words as a sequence of write bursts in back-to-back mode. The
  3648. * maximum legal value for the write watermark level is 128.
  3649. */
  3650. #define BP_USDHC_WTMK_LVL_WR_WML (16) //!< Bit position for USDHC_WTMK_LVL_WR_WML.
  3651. #define BM_USDHC_WTMK_LVL_WR_WML (0x00ff0000) //!< Bit mask for USDHC_WTMK_LVL_WR_WML.
  3652. //! @brief Get value of USDHC_WTMK_LVL_WR_WML from a register value.
  3653. #define BG_USDHC_WTMK_LVL_WR_WML(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_WTMK_LVL_WR_WML) >> BP_USDHC_WTMK_LVL_WR_WML)
  3654. //! @brief Format value for bitfield USDHC_WTMK_LVL_WR_WML.
  3655. #define BF_USDHC_WTMK_LVL_WR_WML(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_WTMK_LVL_WR_WML) & BM_USDHC_WTMK_LVL_WR_WML)
  3656. #ifndef __LANGUAGE_ASM__
  3657. //! @brief Set the WR_WML field to a new value.
  3658. #define BW_USDHC_WTMK_LVL_WR_WML(x, v) (HW_USDHC_WTMK_LVL_WR(x, (HW_USDHC_WTMK_LVL_RD(x) & ~BM_USDHC_WTMK_LVL_WR_WML) | BF_USDHC_WTMK_LVL_WR_WML(v)))
  3659. #endif
  3660. /* --- Register HW_USDHC_WTMK_LVL, field WR_BRST_LEN[28:24] (RW)
  3661. *
  3662. * Write Burst Length: Due to system restriction, the actual burst length may not exceed 16. The
  3663. * number of words the uSDHC writes in a single burst. The write burst length must be less than or
  3664. * equal to the write watermark level, and all bursts within a watermark level transfer will be in
  3665. * back-to-back mode. On reset, this field will be 8. Writing 0 to this field will result in '01000'
  3666. * (i.e. it is not able to clear this field).
  3667. */
  3668. #define BP_USDHC_WTMK_LVL_WR_BRST_LEN (24) //!< Bit position for USDHC_WTMK_LVL_WR_BRST_LEN.
  3669. #define BM_USDHC_WTMK_LVL_WR_BRST_LEN (0x1f000000) //!< Bit mask for USDHC_WTMK_LVL_WR_BRST_LEN.
  3670. //! @brief Get value of USDHC_WTMK_LVL_WR_BRST_LEN from a register value.
  3671. #define BG_USDHC_WTMK_LVL_WR_BRST_LEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_WTMK_LVL_WR_BRST_LEN) >> BP_USDHC_WTMK_LVL_WR_BRST_LEN)
  3672. //! @brief Format value for bitfield USDHC_WTMK_LVL_WR_BRST_LEN.
  3673. #define BF_USDHC_WTMK_LVL_WR_BRST_LEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_WTMK_LVL_WR_BRST_LEN) & BM_USDHC_WTMK_LVL_WR_BRST_LEN)
  3674. #ifndef __LANGUAGE_ASM__
  3675. //! @brief Set the WR_BRST_LEN field to a new value.
  3676. #define BW_USDHC_WTMK_LVL_WR_BRST_LEN(x, v) (HW_USDHC_WTMK_LVL_WR(x, (HW_USDHC_WTMK_LVL_RD(x) & ~BM_USDHC_WTMK_LVL_WR_BRST_LEN) | BF_USDHC_WTMK_LVL_WR_BRST_LEN(v)))
  3677. #endif
  3678. //-------------------------------------------------------------------------------------------
  3679. // HW_USDHC_MIX_CTRL - Mixer Control
  3680. //-------------------------------------------------------------------------------------------
  3681. #ifndef __LANGUAGE_ASM__
  3682. /*!
  3683. * @brief HW_USDHC_MIX_CTRL - Mixer Control (RW)
  3684. *
  3685. * Reset value: 0x80000000
  3686. *
  3687. * This register is used to DMA and data transfer. To prevent data loss, The software should be
  3688. * check if data transfer is active before write this register. Olny data transfer is invalid there
  3689. * can be write. These bits are DPSEL, MBSEL, DTDSEL, AC12EN, BCEN and DMAEN. Transfer Type
  3690. * Register Setting for Various Transfer Types Multi/Single Block Select Block Count
  3691. * Enable Block Count Function 0 Don't Care Don't Care Single Transfer 1
  3692. * 0 Don't Care Infinite Transfer 1 1 Positive Number Multiple Transfer 1
  3693. * 1 Zero No Data Transfer
  3694. */
  3695. typedef union _hw_usdhc_mix_ctrl
  3696. {
  3697. reg32_t U;
  3698. struct _hw_usdhc_mix_ctrl_bitfields
  3699. {
  3700. unsigned DMAEN : 1; //!< [0] DMA Enable: This bit enables DMA functionality.
  3701. unsigned BCEN : 1; //!< [1] Block Count Enable: This bit is used to enable the Block Count register, which is only relevant for multiple block transfers.
  3702. unsigned AC12EN : 1; //!< [2] Auto CMD12 Enable: Multiple block transfers for memory require a CMD12 to stop the transaction.
  3703. unsigned DDR_EN : 1; //!< [3] Dual Data Rate mode selection
  3704. unsigned DTDSEL : 1; //!< [4] Data Transfer Direction Select: This bit defines the direction of DAT line data transfers.
  3705. unsigned MSBSEL : 1; //!< [5] Multi / Single Block Select: This bit enables multiple block DAT line data transfers.
  3706. unsigned NIBBLE_POS : 1; //!< [6] In DDR 4 bit mode nibble position indictation.
  3707. unsigned AC23EN : 1; //!< [7] Auto CMD23 Enable When this bit is set to 1, the Host Controller issues a CMD23 automatically before issuing a command specified in the Command Register.
  3708. unsigned RESERVED0 : 14; //!< [21:8] Reserved
  3709. unsigned EXE_TUNE : 1; //!< [22] Execute Tuning: (Only used for SD3.0, SDR104 mode) This bit is set to 1 to indicate the Host Driver is starting tuning procedure.
  3710. unsigned SMP_CLK_SEL : 1; //!< [23] Tuned clock or Fixed clock is used to sample data/cmd (Only used for SD3.0, SDR104 mode)
  3711. unsigned AUTO_TUNE_EN : 1; //!< [24] Auto tuning enable (Only used for SD3.0, SDR104 mode)
  3712. unsigned FBCLK_SEL : 1; //!< [25] Feedback clock source selection (Only used for SD3.0, SDR104 mode)
  3713. unsigned RESERVED1 : 3; //!< [28:26] Reserved
  3714. unsigned AC12_RD_POINT : 1; //!< [29] Only for debug.
  3715. unsigned CMD_DMY_WAIT_CFG : 1; //!< [30] Only for debug.
  3716. unsigned CMD_DMY_EN : 1; //!< [31] Only for debug.
  3717. } B;
  3718. } hw_usdhc_mix_ctrl_t;
  3719. #endif
  3720. /*
  3721. * constants & macros for entire multi-block USDHC_MIX_CTRL register
  3722. */
  3723. #define HW_USDHC_MIX_CTRL_ADDR(x) (REGS_USDHC_BASE(x) + 0x48)
  3724. #ifndef __LANGUAGE_ASM__
  3725. #define HW_USDHC_MIX_CTRL(x) (*(volatile hw_usdhc_mix_ctrl_t *) HW_USDHC_MIX_CTRL_ADDR(x))
  3726. #define HW_USDHC_MIX_CTRL_RD(x) (HW_USDHC_MIX_CTRL(x).U)
  3727. #define HW_USDHC_MIX_CTRL_WR(x, v) (HW_USDHC_MIX_CTRL(x).U = (v))
  3728. #define HW_USDHC_MIX_CTRL_SET(x, v) (HW_USDHC_MIX_CTRL_WR(x, HW_USDHC_MIX_CTRL_RD(x) | (v)))
  3729. #define HW_USDHC_MIX_CTRL_CLR(x, v) (HW_USDHC_MIX_CTRL_WR(x, HW_USDHC_MIX_CTRL_RD(x) & ~(v)))
  3730. #define HW_USDHC_MIX_CTRL_TOG(x, v) (HW_USDHC_MIX_CTRL_WR(x, HW_USDHC_MIX_CTRL_RD(x) ^ (v)))
  3731. #endif
  3732. /*
  3733. * constants & macros for individual USDHC_MIX_CTRL bitfields
  3734. */
  3735. /* --- Register HW_USDHC_MIX_CTRL, field DMAEN[0] (RW)
  3736. *
  3737. * DMA Enable: This bit enables DMA functionality. If this bit is set to 1, a DMA operation shall
  3738. * begin when the Host Driver sets the DPSEL bit of this register. Whether the Simple DMA, or the
  3739. * Advanced DMA, is active depends on the DMA Select field of the Protocol Control register.
  3740. *
  3741. * Values:
  3742. * 0 - Disable
  3743. * 1 - Enable
  3744. */
  3745. #define BP_USDHC_MIX_CTRL_DMAEN (0) //!< Bit position for USDHC_MIX_CTRL_DMAEN.
  3746. #define BM_USDHC_MIX_CTRL_DMAEN (0x00000001) //!< Bit mask for USDHC_MIX_CTRL_DMAEN.
  3747. //! @brief Get value of USDHC_MIX_CTRL_DMAEN from a register value.
  3748. #define BG_USDHC_MIX_CTRL_DMAEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_DMAEN) >> BP_USDHC_MIX_CTRL_DMAEN)
  3749. //! @brief Format value for bitfield USDHC_MIX_CTRL_DMAEN.
  3750. #define BF_USDHC_MIX_CTRL_DMAEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_DMAEN) & BM_USDHC_MIX_CTRL_DMAEN)
  3751. #ifndef __LANGUAGE_ASM__
  3752. //! @brief Set the DMAEN field to a new value.
  3753. #define BW_USDHC_MIX_CTRL_DMAEN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_DMAEN) | BF_USDHC_MIX_CTRL_DMAEN(v)))
  3754. #endif
  3755. /* --- Register HW_USDHC_MIX_CTRL, field BCEN[1] (RW)
  3756. *
  3757. * Block Count Enable: This bit is used to enable the Block Count register, which is only relevant
  3758. * for multiple block transfers. When this bit is 0, the internal counter for block is disabled,
  3759. * which is useful in executing an infinite transfer.
  3760. *
  3761. * Values:
  3762. * 0 - Disable
  3763. * 1 - Enable
  3764. */
  3765. #define BP_USDHC_MIX_CTRL_BCEN (1) //!< Bit position for USDHC_MIX_CTRL_BCEN.
  3766. #define BM_USDHC_MIX_CTRL_BCEN (0x00000002) //!< Bit mask for USDHC_MIX_CTRL_BCEN.
  3767. //! @brief Get value of USDHC_MIX_CTRL_BCEN from a register value.
  3768. #define BG_USDHC_MIX_CTRL_BCEN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_BCEN) >> BP_USDHC_MIX_CTRL_BCEN)
  3769. //! @brief Format value for bitfield USDHC_MIX_CTRL_BCEN.
  3770. #define BF_USDHC_MIX_CTRL_BCEN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_BCEN) & BM_USDHC_MIX_CTRL_BCEN)
  3771. #ifndef __LANGUAGE_ASM__
  3772. //! @brief Set the BCEN field to a new value.
  3773. #define BW_USDHC_MIX_CTRL_BCEN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_BCEN) | BF_USDHC_MIX_CTRL_BCEN(v)))
  3774. #endif
  3775. /* --- Register HW_USDHC_MIX_CTRL, field AC12EN[2] (RW)
  3776. *
  3777. * Auto CMD12 Enable: Multiple block transfers for memory require a CMD12 to stop the transaction.
  3778. * When this bit is set to 1, the uSDHC will issue a CMD12 automatically when the last block
  3779. * transfer has completed. The Host Driver shall not set this bit to issue commands that do not
  3780. * require CMD12 to stop a multiple block data transfer. In particular, secure commands defined in
  3781. * File Security Specification (see reference list) do not require CMD12. In single block transfer,
  3782. * the uSDHC will ignore this bit no matter if it is set or not.
  3783. *
  3784. * Values:
  3785. * 0 - Disable
  3786. * 1 - Enable
  3787. */
  3788. #define BP_USDHC_MIX_CTRL_AC12EN (2) //!< Bit position for USDHC_MIX_CTRL_AC12EN.
  3789. #define BM_USDHC_MIX_CTRL_AC12EN (0x00000004) //!< Bit mask for USDHC_MIX_CTRL_AC12EN.
  3790. //! @brief Get value of USDHC_MIX_CTRL_AC12EN from a register value.
  3791. #define BG_USDHC_MIX_CTRL_AC12EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_AC12EN) >> BP_USDHC_MIX_CTRL_AC12EN)
  3792. //! @brief Format value for bitfield USDHC_MIX_CTRL_AC12EN.
  3793. #define BF_USDHC_MIX_CTRL_AC12EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_AC12EN) & BM_USDHC_MIX_CTRL_AC12EN)
  3794. #ifndef __LANGUAGE_ASM__
  3795. //! @brief Set the AC12EN field to a new value.
  3796. #define BW_USDHC_MIX_CTRL_AC12EN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_AC12EN) | BF_USDHC_MIX_CTRL_AC12EN(v)))
  3797. #endif
  3798. /* --- Register HW_USDHC_MIX_CTRL, field DDR_EN[3] (RW)
  3799. *
  3800. * Dual Data Rate mode selection
  3801. */
  3802. #define BP_USDHC_MIX_CTRL_DDR_EN (3) //!< Bit position for USDHC_MIX_CTRL_DDR_EN.
  3803. #define BM_USDHC_MIX_CTRL_DDR_EN (0x00000008) //!< Bit mask for USDHC_MIX_CTRL_DDR_EN.
  3804. //! @brief Get value of USDHC_MIX_CTRL_DDR_EN from a register value.
  3805. #define BG_USDHC_MIX_CTRL_DDR_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_DDR_EN) >> BP_USDHC_MIX_CTRL_DDR_EN)
  3806. //! @brief Format value for bitfield USDHC_MIX_CTRL_DDR_EN.
  3807. #define BF_USDHC_MIX_CTRL_DDR_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_DDR_EN) & BM_USDHC_MIX_CTRL_DDR_EN)
  3808. #ifndef __LANGUAGE_ASM__
  3809. //! @brief Set the DDR_EN field to a new value.
  3810. #define BW_USDHC_MIX_CTRL_DDR_EN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_DDR_EN) | BF_USDHC_MIX_CTRL_DDR_EN(v)))
  3811. #endif
  3812. /* --- Register HW_USDHC_MIX_CTRL, field DTDSEL[4] (RW)
  3813. *
  3814. * Data Transfer Direction Select: This bit defines the direction of DAT line data transfers. The
  3815. * bit is set to 1 by the Host Driver to transfer data from the SD card to the uSDHC and is set to 0
  3816. * for all other commands.
  3817. *
  3818. * Values:
  3819. * 0 - Write (Host to Card)
  3820. * 1 - Read (Card to Host)
  3821. */
  3822. #define BP_USDHC_MIX_CTRL_DTDSEL (4) //!< Bit position for USDHC_MIX_CTRL_DTDSEL.
  3823. #define BM_USDHC_MIX_CTRL_DTDSEL (0x00000010) //!< Bit mask for USDHC_MIX_CTRL_DTDSEL.
  3824. //! @brief Get value of USDHC_MIX_CTRL_DTDSEL from a register value.
  3825. #define BG_USDHC_MIX_CTRL_DTDSEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_DTDSEL) >> BP_USDHC_MIX_CTRL_DTDSEL)
  3826. //! @brief Format value for bitfield USDHC_MIX_CTRL_DTDSEL.
  3827. #define BF_USDHC_MIX_CTRL_DTDSEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_DTDSEL) & BM_USDHC_MIX_CTRL_DTDSEL)
  3828. #ifndef __LANGUAGE_ASM__
  3829. //! @brief Set the DTDSEL field to a new value.
  3830. #define BW_USDHC_MIX_CTRL_DTDSEL(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_DTDSEL) | BF_USDHC_MIX_CTRL_DTDSEL(v)))
  3831. #endif
  3832. /* --- Register HW_USDHC_MIX_CTRL, field MSBSEL[5] (RW)
  3833. *
  3834. * Multi / Single Block Select: This bit enables multiple block DAT line data transfers. For any
  3835. * other commands, this bit shall be set to 0. If this bit is 0, it is not necessary to set the
  3836. * Block Count register. (Refer to ).
  3837. *
  3838. * Values:
  3839. * 0 - Single Block
  3840. * 1 - Multiple Blocks
  3841. */
  3842. #define BP_USDHC_MIX_CTRL_MSBSEL (5) //!< Bit position for USDHC_MIX_CTRL_MSBSEL.
  3843. #define BM_USDHC_MIX_CTRL_MSBSEL (0x00000020) //!< Bit mask for USDHC_MIX_CTRL_MSBSEL.
  3844. //! @brief Get value of USDHC_MIX_CTRL_MSBSEL from a register value.
  3845. #define BG_USDHC_MIX_CTRL_MSBSEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_MSBSEL) >> BP_USDHC_MIX_CTRL_MSBSEL)
  3846. //! @brief Format value for bitfield USDHC_MIX_CTRL_MSBSEL.
  3847. #define BF_USDHC_MIX_CTRL_MSBSEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_MSBSEL) & BM_USDHC_MIX_CTRL_MSBSEL)
  3848. #ifndef __LANGUAGE_ASM__
  3849. //! @brief Set the MSBSEL field to a new value.
  3850. #define BW_USDHC_MIX_CTRL_MSBSEL(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_MSBSEL) | BF_USDHC_MIX_CTRL_MSBSEL(v)))
  3851. #endif
  3852. /* --- Register HW_USDHC_MIX_CTRL, field NIBBLE_POS[6] (RW)
  3853. *
  3854. * In DDR 4 bit mode nibble position indictation. 0- the sequence is 'odd high nibble -> even high
  3855. * nibble -> odd low nibble -> even low nibble'; 1- the sequence is 'odd high nibble -> odd low
  3856. * nibble -> even high nibble -> even low nibble'.
  3857. */
  3858. #define BP_USDHC_MIX_CTRL_NIBBLE_POS (6) //!< Bit position for USDHC_MIX_CTRL_NIBBLE_POS.
  3859. #define BM_USDHC_MIX_CTRL_NIBBLE_POS (0x00000040) //!< Bit mask for USDHC_MIX_CTRL_NIBBLE_POS.
  3860. //! @brief Get value of USDHC_MIX_CTRL_NIBBLE_POS from a register value.
  3861. #define BG_USDHC_MIX_CTRL_NIBBLE_POS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_NIBBLE_POS) >> BP_USDHC_MIX_CTRL_NIBBLE_POS)
  3862. //! @brief Format value for bitfield USDHC_MIX_CTRL_NIBBLE_POS.
  3863. #define BF_USDHC_MIX_CTRL_NIBBLE_POS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_NIBBLE_POS) & BM_USDHC_MIX_CTRL_NIBBLE_POS)
  3864. #ifndef __LANGUAGE_ASM__
  3865. //! @brief Set the NIBBLE_POS field to a new value.
  3866. #define BW_USDHC_MIX_CTRL_NIBBLE_POS(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_NIBBLE_POS) | BF_USDHC_MIX_CTRL_NIBBLE_POS(v)))
  3867. #endif
  3868. /* --- Register HW_USDHC_MIX_CTRL, field AC23EN[7] (RW)
  3869. *
  3870. * Auto CMD23 Enable When this bit is set to 1, the Host Controller issues a CMD23 automatically
  3871. * before issuing a command specified in the Command Register.
  3872. */
  3873. #define BP_USDHC_MIX_CTRL_AC23EN (7) //!< Bit position for USDHC_MIX_CTRL_AC23EN.
  3874. #define BM_USDHC_MIX_CTRL_AC23EN (0x00000080) //!< Bit mask for USDHC_MIX_CTRL_AC23EN.
  3875. //! @brief Get value of USDHC_MIX_CTRL_AC23EN from a register value.
  3876. #define BG_USDHC_MIX_CTRL_AC23EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_AC23EN) >> BP_USDHC_MIX_CTRL_AC23EN)
  3877. //! @brief Format value for bitfield USDHC_MIX_CTRL_AC23EN.
  3878. #define BF_USDHC_MIX_CTRL_AC23EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_AC23EN) & BM_USDHC_MIX_CTRL_AC23EN)
  3879. #ifndef __LANGUAGE_ASM__
  3880. //! @brief Set the AC23EN field to a new value.
  3881. #define BW_USDHC_MIX_CTRL_AC23EN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_AC23EN) | BF_USDHC_MIX_CTRL_AC23EN(v)))
  3882. #endif
  3883. /* --- Register HW_USDHC_MIX_CTRL, field EXE_TUNE[22] (RW)
  3884. *
  3885. * Execute Tuning: (Only used for SD3.0, SDR104 mode) This bit is set to 1 to indicate the Host
  3886. * Driver is starting tuning procedure. Tuning procedure is aborted by writing 0.
  3887. *
  3888. * Values:
  3889. * 0 - Not Tuned or Tuning Completed
  3890. * 1 - Execute Tuning
  3891. */
  3892. #define BP_USDHC_MIX_CTRL_EXE_TUNE (22) //!< Bit position for USDHC_MIX_CTRL_EXE_TUNE.
  3893. #define BM_USDHC_MIX_CTRL_EXE_TUNE (0x00400000) //!< Bit mask for USDHC_MIX_CTRL_EXE_TUNE.
  3894. //! @brief Get value of USDHC_MIX_CTRL_EXE_TUNE from a register value.
  3895. #define BG_USDHC_MIX_CTRL_EXE_TUNE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_EXE_TUNE) >> BP_USDHC_MIX_CTRL_EXE_TUNE)
  3896. //! @brief Format value for bitfield USDHC_MIX_CTRL_EXE_TUNE.
  3897. #define BF_USDHC_MIX_CTRL_EXE_TUNE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_EXE_TUNE) & BM_USDHC_MIX_CTRL_EXE_TUNE)
  3898. #ifndef __LANGUAGE_ASM__
  3899. //! @brief Set the EXE_TUNE field to a new value.
  3900. #define BW_USDHC_MIX_CTRL_EXE_TUNE(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_EXE_TUNE) | BF_USDHC_MIX_CTRL_EXE_TUNE(v)))
  3901. #endif
  3902. /* --- Register HW_USDHC_MIX_CTRL, field SMP_CLK_SEL[23] (RW)
  3903. *
  3904. * Tuned clock or Fixed clock is used to sample data/cmd (Only used for SD3.0, SDR104 mode)
  3905. *
  3906. * Values:
  3907. * 0 - Fixed clock is used to sample data/cmd
  3908. * 1 - Tuned clock is used to sample data/cmd
  3909. */
  3910. #define BP_USDHC_MIX_CTRL_SMP_CLK_SEL (23) //!< Bit position for USDHC_MIX_CTRL_SMP_CLK_SEL.
  3911. #define BM_USDHC_MIX_CTRL_SMP_CLK_SEL (0x00800000) //!< Bit mask for USDHC_MIX_CTRL_SMP_CLK_SEL.
  3912. //! @brief Get value of USDHC_MIX_CTRL_SMP_CLK_SEL from a register value.
  3913. #define BG_USDHC_MIX_CTRL_SMP_CLK_SEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_SMP_CLK_SEL) >> BP_USDHC_MIX_CTRL_SMP_CLK_SEL)
  3914. //! @brief Format value for bitfield USDHC_MIX_CTRL_SMP_CLK_SEL.
  3915. #define BF_USDHC_MIX_CTRL_SMP_CLK_SEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_SMP_CLK_SEL) & BM_USDHC_MIX_CTRL_SMP_CLK_SEL)
  3916. #ifndef __LANGUAGE_ASM__
  3917. //! @brief Set the SMP_CLK_SEL field to a new value.
  3918. #define BW_USDHC_MIX_CTRL_SMP_CLK_SEL(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_SMP_CLK_SEL) | BF_USDHC_MIX_CTRL_SMP_CLK_SEL(v)))
  3919. #endif
  3920. /* --- Register HW_USDHC_MIX_CTRL, field AUTO_TUNE_EN[24] (RW)
  3921. *
  3922. * Auto tuning enable (Only used for SD3.0, SDR104 mode)
  3923. *
  3924. * Values:
  3925. * 0 - disable auto tuning
  3926. * 1 - enable auto tuning
  3927. */
  3928. #define BP_USDHC_MIX_CTRL_AUTO_TUNE_EN (24) //!< Bit position for USDHC_MIX_CTRL_AUTO_TUNE_EN.
  3929. #define BM_USDHC_MIX_CTRL_AUTO_TUNE_EN (0x01000000) //!< Bit mask for USDHC_MIX_CTRL_AUTO_TUNE_EN.
  3930. //! @brief Get value of USDHC_MIX_CTRL_AUTO_TUNE_EN from a register value.
  3931. #define BG_USDHC_MIX_CTRL_AUTO_TUNE_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_AUTO_TUNE_EN) >> BP_USDHC_MIX_CTRL_AUTO_TUNE_EN)
  3932. //! @brief Format value for bitfield USDHC_MIX_CTRL_AUTO_TUNE_EN.
  3933. #define BF_USDHC_MIX_CTRL_AUTO_TUNE_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_AUTO_TUNE_EN) & BM_USDHC_MIX_CTRL_AUTO_TUNE_EN)
  3934. #ifndef __LANGUAGE_ASM__
  3935. //! @brief Set the AUTO_TUNE_EN field to a new value.
  3936. #define BW_USDHC_MIX_CTRL_AUTO_TUNE_EN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_AUTO_TUNE_EN) | BF_USDHC_MIX_CTRL_AUTO_TUNE_EN(v)))
  3937. #endif
  3938. /* --- Register HW_USDHC_MIX_CTRL, field FBCLK_SEL[25] (RW)
  3939. *
  3940. * Feedback clock source selection (Only used for SD3.0, SDR104 mode)
  3941. *
  3942. * Values:
  3943. * 0 - feedback clock comes from the loopback CLK
  3944. * 1 - feedback clock comes from the ipp_card_clk_out
  3945. */
  3946. #define BP_USDHC_MIX_CTRL_FBCLK_SEL (25) //!< Bit position for USDHC_MIX_CTRL_FBCLK_SEL.
  3947. #define BM_USDHC_MIX_CTRL_FBCLK_SEL (0x02000000) //!< Bit mask for USDHC_MIX_CTRL_FBCLK_SEL.
  3948. //! @brief Get value of USDHC_MIX_CTRL_FBCLK_SEL from a register value.
  3949. #define BG_USDHC_MIX_CTRL_FBCLK_SEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_FBCLK_SEL) >> BP_USDHC_MIX_CTRL_FBCLK_SEL)
  3950. //! @brief Format value for bitfield USDHC_MIX_CTRL_FBCLK_SEL.
  3951. #define BF_USDHC_MIX_CTRL_FBCLK_SEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_FBCLK_SEL) & BM_USDHC_MIX_CTRL_FBCLK_SEL)
  3952. #ifndef __LANGUAGE_ASM__
  3953. //! @brief Set the FBCLK_SEL field to a new value.
  3954. #define BW_USDHC_MIX_CTRL_FBCLK_SEL(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_FBCLK_SEL) | BF_USDHC_MIX_CTRL_FBCLK_SEL(v)))
  3955. #endif
  3956. /* --- Register HW_USDHC_MIX_CTRL, field AC12_RD_POINT[29] (RW)
  3957. *
  3958. * Only for debug. It's used to control when to send Auto CMD12 after multi-block read. 1 send Auto
  3959. * CMD12 8 cycles after CRC is checked successfully 0 send Auto CMD12 right after CRC is checked
  3960. * successfully
  3961. */
  3962. #define BP_USDHC_MIX_CTRL_AC12_RD_POINT (29) //!< Bit position for USDHC_MIX_CTRL_AC12_RD_POINT.
  3963. #define BM_USDHC_MIX_CTRL_AC12_RD_POINT (0x20000000) //!< Bit mask for USDHC_MIX_CTRL_AC12_RD_POINT.
  3964. //! @brief Get value of USDHC_MIX_CTRL_AC12_RD_POINT from a register value.
  3965. #define BG_USDHC_MIX_CTRL_AC12_RD_POINT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_AC12_RD_POINT) >> BP_USDHC_MIX_CTRL_AC12_RD_POINT)
  3966. //! @brief Format value for bitfield USDHC_MIX_CTRL_AC12_RD_POINT.
  3967. #define BF_USDHC_MIX_CTRL_AC12_RD_POINT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_AC12_RD_POINT) & BM_USDHC_MIX_CTRL_AC12_RD_POINT)
  3968. #ifndef __LANGUAGE_ASM__
  3969. //! @brief Set the AC12_RD_POINT field to a new value.
  3970. #define BW_USDHC_MIX_CTRL_AC12_RD_POINT(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_AC12_RD_POINT) | BF_USDHC_MIX_CTRL_AC12_RD_POINT(v)))
  3971. #endif
  3972. /* --- Register HW_USDHC_MIX_CTRL, field CMD_DMY_WAIT_CFG[30] (RW)
  3973. *
  3974. * Only for debug. It's also used to control the number of dummy clock cycles after each command
  3975. * when CMD_DMY_EN bit is enabled. CMD_DMY_EN = 0, CMD_DMY_WAIT_CFG = x : 12 dummy clocks after each
  3976. * command CMD_DMY_EN = 1, CMD_DMY_WAIT_CFG = 0: 20 dummy clocks after each command CMD_DMY_EN = 1,
  3977. * CMD_DMY_WAIT_CFG = 1: 31 dummy clocks after each command
  3978. */
  3979. #define BP_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG (30) //!< Bit position for USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG.
  3980. #define BM_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG (0x40000000) //!< Bit mask for USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG.
  3981. //! @brief Get value of USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG from a register value.
  3982. #define BG_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG) >> BP_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG)
  3983. //! @brief Format value for bitfield USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG.
  3984. #define BF_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG) & BM_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG)
  3985. #ifndef __LANGUAGE_ASM__
  3986. //! @brief Set the CMD_DMY_WAIT_CFG field to a new value.
  3987. #define BW_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG) | BF_USDHC_MIX_CTRL_CMD_DMY_WAIT_CFG(v)))
  3988. #endif
  3989. /* --- Register HW_USDHC_MIX_CTRL, field CMD_DMY_EN[31] (RW)
  3990. *
  3991. * Only for debug. It's used to control the number of dummy clock cycles after each command.
  3992. */
  3993. #define BP_USDHC_MIX_CTRL_CMD_DMY_EN (31) //!< Bit position for USDHC_MIX_CTRL_CMD_DMY_EN.
  3994. #define BM_USDHC_MIX_CTRL_CMD_DMY_EN (0x80000000) //!< Bit mask for USDHC_MIX_CTRL_CMD_DMY_EN.
  3995. //! @brief Get value of USDHC_MIX_CTRL_CMD_DMY_EN from a register value.
  3996. #define BG_USDHC_MIX_CTRL_CMD_DMY_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MIX_CTRL_CMD_DMY_EN) >> BP_USDHC_MIX_CTRL_CMD_DMY_EN)
  3997. //! @brief Format value for bitfield USDHC_MIX_CTRL_CMD_DMY_EN.
  3998. #define BF_USDHC_MIX_CTRL_CMD_DMY_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MIX_CTRL_CMD_DMY_EN) & BM_USDHC_MIX_CTRL_CMD_DMY_EN)
  3999. #ifndef __LANGUAGE_ASM__
  4000. //! @brief Set the CMD_DMY_EN field to a new value.
  4001. #define BW_USDHC_MIX_CTRL_CMD_DMY_EN(x, v) (HW_USDHC_MIX_CTRL_WR(x, (HW_USDHC_MIX_CTRL_RD(x) & ~BM_USDHC_MIX_CTRL_CMD_DMY_EN) | BF_USDHC_MIX_CTRL_CMD_DMY_EN(v)))
  4002. #endif
  4003. //-------------------------------------------------------------------------------------------
  4004. // HW_USDHC_FORCE_EVENT - Force Event
  4005. //-------------------------------------------------------------------------------------------
  4006. #ifndef __LANGUAGE_ASM__
  4007. /*!
  4008. * @brief HW_USDHC_FORCE_EVENT - Force Event (WORZ)
  4009. *
  4010. * Reset value: 0x00000000
  4011. *
  4012. * The Force Event Register is not a physically implemented register. Rather, it is an address at
  4013. * which the Interrupt Status Register can be written if the corresponding bit of the Interrupt
  4014. * Status Enable Register is set. This register is a write only register and writing 0 to it has no
  4015. * effect. Writing 1 to this register actually sets the corresponding bit of Interrupt Status
  4016. * Register. A read from this register always results in 0's. In order to change the corresponding
  4017. * status bits in the Interrupt Status Register, make sure to set IPGEN bit in System Control
  4018. * Register so that ipg_clk is always active. Forcing a card interrupt will generate a short pulse
  4019. * on the DAT[1] line, and the driver may treat this interrupt as a normal interrupt. The interrupt
  4020. * service routine may skip polling the card interrupt factor as the interrupt is self cleared.
  4021. */
  4022. typedef union _hw_usdhc_force_event
  4023. {
  4024. reg32_t U;
  4025. struct _hw_usdhc_force_event_bitfields
  4026. {
  4027. unsigned FEVTAC12NE : 1; //!< [0] Force Event Auto Command 12 Not Executed: Forces the AC12NE bit in the Auto Command12 Error Status Register to be set
  4028. unsigned FEVTAC12TOE : 1; //!< [1] Force Event Auto Command 12 Time Out Error: Forces the AC12TOE bit in the Auto Command12 Error Status Register to be set
  4029. unsigned FEVTAC12CE : 1; //!< [2] Force Event Auto Command 12 CRC Error: Forces the AC12CE bit in the Auto Command12 Error Status Register to be set
  4030. unsigned FEVTAC12EBE : 1; //!< [3] Force Event Auto Command 12 End Bit Error: Forces the AC12EBE bit in the Auto Command12 Error Status Register to be set
  4031. unsigned FEVTAC12IE : 1; //!< [4] Force Event Auto Command 12 Index Error: Forces the AC12IE bit in the Auto Command12 Error Status Register to be set
  4032. unsigned RESERVED0 : 2; //!< [6:5] Reserved
  4033. unsigned FEVTCNIBAC12E : 1; //!< [7] Force Event Command Not Executed By Auto Command 12 Error: Forces the CNIBAC12E bit in the Auto Command12 Error Status Register to be set
  4034. unsigned RESERVED1 : 8; //!< [15:8] Reserved
  4035. unsigned FEVTCCE : 1; //!< [16] Force Event Command Time Out Error: Forces the CTOE bit of Interrupt Status Register to be set
  4036. unsigned FEVTCCE1 : 1; //!< [17] Force Event Command CRC Error: Forces the CCE bit of Interrupt Status Register to be set
  4037. unsigned FEVTCEBE : 1; //!< [18] Force Event Command End Bit Error: Forces the CEBE bit of Interrupt Status Register to be set
  4038. unsigned FEVTCIE : 1; //!< [19] Force Event Command Index Error: Forces the CCE bit of Interrupt Status Register to be set
  4039. unsigned FEVTDTOE : 1; //!< [20] Force Event Data Time Out Error: Force the DTOE bit of Interrupt Status Register to be set
  4040. unsigned FEVTDCE : 1; //!< [21] Force Event Data CRC Error: Forces the DCE bit of Interrupt Status Register to be set
  4041. unsigned FEVTDEBE : 1; //!< [22] Force Event Data End Bit Error: Forces the DEBE bit of Interrupt Status Register to be set
  4042. unsigned RESERVED2 : 1; //!< [23] Reserved
  4043. unsigned FEVTAC12E : 1; //!< [24] Force Event Auto Command 12 Error: Forces the AC12E bit of Interrupt Status Register to be set
  4044. unsigned RESERVED3 : 1; //!< [25] Reserved
  4045. unsigned FEVTTNE : 1; //!< [26] Force Tuning Error: Forces the TNE bit of Interrupt Status Register to be set
  4046. unsigned RESERVED4 : 1; //!< [27] Reserved
  4047. unsigned FEVTDMAE : 1; //!< [28] Force Event DMA Error: Forces the DMAE bit of Interrupt Status Register to be set
  4048. unsigned RESERVED5 : 2; //!< [30:29] Reserved
  4049. unsigned FEVTCINT : 1; //!< [31] Force Event Card Interrupt: Writing 1 to this bit generates a short low-level pulse on the internal DAT[1] line, as if a self clearing interrupt was received from the external card.
  4050. } B;
  4051. } hw_usdhc_force_event_t;
  4052. #endif
  4053. /*
  4054. * constants & macros for entire multi-block USDHC_FORCE_EVENT register
  4055. */
  4056. #define HW_USDHC_FORCE_EVENT_ADDR(x) (REGS_USDHC_BASE(x) + 0x50)
  4057. #ifndef __LANGUAGE_ASM__
  4058. #define HW_USDHC_FORCE_EVENT(x) (*(volatile hw_usdhc_force_event_t *) HW_USDHC_FORCE_EVENT_ADDR(x))
  4059. #define HW_USDHC_FORCE_EVENT_WR(x, v) (HW_USDHC_FORCE_EVENT(x).U = (v))
  4060. #endif
  4061. /*
  4062. * constants & macros for individual USDHC_FORCE_EVENT bitfields
  4063. */
  4064. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTAC12NE[0] (WORZ)
  4065. *
  4066. * Force Event Auto Command 12 Not Executed: Forces the AC12NE bit in the Auto Command12 Error
  4067. * Status Register to be set
  4068. */
  4069. #define BP_USDHC_FORCE_EVENT_FEVTAC12NE (0) //!< Bit position for USDHC_FORCE_EVENT_FEVTAC12NE.
  4070. #define BM_USDHC_FORCE_EVENT_FEVTAC12NE (0x00000001) //!< Bit mask for USDHC_FORCE_EVENT_FEVTAC12NE.
  4071. //! @brief Get value of USDHC_FORCE_EVENT_FEVTAC12NE from a register value.
  4072. #define BG_USDHC_FORCE_EVENT_FEVTAC12NE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTAC12NE) >> BP_USDHC_FORCE_EVENT_FEVTAC12NE)
  4073. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTAC12NE.
  4074. #define BF_USDHC_FORCE_EVENT_FEVTAC12NE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTAC12NE) & BM_USDHC_FORCE_EVENT_FEVTAC12NE)
  4075. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTAC12TOE[1] (WORZ)
  4076. *
  4077. * Force Event Auto Command 12 Time Out Error: Forces the AC12TOE bit in the Auto Command12 Error
  4078. * Status Register to be set
  4079. */
  4080. #define BP_USDHC_FORCE_EVENT_FEVTAC12TOE (1) //!< Bit position for USDHC_FORCE_EVENT_FEVTAC12TOE.
  4081. #define BM_USDHC_FORCE_EVENT_FEVTAC12TOE (0x00000002) //!< Bit mask for USDHC_FORCE_EVENT_FEVTAC12TOE.
  4082. //! @brief Get value of USDHC_FORCE_EVENT_FEVTAC12TOE from a register value.
  4083. #define BG_USDHC_FORCE_EVENT_FEVTAC12TOE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTAC12TOE) >> BP_USDHC_FORCE_EVENT_FEVTAC12TOE)
  4084. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTAC12TOE.
  4085. #define BF_USDHC_FORCE_EVENT_FEVTAC12TOE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTAC12TOE) & BM_USDHC_FORCE_EVENT_FEVTAC12TOE)
  4086. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTAC12CE[2] (WORZ)
  4087. *
  4088. * Force Event Auto Command 12 CRC Error: Forces the AC12CE bit in the Auto Command12 Error Status
  4089. * Register to be set
  4090. */
  4091. #define BP_USDHC_FORCE_EVENT_FEVTAC12CE (2) //!< Bit position for USDHC_FORCE_EVENT_FEVTAC12CE.
  4092. #define BM_USDHC_FORCE_EVENT_FEVTAC12CE (0x00000004) //!< Bit mask for USDHC_FORCE_EVENT_FEVTAC12CE.
  4093. //! @brief Get value of USDHC_FORCE_EVENT_FEVTAC12CE from a register value.
  4094. #define BG_USDHC_FORCE_EVENT_FEVTAC12CE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTAC12CE) >> BP_USDHC_FORCE_EVENT_FEVTAC12CE)
  4095. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTAC12CE.
  4096. #define BF_USDHC_FORCE_EVENT_FEVTAC12CE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTAC12CE) & BM_USDHC_FORCE_EVENT_FEVTAC12CE)
  4097. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTAC12EBE[3] (WORZ)
  4098. *
  4099. * Force Event Auto Command 12 End Bit Error: Forces the AC12EBE bit in the Auto Command12 Error
  4100. * Status Register to be set
  4101. */
  4102. #define BP_USDHC_FORCE_EVENT_FEVTAC12EBE (3) //!< Bit position for USDHC_FORCE_EVENT_FEVTAC12EBE.
  4103. #define BM_USDHC_FORCE_EVENT_FEVTAC12EBE (0x00000008) //!< Bit mask for USDHC_FORCE_EVENT_FEVTAC12EBE.
  4104. //! @brief Get value of USDHC_FORCE_EVENT_FEVTAC12EBE from a register value.
  4105. #define BG_USDHC_FORCE_EVENT_FEVTAC12EBE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTAC12EBE) >> BP_USDHC_FORCE_EVENT_FEVTAC12EBE)
  4106. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTAC12EBE.
  4107. #define BF_USDHC_FORCE_EVENT_FEVTAC12EBE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTAC12EBE) & BM_USDHC_FORCE_EVENT_FEVTAC12EBE)
  4108. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTAC12IE[4] (WORZ)
  4109. *
  4110. * Force Event Auto Command 12 Index Error: Forces the AC12IE bit in the Auto Command12 Error Status
  4111. * Register to be set
  4112. */
  4113. #define BP_USDHC_FORCE_EVENT_FEVTAC12IE (4) //!< Bit position for USDHC_FORCE_EVENT_FEVTAC12IE.
  4114. #define BM_USDHC_FORCE_EVENT_FEVTAC12IE (0x00000010) //!< Bit mask for USDHC_FORCE_EVENT_FEVTAC12IE.
  4115. //! @brief Get value of USDHC_FORCE_EVENT_FEVTAC12IE from a register value.
  4116. #define BG_USDHC_FORCE_EVENT_FEVTAC12IE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTAC12IE) >> BP_USDHC_FORCE_EVENT_FEVTAC12IE)
  4117. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTAC12IE.
  4118. #define BF_USDHC_FORCE_EVENT_FEVTAC12IE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTAC12IE) & BM_USDHC_FORCE_EVENT_FEVTAC12IE)
  4119. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTCNIBAC12E[7] (WORZ)
  4120. *
  4121. * Force Event Command Not Executed By Auto Command 12 Error: Forces the CNIBAC12E bit in the Auto
  4122. * Command12 Error Status Register to be set
  4123. */
  4124. #define BP_USDHC_FORCE_EVENT_FEVTCNIBAC12E (7) //!< Bit position for USDHC_FORCE_EVENT_FEVTCNIBAC12E.
  4125. #define BM_USDHC_FORCE_EVENT_FEVTCNIBAC12E (0x00000080) //!< Bit mask for USDHC_FORCE_EVENT_FEVTCNIBAC12E.
  4126. //! @brief Get value of USDHC_FORCE_EVENT_FEVTCNIBAC12E from a register value.
  4127. #define BG_USDHC_FORCE_EVENT_FEVTCNIBAC12E(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTCNIBAC12E) >> BP_USDHC_FORCE_EVENT_FEVTCNIBAC12E)
  4128. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTCNIBAC12E.
  4129. #define BF_USDHC_FORCE_EVENT_FEVTCNIBAC12E(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTCNIBAC12E) & BM_USDHC_FORCE_EVENT_FEVTCNIBAC12E)
  4130. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTCCE[16] (WORZ)
  4131. *
  4132. * Force Event Command Time Out Error: Forces the CTOE bit of Interrupt Status Register to be set
  4133. */
  4134. #define BP_USDHC_FORCE_EVENT_FEVTCCE (16) //!< Bit position for USDHC_FORCE_EVENT_FEVTCCE.
  4135. #define BM_USDHC_FORCE_EVENT_FEVTCCE (0x00010000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTCCE.
  4136. //! @brief Get value of USDHC_FORCE_EVENT_FEVTCCE from a register value.
  4137. #define BG_USDHC_FORCE_EVENT_FEVTCCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTCCE) >> BP_USDHC_FORCE_EVENT_FEVTCCE)
  4138. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTCCE.
  4139. #define BF_USDHC_FORCE_EVENT_FEVTCCE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTCCE) & BM_USDHC_FORCE_EVENT_FEVTCCE)
  4140. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTCCE1[17] (WORZ)
  4141. *
  4142. * Force Event Command CRC Error: Forces the CCE bit of Interrupt Status Register to be set
  4143. */
  4144. #define BP_USDHC_FORCE_EVENT_FEVTCCE1 (17) //!< Bit position for USDHC_FORCE_EVENT_FEVTCCE1.
  4145. #define BM_USDHC_FORCE_EVENT_FEVTCCE1 (0x00020000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTCCE1.
  4146. //! @brief Get value of USDHC_FORCE_EVENT_FEVTCCE1 from a register value.
  4147. #define BG_USDHC_FORCE_EVENT_FEVTCCE1(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTCCE1) >> BP_USDHC_FORCE_EVENT_FEVTCCE1)
  4148. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTCCE1.
  4149. #define BF_USDHC_FORCE_EVENT_FEVTCCE1(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTCCE1) & BM_USDHC_FORCE_EVENT_FEVTCCE1)
  4150. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTCEBE[18] (WORZ)
  4151. *
  4152. * Force Event Command End Bit Error: Forces the CEBE bit of Interrupt Status Register to be set
  4153. */
  4154. #define BP_USDHC_FORCE_EVENT_FEVTCEBE (18) //!< Bit position for USDHC_FORCE_EVENT_FEVTCEBE.
  4155. #define BM_USDHC_FORCE_EVENT_FEVTCEBE (0x00040000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTCEBE.
  4156. //! @brief Get value of USDHC_FORCE_EVENT_FEVTCEBE from a register value.
  4157. #define BG_USDHC_FORCE_EVENT_FEVTCEBE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTCEBE) >> BP_USDHC_FORCE_EVENT_FEVTCEBE)
  4158. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTCEBE.
  4159. #define BF_USDHC_FORCE_EVENT_FEVTCEBE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTCEBE) & BM_USDHC_FORCE_EVENT_FEVTCEBE)
  4160. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTCIE[19] (WORZ)
  4161. *
  4162. * Force Event Command Index Error: Forces the CCE bit of Interrupt Status Register to be set
  4163. */
  4164. #define BP_USDHC_FORCE_EVENT_FEVTCIE (19) //!< Bit position for USDHC_FORCE_EVENT_FEVTCIE.
  4165. #define BM_USDHC_FORCE_EVENT_FEVTCIE (0x00080000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTCIE.
  4166. //! @brief Get value of USDHC_FORCE_EVENT_FEVTCIE from a register value.
  4167. #define BG_USDHC_FORCE_EVENT_FEVTCIE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTCIE) >> BP_USDHC_FORCE_EVENT_FEVTCIE)
  4168. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTCIE.
  4169. #define BF_USDHC_FORCE_EVENT_FEVTCIE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTCIE) & BM_USDHC_FORCE_EVENT_FEVTCIE)
  4170. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTDTOE[20] (WORZ)
  4171. *
  4172. * Force Event Data Time Out Error: Force the DTOE bit of Interrupt Status Register to be set
  4173. */
  4174. #define BP_USDHC_FORCE_EVENT_FEVTDTOE (20) //!< Bit position for USDHC_FORCE_EVENT_FEVTDTOE.
  4175. #define BM_USDHC_FORCE_EVENT_FEVTDTOE (0x00100000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTDTOE.
  4176. //! @brief Get value of USDHC_FORCE_EVENT_FEVTDTOE from a register value.
  4177. #define BG_USDHC_FORCE_EVENT_FEVTDTOE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTDTOE) >> BP_USDHC_FORCE_EVENT_FEVTDTOE)
  4178. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTDTOE.
  4179. #define BF_USDHC_FORCE_EVENT_FEVTDTOE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTDTOE) & BM_USDHC_FORCE_EVENT_FEVTDTOE)
  4180. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTDCE[21] (WORZ)
  4181. *
  4182. * Force Event Data CRC Error: Forces the DCE bit of Interrupt Status Register to be set
  4183. */
  4184. #define BP_USDHC_FORCE_EVENT_FEVTDCE (21) //!< Bit position for USDHC_FORCE_EVENT_FEVTDCE.
  4185. #define BM_USDHC_FORCE_EVENT_FEVTDCE (0x00200000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTDCE.
  4186. //! @brief Get value of USDHC_FORCE_EVENT_FEVTDCE from a register value.
  4187. #define BG_USDHC_FORCE_EVENT_FEVTDCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTDCE) >> BP_USDHC_FORCE_EVENT_FEVTDCE)
  4188. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTDCE.
  4189. #define BF_USDHC_FORCE_EVENT_FEVTDCE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTDCE) & BM_USDHC_FORCE_EVENT_FEVTDCE)
  4190. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTDEBE[22] (WORZ)
  4191. *
  4192. * Force Event Data End Bit Error: Forces the DEBE bit of Interrupt Status Register to be set
  4193. */
  4194. #define BP_USDHC_FORCE_EVENT_FEVTDEBE (22) //!< Bit position for USDHC_FORCE_EVENT_FEVTDEBE.
  4195. #define BM_USDHC_FORCE_EVENT_FEVTDEBE (0x00400000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTDEBE.
  4196. //! @brief Get value of USDHC_FORCE_EVENT_FEVTDEBE from a register value.
  4197. #define BG_USDHC_FORCE_EVENT_FEVTDEBE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTDEBE) >> BP_USDHC_FORCE_EVENT_FEVTDEBE)
  4198. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTDEBE.
  4199. #define BF_USDHC_FORCE_EVENT_FEVTDEBE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTDEBE) & BM_USDHC_FORCE_EVENT_FEVTDEBE)
  4200. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTAC12E[24] (WORZ)
  4201. *
  4202. * Force Event Auto Command 12 Error: Forces the AC12E bit of Interrupt Status Register to be set
  4203. */
  4204. #define BP_USDHC_FORCE_EVENT_FEVTAC12E (24) //!< Bit position for USDHC_FORCE_EVENT_FEVTAC12E.
  4205. #define BM_USDHC_FORCE_EVENT_FEVTAC12E (0x01000000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTAC12E.
  4206. //! @brief Get value of USDHC_FORCE_EVENT_FEVTAC12E from a register value.
  4207. #define BG_USDHC_FORCE_EVENT_FEVTAC12E(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTAC12E) >> BP_USDHC_FORCE_EVENT_FEVTAC12E)
  4208. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTAC12E.
  4209. #define BF_USDHC_FORCE_EVENT_FEVTAC12E(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTAC12E) & BM_USDHC_FORCE_EVENT_FEVTAC12E)
  4210. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTTNE[26] (WORZ)
  4211. *
  4212. * Force Tuning Error: Forces the TNE bit of Interrupt Status Register to be set
  4213. */
  4214. #define BP_USDHC_FORCE_EVENT_FEVTTNE (26) //!< Bit position for USDHC_FORCE_EVENT_FEVTTNE.
  4215. #define BM_USDHC_FORCE_EVENT_FEVTTNE (0x04000000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTTNE.
  4216. //! @brief Get value of USDHC_FORCE_EVENT_FEVTTNE from a register value.
  4217. #define BG_USDHC_FORCE_EVENT_FEVTTNE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTTNE) >> BP_USDHC_FORCE_EVENT_FEVTTNE)
  4218. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTTNE.
  4219. #define BF_USDHC_FORCE_EVENT_FEVTTNE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTTNE) & BM_USDHC_FORCE_EVENT_FEVTTNE)
  4220. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTDMAE[28] (WORZ)
  4221. *
  4222. * Force Event DMA Error: Forces the DMAE bit of Interrupt Status Register to be set
  4223. */
  4224. #define BP_USDHC_FORCE_EVENT_FEVTDMAE (28) //!< Bit position for USDHC_FORCE_EVENT_FEVTDMAE.
  4225. #define BM_USDHC_FORCE_EVENT_FEVTDMAE (0x10000000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTDMAE.
  4226. //! @brief Get value of USDHC_FORCE_EVENT_FEVTDMAE from a register value.
  4227. #define BG_USDHC_FORCE_EVENT_FEVTDMAE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTDMAE) >> BP_USDHC_FORCE_EVENT_FEVTDMAE)
  4228. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTDMAE.
  4229. #define BF_USDHC_FORCE_EVENT_FEVTDMAE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTDMAE) & BM_USDHC_FORCE_EVENT_FEVTDMAE)
  4230. /* --- Register HW_USDHC_FORCE_EVENT, field FEVTCINT[31] (WORZ)
  4231. *
  4232. * Force Event Card Interrupt: Writing 1 to this bit generates a short low-level pulse on the
  4233. * internal DAT[1] line, as if a self clearing interrupt was received from the external card. If
  4234. * enabled, the CINT bit will be set and the interrupt service routine may treat this interrupt as a
  4235. * normal interrupt from the external card.
  4236. */
  4237. #define BP_USDHC_FORCE_EVENT_FEVTCINT (31) //!< Bit position for USDHC_FORCE_EVENT_FEVTCINT.
  4238. #define BM_USDHC_FORCE_EVENT_FEVTCINT (0x80000000) //!< Bit mask for USDHC_FORCE_EVENT_FEVTCINT.
  4239. //! @brief Get value of USDHC_FORCE_EVENT_FEVTCINT from a register value.
  4240. #define BG_USDHC_FORCE_EVENT_FEVTCINT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_FORCE_EVENT_FEVTCINT) >> BP_USDHC_FORCE_EVENT_FEVTCINT)
  4241. //! @brief Format value for bitfield USDHC_FORCE_EVENT_FEVTCINT.
  4242. #define BF_USDHC_FORCE_EVENT_FEVTCINT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_FORCE_EVENT_FEVTCINT) & BM_USDHC_FORCE_EVENT_FEVTCINT)
  4243. //-------------------------------------------------------------------------------------------
  4244. // HW_USDHC_ADMA_ERR_STATUS - ADMA Error Status Register
  4245. //-------------------------------------------------------------------------------------------
  4246. #ifndef __LANGUAGE_ASM__
  4247. /*!
  4248. * @brief HW_USDHC_ADMA_ERR_STATUS - ADMA Error Status Register (RO)
  4249. *
  4250. * Reset value: 0x00000000
  4251. *
  4252. * When an ADMA Error Interrupt has occurred, the ADMA Error States field in this register holds the
  4253. * ADMA state and the ADMA System Address register holds the address around the error descriptor.
  4254. * For recovering from this error, the Host Driver requires the ADMA state to identify the error
  4255. * descriptor address as follows: ST_STOP: Previous location set in the ADMA System Address
  4256. * register is the error descriptor address ST_FDS: Current location set in the ADMA System Address
  4257. * register is the error descriptor address ST_CADR: This state is never set because it only
  4258. * increments the descriptor pointer and doesn't generate an ADMA error ST_TFR: Previous location
  4259. * set in the ADMA System Address register is the error descriptor address In case of a write
  4260. * operation, the Host Driver should use the ACMD22 to get the number of the written block, rather
  4261. * than using this information, since unwritten data may exist in the Host Controller. The Host
  4262. * Controller generates the ADMA Error Interrupt when it detects invalid descriptor data (Valid=0)
  4263. * in the ST_FDS state. The Host Driver can distinguish this error by reading the Valid bit of the
  4264. * error descriptor. ADMA Error State Coding D01-D00 ADMA Error State (when error has
  4265. * occurred) Contents of ADMA System Address Register 00 ST_STOP (Stop DMA) Holds
  4266. * the address of the next executable Descriptor command 01 ST_FDS (Fetch Descriptor)
  4267. * Holds the valid Descriptor address 10 ST_CADR (Change Address) No ADMA Error is
  4268. * generated 11 ST_TFR (Transfer Data) Holds the address of the next executable
  4269. * Descriptor command
  4270. */
  4271. typedef union _hw_usdhc_adma_err_status
  4272. {
  4273. reg32_t U;
  4274. struct _hw_usdhc_adma_err_status_bitfields
  4275. {
  4276. unsigned ADMAES : 2; //!< [1:0] ADMA Error State (when ADMA Error is occurred.): This field indicates the state of the ADMA when an error has occurred during an ADMA data transfer.
  4277. unsigned ADMALME : 1; //!< [2] ADMA Length Mismatch Error: This error occurs in the following 2 cases: While the Block Count Enable is being set, the total data length specified by the Descriptor table is different from that specified by the Block Count and Block Length Total data length can not be divided by the block length
  4278. unsigned ADMADCE : 1; //!< [3] ADMA Descritor Error: This error occurs when invalid descriptor fetched by ADMA:
  4279. unsigned RESERVED0 : 28; //!< [31:4] Reserved
  4280. } B;
  4281. } hw_usdhc_adma_err_status_t;
  4282. #endif
  4283. /*
  4284. * constants & macros for entire multi-block USDHC_ADMA_ERR_STATUS register
  4285. */
  4286. #define HW_USDHC_ADMA_ERR_STATUS_ADDR(x) (REGS_USDHC_BASE(x) + 0x54)
  4287. #ifndef __LANGUAGE_ASM__
  4288. #define HW_USDHC_ADMA_ERR_STATUS(x) (*(volatile hw_usdhc_adma_err_status_t *) HW_USDHC_ADMA_ERR_STATUS_ADDR(x))
  4289. #define HW_USDHC_ADMA_ERR_STATUS_RD(x) (HW_USDHC_ADMA_ERR_STATUS(x).U)
  4290. #endif
  4291. /*
  4292. * constants & macros for individual USDHC_ADMA_ERR_STATUS bitfields
  4293. */
  4294. /* --- Register HW_USDHC_ADMA_ERR_STATUS, field ADMAES[1:0] (RO)
  4295. *
  4296. * ADMA Error State (when ADMA Error is occurred.): This field indicates the state of the ADMA when
  4297. * an error has occurred during an ADMA data transfer. Refer to for more details.
  4298. */
  4299. #define BP_USDHC_ADMA_ERR_STATUS_ADMAES (0) //!< Bit position for USDHC_ADMA_ERR_STATUS_ADMAES.
  4300. #define BM_USDHC_ADMA_ERR_STATUS_ADMAES (0x00000003) //!< Bit mask for USDHC_ADMA_ERR_STATUS_ADMAES.
  4301. //! @brief Get value of USDHC_ADMA_ERR_STATUS_ADMAES from a register value.
  4302. #define BG_USDHC_ADMA_ERR_STATUS_ADMAES(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_ADMA_ERR_STATUS_ADMAES) >> BP_USDHC_ADMA_ERR_STATUS_ADMAES)
  4303. /* --- Register HW_USDHC_ADMA_ERR_STATUS, field ADMALME[2] (RO)
  4304. *
  4305. * ADMA Length Mismatch Error: This error occurs in the following 2 cases: While the Block Count
  4306. * Enable is being set, the total data length specified by the Descriptor table is different from
  4307. * that specified by the Block Count and Block Length Total data length can not be divided by the
  4308. * block length
  4309. *
  4310. * Values:
  4311. * 0 - No Error
  4312. * 1 - Error
  4313. */
  4314. #define BP_USDHC_ADMA_ERR_STATUS_ADMALME (2) //!< Bit position for USDHC_ADMA_ERR_STATUS_ADMALME.
  4315. #define BM_USDHC_ADMA_ERR_STATUS_ADMALME (0x00000004) //!< Bit mask for USDHC_ADMA_ERR_STATUS_ADMALME.
  4316. //! @brief Get value of USDHC_ADMA_ERR_STATUS_ADMALME from a register value.
  4317. #define BG_USDHC_ADMA_ERR_STATUS_ADMALME(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_ADMA_ERR_STATUS_ADMALME) >> BP_USDHC_ADMA_ERR_STATUS_ADMALME)
  4318. /* --- Register HW_USDHC_ADMA_ERR_STATUS, field ADMADCE[3] (RO)
  4319. *
  4320. * ADMA Descritor Error: This error occurs when invalid descriptor fetched by ADMA:
  4321. *
  4322. * Values:
  4323. * 0 - No Error
  4324. * 1 - Error
  4325. */
  4326. #define BP_USDHC_ADMA_ERR_STATUS_ADMADCE (3) //!< Bit position for USDHC_ADMA_ERR_STATUS_ADMADCE.
  4327. #define BM_USDHC_ADMA_ERR_STATUS_ADMADCE (0x00000008) //!< Bit mask for USDHC_ADMA_ERR_STATUS_ADMADCE.
  4328. //! @brief Get value of USDHC_ADMA_ERR_STATUS_ADMADCE from a register value.
  4329. #define BG_USDHC_ADMA_ERR_STATUS_ADMADCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_ADMA_ERR_STATUS_ADMADCE) >> BP_USDHC_ADMA_ERR_STATUS_ADMADCE)
  4330. //-------------------------------------------------------------------------------------------
  4331. // HW_USDHC_ADMA_SYS_ADDR - ADMA System Address
  4332. //-------------------------------------------------------------------------------------------
  4333. #ifndef __LANGUAGE_ASM__
  4334. /*!
  4335. * @brief HW_USDHC_ADMA_SYS_ADDR - ADMA System Address (RW)
  4336. *
  4337. * Reset value: 0x00000000
  4338. *
  4339. * This register contains the physical system memory address used for ADMA transfers.
  4340. */
  4341. typedef union _hw_usdhc_adma_sys_addr
  4342. {
  4343. reg32_t U;
  4344. struct _hw_usdhc_adma_sys_addr_bitfields
  4345. {
  4346. unsigned RESERVED0 : 2; //!< [1:0] Reserved
  4347. unsigned ADS_ADDR : 30; //!< [31:2] ADMA System Address: This register holds the word address of the executing command in the Descriptor table.
  4348. } B;
  4349. } hw_usdhc_adma_sys_addr_t;
  4350. #endif
  4351. /*
  4352. * constants & macros for entire multi-block USDHC_ADMA_SYS_ADDR register
  4353. */
  4354. #define HW_USDHC_ADMA_SYS_ADDR_ADDR(x) (REGS_USDHC_BASE(x) + 0x58)
  4355. #ifndef __LANGUAGE_ASM__
  4356. #define HW_USDHC_ADMA_SYS_ADDR(x) (*(volatile hw_usdhc_adma_sys_addr_t *) HW_USDHC_ADMA_SYS_ADDR_ADDR(x))
  4357. #define HW_USDHC_ADMA_SYS_ADDR_RD(x) (HW_USDHC_ADMA_SYS_ADDR(x).U)
  4358. #define HW_USDHC_ADMA_SYS_ADDR_WR(x, v) (HW_USDHC_ADMA_SYS_ADDR(x).U = (v))
  4359. #define HW_USDHC_ADMA_SYS_ADDR_SET(x, v) (HW_USDHC_ADMA_SYS_ADDR_WR(x, HW_USDHC_ADMA_SYS_ADDR_RD(x) | (v)))
  4360. #define HW_USDHC_ADMA_SYS_ADDR_CLR(x, v) (HW_USDHC_ADMA_SYS_ADDR_WR(x, HW_USDHC_ADMA_SYS_ADDR_RD(x) & ~(v)))
  4361. #define HW_USDHC_ADMA_SYS_ADDR_TOG(x, v) (HW_USDHC_ADMA_SYS_ADDR_WR(x, HW_USDHC_ADMA_SYS_ADDR_RD(x) ^ (v)))
  4362. #endif
  4363. /*
  4364. * constants & macros for individual USDHC_ADMA_SYS_ADDR bitfields
  4365. */
  4366. /* --- Register HW_USDHC_ADMA_SYS_ADDR, field ADS_ADDR[31:2] (RW)
  4367. *
  4368. * ADMA System Address: This register holds the word address of the executing command in the
  4369. * Descriptor table. At the start of ADMA, the Host Driver shall set the start address of the
  4370. * Descriptor table. The ADMA engine increments this register address whenever fetching a Descriptor
  4371. * command. When the ADMA is stopped at the Block Gap, this register indicates the address of the
  4372. * next executable Descriptor command. When the ADMA Error Interrupt is generated, this register
  4373. * shall hold the valid Descriptor address depending on the ADMA state. The lower 2 bits of this
  4374. * register is tied to '0' so the ADMA address is always word aligned. Since this register supports
  4375. * dynamic address reflecting, when TC bit is set, it automatically alters the value of internal
  4376. * address counter, so SW cannot change this register when TC bit is set. Such restriction is also
  4377. * listed in .
  4378. */
  4379. #define BP_USDHC_ADMA_SYS_ADDR_ADS_ADDR (2) //!< Bit position for USDHC_ADMA_SYS_ADDR_ADS_ADDR.
  4380. #define BM_USDHC_ADMA_SYS_ADDR_ADS_ADDR (0xfffffffc) //!< Bit mask for USDHC_ADMA_SYS_ADDR_ADS_ADDR.
  4381. //! @brief Get value of USDHC_ADMA_SYS_ADDR_ADS_ADDR from a register value.
  4382. #define BG_USDHC_ADMA_SYS_ADDR_ADS_ADDR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_ADMA_SYS_ADDR_ADS_ADDR) >> BP_USDHC_ADMA_SYS_ADDR_ADS_ADDR)
  4383. //! @brief Format value for bitfield USDHC_ADMA_SYS_ADDR_ADS_ADDR.
  4384. #define BF_USDHC_ADMA_SYS_ADDR_ADS_ADDR(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_ADMA_SYS_ADDR_ADS_ADDR) & BM_USDHC_ADMA_SYS_ADDR_ADS_ADDR)
  4385. #ifndef __LANGUAGE_ASM__
  4386. //! @brief Set the ADS_ADDR field to a new value.
  4387. #define BW_USDHC_ADMA_SYS_ADDR_ADS_ADDR(x, v) (HW_USDHC_ADMA_SYS_ADDR_WR(x, (HW_USDHC_ADMA_SYS_ADDR_RD(x) & ~BM_USDHC_ADMA_SYS_ADDR_ADS_ADDR) | BF_USDHC_ADMA_SYS_ADDR_ADS_ADDR(v)))
  4388. #endif
  4389. //-------------------------------------------------------------------------------------------
  4390. // HW_USDHC_DLL_CTRL - DLL (Delay Line) Control
  4391. //-------------------------------------------------------------------------------------------
  4392. #ifndef __LANGUAGE_ASM__
  4393. /*!
  4394. * @brief HW_USDHC_DLL_CTRL - DLL (Delay Line) Control (RW)
  4395. *
  4396. * Reset value: 0x00000000
  4397. *
  4398. * This register contains control bits for DLL.
  4399. */
  4400. typedef union _hw_usdhc_dll_ctrl
  4401. {
  4402. reg32_t U;
  4403. struct _hw_usdhc_dll_ctrl_bitfields
  4404. {
  4405. unsigned DLL_CTRL_ENABLE : 1; //!< [0] Set this bit to 1 to enable the DLL and delay chain; otherwise; set to 0 to bypasses DLL.
  4406. unsigned DLL_CTRL_RESET : 1; //!< [1] Setting this bit to 1 force a reset on DLL.
  4407. unsigned DLL_CTRL_SLV_FORCE_UPD : 1; //!< [2] Setting this bit to 1, forces the slave delay line to update to the DLL calibrated value immediately.
  4408. unsigned DLL_CTRL_SLV_DLY_TARGET : 4; //!< [6:3] The delay target for the uSDHC loopback read clock can be programmed in 1/16th increments of an ref_clock half-period.
  4409. unsigned DLL_CTRL_GATE_UPDATE : 1; //!< [7] Set this bit to 1 to force DLL not update from now on.Since when clock_in exists, glitches might appear during update.
  4410. unsigned DLL_CTRL_SLV_OVERRIDE : 1; //!< [8] Set this bit to 1 to Enable manual override for slave delay chain using SLV_OVERRIDE_VAL; to set 0 to disable manual override.
  4411. unsigned DLL_CTRL_SLV_OVERRIDE_VAL : 7; //!< [15:9] When SLV_OVERRIDE=1 This field is used to select 1 of 128 physical taps manually.
  4412. unsigned DLL_CTRL_SLV_DLY_TARGET1 : 3; //!< [18:16] Refer to DLL_CTRL_SLV_DLY_TARGET[3:0] below.
  4413. unsigned RESERVED0 : 1; //!< [19] Reserved
  4414. unsigned DLL_CTRL_SLV_UPDATE_INT : 8; //!< [27:20] slave delay line update interval.
  4415. unsigned DLL_CTRL_REF_UPDATE_INT : 4; //!< [31:28] DLL control loop update interval.
  4416. } B;
  4417. } hw_usdhc_dll_ctrl_t;
  4418. #endif
  4419. /*
  4420. * constants & macros for entire multi-block USDHC_DLL_CTRL register
  4421. */
  4422. #define HW_USDHC_DLL_CTRL_ADDR(x) (REGS_USDHC_BASE(x) + 0x60)
  4423. #ifndef __LANGUAGE_ASM__
  4424. #define HW_USDHC_DLL_CTRL(x) (*(volatile hw_usdhc_dll_ctrl_t *) HW_USDHC_DLL_CTRL_ADDR(x))
  4425. #define HW_USDHC_DLL_CTRL_RD(x) (HW_USDHC_DLL_CTRL(x).U)
  4426. #define HW_USDHC_DLL_CTRL_WR(x, v) (HW_USDHC_DLL_CTRL(x).U = (v))
  4427. #define HW_USDHC_DLL_CTRL_SET(x, v) (HW_USDHC_DLL_CTRL_WR(x, HW_USDHC_DLL_CTRL_RD(x) | (v)))
  4428. #define HW_USDHC_DLL_CTRL_CLR(x, v) (HW_USDHC_DLL_CTRL_WR(x, HW_USDHC_DLL_CTRL_RD(x) & ~(v)))
  4429. #define HW_USDHC_DLL_CTRL_TOG(x, v) (HW_USDHC_DLL_CTRL_WR(x, HW_USDHC_DLL_CTRL_RD(x) ^ (v)))
  4430. #endif
  4431. /*
  4432. * constants & macros for individual USDHC_DLL_CTRL bitfields
  4433. */
  4434. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_ENABLE[0] (RW)
  4435. *
  4436. * Set this bit to 1 to enable the DLL and delay chain; otherwise; set to 0 to bypasses DLL. Note
  4437. * that using the slave delay line override feature with SLV_OVERRIDE and SLV_OVERRIDE VAL, the DLL
  4438. * does not need to be enabled
  4439. */
  4440. #define BP_USDHC_DLL_CTRL_DLL_CTRL_ENABLE (0) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_ENABLE.
  4441. #define BM_USDHC_DLL_CTRL_DLL_CTRL_ENABLE (0x00000001) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_ENABLE.
  4442. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_ENABLE from a register value.
  4443. #define BG_USDHC_DLL_CTRL_DLL_CTRL_ENABLE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_ENABLE) >> BP_USDHC_DLL_CTRL_DLL_CTRL_ENABLE)
  4444. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_ENABLE.
  4445. #define BF_USDHC_DLL_CTRL_DLL_CTRL_ENABLE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_ENABLE) & BM_USDHC_DLL_CTRL_DLL_CTRL_ENABLE)
  4446. #ifndef __LANGUAGE_ASM__
  4447. //! @brief Set the DLL_CTRL_ENABLE field to a new value.
  4448. #define BW_USDHC_DLL_CTRL_DLL_CTRL_ENABLE(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_ENABLE) | BF_USDHC_DLL_CTRL_DLL_CTRL_ENABLE(v)))
  4449. #endif
  4450. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_RESET[1] (RW)
  4451. *
  4452. * Setting this bit to 1 force a reset on DLL. This will cause the DLL to lose lock and re-calibrate
  4453. * to detect an ref_clock half period phase shift. This signal is used by the DLL as edge-sensitive,
  4454. * so in order to create a subsequent reset, RESET must be taken low and then asserted again
  4455. */
  4456. #define BP_USDHC_DLL_CTRL_DLL_CTRL_RESET (1) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_RESET.
  4457. #define BM_USDHC_DLL_CTRL_DLL_CTRL_RESET (0x00000002) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_RESET.
  4458. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_RESET from a register value.
  4459. #define BG_USDHC_DLL_CTRL_DLL_CTRL_RESET(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_RESET) >> BP_USDHC_DLL_CTRL_DLL_CTRL_RESET)
  4460. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_RESET.
  4461. #define BF_USDHC_DLL_CTRL_DLL_CTRL_RESET(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_RESET) & BM_USDHC_DLL_CTRL_DLL_CTRL_RESET)
  4462. #ifndef __LANGUAGE_ASM__
  4463. //! @brief Set the DLL_CTRL_RESET field to a new value.
  4464. #define BW_USDHC_DLL_CTRL_DLL_CTRL_RESET(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_RESET) | BF_USDHC_DLL_CTRL_DLL_CTRL_RESET(v)))
  4465. #endif
  4466. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_SLV_FORCE_UPD[2] (RW)
  4467. *
  4468. * Setting this bit to 1, forces the slave delay line to update to the DLL calibrated value
  4469. * immediately. The slave delay line shall update automatically based on the SLV_UPDATE_INT interval
  4470. * or when a DLL lock condition is sensed. Subsequent forcing of the slave-line update can only
  4471. * occur if SLV_FORCE_UP is set back to 0 and then asserted again (edge triggered). Be sure to use
  4472. * it when uSDHC is idle. This function may not work when uSDHC is working on data/cmd/response.
  4473. */
  4474. #define BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD (2) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD.
  4475. #define BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD (0x00000004) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD.
  4476. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD from a register value.
  4477. #define BG_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD) >> BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD)
  4478. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD.
  4479. #define BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD)
  4480. #ifndef __LANGUAGE_ASM__
  4481. //! @brief Set the DLL_CTRL_SLV_FORCE_UPD field to a new value.
  4482. #define BW_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD) | BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD(v)))
  4483. #endif
  4484. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_SLV_DLY_TARGET[6:3] (RW)
  4485. *
  4486. * The delay target for the uSDHC loopback read clock can be programmed in 1/16th increments of an
  4487. * ref_clock half-period. The delay is ((DLL_CTRL_SLV_DLY_TARGET[6:0] +1)* ref_clock/2)/16 So the
  4488. * input read-clock can be delayed relative input data from (ref_clock/2)/16 to ref_clock*4
  4489. */
  4490. #define BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET (3) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET.
  4491. #define BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET (0x00000078) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET.
  4492. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET from a register value.
  4493. #define BG_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET) >> BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET)
  4494. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET.
  4495. #define BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET)
  4496. #ifndef __LANGUAGE_ASM__
  4497. //! @brief Set the DLL_CTRL_SLV_DLY_TARGET field to a new value.
  4498. #define BW_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET) | BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET(v)))
  4499. #endif
  4500. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_GATE_UPDATE[7] (RW)
  4501. *
  4502. * Set this bit to 1 to force DLL not update from now on.Since when clock_in exists, glitches might
  4503. * appear during update. This bit is used by software if we met such kind of condition. Set it to 0
  4504. * to let DLL update automatically
  4505. */
  4506. #define BP_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE (7) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE.
  4507. #define BM_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE (0x00000080) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE.
  4508. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE from a register value.
  4509. #define BG_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE) >> BP_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE)
  4510. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE.
  4511. #define BF_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE) & BM_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE)
  4512. #ifndef __LANGUAGE_ASM__
  4513. //! @brief Set the DLL_CTRL_GATE_UPDATE field to a new value.
  4514. #define BW_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE) | BF_USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE(v)))
  4515. #endif
  4516. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_SLV_OVERRIDE[8] (RW)
  4517. *
  4518. * Set this bit to 1 to Enable manual override for slave delay chain using SLV_OVERRIDE_VAL; to set
  4519. * 0 to disable manual override. This feature does not require the DLL to tbe enabled using the
  4520. * ENABLE bit. In fact to reduce power, if SLV_OVERRIDE is used, it is recommended to disable the
  4521. * DLL with ENABLE=0
  4522. */
  4523. #define BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE (8) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE.
  4524. #define BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE (0x00000100) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE.
  4525. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE from a register value.
  4526. #define BG_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE) >> BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE)
  4527. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE.
  4528. #define BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE)
  4529. #ifndef __LANGUAGE_ASM__
  4530. //! @brief Set the DLL_CTRL_SLV_OVERRIDE field to a new value.
  4531. #define BW_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE) | BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE(v)))
  4532. #endif
  4533. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_SLV_OVERRIDE_VAL[15:9] (RW)
  4534. *
  4535. * When SLV_OVERRIDE=1 This field is used to select 1 of 128 physical taps manually. A value of 0
  4536. * selects tap 1, and a value of 0x7f selects tap 128.
  4537. */
  4538. #define BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL (9) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL.
  4539. #define BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL (0x0000fe00) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL.
  4540. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL from a register value.
  4541. #define BG_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL) >> BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL)
  4542. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL.
  4543. #define BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL)
  4544. #ifndef __LANGUAGE_ASM__
  4545. //! @brief Set the DLL_CTRL_SLV_OVERRIDE_VAL field to a new value.
  4546. #define BW_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL) | BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL(v)))
  4547. #endif
  4548. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_SLV_DLY_TARGET1[18:16] (RW)
  4549. *
  4550. * Refer to DLL_CTRL_SLV_DLY_TARGET[3:0] below.
  4551. */
  4552. #define BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1 (16) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1.
  4553. #define BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1 (0x00070000) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1.
  4554. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1 from a register value.
  4555. #define BG_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1) >> BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1)
  4556. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1.
  4557. #define BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1)
  4558. #ifndef __LANGUAGE_ASM__
  4559. //! @brief Set the DLL_CTRL_SLV_DLY_TARGET1 field to a new value.
  4560. #define BW_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1) | BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1(v)))
  4561. #endif
  4562. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_SLV_UPDATE_INT[27:20] (RW)
  4563. *
  4564. * slave delay line update interval. If default 0 is used, it means 256 cycles of ref_clock. A value
  4565. * of 0x0f results in 15 cycles and so on. Note that software can always cause an update of the
  4566. * slave-delay line using the SLV_FORCE_UPDATE register. Note that the slave delay line will also
  4567. * update automatically when the reference DLL transitions to a locked state (from an un-locked
  4568. * state).
  4569. */
  4570. #define BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT (20) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT.
  4571. #define BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT (0x0ff00000) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT.
  4572. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT from a register value.
  4573. #define BG_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT) >> BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT)
  4574. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT.
  4575. #define BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT) & BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT)
  4576. #ifndef __LANGUAGE_ASM__
  4577. //! @brief Set the DLL_CTRL_SLV_UPDATE_INT field to a new value.
  4578. #define BW_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT) | BF_USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT(v)))
  4579. #endif
  4580. /* --- Register HW_USDHC_DLL_CTRL, field DLL_CTRL_REF_UPDATE_INT[31:28] (RW)
  4581. *
  4582. * DLL control loop update interval. The interval cycle is (2 + REF_UPDATE_INT) * ref_clock. By
  4583. * default, the DLL control loop shall update every two ref_clock cycles. It should be noted that
  4584. * increasing the reference delay-line update interval reduces the ability of the DLL to adjust to
  4585. * fast changes in conditions that may effect the delay (such as voltage and temperature)
  4586. */
  4587. #define BP_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT (28) //!< Bit position for USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT.
  4588. #define BM_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT (0xf0000000) //!< Bit mask for USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT.
  4589. //! @brief Get value of USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT from a register value.
  4590. #define BG_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT) >> BP_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT)
  4591. //! @brief Format value for bitfield USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT.
  4592. #define BF_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT) & BM_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT)
  4593. #ifndef __LANGUAGE_ASM__
  4594. //! @brief Set the DLL_CTRL_REF_UPDATE_INT field to a new value.
  4595. #define BW_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT(x, v) (HW_USDHC_DLL_CTRL_WR(x, (HW_USDHC_DLL_CTRL_RD(x) & ~BM_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT) | BF_USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT(v)))
  4596. #endif
  4597. //-------------------------------------------------------------------------------------------
  4598. // HW_USDHC_DLL_STATUS - DLL Status
  4599. //-------------------------------------------------------------------------------------------
  4600. #ifndef __LANGUAGE_ASM__
  4601. /*!
  4602. * @brief HW_USDHC_DLL_STATUS - DLL Status (RO)
  4603. *
  4604. * Reset value: 0x00000000
  4605. *
  4606. * This register contains the DLL status information. All bits are read only and will read the same
  4607. * as the power-reset value.
  4608. */
  4609. typedef union _hw_usdhc_dll_status
  4610. {
  4611. reg32_t U;
  4612. struct _hw_usdhc_dll_status_bitfields
  4613. {
  4614. unsigned DLL_STS_SLV_LOCK : 1; //!< [0] Slave delay-line lock status.
  4615. unsigned DLL_STS_REF_LOCK : 1; //!< [1] Reference DLL lock status.
  4616. unsigned DLL_STS_SLV_SEL : 7; //!< [8:2] Slave delay line select status.
  4617. unsigned DLL_STS_REF_SEL : 7; //!< [15:9] Reference delay line select taps.
  4618. unsigned RESERVED0 : 16; //!< [31:16] Reserved
  4619. } B;
  4620. } hw_usdhc_dll_status_t;
  4621. #endif
  4622. /*
  4623. * constants & macros for entire multi-block USDHC_DLL_STATUS register
  4624. */
  4625. #define HW_USDHC_DLL_STATUS_ADDR(x) (REGS_USDHC_BASE(x) + 0x64)
  4626. #ifndef __LANGUAGE_ASM__
  4627. #define HW_USDHC_DLL_STATUS(x) (*(volatile hw_usdhc_dll_status_t *) HW_USDHC_DLL_STATUS_ADDR(x))
  4628. #define HW_USDHC_DLL_STATUS_RD(x) (HW_USDHC_DLL_STATUS(x).U)
  4629. #endif
  4630. /*
  4631. * constants & macros for individual USDHC_DLL_STATUS bitfields
  4632. */
  4633. /* --- Register HW_USDHC_DLL_STATUS, field DLL_STS_SLV_LOCK[0] (RO)
  4634. *
  4635. * Slave delay-line lock status. This signifies that a valid calibration has been set to the slave-
  4636. * delay line and that the slave-delay line is implementing the programmed delay value
  4637. */
  4638. #define BP_USDHC_DLL_STATUS_DLL_STS_SLV_LOCK (0) //!< Bit position for USDHC_DLL_STATUS_DLL_STS_SLV_LOCK.
  4639. #define BM_USDHC_DLL_STATUS_DLL_STS_SLV_LOCK (0x00000001) //!< Bit mask for USDHC_DLL_STATUS_DLL_STS_SLV_LOCK.
  4640. //! @brief Get value of USDHC_DLL_STATUS_DLL_STS_SLV_LOCK from a register value.
  4641. #define BG_USDHC_DLL_STATUS_DLL_STS_SLV_LOCK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_STATUS_DLL_STS_SLV_LOCK) >> BP_USDHC_DLL_STATUS_DLL_STS_SLV_LOCK)
  4642. /* --- Register HW_USDHC_DLL_STATUS, field DLL_STS_REF_LOCK[1] (RO)
  4643. *
  4644. * Reference DLL lock status. This signifies that the DLL has detected and locked to a half-phase
  4645. * ref_clock shift, allowing the slave delay-line to perform programmed clock delays
  4646. */
  4647. #define BP_USDHC_DLL_STATUS_DLL_STS_REF_LOCK (1) //!< Bit position for USDHC_DLL_STATUS_DLL_STS_REF_LOCK.
  4648. #define BM_USDHC_DLL_STATUS_DLL_STS_REF_LOCK (0x00000002) //!< Bit mask for USDHC_DLL_STATUS_DLL_STS_REF_LOCK.
  4649. //! @brief Get value of USDHC_DLL_STATUS_DLL_STS_REF_LOCK from a register value.
  4650. #define BG_USDHC_DLL_STATUS_DLL_STS_REF_LOCK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_STATUS_DLL_STS_REF_LOCK) >> BP_USDHC_DLL_STATUS_DLL_STS_REF_LOCK)
  4651. /* --- Register HW_USDHC_DLL_STATUS, field DLL_STS_SLV_SEL[8:2] (RO)
  4652. *
  4653. * Slave delay line select status. This is the instant value generated from reference chain. Since
  4654. * only when ref_lock is detected can the reference chain get updated, this value should be the
  4655. * right value next be update to the slave line when reference is locked.
  4656. */
  4657. #define BP_USDHC_DLL_STATUS_DLL_STS_SLV_SEL (2) //!< Bit position for USDHC_DLL_STATUS_DLL_STS_SLV_SEL.
  4658. #define BM_USDHC_DLL_STATUS_DLL_STS_SLV_SEL (0x000001fc) //!< Bit mask for USDHC_DLL_STATUS_DLL_STS_SLV_SEL.
  4659. //! @brief Get value of USDHC_DLL_STATUS_DLL_STS_SLV_SEL from a register value.
  4660. #define BG_USDHC_DLL_STATUS_DLL_STS_SLV_SEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_STATUS_DLL_STS_SLV_SEL) >> BP_USDHC_DLL_STATUS_DLL_STS_SLV_SEL)
  4661. /* --- Register HW_USDHC_DLL_STATUS, field DLL_STS_REF_SEL[15:9] (RO)
  4662. *
  4663. * Reference delay line select taps. Be noted this is encoded by 7 bits for 127taps.
  4664. */
  4665. #define BP_USDHC_DLL_STATUS_DLL_STS_REF_SEL (9) //!< Bit position for USDHC_DLL_STATUS_DLL_STS_REF_SEL.
  4666. #define BM_USDHC_DLL_STATUS_DLL_STS_REF_SEL (0x0000fe00) //!< Bit mask for USDHC_DLL_STATUS_DLL_STS_REF_SEL.
  4667. //! @brief Get value of USDHC_DLL_STATUS_DLL_STS_REF_SEL from a register value.
  4668. #define BG_USDHC_DLL_STATUS_DLL_STS_REF_SEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_DLL_STATUS_DLL_STS_REF_SEL) >> BP_USDHC_DLL_STATUS_DLL_STS_REF_SEL)
  4669. //-------------------------------------------------------------------------------------------
  4670. // HW_USDHC_CLK_TUNE_CTRL_STATUS - CLK Tuning Control and Status
  4671. //-------------------------------------------------------------------------------------------
  4672. #ifndef __LANGUAGE_ASM__
  4673. /*!
  4674. * @brief HW_USDHC_CLK_TUNE_CTRL_STATUS - CLK Tuning Control and Status (RW)
  4675. *
  4676. * Reset value: 0x00000000
  4677. *
  4678. * This register contains the Clock Tuning Control status information. All bits are read only and
  4679. * will read the same as the power-reset value. This register is added to support SD3.0 UHS-I SDR104
  4680. * mode.
  4681. */
  4682. typedef union _hw_usdhc_clk_tune_ctrl_status
  4683. {
  4684. reg32_t U;
  4685. struct _hw_usdhc_clk_tune_ctrl_status_bitfields
  4686. {
  4687. unsigned DLY_CELL_SET_POST : 4; //!< [3:0] Set the number of delay cells on the feedback clock between CLK_OUT and CLK_POST.
  4688. unsigned DLY_CELL_SET_OUT : 4; //!< [7:4] Set the number of delay cells on the feedback clock between CLK_PRE and CLK_OUT.
  4689. unsigned DLY_CELL_SET_PRE : 7; //!< [14:8] Set the number of delay cells on the feedback clock between the feedback clock and CLK_PRE.
  4690. unsigned NXT_ERR : 1; //!< [15] NXT error which means the number of delay cells added on the feedback clock is too large.
  4691. unsigned TAP_SEL_POST : 4; //!< [19:16] Reflect the number of delay cells added on the feedback clock between CLK_OUT and CLK_POST.
  4692. unsigned TAP_SEL_OUT : 4; //!< [23:20] Reflect the number of delay cells added on the feedback clock between CLK_PRE and CLK_OUT.
  4693. unsigned TAP_SEL_PRE : 7; //!< [30:24] Reflect the number of delay cells added on the feedback clock between the feedback clock and CLK_PRE.
  4694. unsigned PRE_ERR : 1; //!< [31] PRE error which means the number of delay cells added on the feedback clock is too small.
  4695. } B;
  4696. } hw_usdhc_clk_tune_ctrl_status_t;
  4697. #endif
  4698. /*
  4699. * constants & macros for entire multi-block USDHC_CLK_TUNE_CTRL_STATUS register
  4700. */
  4701. #define HW_USDHC_CLK_TUNE_CTRL_STATUS_ADDR(x) (REGS_USDHC_BASE(x) + 0x68)
  4702. #ifndef __LANGUAGE_ASM__
  4703. #define HW_USDHC_CLK_TUNE_CTRL_STATUS(x) (*(volatile hw_usdhc_clk_tune_ctrl_status_t *) HW_USDHC_CLK_TUNE_CTRL_STATUS_ADDR(x))
  4704. #define HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) (HW_USDHC_CLK_TUNE_CTRL_STATUS(x).U)
  4705. #define HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS(x).U = (v))
  4706. #define HW_USDHC_CLK_TUNE_CTRL_STATUS_SET(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) | (v)))
  4707. #define HW_USDHC_CLK_TUNE_CTRL_STATUS_CLR(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) & ~(v)))
  4708. #define HW_USDHC_CLK_TUNE_CTRL_STATUS_TOG(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) ^ (v)))
  4709. #endif
  4710. /*
  4711. * constants & macros for individual USDHC_CLK_TUNE_CTRL_STATUS bitfields
  4712. */
  4713. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field DLY_CELL_SET_POST[3:0] (RW)
  4714. *
  4715. * Set the number of delay cells on the feedback clock between CLK_OUT and CLK_POST.
  4716. */
  4717. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST (0) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST.
  4718. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST (0x0000000f) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST.
  4719. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST from a register value.
  4720. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST)
  4721. //! @brief Format value for bitfield USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST.
  4722. #define BF_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST) & BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST)
  4723. #ifndef __LANGUAGE_ASM__
  4724. //! @brief Set the DLY_CELL_SET_POST field to a new value.
  4725. #define BW_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, (HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) & ~BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST) | BF_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(v)))
  4726. #endif
  4727. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field DLY_CELL_SET_OUT[7:4] (RW)
  4728. *
  4729. * Set the number of delay cells on the feedback clock between CLK_PRE and CLK_OUT.
  4730. */
  4731. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT (4) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT.
  4732. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT (0x000000f0) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT.
  4733. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT from a register value.
  4734. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT)
  4735. //! @brief Format value for bitfield USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT.
  4736. #define BF_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT) & BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT)
  4737. #ifndef __LANGUAGE_ASM__
  4738. //! @brief Set the DLY_CELL_SET_OUT field to a new value.
  4739. #define BW_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, (HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) & ~BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT) | BF_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(v)))
  4740. #endif
  4741. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field DLY_CELL_SET_PRE[14:8] (RW)
  4742. *
  4743. * Set the number of delay cells on the feedback clock between the feedback clock and CLK_PRE.
  4744. */
  4745. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE (8) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE.
  4746. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE (0x00007f00) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE.
  4747. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE from a register value.
  4748. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE)
  4749. //! @brief Format value for bitfield USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE.
  4750. #define BF_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE) & BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE)
  4751. #ifndef __LANGUAGE_ASM__
  4752. //! @brief Set the DLY_CELL_SET_PRE field to a new value.
  4753. #define BW_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(x, v) (HW_USDHC_CLK_TUNE_CTRL_STATUS_WR(x, (HW_USDHC_CLK_TUNE_CTRL_STATUS_RD(x) & ~BM_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE) | BF_USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(v)))
  4754. #endif
  4755. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field NXT_ERR[15] (RO)
  4756. *
  4757. * NXT error which means the number of delay cells added on the feedback clock is too large. It's
  4758. * valid only when SMP_CLK_SEL of Mix control register(bit23 of 0x48) is enabled.
  4759. */
  4760. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR (15) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR.
  4761. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR (0x00008000) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR.
  4762. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR from a register value.
  4763. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR)
  4764. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field TAP_SEL_POST[19:16] (RO)
  4765. *
  4766. * Reflect the number of delay cells added on the feedback clock between CLK_OUT and CLK_POST.
  4767. */
  4768. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST (16) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST.
  4769. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST (0x000f0000) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST.
  4770. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST from a register value.
  4771. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST)
  4772. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field TAP_SEL_OUT[23:20] (RO)
  4773. *
  4774. * Reflect the number of delay cells added on the feedback clock between CLK_PRE and CLK_OUT.
  4775. */
  4776. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT (20) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT.
  4777. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT (0x00f00000) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT.
  4778. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT from a register value.
  4779. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT)
  4780. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field TAP_SEL_PRE[30:24] (RO)
  4781. *
  4782. * Reflect the number of delay cells added on the feedback clock between the feedback clock and
  4783. * CLK_PRE. When AUTO_TUNE_EN(bit24 of 0x48) is disabled, TAP_SEL_PRE is always equal to
  4784. * DLY_CELL_SET_PRE. When AUTO_TUNE_EN(bit24 of 0x48) is enabled, TAP_SEL_PRE will be updated
  4785. * automatically according to the status of the auto tuning circuit to adjust the sample clock
  4786. * phase.
  4787. */
  4788. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE (24) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE.
  4789. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE (0x7f000000) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE.
  4790. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE from a register value.
  4791. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE)
  4792. /* --- Register HW_USDHC_CLK_TUNE_CTRL_STATUS, field PRE_ERR[31] (RO)
  4793. *
  4794. * PRE error which means the number of delay cells added on the feedback clock is too small. It's
  4795. * valid only when SMP_CLK_SEL of Mix control register(bit23 of 0x48) is enabled.
  4796. */
  4797. #define BP_USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR (31) //!< Bit position for USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR.
  4798. #define BM_USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR (0x80000000) //!< Bit mask for USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR.
  4799. //! @brief Get value of USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR from a register value.
  4800. #define BG_USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR) >> BP_USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR)
  4801. //-------------------------------------------------------------------------------------------
  4802. // HW_USDHC_VEND_SPEC - Vendor Specific Register
  4803. //-------------------------------------------------------------------------------------------
  4804. #ifndef __LANGUAGE_ASM__
  4805. /*!
  4806. * @brief HW_USDHC_VEND_SPEC - Vendor Specific Register (RW)
  4807. *
  4808. * Reset value: 0x20007809
  4809. *
  4810. * This register contains the vendor specific control/status register.
  4811. */
  4812. typedef union _hw_usdhc_vend_spec
  4813. {
  4814. reg32_t U;
  4815. struct _hw_usdhc_vend_spec_bitfields
  4816. {
  4817. unsigned EXT_DMA_EN : 1; //!< [0] External DMA Request Enable Enable the request to external DMA.
  4818. unsigned VSELECT : 1; //!< [1] Voltage Selection Change the value of output signal VSELECT, to control the voltage on pads for external card.
  4819. unsigned CONFLICT_CHK_EN : 1; //!< [2] It's not implemented in uSDHC IP.
  4820. unsigned AC12_WR_CHKBUSY_EN : 1; //!< [3] Check busy enable after auto CMD12 for write data packet
  4821. unsigned DAT3_CD_POL : 1; //!< [4] This bit only uses for debugging.
  4822. unsigned CD_POL : 1; //!< [5] This bit only uses for debugging.
  4823. unsigned WP_POL : 1; //!< [6] This bit only uses for debugging.
  4824. unsigned CLKONJ_IN_ABORT : 1; //!< [7] This bit only uses for debugging.
  4825. unsigned FRC_SDCLK_ON : 1; //!< [8] Force CLK output active:
  4826. unsigned AC12_ISNOT_ABORT : 1; //!< [9] This bit only uses for debugging.
  4827. unsigned DDREN_ACT_ATONCE : 1; //!< [10] This bit only uses for debugging.
  4828. unsigned IPG_CLK_SOFT_EN : 1; //!< [11] IPG_CLK software enable
  4829. unsigned HCLK_SOFT_EN : 1; //!< [12] Please note, hardware auto-enables the AHB clock when the internal DMA is enabled even if HCLK_SOFT_EN is 0.
  4830. unsigned IPG_PERCLK_SOFT_EN : 1; //!< [13] ipg_perclk software enable
  4831. unsigned CARD_CLK_SOFT_EN : 1; //!< [14] card clock software enable
  4832. unsigned CRC_CHK_DIS : 1; //!< [15] CRC check disable
  4833. unsigned INT_ST_VAL : 8; //!< [23:16] Internal State Value Internal state value, reflecting the corresponding state value selected by Debug Select field.
  4834. unsigned DBG_SEL : 4; //!< [27:24] Debug Select Select the internal sub-module to show its internal state value.
  4835. unsigned CMD_OE_PRE_EN : 1; //!< [28] Only for debug.
  4836. unsigned AC12_RD_CHKBUSY_EN : 1; //!< [29] Only for debug.
  4837. unsigned CARD_DET_IN_IDLE_ENJ : 1; //!< [30] Only for debug.
  4838. unsigned RESERVED0 : 1; //!< [31] Reserved
  4839. } B;
  4840. } hw_usdhc_vend_spec_t;
  4841. #endif
  4842. /*
  4843. * constants & macros for entire multi-block USDHC_VEND_SPEC register
  4844. */
  4845. #define HW_USDHC_VEND_SPEC_ADDR(x) (REGS_USDHC_BASE(x) + 0xc0)
  4846. #ifndef __LANGUAGE_ASM__
  4847. #define HW_USDHC_VEND_SPEC(x) (*(volatile hw_usdhc_vend_spec_t *) HW_USDHC_VEND_SPEC_ADDR(x))
  4848. #define HW_USDHC_VEND_SPEC_RD(x) (HW_USDHC_VEND_SPEC(x).U)
  4849. #define HW_USDHC_VEND_SPEC_WR(x, v) (HW_USDHC_VEND_SPEC(x).U = (v))
  4850. #define HW_USDHC_VEND_SPEC_SET(x, v) (HW_USDHC_VEND_SPEC_WR(x, HW_USDHC_VEND_SPEC_RD(x) | (v)))
  4851. #define HW_USDHC_VEND_SPEC_CLR(x, v) (HW_USDHC_VEND_SPEC_WR(x, HW_USDHC_VEND_SPEC_RD(x) & ~(v)))
  4852. #define HW_USDHC_VEND_SPEC_TOG(x, v) (HW_USDHC_VEND_SPEC_WR(x, HW_USDHC_VEND_SPEC_RD(x) ^ (v)))
  4853. #endif
  4854. /*
  4855. * constants & macros for individual USDHC_VEND_SPEC bitfields
  4856. */
  4857. /* --- Register HW_USDHC_VEND_SPEC, field EXT_DMA_EN[0] (RW)
  4858. *
  4859. * External DMA Request Enable Enable the request to external DMA. When the internal DMA (either
  4860. * Simple DMA or Advanced DMA) is not in use, and this bit is set, uSDHC will send out DMA request
  4861. * when the internal buffer is ready. This bit is particularly useful when transferring data by ARM
  4862. * platform polling mode, and it is not allowed to send out the external DMA request. By default,
  4863. * this bit is set.
  4864. *
  4865. * Values:
  4866. * 0 - In any scenario, uSDHC does not send out external DMA request
  4867. * 1 - When internal DMA is not active, the external DMA request will be sent out
  4868. */
  4869. #define BP_USDHC_VEND_SPEC_EXT_DMA_EN (0) //!< Bit position for USDHC_VEND_SPEC_EXT_DMA_EN.
  4870. #define BM_USDHC_VEND_SPEC_EXT_DMA_EN (0x00000001) //!< Bit mask for USDHC_VEND_SPEC_EXT_DMA_EN.
  4871. //! @brief Get value of USDHC_VEND_SPEC_EXT_DMA_EN from a register value.
  4872. #define BG_USDHC_VEND_SPEC_EXT_DMA_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_EXT_DMA_EN) >> BP_USDHC_VEND_SPEC_EXT_DMA_EN)
  4873. //! @brief Format value for bitfield USDHC_VEND_SPEC_EXT_DMA_EN.
  4874. #define BF_USDHC_VEND_SPEC_EXT_DMA_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_EXT_DMA_EN) & BM_USDHC_VEND_SPEC_EXT_DMA_EN)
  4875. #ifndef __LANGUAGE_ASM__
  4876. //! @brief Set the EXT_DMA_EN field to a new value.
  4877. #define BW_USDHC_VEND_SPEC_EXT_DMA_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_EXT_DMA_EN) | BF_USDHC_VEND_SPEC_EXT_DMA_EN(v)))
  4878. #endif
  4879. /* --- Register HW_USDHC_VEND_SPEC, field VSELECT[1] (RW)
  4880. *
  4881. * Voltage Selection Change the value of output signal VSELECT, to control the voltage on pads for
  4882. * external card. There must be a control circuit out of uSDHC to change the voltage on pads.
  4883. *
  4884. * Values:
  4885. * 0 - Change the voltage to high voltage range, around 3.0V
  4886. * 1 - Change the voltage to low voltage range, around 1.8V
  4887. */
  4888. #define BP_USDHC_VEND_SPEC_VSELECT (1) //!< Bit position for USDHC_VEND_SPEC_VSELECT.
  4889. #define BM_USDHC_VEND_SPEC_VSELECT (0x00000002) //!< Bit mask for USDHC_VEND_SPEC_VSELECT.
  4890. //! @brief Get value of USDHC_VEND_SPEC_VSELECT from a register value.
  4891. #define BG_USDHC_VEND_SPEC_VSELECT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_VSELECT) >> BP_USDHC_VEND_SPEC_VSELECT)
  4892. //! @brief Format value for bitfield USDHC_VEND_SPEC_VSELECT.
  4893. #define BF_USDHC_VEND_SPEC_VSELECT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_VSELECT) & BM_USDHC_VEND_SPEC_VSELECT)
  4894. #ifndef __LANGUAGE_ASM__
  4895. //! @brief Set the VSELECT field to a new value.
  4896. #define BW_USDHC_VEND_SPEC_VSELECT(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_VSELECT) | BF_USDHC_VEND_SPEC_VSELECT(v)))
  4897. #endif
  4898. /* --- Register HW_USDHC_VEND_SPEC, field CONFLICT_CHK_EN[2] (RW)
  4899. *
  4900. * It's not implemented in uSDHC IP. Conflict check enable.
  4901. *
  4902. * Values:
  4903. * 0 - conflict check disable
  4904. * 1 - conflict check enable
  4905. */
  4906. #define BP_USDHC_VEND_SPEC_CONFLICT_CHK_EN (2) //!< Bit position for USDHC_VEND_SPEC_CONFLICT_CHK_EN.
  4907. #define BM_USDHC_VEND_SPEC_CONFLICT_CHK_EN (0x00000004) //!< Bit mask for USDHC_VEND_SPEC_CONFLICT_CHK_EN.
  4908. //! @brief Get value of USDHC_VEND_SPEC_CONFLICT_CHK_EN from a register value.
  4909. #define BG_USDHC_VEND_SPEC_CONFLICT_CHK_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CONFLICT_CHK_EN) >> BP_USDHC_VEND_SPEC_CONFLICT_CHK_EN)
  4910. //! @brief Format value for bitfield USDHC_VEND_SPEC_CONFLICT_CHK_EN.
  4911. #define BF_USDHC_VEND_SPEC_CONFLICT_CHK_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_CONFLICT_CHK_EN) & BM_USDHC_VEND_SPEC_CONFLICT_CHK_EN)
  4912. #ifndef __LANGUAGE_ASM__
  4913. //! @brief Set the CONFLICT_CHK_EN field to a new value.
  4914. #define BW_USDHC_VEND_SPEC_CONFLICT_CHK_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_CONFLICT_CHK_EN) | BF_USDHC_VEND_SPEC_CONFLICT_CHK_EN(v)))
  4915. #endif
  4916. /* --- Register HW_USDHC_VEND_SPEC, field AC12_WR_CHKBUSY_EN[3] (RW)
  4917. *
  4918. * Check busy enable after auto CMD12 for write data packet
  4919. *
  4920. * Values:
  4921. * 0 - Not check busy after auto CMD12 for write data packet
  4922. * 1 - Check busy after auto CMD12 for write data packet
  4923. */
  4924. #define BP_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN (3) //!< Bit position for USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN.
  4925. #define BM_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN (0x00000008) //!< Bit mask for USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN.
  4926. //! @brief Get value of USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN from a register value.
  4927. #define BG_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN) >> BP_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN)
  4928. //! @brief Format value for bitfield USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN.
  4929. #define BF_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN) & BM_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN)
  4930. #ifndef __LANGUAGE_ASM__
  4931. //! @brief Set the AC12_WR_CHKBUSY_EN field to a new value.
  4932. #define BW_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN) | BF_USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN(v)))
  4933. #endif
  4934. /* --- Register HW_USDHC_VEND_SPEC, field DAT3_CD_POL[4] (RW)
  4935. *
  4936. * This bit only uses for debugging. Polarity of Dat3 pin when it's used as card detection:
  4937. *
  4938. * Values:
  4939. * 0 - card detected when DAT3 is high
  4940. * 1 - card detected when DAT3 is low
  4941. */
  4942. #define BP_USDHC_VEND_SPEC_DAT3_CD_POL (4) //!< Bit position for USDHC_VEND_SPEC_DAT3_CD_POL.
  4943. #define BM_USDHC_VEND_SPEC_DAT3_CD_POL (0x00000010) //!< Bit mask for USDHC_VEND_SPEC_DAT3_CD_POL.
  4944. //! @brief Get value of USDHC_VEND_SPEC_DAT3_CD_POL from a register value.
  4945. #define BG_USDHC_VEND_SPEC_DAT3_CD_POL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_DAT3_CD_POL) >> BP_USDHC_VEND_SPEC_DAT3_CD_POL)
  4946. //! @brief Format value for bitfield USDHC_VEND_SPEC_DAT3_CD_POL.
  4947. #define BF_USDHC_VEND_SPEC_DAT3_CD_POL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_DAT3_CD_POL) & BM_USDHC_VEND_SPEC_DAT3_CD_POL)
  4948. #ifndef __LANGUAGE_ASM__
  4949. //! @brief Set the DAT3_CD_POL field to a new value.
  4950. #define BW_USDHC_VEND_SPEC_DAT3_CD_POL(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_DAT3_CD_POL) | BF_USDHC_VEND_SPEC_DAT3_CD_POL(v)))
  4951. #endif
  4952. /* --- Register HW_USDHC_VEND_SPEC, field CD_POL[5] (RW)
  4953. *
  4954. * This bit only uses for debugging. Polarity of the CD pin:
  4955. *
  4956. * Values:
  4957. * 0 - CD pin is low active
  4958. * 1 - CD pin is high active
  4959. */
  4960. #define BP_USDHC_VEND_SPEC_CD_POL (5) //!< Bit position for USDHC_VEND_SPEC_CD_POL.
  4961. #define BM_USDHC_VEND_SPEC_CD_POL (0x00000020) //!< Bit mask for USDHC_VEND_SPEC_CD_POL.
  4962. //! @brief Get value of USDHC_VEND_SPEC_CD_POL from a register value.
  4963. #define BG_USDHC_VEND_SPEC_CD_POL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CD_POL) >> BP_USDHC_VEND_SPEC_CD_POL)
  4964. //! @brief Format value for bitfield USDHC_VEND_SPEC_CD_POL.
  4965. #define BF_USDHC_VEND_SPEC_CD_POL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_CD_POL) & BM_USDHC_VEND_SPEC_CD_POL)
  4966. #ifndef __LANGUAGE_ASM__
  4967. //! @brief Set the CD_POL field to a new value.
  4968. #define BW_USDHC_VEND_SPEC_CD_POL(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_CD_POL) | BF_USDHC_VEND_SPEC_CD_POL(v)))
  4969. #endif
  4970. /* --- Register HW_USDHC_VEND_SPEC, field WP_POL[6] (RW)
  4971. *
  4972. * This bit only uses for debugging. Polarity of the WP pin:
  4973. *
  4974. * Values:
  4975. * 0 - WP pin is high active
  4976. * 1 - WP pin is low active
  4977. */
  4978. #define BP_USDHC_VEND_SPEC_WP_POL (6) //!< Bit position for USDHC_VEND_SPEC_WP_POL.
  4979. #define BM_USDHC_VEND_SPEC_WP_POL (0x00000040) //!< Bit mask for USDHC_VEND_SPEC_WP_POL.
  4980. //! @brief Get value of USDHC_VEND_SPEC_WP_POL from a register value.
  4981. #define BG_USDHC_VEND_SPEC_WP_POL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_WP_POL) >> BP_USDHC_VEND_SPEC_WP_POL)
  4982. //! @brief Format value for bitfield USDHC_VEND_SPEC_WP_POL.
  4983. #define BF_USDHC_VEND_SPEC_WP_POL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_WP_POL) & BM_USDHC_VEND_SPEC_WP_POL)
  4984. #ifndef __LANGUAGE_ASM__
  4985. //! @brief Set the WP_POL field to a new value.
  4986. #define BW_USDHC_VEND_SPEC_WP_POL(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_WP_POL) | BF_USDHC_VEND_SPEC_WP_POL(v)))
  4987. #endif
  4988. /* --- Register HW_USDHC_VEND_SPEC, field CLKONJ_IN_ABORT[7] (RW)
  4989. *
  4990. * This bit only uses for debugging. Force CLK output active when sending Abort command:
  4991. *
  4992. * Values:
  4993. * 0 - the CLK output is active when sending abort command while data is transmitting even if the internal
  4994. * FIFO is full(for read) or empty(for write)
  4995. * 1 - the CLK output is inactive when sending abort command while data is transmitting if the internal
  4996. * FIFO is full(for read) or empty(for write)
  4997. */
  4998. #define BP_USDHC_VEND_SPEC_CLKONJ_IN_ABORT (7) //!< Bit position for USDHC_VEND_SPEC_CLKONJ_IN_ABORT.
  4999. #define BM_USDHC_VEND_SPEC_CLKONJ_IN_ABORT (0x00000080) //!< Bit mask for USDHC_VEND_SPEC_CLKONJ_IN_ABORT.
  5000. //! @brief Get value of USDHC_VEND_SPEC_CLKONJ_IN_ABORT from a register value.
  5001. #define BG_USDHC_VEND_SPEC_CLKONJ_IN_ABORT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CLKONJ_IN_ABORT) >> BP_USDHC_VEND_SPEC_CLKONJ_IN_ABORT)
  5002. //! @brief Format value for bitfield USDHC_VEND_SPEC_CLKONJ_IN_ABORT.
  5003. #define BF_USDHC_VEND_SPEC_CLKONJ_IN_ABORT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_CLKONJ_IN_ABORT) & BM_USDHC_VEND_SPEC_CLKONJ_IN_ABORT)
  5004. #ifndef __LANGUAGE_ASM__
  5005. //! @brief Set the CLKONJ_IN_ABORT field to a new value.
  5006. #define BW_USDHC_VEND_SPEC_CLKONJ_IN_ABORT(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_CLKONJ_IN_ABORT) | BF_USDHC_VEND_SPEC_CLKONJ_IN_ABORT(v)))
  5007. #endif
  5008. /* --- Register HW_USDHC_VEND_SPEC, field FRC_SDCLK_ON[8] (RW)
  5009. *
  5010. * Force CLK output active:
  5011. *
  5012. * Values:
  5013. * 0 - CLK active or inactive is fully controlled by the hardware
  5014. * 1 - force CLK active
  5015. */
  5016. #define BP_USDHC_VEND_SPEC_FRC_SDCLK_ON (8) //!< Bit position for USDHC_VEND_SPEC_FRC_SDCLK_ON.
  5017. #define BM_USDHC_VEND_SPEC_FRC_SDCLK_ON (0x00000100) //!< Bit mask for USDHC_VEND_SPEC_FRC_SDCLK_ON.
  5018. //! @brief Get value of USDHC_VEND_SPEC_FRC_SDCLK_ON from a register value.
  5019. #define BG_USDHC_VEND_SPEC_FRC_SDCLK_ON(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_FRC_SDCLK_ON) >> BP_USDHC_VEND_SPEC_FRC_SDCLK_ON)
  5020. //! @brief Format value for bitfield USDHC_VEND_SPEC_FRC_SDCLK_ON.
  5021. #define BF_USDHC_VEND_SPEC_FRC_SDCLK_ON(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_FRC_SDCLK_ON) & BM_USDHC_VEND_SPEC_FRC_SDCLK_ON)
  5022. #ifndef __LANGUAGE_ASM__
  5023. //! @brief Set the FRC_SDCLK_ON field to a new value.
  5024. #define BW_USDHC_VEND_SPEC_FRC_SDCLK_ON(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_FRC_SDCLK_ON) | BF_USDHC_VEND_SPEC_FRC_SDCLK_ON(v)))
  5025. #endif
  5026. /* --- Register HW_USDHC_VEND_SPEC, field AC12_ISNOT_ABORT[9] (RW)
  5027. *
  5028. * This bit only uses for debugging. Auto CMD12 is not a abort command:
  5029. *
  5030. * Values:
  5031. * 0 - Hardware treats the Auto CMD12 as abort command
  5032. * 1 - Hardwae doesn't treat the Auto CMD12 as abort comman
  5033. */
  5034. #define BP_USDHC_VEND_SPEC_AC12_ISNOT_ABORT (9) //!< Bit position for USDHC_VEND_SPEC_AC12_ISNOT_ABORT.
  5035. #define BM_USDHC_VEND_SPEC_AC12_ISNOT_ABORT (0x00000200) //!< Bit mask for USDHC_VEND_SPEC_AC12_ISNOT_ABORT.
  5036. //! @brief Get value of USDHC_VEND_SPEC_AC12_ISNOT_ABORT from a register value.
  5037. #define BG_USDHC_VEND_SPEC_AC12_ISNOT_ABORT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_AC12_ISNOT_ABORT) >> BP_USDHC_VEND_SPEC_AC12_ISNOT_ABORT)
  5038. //! @brief Format value for bitfield USDHC_VEND_SPEC_AC12_ISNOT_ABORT.
  5039. #define BF_USDHC_VEND_SPEC_AC12_ISNOT_ABORT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_AC12_ISNOT_ABORT) & BM_USDHC_VEND_SPEC_AC12_ISNOT_ABORT)
  5040. #ifndef __LANGUAGE_ASM__
  5041. //! @brief Set the AC12_ISNOT_ABORT field to a new value.
  5042. #define BW_USDHC_VEND_SPEC_AC12_ISNOT_ABORT(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_AC12_ISNOT_ABORT) | BF_USDHC_VEND_SPEC_AC12_ISNOT_ABORT(v)))
  5043. #endif
  5044. /* --- Register HW_USDHC_VEND_SPEC, field DDREN_ACT_ATONCE[10] (RW)
  5045. *
  5046. * This bit only uses for debugging. DDR_EN setting take active at once:
  5047. *
  5048. * Values:
  5049. * 0 - DDR_EN setting takes active only when the data and cmd line are idle.
  5050. * 1 - DDR_EN setting takes active at once no matter what the state of the data and cmd line are.
  5051. */
  5052. #define BP_USDHC_VEND_SPEC_DDREN_ACT_ATONCE (10) //!< Bit position for USDHC_VEND_SPEC_DDREN_ACT_ATONCE.
  5053. #define BM_USDHC_VEND_SPEC_DDREN_ACT_ATONCE (0x00000400) //!< Bit mask for USDHC_VEND_SPEC_DDREN_ACT_ATONCE.
  5054. //! @brief Get value of USDHC_VEND_SPEC_DDREN_ACT_ATONCE from a register value.
  5055. #define BG_USDHC_VEND_SPEC_DDREN_ACT_ATONCE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_DDREN_ACT_ATONCE) >> BP_USDHC_VEND_SPEC_DDREN_ACT_ATONCE)
  5056. //! @brief Format value for bitfield USDHC_VEND_SPEC_DDREN_ACT_ATONCE.
  5057. #define BF_USDHC_VEND_SPEC_DDREN_ACT_ATONCE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_DDREN_ACT_ATONCE) & BM_USDHC_VEND_SPEC_DDREN_ACT_ATONCE)
  5058. #ifndef __LANGUAGE_ASM__
  5059. //! @brief Set the DDREN_ACT_ATONCE field to a new value.
  5060. #define BW_USDHC_VEND_SPEC_DDREN_ACT_ATONCE(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_DDREN_ACT_ATONCE) | BF_USDHC_VEND_SPEC_DDREN_ACT_ATONCE(v)))
  5061. #endif
  5062. /* --- Register HW_USDHC_VEND_SPEC, field IPG_CLK_SOFT_EN[11] (RW)
  5063. *
  5064. * IPG_CLK software enable
  5065. *
  5066. * Values:
  5067. * 0 - gate off the IPG_CLK
  5068. * 1 - enable the IPG_CLK
  5069. */
  5070. #define BP_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN (11) //!< Bit position for USDHC_VEND_SPEC_IPG_CLK_SOFT_EN.
  5071. #define BM_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN (0x00000800) //!< Bit mask for USDHC_VEND_SPEC_IPG_CLK_SOFT_EN.
  5072. //! @brief Get value of USDHC_VEND_SPEC_IPG_CLK_SOFT_EN from a register value.
  5073. #define BG_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN) >> BP_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN)
  5074. //! @brief Format value for bitfield USDHC_VEND_SPEC_IPG_CLK_SOFT_EN.
  5075. #define BF_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN) & BM_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN)
  5076. #ifndef __LANGUAGE_ASM__
  5077. //! @brief Set the IPG_CLK_SOFT_EN field to a new value.
  5078. #define BW_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN) | BF_USDHC_VEND_SPEC_IPG_CLK_SOFT_EN(v)))
  5079. #endif
  5080. /* --- Register HW_USDHC_VEND_SPEC, field HCLK_SOFT_EN[12] (RW)
  5081. *
  5082. * Please note, hardware auto-enables the AHB clock when the internal DMA is enabled even if
  5083. * HCLK_SOFT_EN is 0. AHB clock software enable
  5084. *
  5085. * Values:
  5086. * 0 - gate off the AHB clock.
  5087. * 1 - enable the AHB clock.
  5088. */
  5089. #define BP_USDHC_VEND_SPEC_HCLK_SOFT_EN (12) //!< Bit position for USDHC_VEND_SPEC_HCLK_SOFT_EN.
  5090. #define BM_USDHC_VEND_SPEC_HCLK_SOFT_EN (0x00001000) //!< Bit mask for USDHC_VEND_SPEC_HCLK_SOFT_EN.
  5091. //! @brief Get value of USDHC_VEND_SPEC_HCLK_SOFT_EN from a register value.
  5092. #define BG_USDHC_VEND_SPEC_HCLK_SOFT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_HCLK_SOFT_EN) >> BP_USDHC_VEND_SPEC_HCLK_SOFT_EN)
  5093. //! @brief Format value for bitfield USDHC_VEND_SPEC_HCLK_SOFT_EN.
  5094. #define BF_USDHC_VEND_SPEC_HCLK_SOFT_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_HCLK_SOFT_EN) & BM_USDHC_VEND_SPEC_HCLK_SOFT_EN)
  5095. #ifndef __LANGUAGE_ASM__
  5096. //! @brief Set the HCLK_SOFT_EN field to a new value.
  5097. #define BW_USDHC_VEND_SPEC_HCLK_SOFT_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_HCLK_SOFT_EN) | BF_USDHC_VEND_SPEC_HCLK_SOFT_EN(v)))
  5098. #endif
  5099. /* --- Register HW_USDHC_VEND_SPEC, field IPG_PERCLK_SOFT_EN[13] (RW)
  5100. *
  5101. * ipg_perclk software enable
  5102. *
  5103. * Values:
  5104. * 0 - gate off the ipg_perclk
  5105. * 1 - enable the ipg_perclk
  5106. */
  5107. #define BP_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN (13) //!< Bit position for USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN.
  5108. #define BM_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN (0x00002000) //!< Bit mask for USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN.
  5109. //! @brief Get value of USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN from a register value.
  5110. #define BG_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN) >> BP_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN)
  5111. //! @brief Format value for bitfield USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN.
  5112. #define BF_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN) & BM_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN)
  5113. #ifndef __LANGUAGE_ASM__
  5114. //! @brief Set the IPG_PERCLK_SOFT_EN field to a new value.
  5115. #define BW_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN) | BF_USDHC_VEND_SPEC_IPG_PERCLK_SOFT_EN(v)))
  5116. #endif
  5117. /* --- Register HW_USDHC_VEND_SPEC, field CARD_CLK_SOFT_EN[14] (ROO)
  5118. *
  5119. * card clock software enable
  5120. *
  5121. * Values:
  5122. * 0 - gate off the sd_clk
  5123. * 1 - enable the sd_clk
  5124. */
  5125. #define BP_USDHC_VEND_SPEC_CARD_CLK_SOFT_EN (14) //!< Bit position for USDHC_VEND_SPEC_CARD_CLK_SOFT_EN.
  5126. #define BM_USDHC_VEND_SPEC_CARD_CLK_SOFT_EN (0x00004000) //!< Bit mask for USDHC_VEND_SPEC_CARD_CLK_SOFT_EN.
  5127. //! @brief Get value of USDHC_VEND_SPEC_CARD_CLK_SOFT_EN from a register value.
  5128. #define BG_USDHC_VEND_SPEC_CARD_CLK_SOFT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CARD_CLK_SOFT_EN) >> BP_USDHC_VEND_SPEC_CARD_CLK_SOFT_EN)
  5129. /* --- Register HW_USDHC_VEND_SPEC, field CRC_CHK_DIS[15] (RW)
  5130. *
  5131. * CRC check disable
  5132. *
  5133. * Values:
  5134. * 0 - check CRC16 for every read data packet and check CRC bits for every write data packet
  5135. * 1 - ignore CRC16 check for every read data packet and ignore CRC bits check for every write data packet
  5136. */
  5137. #define BP_USDHC_VEND_SPEC_CRC_CHK_DIS (15) //!< Bit position for USDHC_VEND_SPEC_CRC_CHK_DIS.
  5138. #define BM_USDHC_VEND_SPEC_CRC_CHK_DIS (0x00008000) //!< Bit mask for USDHC_VEND_SPEC_CRC_CHK_DIS.
  5139. //! @brief Get value of USDHC_VEND_SPEC_CRC_CHK_DIS from a register value.
  5140. #define BG_USDHC_VEND_SPEC_CRC_CHK_DIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CRC_CHK_DIS) >> BP_USDHC_VEND_SPEC_CRC_CHK_DIS)
  5141. //! @brief Format value for bitfield USDHC_VEND_SPEC_CRC_CHK_DIS.
  5142. #define BF_USDHC_VEND_SPEC_CRC_CHK_DIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_CRC_CHK_DIS) & BM_USDHC_VEND_SPEC_CRC_CHK_DIS)
  5143. #ifndef __LANGUAGE_ASM__
  5144. //! @brief Set the CRC_CHK_DIS field to a new value.
  5145. #define BW_USDHC_VEND_SPEC_CRC_CHK_DIS(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_CRC_CHK_DIS) | BF_USDHC_VEND_SPEC_CRC_CHK_DIS(v)))
  5146. #endif
  5147. /* --- Register HW_USDHC_VEND_SPEC, field INT_ST_VAL[23:16] (RO)
  5148. *
  5149. * Internal State Value Internal state value, reflecting the corresponding state value selected by
  5150. * Debug Select field. This field is read-only and write to this field does not have effect.
  5151. */
  5152. #define BP_USDHC_VEND_SPEC_INT_ST_VAL (16) //!< Bit position for USDHC_VEND_SPEC_INT_ST_VAL.
  5153. #define BM_USDHC_VEND_SPEC_INT_ST_VAL (0x00ff0000) //!< Bit mask for USDHC_VEND_SPEC_INT_ST_VAL.
  5154. //! @brief Get value of USDHC_VEND_SPEC_INT_ST_VAL from a register value.
  5155. #define BG_USDHC_VEND_SPEC_INT_ST_VAL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_INT_ST_VAL) >> BP_USDHC_VEND_SPEC_INT_ST_VAL)
  5156. /* --- Register HW_USDHC_VEND_SPEC, field DBG_SEL[27:24] (RW)
  5157. *
  5158. * Debug Select Select the internal sub-module to show its internal state value.
  5159. */
  5160. #define BP_USDHC_VEND_SPEC_DBG_SEL (24) //!< Bit position for USDHC_VEND_SPEC_DBG_SEL.
  5161. #define BM_USDHC_VEND_SPEC_DBG_SEL (0x0f000000) //!< Bit mask for USDHC_VEND_SPEC_DBG_SEL.
  5162. //! @brief Get value of USDHC_VEND_SPEC_DBG_SEL from a register value.
  5163. #define BG_USDHC_VEND_SPEC_DBG_SEL(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_DBG_SEL) >> BP_USDHC_VEND_SPEC_DBG_SEL)
  5164. //! @brief Format value for bitfield USDHC_VEND_SPEC_DBG_SEL.
  5165. #define BF_USDHC_VEND_SPEC_DBG_SEL(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_DBG_SEL) & BM_USDHC_VEND_SPEC_DBG_SEL)
  5166. #ifndef __LANGUAGE_ASM__
  5167. //! @brief Set the DBG_SEL field to a new value.
  5168. #define BW_USDHC_VEND_SPEC_DBG_SEL(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_DBG_SEL) | BF_USDHC_VEND_SPEC_DBG_SEL(v)))
  5169. #endif
  5170. /* --- Register HW_USDHC_VEND_SPEC, field CMD_OE_PRE_EN[28] (RW)
  5171. *
  5172. * Only for debug. Control the assert point of CMD_OE signal
  5173. *
  5174. * Values:
  5175. * 0 - CMD_OE and CMD_O assert at the same time
  5176. * 1 - CMD_OE asserts one clock cycle before CMD_O
  5177. */
  5178. #define BP_USDHC_VEND_SPEC_CMD_OE_PRE_EN (28) //!< Bit position for USDHC_VEND_SPEC_CMD_OE_PRE_EN.
  5179. #define BM_USDHC_VEND_SPEC_CMD_OE_PRE_EN (0x10000000) //!< Bit mask for USDHC_VEND_SPEC_CMD_OE_PRE_EN.
  5180. //! @brief Get value of USDHC_VEND_SPEC_CMD_OE_PRE_EN from a register value.
  5181. #define BG_USDHC_VEND_SPEC_CMD_OE_PRE_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CMD_OE_PRE_EN) >> BP_USDHC_VEND_SPEC_CMD_OE_PRE_EN)
  5182. //! @brief Format value for bitfield USDHC_VEND_SPEC_CMD_OE_PRE_EN.
  5183. #define BF_USDHC_VEND_SPEC_CMD_OE_PRE_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_CMD_OE_PRE_EN) & BM_USDHC_VEND_SPEC_CMD_OE_PRE_EN)
  5184. #ifndef __LANGUAGE_ASM__
  5185. //! @brief Set the CMD_OE_PRE_EN field to a new value.
  5186. #define BW_USDHC_VEND_SPEC_CMD_OE_PRE_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_CMD_OE_PRE_EN) | BF_USDHC_VEND_SPEC_CMD_OE_PRE_EN(v)))
  5187. #endif
  5188. /* --- Register HW_USDHC_VEND_SPEC, field AC12_RD_CHKBUSY_EN[29] (RW)
  5189. *
  5190. * Only for debug. Auto CMD12 to terminate multi-block read needs to check busy or not
  5191. *
  5192. * Values:
  5193. * 0 - Auto CMD12 to terminate multi-block read doesn't need to check busy
  5194. * 1 - Auto CMD12 to terminate multi-block read needs to check busy
  5195. */
  5196. #define BP_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN (29) //!< Bit position for USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN.
  5197. #define BM_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN (0x20000000) //!< Bit mask for USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN.
  5198. //! @brief Get value of USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN from a register value.
  5199. #define BG_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN) >> BP_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN)
  5200. //! @brief Format value for bitfield USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN.
  5201. #define BF_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN) & BM_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN)
  5202. #ifndef __LANGUAGE_ASM__
  5203. //! @brief Set the AC12_RD_CHKBUSY_EN field to a new value.
  5204. #define BW_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN) | BF_USDHC_VEND_SPEC_AC12_RD_CHKBUSY_EN(v)))
  5205. #endif
  5206. /* --- Register HW_USDHC_VEND_SPEC, field CARD_DET_IN_IDLE_ENJ[30] (RW)
  5207. *
  5208. * Only for debug. Card detection is only detected during data line idle.
  5209. *
  5210. * Values:
  5211. * 1b -
  5212. */
  5213. #define BP_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ (30) //!< Bit position for USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ.
  5214. #define BM_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ (0x40000000) //!< Bit mask for USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ.
  5215. //! @brief Get value of USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ from a register value.
  5216. #define BG_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ) >> BP_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ)
  5217. //! @brief Format value for bitfield USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ.
  5218. #define BF_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ) & BM_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ)
  5219. #ifndef __LANGUAGE_ASM__
  5220. //! @brief Set the CARD_DET_IN_IDLE_ENJ field to a new value.
  5221. #define BW_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ(x, v) (HW_USDHC_VEND_SPEC_WR(x, (HW_USDHC_VEND_SPEC_RD(x) & ~BM_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ) | BF_USDHC_VEND_SPEC_CARD_DET_IN_IDLE_ENJ(v)))
  5222. #endif
  5223. //-------------------------------------------------------------------------------------------
  5224. // HW_USDHC_MMC_BOOT - MMC Boot Register
  5225. //-------------------------------------------------------------------------------------------
  5226. #ifndef __LANGUAGE_ASM__
  5227. /*!
  5228. * @brief HW_USDHC_MMC_BOOT - MMC Boot Register (RW)
  5229. *
  5230. * Reset value: 0x00000000
  5231. *
  5232. * This register contains the MMC Fast Boot control register.
  5233. */
  5234. typedef union _hw_usdhc_mmc_boot
  5235. {
  5236. reg32_t U;
  5237. struct _hw_usdhc_mmc_boot_bitfields
  5238. {
  5239. unsigned DTOCV_ACK : 4; //!< [3:0] Boot ACK time out counter value.
  5240. unsigned BOOT_ACK : 1; //!< [4] Boot ack mode select 0: no ack 1: ack
  5241. unsigned BOOT_MODE : 1; //!< [5] Boot mode select 0: normal boot 1: alternative boot
  5242. unsigned BOOT_EN : 1; //!< [6] Boot mode enable 0: fast boot disable 1: fast boot enable
  5243. unsigned AUTO_SABG_EN : 1; //!< [7] When boot, enable auto stop at block gap function.
  5244. unsigned DISABLE_TIME_OUT : 1; //!< [8] Please note, when this bit is set, there is no timeout check no matter boot_en is set or not.
  5245. unsigned RESERVED0 : 7; //!< [15:9] Reserved
  5246. unsigned BOOT_BLK_CNT : 16; //!< [31:16] The value defines the Stop At Block Gap value of automatic mode.
  5247. } B;
  5248. } hw_usdhc_mmc_boot_t;
  5249. #endif
  5250. /*
  5251. * constants & macros for entire multi-block USDHC_MMC_BOOT register
  5252. */
  5253. #define HW_USDHC_MMC_BOOT_ADDR(x) (REGS_USDHC_BASE(x) + 0xc4)
  5254. #ifndef __LANGUAGE_ASM__
  5255. #define HW_USDHC_MMC_BOOT(x) (*(volatile hw_usdhc_mmc_boot_t *) HW_USDHC_MMC_BOOT_ADDR(x))
  5256. #define HW_USDHC_MMC_BOOT_RD(x) (HW_USDHC_MMC_BOOT(x).U)
  5257. #define HW_USDHC_MMC_BOOT_WR(x, v) (HW_USDHC_MMC_BOOT(x).U = (v))
  5258. #define HW_USDHC_MMC_BOOT_SET(x, v) (HW_USDHC_MMC_BOOT_WR(x, HW_USDHC_MMC_BOOT_RD(x) | (v)))
  5259. #define HW_USDHC_MMC_BOOT_CLR(x, v) (HW_USDHC_MMC_BOOT_WR(x, HW_USDHC_MMC_BOOT_RD(x) & ~(v)))
  5260. #define HW_USDHC_MMC_BOOT_TOG(x, v) (HW_USDHC_MMC_BOOT_WR(x, HW_USDHC_MMC_BOOT_RD(x) ^ (v)))
  5261. #endif
  5262. /*
  5263. * constants & macros for individual USDHC_MMC_BOOT bitfields
  5264. */
  5265. /* --- Register HW_USDHC_MMC_BOOT, field DTOCV_ACK[3:0] (RW)
  5266. *
  5267. * Boot ACK time out counter value.
  5268. *
  5269. * Values:
  5270. * 0000 - SDCLK x 2^13
  5271. * 0001 - SDCLK x 2^14
  5272. * 0010 - SDCLK x 2^15
  5273. * 0011 - SDCLK x 2^16
  5274. * 0100 - SDCLK x 2^17
  5275. * 0101 - SDCLK x 2^18
  5276. * 0110 - SDCLK x 2^19
  5277. * 0111 - SDCLK x 2^20
  5278. * 1110 - SDCLK x 2^27
  5279. * 1111 - SDCLK x 2^28
  5280. */
  5281. #define BP_USDHC_MMC_BOOT_DTOCV_ACK (0) //!< Bit position for USDHC_MMC_BOOT_DTOCV_ACK.
  5282. #define BM_USDHC_MMC_BOOT_DTOCV_ACK (0x0000000f) //!< Bit mask for USDHC_MMC_BOOT_DTOCV_ACK.
  5283. //! @brief Get value of USDHC_MMC_BOOT_DTOCV_ACK from a register value.
  5284. #define BG_USDHC_MMC_BOOT_DTOCV_ACK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_DTOCV_ACK) >> BP_USDHC_MMC_BOOT_DTOCV_ACK)
  5285. //! @brief Format value for bitfield USDHC_MMC_BOOT_DTOCV_ACK.
  5286. #define BF_USDHC_MMC_BOOT_DTOCV_ACK(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_DTOCV_ACK) & BM_USDHC_MMC_BOOT_DTOCV_ACK)
  5287. #ifndef __LANGUAGE_ASM__
  5288. //! @brief Set the DTOCV_ACK field to a new value.
  5289. #define BW_USDHC_MMC_BOOT_DTOCV_ACK(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_DTOCV_ACK) | BF_USDHC_MMC_BOOT_DTOCV_ACK(v)))
  5290. #endif
  5291. /* --- Register HW_USDHC_MMC_BOOT, field BOOT_ACK[4] (RW)
  5292. *
  5293. * Boot ack mode select 0: no ack 1: ack
  5294. */
  5295. #define BP_USDHC_MMC_BOOT_BOOT_ACK (4) //!< Bit position for USDHC_MMC_BOOT_BOOT_ACK.
  5296. #define BM_USDHC_MMC_BOOT_BOOT_ACK (0x00000010) //!< Bit mask for USDHC_MMC_BOOT_BOOT_ACK.
  5297. //! @brief Get value of USDHC_MMC_BOOT_BOOT_ACK from a register value.
  5298. #define BG_USDHC_MMC_BOOT_BOOT_ACK(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_BOOT_ACK) >> BP_USDHC_MMC_BOOT_BOOT_ACK)
  5299. //! @brief Format value for bitfield USDHC_MMC_BOOT_BOOT_ACK.
  5300. #define BF_USDHC_MMC_BOOT_BOOT_ACK(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_BOOT_ACK) & BM_USDHC_MMC_BOOT_BOOT_ACK)
  5301. #ifndef __LANGUAGE_ASM__
  5302. //! @brief Set the BOOT_ACK field to a new value.
  5303. #define BW_USDHC_MMC_BOOT_BOOT_ACK(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_BOOT_ACK) | BF_USDHC_MMC_BOOT_BOOT_ACK(v)))
  5304. #endif
  5305. /* --- Register HW_USDHC_MMC_BOOT, field BOOT_MODE[5] (RW)
  5306. *
  5307. * Boot mode select 0: normal boot 1: alternative boot
  5308. */
  5309. #define BP_USDHC_MMC_BOOT_BOOT_MODE (5) //!< Bit position for USDHC_MMC_BOOT_BOOT_MODE.
  5310. #define BM_USDHC_MMC_BOOT_BOOT_MODE (0x00000020) //!< Bit mask for USDHC_MMC_BOOT_BOOT_MODE.
  5311. //! @brief Get value of USDHC_MMC_BOOT_BOOT_MODE from a register value.
  5312. #define BG_USDHC_MMC_BOOT_BOOT_MODE(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_BOOT_MODE) >> BP_USDHC_MMC_BOOT_BOOT_MODE)
  5313. //! @brief Format value for bitfield USDHC_MMC_BOOT_BOOT_MODE.
  5314. #define BF_USDHC_MMC_BOOT_BOOT_MODE(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_BOOT_MODE) & BM_USDHC_MMC_BOOT_BOOT_MODE)
  5315. #ifndef __LANGUAGE_ASM__
  5316. //! @brief Set the BOOT_MODE field to a new value.
  5317. #define BW_USDHC_MMC_BOOT_BOOT_MODE(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_BOOT_MODE) | BF_USDHC_MMC_BOOT_BOOT_MODE(v)))
  5318. #endif
  5319. /* --- Register HW_USDHC_MMC_BOOT, field BOOT_EN[6] (RW)
  5320. *
  5321. * Boot mode enable 0: fast boot disable 1: fast boot enable
  5322. */
  5323. #define BP_USDHC_MMC_BOOT_BOOT_EN (6) //!< Bit position for USDHC_MMC_BOOT_BOOT_EN.
  5324. #define BM_USDHC_MMC_BOOT_BOOT_EN (0x00000040) //!< Bit mask for USDHC_MMC_BOOT_BOOT_EN.
  5325. //! @brief Get value of USDHC_MMC_BOOT_BOOT_EN from a register value.
  5326. #define BG_USDHC_MMC_BOOT_BOOT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_BOOT_EN) >> BP_USDHC_MMC_BOOT_BOOT_EN)
  5327. //! @brief Format value for bitfield USDHC_MMC_BOOT_BOOT_EN.
  5328. #define BF_USDHC_MMC_BOOT_BOOT_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_BOOT_EN) & BM_USDHC_MMC_BOOT_BOOT_EN)
  5329. #ifndef __LANGUAGE_ASM__
  5330. //! @brief Set the BOOT_EN field to a new value.
  5331. #define BW_USDHC_MMC_BOOT_BOOT_EN(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_BOOT_EN) | BF_USDHC_MMC_BOOT_BOOT_EN(v)))
  5332. #endif
  5333. /* --- Register HW_USDHC_MMC_BOOT, field AUTO_SABG_EN[7] (RW)
  5334. *
  5335. * When boot, enable auto stop at block gap function. This function will be triggered, and host will
  5336. * stop at block gap when received card block cnt is equal to (BLK_CNT - BOOT_BLK_CNT).
  5337. */
  5338. #define BP_USDHC_MMC_BOOT_AUTO_SABG_EN (7) //!< Bit position for USDHC_MMC_BOOT_AUTO_SABG_EN.
  5339. #define BM_USDHC_MMC_BOOT_AUTO_SABG_EN (0x00000080) //!< Bit mask for USDHC_MMC_BOOT_AUTO_SABG_EN.
  5340. //! @brief Get value of USDHC_MMC_BOOT_AUTO_SABG_EN from a register value.
  5341. #define BG_USDHC_MMC_BOOT_AUTO_SABG_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_AUTO_SABG_EN) >> BP_USDHC_MMC_BOOT_AUTO_SABG_EN)
  5342. //! @brief Format value for bitfield USDHC_MMC_BOOT_AUTO_SABG_EN.
  5343. #define BF_USDHC_MMC_BOOT_AUTO_SABG_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_AUTO_SABG_EN) & BM_USDHC_MMC_BOOT_AUTO_SABG_EN)
  5344. #ifndef __LANGUAGE_ASM__
  5345. //! @brief Set the AUTO_SABG_EN field to a new value.
  5346. #define BW_USDHC_MMC_BOOT_AUTO_SABG_EN(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_AUTO_SABG_EN) | BF_USDHC_MMC_BOOT_AUTO_SABG_EN(v)))
  5347. #endif
  5348. /* --- Register HW_USDHC_MMC_BOOT, field DISABLE_TIME_OUT[8] (RW)
  5349. *
  5350. * Please note, when this bit is set, there is no timeout check no matter boot_en is set or not.
  5351. * Disable time out.
  5352. *
  5353. * Values:
  5354. * 0 - enable time out
  5355. * 1 - Disable time out
  5356. */
  5357. #define BP_USDHC_MMC_BOOT_DISABLE_TIME_OUT (8) //!< Bit position for USDHC_MMC_BOOT_DISABLE_TIME_OUT.
  5358. #define BM_USDHC_MMC_BOOT_DISABLE_TIME_OUT (0x00000100) //!< Bit mask for USDHC_MMC_BOOT_DISABLE_TIME_OUT.
  5359. //! @brief Get value of USDHC_MMC_BOOT_DISABLE_TIME_OUT from a register value.
  5360. #define BG_USDHC_MMC_BOOT_DISABLE_TIME_OUT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_DISABLE_TIME_OUT) >> BP_USDHC_MMC_BOOT_DISABLE_TIME_OUT)
  5361. //! @brief Format value for bitfield USDHC_MMC_BOOT_DISABLE_TIME_OUT.
  5362. #define BF_USDHC_MMC_BOOT_DISABLE_TIME_OUT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_DISABLE_TIME_OUT) & BM_USDHC_MMC_BOOT_DISABLE_TIME_OUT)
  5363. #ifndef __LANGUAGE_ASM__
  5364. //! @brief Set the DISABLE_TIME_OUT field to a new value.
  5365. #define BW_USDHC_MMC_BOOT_DISABLE_TIME_OUT(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_DISABLE_TIME_OUT) | BF_USDHC_MMC_BOOT_DISABLE_TIME_OUT(v)))
  5366. #endif
  5367. /* --- Register HW_USDHC_MMC_BOOT, field BOOT_BLK_CNT[31:16] (RW)
  5368. *
  5369. * The value defines the Stop At Block Gap value of automatic mode. When received card block cnt is
  5370. * equal to (BLK_CNT - BOOT_BLK_CNT) and AUTO_SABG_EN is 1, then Stop At Block Gap. Here, BLK_CNT is
  5371. * defined in the Block Atrributes Register, bit31-16 of 0x04.
  5372. */
  5373. #define BP_USDHC_MMC_BOOT_BOOT_BLK_CNT (16) //!< Bit position for USDHC_MMC_BOOT_BOOT_BLK_CNT.
  5374. #define BM_USDHC_MMC_BOOT_BOOT_BLK_CNT (0xffff0000) //!< Bit mask for USDHC_MMC_BOOT_BOOT_BLK_CNT.
  5375. //! @brief Get value of USDHC_MMC_BOOT_BOOT_BLK_CNT from a register value.
  5376. #define BG_USDHC_MMC_BOOT_BOOT_BLK_CNT(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_MMC_BOOT_BOOT_BLK_CNT) >> BP_USDHC_MMC_BOOT_BOOT_BLK_CNT)
  5377. //! @brief Format value for bitfield USDHC_MMC_BOOT_BOOT_BLK_CNT.
  5378. #define BF_USDHC_MMC_BOOT_BOOT_BLK_CNT(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_MMC_BOOT_BOOT_BLK_CNT) & BM_USDHC_MMC_BOOT_BOOT_BLK_CNT)
  5379. #ifndef __LANGUAGE_ASM__
  5380. //! @brief Set the BOOT_BLK_CNT field to a new value.
  5381. #define BW_USDHC_MMC_BOOT_BOOT_BLK_CNT(x, v) (HW_USDHC_MMC_BOOT_WR(x, (HW_USDHC_MMC_BOOT_RD(x) & ~BM_USDHC_MMC_BOOT_BOOT_BLK_CNT) | BF_USDHC_MMC_BOOT_BOOT_BLK_CNT(v)))
  5382. #endif
  5383. //-------------------------------------------------------------------------------------------
  5384. // HW_USDHC_VEND_SPEC2 - Vendor Specific 2 Register
  5385. //-------------------------------------------------------------------------------------------
  5386. #ifndef __LANGUAGE_ASM__
  5387. /*!
  5388. * @brief HW_USDHC_VEND_SPEC2 - Vendor Specific 2 Register (RW)
  5389. *
  5390. * Reset value: 0x00000006
  5391. *
  5392. * This register contains the vendor specific control 2 register.
  5393. */
  5394. typedef union _hw_usdhc_vend_spec2
  5395. {
  5396. reg32_t U;
  5397. struct _hw_usdhc_vend_spec2_bitfields
  5398. {
  5399. unsigned SDR104_TIMING_DIS : 1; //!< [0] Timeout counter test.
  5400. unsigned SDR104_OE_DIS : 1; //!< [1] CMD_OE/DAT_OE logic generation test.
  5401. unsigned SDR104_NSD_DIS : 1; //!< [2] Interrupt window after abort command is sent.
  5402. unsigned CARD_INT_D3_TEST : 1; //!< [3] Card interrupt detection test.
  5403. unsigned TUNING_8BIT_EN : 1; //!< [4] Enable the auto tuning circuit to check the DAT[7:0].
  5404. unsigned TUNING_1BIT_EN : 1; //!< [5] Enable the auto tuning circuit to check the DAT0 only.
  5405. unsigned TUNING_CMD_EN : 1; //!< [6] Enable the auto tuning circuit to check the CMD line.
  5406. unsigned CARD_INT_AUTO_CLR_DIS : 1; //!< [7] Disable the feature to clear the Card interrupt status bit when Card Interrupt status enable bit is cleared.
  5407. unsigned RESERVED0 : 24; //!< [31:8] Reserved
  5408. } B;
  5409. } hw_usdhc_vend_spec2_t;
  5410. #endif
  5411. /*
  5412. * constants & macros for entire multi-block USDHC_VEND_SPEC2 register
  5413. */
  5414. #define HW_USDHC_VEND_SPEC2_ADDR(x) (REGS_USDHC_BASE(x) + 0xc8)
  5415. #ifndef __LANGUAGE_ASM__
  5416. #define HW_USDHC_VEND_SPEC2(x) (*(volatile hw_usdhc_vend_spec2_t *) HW_USDHC_VEND_SPEC2_ADDR(x))
  5417. #define HW_USDHC_VEND_SPEC2_RD(x) (HW_USDHC_VEND_SPEC2(x).U)
  5418. #define HW_USDHC_VEND_SPEC2_WR(x, v) (HW_USDHC_VEND_SPEC2(x).U = (v))
  5419. #define HW_USDHC_VEND_SPEC2_SET(x, v) (HW_USDHC_VEND_SPEC2_WR(x, HW_USDHC_VEND_SPEC2_RD(x) | (v)))
  5420. #define HW_USDHC_VEND_SPEC2_CLR(x, v) (HW_USDHC_VEND_SPEC2_WR(x, HW_USDHC_VEND_SPEC2_RD(x) & ~(v)))
  5421. #define HW_USDHC_VEND_SPEC2_TOG(x, v) (HW_USDHC_VEND_SPEC2_WR(x, HW_USDHC_VEND_SPEC2_RD(x) ^ (v)))
  5422. #endif
  5423. /*
  5424. * constants & macros for individual USDHC_VEND_SPEC2 bitfields
  5425. */
  5426. /* --- Register HW_USDHC_VEND_SPEC2, field SDR104_TIMING_DIS[0] (RW)
  5427. *
  5428. * Timeout counter test. This bit only uses for debugging.
  5429. *
  5430. * Values:
  5431. * 0 - The timeout counter for Ncr changes to 80, Ncrc changes to 21.
  5432. * 1 - The timeout counter for Ncr changes to 72, Ncrc changes to 15.
  5433. */
  5434. #define BP_USDHC_VEND_SPEC2_SDR104_TIMING_DIS (0) //!< Bit position for USDHC_VEND_SPEC2_SDR104_TIMING_DIS.
  5435. #define BM_USDHC_VEND_SPEC2_SDR104_TIMING_DIS (0x00000001) //!< Bit mask for USDHC_VEND_SPEC2_SDR104_TIMING_DIS.
  5436. //! @brief Get value of USDHC_VEND_SPEC2_SDR104_TIMING_DIS from a register value.
  5437. #define BG_USDHC_VEND_SPEC2_SDR104_TIMING_DIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_SDR104_TIMING_DIS) >> BP_USDHC_VEND_SPEC2_SDR104_TIMING_DIS)
  5438. //! @brief Format value for bitfield USDHC_VEND_SPEC2_SDR104_TIMING_DIS.
  5439. #define BF_USDHC_VEND_SPEC2_SDR104_TIMING_DIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_SDR104_TIMING_DIS) & BM_USDHC_VEND_SPEC2_SDR104_TIMING_DIS)
  5440. #ifndef __LANGUAGE_ASM__
  5441. //! @brief Set the SDR104_TIMING_DIS field to a new value.
  5442. #define BW_USDHC_VEND_SPEC2_SDR104_TIMING_DIS(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_SDR104_TIMING_DIS) | BF_USDHC_VEND_SPEC2_SDR104_TIMING_DIS(v)))
  5443. #endif
  5444. /* --- Register HW_USDHC_VEND_SPEC2, field SDR104_OE_DIS[1] (RW)
  5445. *
  5446. * CMD_OE/DAT_OE logic generation test. This bit only uses for debugging.
  5447. *
  5448. * Values:
  5449. * 0 - Drive the CMD_OE/DAT_OE for one more clock cycle after the end bit.
  5450. * 1 - Stop to drive the CMD_OE/DAT_OE at once after driving the end bit.
  5451. */
  5452. #define BP_USDHC_VEND_SPEC2_SDR104_OE_DIS (1) //!< Bit position for USDHC_VEND_SPEC2_SDR104_OE_DIS.
  5453. #define BM_USDHC_VEND_SPEC2_SDR104_OE_DIS (0x00000002) //!< Bit mask for USDHC_VEND_SPEC2_SDR104_OE_DIS.
  5454. //! @brief Get value of USDHC_VEND_SPEC2_SDR104_OE_DIS from a register value.
  5455. #define BG_USDHC_VEND_SPEC2_SDR104_OE_DIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_SDR104_OE_DIS) >> BP_USDHC_VEND_SPEC2_SDR104_OE_DIS)
  5456. //! @brief Format value for bitfield USDHC_VEND_SPEC2_SDR104_OE_DIS.
  5457. #define BF_USDHC_VEND_SPEC2_SDR104_OE_DIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_SDR104_OE_DIS) & BM_USDHC_VEND_SPEC2_SDR104_OE_DIS)
  5458. #ifndef __LANGUAGE_ASM__
  5459. //! @brief Set the SDR104_OE_DIS field to a new value.
  5460. #define BW_USDHC_VEND_SPEC2_SDR104_OE_DIS(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_SDR104_OE_DIS) | BF_USDHC_VEND_SPEC2_SDR104_OE_DIS(v)))
  5461. #endif
  5462. /* --- Register HW_USDHC_VEND_SPEC2, field SDR104_NSD_DIS[2] (RW)
  5463. *
  5464. * Interrupt window after abort command is sent. This bit only uses for debugging.
  5465. *
  5466. * Values:
  5467. * 0 - Enable the interrupt window 9 cycles later after the end of the I/O abort command(or CMD12) is sent.
  5468. * 1 - Enable the interrupt window 5 cycles later after the end of the I/O abort command(or CMD12) is sent.
  5469. */
  5470. #define BP_USDHC_VEND_SPEC2_SDR104_NSD_DIS (2) //!< Bit position for USDHC_VEND_SPEC2_SDR104_NSD_DIS.
  5471. #define BM_USDHC_VEND_SPEC2_SDR104_NSD_DIS (0x00000004) //!< Bit mask for USDHC_VEND_SPEC2_SDR104_NSD_DIS.
  5472. //! @brief Get value of USDHC_VEND_SPEC2_SDR104_NSD_DIS from a register value.
  5473. #define BG_USDHC_VEND_SPEC2_SDR104_NSD_DIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_SDR104_NSD_DIS) >> BP_USDHC_VEND_SPEC2_SDR104_NSD_DIS)
  5474. //! @brief Format value for bitfield USDHC_VEND_SPEC2_SDR104_NSD_DIS.
  5475. #define BF_USDHC_VEND_SPEC2_SDR104_NSD_DIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_SDR104_NSD_DIS) & BM_USDHC_VEND_SPEC2_SDR104_NSD_DIS)
  5476. #ifndef __LANGUAGE_ASM__
  5477. //! @brief Set the SDR104_NSD_DIS field to a new value.
  5478. #define BW_USDHC_VEND_SPEC2_SDR104_NSD_DIS(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_SDR104_NSD_DIS) | BF_USDHC_VEND_SPEC2_SDR104_NSD_DIS(v)))
  5479. #endif
  5480. /* --- Register HW_USDHC_VEND_SPEC2, field CARD_INT_D3_TEST[3] (RW)
  5481. *
  5482. * Card interrupt detection test. This bit only uses for debugging.
  5483. *
  5484. * Values:
  5485. * 0 - Check the card interrupt only when DAT[3] is high.
  5486. * 1 - Check the card interrupt by ignoring the status of DAT[3].
  5487. */
  5488. #define BP_USDHC_VEND_SPEC2_CARD_INT_D3_TEST (3) //!< Bit position for USDHC_VEND_SPEC2_CARD_INT_D3_TEST.
  5489. #define BM_USDHC_VEND_SPEC2_CARD_INT_D3_TEST (0x00000008) //!< Bit mask for USDHC_VEND_SPEC2_CARD_INT_D3_TEST.
  5490. //! @brief Get value of USDHC_VEND_SPEC2_CARD_INT_D3_TEST from a register value.
  5491. #define BG_USDHC_VEND_SPEC2_CARD_INT_D3_TEST(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_CARD_INT_D3_TEST) >> BP_USDHC_VEND_SPEC2_CARD_INT_D3_TEST)
  5492. //! @brief Format value for bitfield USDHC_VEND_SPEC2_CARD_INT_D3_TEST.
  5493. #define BF_USDHC_VEND_SPEC2_CARD_INT_D3_TEST(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_CARD_INT_D3_TEST) & BM_USDHC_VEND_SPEC2_CARD_INT_D3_TEST)
  5494. #ifndef __LANGUAGE_ASM__
  5495. //! @brief Set the CARD_INT_D3_TEST field to a new value.
  5496. #define BW_USDHC_VEND_SPEC2_CARD_INT_D3_TEST(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_CARD_INT_D3_TEST) | BF_USDHC_VEND_SPEC2_CARD_INT_D3_TEST(v)))
  5497. #endif
  5498. /* --- Register HW_USDHC_VEND_SPEC2, field TUNING_8BIT_EN[4] (RW)
  5499. *
  5500. * Enable the auto tuning circuit to check the DAT[7:0]. It's used with the TUNING_1bit_EN together.
  5501. *
  5502. * Values:
  5503. * 00 - Tuning circuit only checks the DAT[3:0].
  5504. * 01 - Tuning circuit only checks the DAT[0].
  5505. * 10 - Tuning circuit checks the whole DAT[7:0].
  5506. * 11 - Invalid.
  5507. */
  5508. #define BP_USDHC_VEND_SPEC2_TUNING_8BIT_EN (4) //!< Bit position for USDHC_VEND_SPEC2_TUNING_8BIT_EN.
  5509. #define BM_USDHC_VEND_SPEC2_TUNING_8BIT_EN (0x00000010) //!< Bit mask for USDHC_VEND_SPEC2_TUNING_8BIT_EN.
  5510. //! @brief Get value of USDHC_VEND_SPEC2_TUNING_8BIT_EN from a register value.
  5511. #define BG_USDHC_VEND_SPEC2_TUNING_8BIT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_TUNING_8BIT_EN) >> BP_USDHC_VEND_SPEC2_TUNING_8BIT_EN)
  5512. //! @brief Format value for bitfield USDHC_VEND_SPEC2_TUNING_8BIT_EN.
  5513. #define BF_USDHC_VEND_SPEC2_TUNING_8BIT_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_TUNING_8BIT_EN) & BM_USDHC_VEND_SPEC2_TUNING_8BIT_EN)
  5514. #ifndef __LANGUAGE_ASM__
  5515. //! @brief Set the TUNING_8BIT_EN field to a new value.
  5516. #define BW_USDHC_VEND_SPEC2_TUNING_8BIT_EN(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_TUNING_8BIT_EN) | BF_USDHC_VEND_SPEC2_TUNING_8BIT_EN(v)))
  5517. #endif
  5518. /* --- Register HW_USDHC_VEND_SPEC2, field TUNING_1BIT_EN[5] (RW)
  5519. *
  5520. * Enable the auto tuning circuit to check the DAT0 only. It's used with the TUNING_8bit_EN
  5521. * together.
  5522. */
  5523. #define BP_USDHC_VEND_SPEC2_TUNING_1BIT_EN (5) //!< Bit position for USDHC_VEND_SPEC2_TUNING_1BIT_EN.
  5524. #define BM_USDHC_VEND_SPEC2_TUNING_1BIT_EN (0x00000020) //!< Bit mask for USDHC_VEND_SPEC2_TUNING_1BIT_EN.
  5525. //! @brief Get value of USDHC_VEND_SPEC2_TUNING_1BIT_EN from a register value.
  5526. #define BG_USDHC_VEND_SPEC2_TUNING_1BIT_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_TUNING_1BIT_EN) >> BP_USDHC_VEND_SPEC2_TUNING_1BIT_EN)
  5527. //! @brief Format value for bitfield USDHC_VEND_SPEC2_TUNING_1BIT_EN.
  5528. #define BF_USDHC_VEND_SPEC2_TUNING_1BIT_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_TUNING_1BIT_EN) & BM_USDHC_VEND_SPEC2_TUNING_1BIT_EN)
  5529. #ifndef __LANGUAGE_ASM__
  5530. //! @brief Set the TUNING_1BIT_EN field to a new value.
  5531. #define BW_USDHC_VEND_SPEC2_TUNING_1BIT_EN(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_TUNING_1BIT_EN) | BF_USDHC_VEND_SPEC2_TUNING_1BIT_EN(v)))
  5532. #endif
  5533. /* --- Register HW_USDHC_VEND_SPEC2, field TUNING_CMD_EN[6] (RW)
  5534. *
  5535. * Enable the auto tuning circuit to check the CMD line.
  5536. *
  5537. * Values:
  5538. * 0 - Auto tuning circuit doesn't check the CMD line.
  5539. * 1 - Auto tuning circuit checks the CMD line.
  5540. */
  5541. #define BP_USDHC_VEND_SPEC2_TUNING_CMD_EN (6) //!< Bit position for USDHC_VEND_SPEC2_TUNING_CMD_EN.
  5542. #define BM_USDHC_VEND_SPEC2_TUNING_CMD_EN (0x00000040) //!< Bit mask for USDHC_VEND_SPEC2_TUNING_CMD_EN.
  5543. //! @brief Get value of USDHC_VEND_SPEC2_TUNING_CMD_EN from a register value.
  5544. #define BG_USDHC_VEND_SPEC2_TUNING_CMD_EN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_TUNING_CMD_EN) >> BP_USDHC_VEND_SPEC2_TUNING_CMD_EN)
  5545. //! @brief Format value for bitfield USDHC_VEND_SPEC2_TUNING_CMD_EN.
  5546. #define BF_USDHC_VEND_SPEC2_TUNING_CMD_EN(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_TUNING_CMD_EN) & BM_USDHC_VEND_SPEC2_TUNING_CMD_EN)
  5547. #ifndef __LANGUAGE_ASM__
  5548. //! @brief Set the TUNING_CMD_EN field to a new value.
  5549. #define BW_USDHC_VEND_SPEC2_TUNING_CMD_EN(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_TUNING_CMD_EN) | BF_USDHC_VEND_SPEC2_TUNING_CMD_EN(v)))
  5550. #endif
  5551. /* --- Register HW_USDHC_VEND_SPEC2, field CARD_INT_AUTO_CLR_DIS[7] (RW)
  5552. *
  5553. * Disable the feature to clear the Card interrupt status bit when Card Interrupt status enable bit
  5554. * is cleared. This bit only uses for debugging.
  5555. *
  5556. * Values:
  5557. * 0 - Card interrupt status bit(CINT) can be cleared when Card Interrupt status enable bit is 0.
  5558. * 1 - Card interrupt status bit(CINT) can only be cleared by written-1 to CINT bit.
  5559. */
  5560. #define BP_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS (7) //!< Bit position for USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS.
  5561. #define BM_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS (0x00000080) //!< Bit mask for USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS.
  5562. //! @brief Get value of USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS from a register value.
  5563. #define BG_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS) >> BP_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS)
  5564. //! @brief Format value for bitfield USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS.
  5565. #define BF_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS(v) ((__REG_VALUE_TYPE((v), reg32_t) << BP_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS) & BM_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS)
  5566. #ifndef __LANGUAGE_ASM__
  5567. //! @brief Set the CARD_INT_AUTO_CLR_DIS field to a new value.
  5568. #define BW_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS(x, v) (HW_USDHC_VEND_SPEC2_WR(x, (HW_USDHC_VEND_SPEC2_RD(x) & ~BM_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS) | BF_USDHC_VEND_SPEC2_CARD_INT_AUTO_CLR_DIS(v)))
  5569. #endif
  5570. //-------------------------------------------------------------------------------------------
  5571. // HW_USDHC_HOST_CTRL_VER - Host Controller Version
  5572. //-------------------------------------------------------------------------------------------
  5573. #ifndef __LANGUAGE_ASM__
  5574. /*!
  5575. * @brief HW_USDHC_HOST_CTRL_VER - Host Controller Version (RO)
  5576. *
  5577. * Reset value: 0x00000003
  5578. *
  5579. * This register contains the vendor Host Controller version information. All bits are read only and
  5580. * will read the same as the power-reset value.
  5581. */
  5582. typedef union _hw_usdhc_host_ctrl_ver
  5583. {
  5584. reg32_t U;
  5585. struct _hw_usdhc_host_ctrl_ver_bitfields
  5586. {
  5587. unsigned SVN : 8; //!< [7:0] Specification Version Number: These status bits indicate the Host Controller Specification Version.
  5588. unsigned VVN : 8; //!< [15:8] Vendor Version Number: These status bits are reserved for the vendor version number.
  5589. unsigned RESERVED0 : 16; //!< [31:16] Reserved
  5590. } B;
  5591. } hw_usdhc_host_ctrl_ver_t;
  5592. #endif
  5593. /*
  5594. * constants & macros for entire multi-block USDHC_HOST_CTRL_VER register
  5595. */
  5596. #define HW_USDHC_HOST_CTRL_VER_ADDR(x) (REGS_USDHC_BASE(x) + 0xfc)
  5597. #ifndef __LANGUAGE_ASM__
  5598. #define HW_USDHC_HOST_CTRL_VER(x) (*(volatile hw_usdhc_host_ctrl_ver_t *) HW_USDHC_HOST_CTRL_VER_ADDR(x))
  5599. #define HW_USDHC_HOST_CTRL_VER_RD(x) (HW_USDHC_HOST_CTRL_VER(x).U)
  5600. #endif
  5601. /*
  5602. * constants & macros for individual USDHC_HOST_CTRL_VER bitfields
  5603. */
  5604. /* --- Register HW_USDHC_HOST_CTRL_VER, field SVN[7:0] (RO)
  5605. *
  5606. * Specification Version Number: These status bits indicate the Host Controller Specification
  5607. * Version. 00 SD Host Specification Version 1.0 03 SD Host Specification Version 3.0, supports Test
  5608. * Event Register and ADMA. All others) Reserved
  5609. */
  5610. #define BP_USDHC_HOST_CTRL_VER_SVN (0) //!< Bit position for USDHC_HOST_CTRL_VER_SVN.
  5611. #define BM_USDHC_HOST_CTRL_VER_SVN (0x000000ff) //!< Bit mask for USDHC_HOST_CTRL_VER_SVN.
  5612. //! @brief Get value of USDHC_HOST_CTRL_VER_SVN from a register value.
  5613. #define BG_USDHC_HOST_CTRL_VER_SVN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_VER_SVN) >> BP_USDHC_HOST_CTRL_VER_SVN)
  5614. /* --- Register HW_USDHC_HOST_CTRL_VER, field VVN[15:8] (RO)
  5615. *
  5616. * Vendor Version Number: These status bits are reserved for the vendor version number. The Host
  5617. * Driver shall not use this status. 01 Freescale uSDHC Version 1.1 others) Reserved
  5618. */
  5619. #define BP_USDHC_HOST_CTRL_VER_VVN (8) //!< Bit position for USDHC_HOST_CTRL_VER_VVN.
  5620. #define BM_USDHC_HOST_CTRL_VER_VVN (0x0000ff00) //!< Bit mask for USDHC_HOST_CTRL_VER_VVN.
  5621. //! @brief Get value of USDHC_HOST_CTRL_VER_VVN from a register value.
  5622. #define BG_USDHC_HOST_CTRL_VER_VVN(r) ((__REG_VALUE_TYPE((r), reg32_t) & BM_USDHC_HOST_CTRL_VER_VVN) >> BP_USDHC_HOST_CTRL_VER_VVN)
  5623. /*!
  5624. * @brief All USDHC module registers.
  5625. */
  5626. #ifndef __LANGUAGE_ASM__
  5627. #pragma pack(1)
  5628. typedef struct _hw_usdhc
  5629. {
  5630. volatile hw_usdhc_ds_addr_t DS_ADDR; //!< DMA System Address
  5631. volatile hw_usdhc_blk_att_t BLK_ATT; //!< Block Attributes
  5632. volatile hw_usdhc_cmd_arg_t CMD_ARG; //!< Command Argument
  5633. volatile hw_usdhc_cmd_xfr_typ_t CMD_XFR_TYP; //!< Command Transfer Type
  5634. volatile hw_usdhc_cmd_rsp0_t CMD_RSP0; //!< Command Response0
  5635. volatile hw_usdhc_cmd_rsp1_t CMD_RSP1; //!< Command Response1
  5636. volatile hw_usdhc_cmd_rsp2_t CMD_RSP2; //!< Command Response2
  5637. volatile hw_usdhc_cmd_rsp3_t CMD_RSP3; //!< Command Response3
  5638. volatile hw_usdhc_data_buff_acc_port_t DATA_BUFF_ACC_PORT; //!< Data Buffer Access Port
  5639. volatile hw_usdhc_pres_state_t PRES_STATE; //!< Present State
  5640. volatile hw_usdhc_prot_ctrl_t PROT_CTRL; //!< Protocol Control
  5641. volatile hw_usdhc_sys_ctrl_t SYS_CTRL; //!< System Control
  5642. volatile hw_usdhc_int_status_t INT_STATUS; //!< Interrupt Status
  5643. volatile hw_usdhc_int_status_en_t INT_STATUS_EN; //!< Interrupt Status Enable
  5644. volatile hw_usdhc_int_signal_en_t INT_SIGNAL_EN; //!< Interrupt Signal Enable
  5645. volatile hw_usdhc_autocmd12_err_status_t AUTOCMD12_ERR_STATUS; //!< Auto CMD12 Error Status
  5646. volatile hw_usdhc_host_ctrl_cap_t HOST_CTRL_CAP; //!< Host Controller Capabilities
  5647. volatile hw_usdhc_wtmk_lvl_t WTMK_LVL; //!< Watermark Level
  5648. volatile hw_usdhc_mix_ctrl_t MIX_CTRL; //!< Mixer Control
  5649. reg32_t _reserved0;
  5650. volatile hw_usdhc_force_event_t FORCE_EVENT; //!< Force Event
  5651. volatile hw_usdhc_adma_err_status_t ADMA_ERR_STATUS; //!< ADMA Error Status Register
  5652. volatile hw_usdhc_adma_sys_addr_t ADMA_SYS_ADDR; //!< ADMA System Address
  5653. reg32_t _reserved1;
  5654. volatile hw_usdhc_dll_ctrl_t DLL_CTRL; //!< DLL (Delay Line) Control
  5655. volatile hw_usdhc_dll_status_t DLL_STATUS; //!< DLL Status
  5656. volatile hw_usdhc_clk_tune_ctrl_status_t CLK_TUNE_CTRL_STATUS; //!< CLK Tuning Control and Status
  5657. reg32_t _reserved2[21];
  5658. volatile hw_usdhc_vend_spec_t VEND_SPEC; //!< Vendor Specific Register
  5659. volatile hw_usdhc_mmc_boot_t MMC_BOOT; //!< MMC Boot Register
  5660. volatile hw_usdhc_vend_spec2_t VEND_SPEC2; //!< Vendor Specific 2 Register
  5661. reg32_t _reserved3[12];
  5662. volatile hw_usdhc_host_ctrl_ver_t HOST_CTRL_VER; //!< Host Controller Version
  5663. } hw_usdhc_t;
  5664. #pragma pack()
  5665. //! @brief Macro to access all USDHC registers.
  5666. //! @param x USDHC instance number.
  5667. //! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
  5668. //! use the '&' operator, like <code>&HW_USDHC(0)</code>.
  5669. #define HW_USDHC(x) (*(volatile hw_usdhc_t *) REGS_USDHC_BASE(x))
  5670. #endif
  5671. #endif // __HW_USDHC_REGISTERS_H__