csl_srioAux.h 201 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952
  1. /**
  2. * @file csl_srioAux.h
  3. *
  4. * @brief
  5. * This is the SRIO Auxilary Header File which exposes the various
  6. * CSL Functional Layer API's to configure the SRIO Module.
  7. *
  8. * \par
  9. * ============================================================================
  10. * @n (C) Copyright 2008-2011, Texas Instruments, Inc.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. *
  16. * Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. *
  19. * Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in the
  21. * documentation and/or other materials provided with the
  22. * distribution.
  23. *
  24. * Neither the name of Texas Instruments Incorporated nor the names of
  25. * its contributors may be used to endorse or promote products derived
  26. * from this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. */
  41. #ifndef CSL_SRIOAUX_H_
  42. #define CSL_SRIOAUX_H_
  43. #include <ti/csl/soc.h>
  44. #include <ti/csl/csl_srio.h>
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. /** @addtogroup CSL_SRIO_FUNCTION
  49. @{ */
  50. /** ============================================================================
  51. * @n@b CSL_SRIO_GetPID
  52. *
  53. * @b Description
  54. * @n This function reads the peripheral ID register which identifies the
  55. * peripheral number for the peripheral.
  56. *
  57. * @b Arguments
  58. @verbatim
  59. revInfo Peripheral Revision populated by this API
  60. classInfo Peripheral class populated by this API
  61. typeInfo Peripheral Type populated by this API
  62. @endverbatim
  63. *
  64. * <b> Return Value </b>
  65. * @n None
  66. *
  67. * <b> Pre Condition </b>
  68. * @n CSL_SRIO_Open() must be called
  69. *
  70. * <b> Post Condition </b>
  71. * @n None
  72. *
  73. * @b Reads
  74. * @n SRIO_RIO_PID
  75. *
  76. * @b Example
  77. * @verbatim
  78. Uint32 pid;
  79. CSL_SrioHandle hSrio;
  80. // Open the CSL SRIO Module 0
  81. hSrio = CSL_SRIO_Open (0);
  82. // Get the SRIO Peripheral Identification.
  83. CSL_SRIO_GetPID (hSrio, &pid);
  84. @endverbatim
  85. * =============================================================================
  86. */
  87. static inline void CSL_SRIO_GetPID
  88. (
  89. CSL_SrioHandle hSrio,
  90. Uint32* pid
  91. )
  92. {
  93. *pid = hSrio->RIO_PID;
  94. }
  95. /** ============================================================================
  96. * @n@b CSL_SRIO_EnablePeripheral
  97. *
  98. * @b Description
  99. * @n This function sets the PEREN bit in the Peripheral Control register and
  100. * if not set this will prevent the peripheral from participating in any
  101. * transmit transactions and will disable all incoming requests. This should
  102. * be the last enable bit when bringing the device out of reset.
  103. *
  104. * @b Arguments
  105. @verbatim
  106. hSrio Handle of the SRIO device
  107. @endverbatim
  108. *
  109. * <b> Return Value </b>
  110. * @n None
  111. *
  112. * <b> Pre Condition </b>
  113. * @n CSL_SRIO_Open() must be called
  114. *
  115. * <b> Post Condition </b>
  116. * @n None
  117. *
  118. * @b Writes
  119. * @n SRIO_RIO_PCR_PEREN=1
  120. *
  121. * @b Example
  122. * @verbatim
  123. CSL_SrioHandle hSrio;
  124. // Open the CSL SRIO Module 0
  125. hSrio = CSL_SRIO_Open (0);
  126. // Enable the SRIO peripheral.
  127. CSL_SRIO_EnablePeripheral (hSrio);
  128. ...
  129. @endverbatim
  130. * =============================================================================
  131. */
  132. static inline void CSL_SRIO_EnablePeripheral (CSL_SrioHandle hSrio)
  133. {
  134. CSL_FINS(hSrio->RIO_PCR, SRIO_RIO_PCR_PEREN, 1);
  135. }
  136. /** ============================================================================
  137. * @n@b CSL_SRIO_DisablePeripheral
  138. *
  139. * @b Description
  140. * @n This function resets the PEREN bit in the Peripheral Control register
  141. * and disables the SRIO peripheral.
  142. *
  143. * @b Arguments
  144. @verbatim
  145. hSrio Handle of the SRIO device
  146. @endverbatim
  147. *
  148. * <b> Return Value </b>
  149. * @n None
  150. *
  151. * <b> Pre Condition </b>
  152. * @n CSL_SRIO_Open() must be called
  153. *
  154. * <b> Post Condition </b>
  155. * @n None
  156. *
  157. * @b Writes
  158. * @n SRIO_RIO_PCR_PEREN=0
  159. *
  160. * @b Example
  161. * @verbatim
  162. CSL_SrioHandle hSrio;
  163. // Open the CSL SRIO Module 0
  164. hSrio = CSL_SRIO_Open (0);
  165. // Disable the SRIO peripheral.
  166. CSL_SRIO_DisablePeripheral (hSrio);
  167. ...
  168. @endverbatim
  169. * =============================================================================
  170. */
  171. static inline void CSL_SRIO_DisablePeripheral (CSL_SrioHandle hSrio)
  172. {
  173. CSL_FINS(hSrio->RIO_PCR, SRIO_RIO_PCR_PEREN, 0);
  174. }
  175. /** ============================================================================
  176. * @n@b CSL_SRIO_SetMAUSwappingMode
  177. *
  178. * @b Description
  179. * @n This function sets the Little Endian Swapping Mode for the Memory Access
  180. * Unit.
  181. *
  182. * @b Arguments
  183. @verbatim
  184. hSrio Handle of the SRIO device
  185. mode Little Endian Swapping Mode for the MAU.
  186. @endverbatim
  187. *
  188. * <b> Return Value </b>
  189. * @n None
  190. *
  191. * <b> Pre Condition </b>
  192. * @n CSL_SRIO_Open() must be called
  193. *
  194. * <b> Post Condition </b>
  195. * @n None
  196. *
  197. * @b Writes
  198. * @n SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE
  199. *
  200. * @b Example
  201. * @verbatim
  202. CSL_SrioHandle hSrio;
  203. // Open the CSL SRIO Module 0
  204. hSrio = CSL_SRIO_Open (0);
  205. // Ensure that the Memory Access Unit operates in mode A
  206. CSL_SRIO_SetMAUSwappingMode (hSrio, 0);
  207. ...
  208. @endverbatim
  209. * =============================================================================
  210. */
  211. static inline void CSL_SRIO_SetMAUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
  212. {
  213. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE, mode);
  214. }
  215. /** ============================================================================
  216. * @n@b CSL_SRIO_GetMAUSwappingMode
  217. *
  218. * @b Description
  219. * @n This function gets the Little Endian Swapping Mode for the Memory Access
  220. * Unit.
  221. *
  222. * @b Arguments
  223. @verbatim
  224. hSrio Handle of the SRIO device
  225. mode Little Endian Swapping Mode for the MAU populated by this API
  226. @endverbatim
  227. *
  228. * <b> Return Value </b>
  229. * @n None
  230. *
  231. * <b> Pre Condition </b>
  232. * @n CSL_SRIO_Open() must be called
  233. *
  234. * <b> Post Condition </b>
  235. * @n None
  236. *
  237. * @b Reads
  238. * @n SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE
  239. *
  240. * @b Example
  241. * @verbatim
  242. CSL_SrioHandle hSrio;
  243. Uint8 mode;
  244. // Open the CSL SRIO Module 0
  245. hSrio = CSL_SRIO_Open (0);
  246. // Get the Memory Access Unit Swapping Mode.
  247. CSL_SRIO_GetMAUSwappingMode (hSrio, &mode);
  248. ...
  249. @endverbatim
  250. * =============================================================================
  251. */
  252. static inline void CSL_SRIO_GetMAUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
  253. {
  254. *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_MAU_LEND_SWAP_MODE);
  255. }
  256. /** ============================================================================
  257. * @n@b CSL_SRIO_SetLSUSwappingMode
  258. *
  259. * @b Description
  260. * @n This function sets the Little Endian Swapping Mode for the Load Store
  261. * Unit
  262. *
  263. * @b Arguments
  264. @verbatim
  265. hSrio Handle of the SRIO device
  266. mode Little Endian Swapping Mode for the LSU.
  267. @endverbatim
  268. *
  269. * <b> Return Value </b>
  270. * @n None
  271. *
  272. * <b> Pre Condition </b>
  273. * @n CSL_SRIO_Open() must be called
  274. *
  275. * <b> Post Condition </b>
  276. * @n None
  277. *
  278. * @b Writes
  279. * @n SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE
  280. *
  281. * @b Example
  282. * @verbatim
  283. CSL_SrioHandle hSrio;
  284. // Open the CSL SRIO Module 0
  285. hSrio = CSL_SRIO_Open (0);
  286. // Ensure that the LSU operates in mode A
  287. CSL_SRIO_SetLSUSwappingMode (hSrio, 0);
  288. ...
  289. @endverbatim
  290. * =============================================================================
  291. */
  292. static inline void CSL_SRIO_SetLSUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
  293. {
  294. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE, mode);
  295. }
  296. /** ============================================================================
  297. * @n@b CSL_SRIO_GetLSUSwappingMode
  298. *
  299. * @b Description
  300. * @n This function gets the Little Endian Swapping Mode for the Load Store
  301. * Unit.
  302. *
  303. * @b Arguments
  304. @verbatim
  305. hSrio Handle of the SRIO device
  306. mode Little Endian Swapping Mode for the LSU populated by this API
  307. @endverbatim
  308. *
  309. * <b> Return Value </b>
  310. * @n None
  311. *
  312. * <b> Pre Condition </b>
  313. * @n CSL_SRIO_Open() must be called
  314. *
  315. * <b> Post Condition </b>
  316. * @n None
  317. *
  318. * @b Reads
  319. * @n SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE
  320. *
  321. * @b Example
  322. * @verbatim
  323. CSL_SrioHandle hSrio;
  324. Uint8 mode;
  325. // Open the CSL SRIO Module 0
  326. hSrio = CSL_SRIO_Open (0);
  327. // Get the LSU Swapping Mode.
  328. CSL_SRIO_GetLSUSwappingMode (hSrio, &mode);
  329. ...
  330. @endverbatim
  331. * =============================================================================
  332. */
  333. static inline void CSL_SRIO_GetLSUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
  334. {
  335. *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LSU_LEND_SWAP_MODE);
  336. }
  337. /** ============================================================================
  338. * @n@b CSL_SRIO_EnablePromiscuous
  339. *
  340. * @b Description
  341. * @n This function enables the LOG_TGT_ID_DIS bit which ensures that the SRIO
  342. * packets are accepted at the logical layer even if there is no match with
  343. * the destination identifier.
  344. *
  345. * @b Arguments
  346. @verbatim
  347. hSrio Handle of the SRIO device
  348. @endverbatim
  349. *
  350. * <b> Return Value </b>
  351. * @n None
  352. *
  353. * <b> Pre Condition </b>
  354. * @n CSL_SRIO_Open() must be called
  355. *
  356. * <b> Post Condition </b>
  357. * @n None
  358. *
  359. * @b Writes
  360. * @n SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS=1
  361. *
  362. * @b Example
  363. * @verbatim
  364. CSL_SrioHandle hSrio;
  365. // Open the CSL SRIO Module 0
  366. hSrio = CSL_SRIO_Open (0);
  367. // Operate the peripheral in PROMISCUOUS mode.
  368. CSL_SRIO_EnablePromiscuous (hSrio);
  369. ...
  370. @endverbatim
  371. * =============================================================================
  372. */
  373. static inline void CSL_SRIO_EnablePromiscuous (CSL_SrioHandle hSrio)
  374. {
  375. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS, 1);
  376. }
  377. /** ============================================================================
  378. * @n@b CSL_SRIO_DisablePromiscuous
  379. *
  380. * @b Description
  381. * @n This function disables the LOG_TGT_ID_DIS bit which ensures that the SRIO
  382. * packets are accepted at the logical layer only if there is a match with the
  383. * specific destination identifier.
  384. *
  385. * @b Arguments
  386. @verbatim
  387. hSrio Handle of the SRIO device
  388. @endverbatim
  389. *
  390. * <b> Return Value </b>
  391. * @n None
  392. *
  393. * <b> Pre Condition </b>
  394. * @n CSL_SRIO_Open() must be called
  395. *
  396. * <b> Post Condition </b>
  397. * @n None
  398. *
  399. * @b Writes
  400. * @n SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS=0
  401. *
  402. * @b Example
  403. * @verbatim
  404. CSL_SrioHandle hSrio;
  405. // Open the CSL SRIO Module 0
  406. hSrio = CSL_SRIO_Open (0);
  407. // Operate the peripheral in non-PROMISC mode.
  408. CSL_SRIO_DisablePromiscuous (hSrio);
  409. ...
  410. @endverbatim
  411. * =============================================================================
  412. */
  413. static inline void CSL_SRIO_DisablePromiscuous (CSL_SrioHandle hSrio)
  414. {
  415. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS, 0);
  416. }
  417. /** ============================================================================
  418. * @n@b CSL_SRIO_IsPromiscuous
  419. *
  420. * @b Description
  421. * @n This function returns the status of the peripheral as TRUE if the device
  422. * is operating in PROMISCUOUS mode else FALSE.
  423. *
  424. * @b Arguments
  425. @verbatim
  426. hSrio Handle of the SRIO device
  427. @endverbatim
  428. *
  429. * <b> Return Value </b>
  430. * @n TRUE - Device is in PROMISCUOUS Mode.
  431. * @n FALSE - Device is in NON-PROMISCUOUS Mode.
  432. *
  433. * <b> Pre Condition </b>
  434. * @n CSL_SRIO_Open() must be called
  435. *
  436. * <b> Post Condition </b>
  437. * @n None
  438. *
  439. * @b Reads
  440. * @n SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS
  441. *
  442. * @b Example
  443. * @verbatim
  444. CSL_SrioHandle hSrio;
  445. // Open the CSL SRIO Module 0
  446. hSrio = CSL_SRIO_Open (0);
  447. // Check if we are operating in PROMISCUOUS mode or not?
  448. if (CSL_SRIO_IsPromiscuous (hSrio) == TRUE)
  449. {
  450. // Device is in PROMISCUOUS Mode.
  451. }
  452. else
  453. {
  454. // Device is in Non-PROMISCUOUS Mode.
  455. }
  456. ...
  457. @endverbatim
  458. * =============================================================================
  459. */
  460. static inline Bool CSL_SRIO_IsPromiscuous (CSL_SrioHandle hSrio)
  461. {
  462. if (CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_LOG_TGT_ID_DIS) == 1)
  463. return TRUE;
  464. return FALSE;
  465. }
  466. /** ============================================================================
  467. * @n@b CSL_SRIO_SetAMUSwappingMode
  468. *
  469. * @b Description
  470. * @n This function sets the Little Endian Swapping Mode for the AMU
  471. *
  472. * @b Arguments
  473. @verbatim
  474. hSrio Handle of the SRIO device
  475. mode Little Endian Swapping Mode for the AMU
  476. @endverbatim
  477. *
  478. * <b> Return Value </b>
  479. * @n None
  480. *
  481. * <b> Pre Condition </b>
  482. * @n CSL_SRIO_Open() must be called
  483. *
  484. * <b> Post Condition </b>
  485. * @n None
  486. *
  487. * @b Writes
  488. * @n SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE
  489. *
  490. * @b Example
  491. * @verbatim
  492. CSL_SrioHandle hSrio;
  493. // Open the CSL SRIO Module 0
  494. hSrio = CSL_SRIO_Open (0);
  495. // Ensure that the AMU operates in mode A
  496. CSL_SRIO_SetAMUSwappingMode (hSrio, 0);
  497. ...
  498. @endverbatim
  499. * =============================================================================
  500. */
  501. static inline void CSL_SRIO_SetAMUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
  502. {
  503. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE, mode);
  504. }
  505. /** ============================================================================
  506. * @n@b CSL_SRIO_GetAMUSwappingMode
  507. *
  508. * @b Description
  509. * @n This function gets the Little Endian Swapping Mode for the AMU
  510. *
  511. * @b Arguments
  512. @verbatim
  513. hSrio Handle of the SRIO device
  514. mode Little Endian Swapping Mode for the AMU populated by this API
  515. @endverbatim
  516. *
  517. * <b> Return Value </b>
  518. * @n None
  519. *
  520. * <b> Pre Condition </b>
  521. * @n CSL_SRIO_Open() must be called
  522. *
  523. * <b> Post Condition </b>
  524. * @n None
  525. *
  526. * @b Reads
  527. * @n SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE
  528. *
  529. * @b Example
  530. * @verbatim
  531. CSL_SrioHandle hSrio;
  532. Uint8 mode;
  533. // Open the CSL SRIO Module 0
  534. hSrio = CSL_SRIO_Open (0);
  535. // Get the AMU Swapping Mode.
  536. CSL_SRIO_GetAMUSwappingMode (hSrio, &mode);
  537. ...
  538. @endverbatim
  539. * =============================================================================
  540. */
  541. static inline void CSL_SRIO_GetAMUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
  542. {
  543. *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_AMU_LEND_SWAP_MODE);
  544. }
  545. /** ============================================================================
  546. * @n@b CSL_SRIO_SetBootComplete
  547. *
  548. * @b Description
  549. * @n This function sets the boot complete flag as specified.
  550. *
  551. * @b Arguments
  552. @verbatim
  553. hSrio Handle of the SRIO device
  554. bootCompleteFlag Boot Complete Flag to be set in the register.
  555. @endverbatim
  556. *
  557. * <b> Return Value </b>
  558. * @n None
  559. *
  560. * <b> Pre Condition </b>
  561. * @n CSL_SRIO_Open() must be called
  562. *
  563. * <b> Post Condition </b>
  564. * @n None
  565. *
  566. * @b Writes
  567. * @n SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE
  568. *
  569. * @b Example
  570. * @verbatim
  571. CSL_SrioHandle hSrio;
  572. // Open the CSL SRIO Module 0
  573. hSrio = CSL_SRIO_Open (0);
  574. // Set the Boot Complete Flag to 1
  575. CSL_SRIO_SetBootComplete (hSrio, 1);
  576. ...
  577. @endverbatim
  578. * =============================================================================
  579. */
  580. static inline void CSL_SRIO_SetBootComplete (CSL_SrioHandle hSrio, Uint8 bootCompleteFlag)
  581. {
  582. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE, bootCompleteFlag);
  583. }
  584. /** ============================================================================
  585. * @n@b CSL_SRIO_GetBootComplete
  586. *
  587. * @b Description
  588. * @n This function gets the boot complete flag.
  589. *
  590. * @b Arguments
  591. @verbatim
  592. hSrio Handle of the SRIO device
  593. bootCompleteFlag Boot Complete Flag populated by this API.
  594. @endverbatim
  595. *
  596. * <b> Return Value </b>
  597. * @n None
  598. *
  599. * <b> Pre Condition </b>
  600. * @n CSL_SRIO_Open() must be called
  601. *
  602. * <b> Post Condition </b>
  603. * @n None
  604. *
  605. * @b Reads
  606. * @n SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE
  607. *
  608. * @b Example
  609. * @verbatim
  610. CSL_SrioHandle hSrio;
  611. Uint8 bootCompleteFlag;
  612. // Open the CSL SRIO Module 0
  613. hSrio = CSL_SRIO_Open (0);
  614. // Get the Boot Complete Flag
  615. bootCompleteFlag = CSL_SRIO_GetBootComplete (hSrio);
  616. ...
  617. @endverbatim
  618. * =============================================================================
  619. */
  620. static inline void CSL_SRIO_GetBootComplete (CSL_SrioHandle hSrio, Uint8* bootCompleteFlag)
  621. {
  622. *bootCompleteFlag = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_BOOT_COMPLETE);
  623. }
  624. /** ============================================================================
  625. * @n@b CSL_SRIO_SetTXURXUSwappingMode
  626. *
  627. * @b Description
  628. * @n This function sets the Little Endian Swapping Mode for the TXU and RXU
  629. *
  630. * @b Arguments
  631. @verbatim
  632. hSrio Handle of the SRIO device
  633. mode Little Endian Swapping Mode for the TXU and RXU.
  634. @endverbatim
  635. *
  636. * <b> Return Value </b>
  637. * @n None
  638. *
  639. * <b> Pre Condition </b>
  640. * @n CSL_SRIO_Open() must be called
  641. *
  642. * <b> Post Condition </b>
  643. * @n None
  644. *
  645. * @b Writes
  646. * @n SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE
  647. *
  648. * @b Example
  649. * @verbatim
  650. CSL_SrioHandle hSrio;
  651. // Open the CSL SRIO Module 0
  652. hSrio = CSL_SRIO_Open (0);
  653. // Ensure that the TXU and RXU operates in mode A
  654. CSL_SRIO_SetTXURXUSwappingMode (hSrio, 0);
  655. ...
  656. @endverbatim
  657. * =============================================================================
  658. */
  659. static inline void CSL_SRIO_SetTXURXUSwappingMode (CSL_SrioHandle hSrio, Uint8 mode)
  660. {
  661. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE, mode);
  662. }
  663. /** ============================================================================
  664. * @n@b CSL_SRIO_GetTXURXUSwappingMode
  665. *
  666. * @b Description
  667. * @n This function gets the Little Endian Swapping Mode for the Memory Access
  668. * Unit.
  669. *
  670. * @b Arguments
  671. @verbatim
  672. hSrio Handle of the SRIO device
  673. mode Little Endian Swapping Mode for the TXU and RXU populated by this API
  674. @endverbatim
  675. *
  676. * <b> Return Value </b>
  677. * @n None
  678. *
  679. * <b> Pre Condition </b>
  680. * @n CSL_SRIO_Open() must be called
  681. *
  682. * <b> Post Condition </b>
  683. * @n None
  684. *
  685. * @b Reads
  686. * @n SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE
  687. *
  688. * @b Example
  689. * @verbatim
  690. CSL_SrioHandle hSrio;
  691. Uint8 mode;
  692. // Open the CSL SRIO Module 0
  693. hSrio = CSL_SRIO_Open (0);
  694. // Get the TXU and RXU Swapping Mode.
  695. CSL_SRIO_GetTXURXUSwappingMode (hSrio, &mode);
  696. ...
  697. @endverbatim
  698. * =============================================================================
  699. */
  700. static inline void CSL_SRIO_GetTXURXUSwappingMode (CSL_SrioHandle hSrio, Uint8* mode)
  701. {
  702. *mode = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TXU_RXU_LEND_SWAP_MODE);
  703. }
  704. /** ============================================================================
  705. * @n@b CSL_SRIO_EnableAutomaticPriorityPromotion
  706. *
  707. * @b Description
  708. * @n This function enables the automatic promotion of response priority by
  709. * RXU and MAU.
  710. *
  711. * @b Arguments
  712. @verbatim
  713. hSrio Handle of the SRIO device
  714. @endverbatim
  715. *
  716. * <b> Return Value </b>
  717. * @n None
  718. *
  719. * <b> Pre Condition </b>
  720. * @n CSL_SRIO_Open() must be called
  721. *
  722. * <b> Post Condition </b>
  723. * @n None
  724. *
  725. * @b Writes
  726. * @n SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS=0
  727. *
  728. * @b Example
  729. * @verbatim
  730. CSL_SrioHandle hSrio;
  731. // Open the CSL SRIO Module 0
  732. hSrio = CSL_SRIO_Open (0);
  733. // Enable Automatic Priority Promotion.
  734. CSL_SRIO_EnableAutomaticPriorityPromotion (hSrio);
  735. ...
  736. @endverbatim
  737. * =============================================================================
  738. */
  739. static inline void CSL_SRIO_EnableAutomaticPriorityPromotion (CSL_SrioHandle hSrio)
  740. {
  741. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS, 0);
  742. }
  743. /** ============================================================================
  744. * @n@b CSL_SRIO_DisableAutomaticPriorityPromotion
  745. *
  746. * @b Description
  747. * @n This function disables the automatic promotion of response priority by
  748. * RXU and MAU.
  749. *
  750. * @b Arguments
  751. @verbatim
  752. hSrio Handle of the SRIO device
  753. @endverbatim
  754. *
  755. * <b> Return Value </b>
  756. * @n None
  757. *
  758. * <b> Pre Condition </b>
  759. * @n CSL_SRIO_Open() must be called
  760. *
  761. * <b> Post Condition </b>
  762. * @n None
  763. *
  764. * @b Writes
  765. * @n SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS=1
  766. *
  767. * @b Example
  768. * @verbatim
  769. CSL_SrioHandle hSrio;
  770. // Open the CSL SRIO Module 0
  771. hSrio = CSL_SRIO_Open (0);
  772. // Disable Automatic Priority Promotion.
  773. CSL_SRIO_DisableAutomaticPriorityPromotion (hSrio);
  774. ...
  775. @endverbatim
  776. * =============================================================================
  777. */
  778. static inline void CSL_SRIO_DisableAutomaticPriorityPromotion (CSL_SrioHandle hSrio)
  779. {
  780. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS, 1);
  781. }
  782. /** ============================================================================
  783. * @n@b CSL_SRIO_IsAutomaticPriorityPromotionEnabled
  784. *
  785. * @b Description
  786. * @n This function check if the automatic promotion of response priority by
  787. * RXU and MAU is enabled or not?
  788. *
  789. * @b Arguments
  790. @verbatim
  791. hSrio Handle of the SRIO device
  792. @endverbatim
  793. *
  794. * <b> Return Value </b>
  795. * @n TRUE - Automatic Priority Promotion is enabled
  796. * @n FALSE - Automatic Priority Promotion is disabled
  797. *
  798. * <b> Pre Condition </b>
  799. * @n CSL_SRIO_Open() must be called
  800. *
  801. * <b> Post Condition </b>
  802. * @n None
  803. *
  804. * @b Reads
  805. * @n SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS
  806. *
  807. * @b Example
  808. * @verbatim
  809. CSL_SrioHandle hSrio;
  810. // Open the CSL SRIO Module 0
  811. hSrio = CSL_SRIO_Open (0);
  812. // Check if Automatic Priority Promotion.
  813. if (CSL_SRIO_IsAutomaticPriorityPromotionEnabled (hSrio) == TRUE)
  814. {
  815. // Automatic Priority Promotion is enabled.
  816. }
  817. else
  818. {
  819. // Automatic Priority Promotion is disabled.
  820. }
  821. ...
  822. @endverbatim
  823. * =============================================================================
  824. */
  825. static inline Bool CSL_SRIO_IsAutomaticPriorityPromotionEnabled (CSL_SrioHandle hSrio)
  826. {
  827. if (CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PROMOTE_DIS) == 0)
  828. return TRUE;
  829. return FALSE;
  830. }
  831. /** ============================================================================
  832. * @n@b CSL_SRIO_SetTxCreditThreshold
  833. *
  834. * @b Description
  835. * @n This function sets the transmit credit threshold for priority packets
  836. *
  837. * @b Arguments
  838. @verbatim
  839. hSrio Handle of the SRIO device
  840. priority Priority of the Transmit Buffers
  841. credit Credit Threshold for the priority which is to be configured.
  842. @endverbatim
  843. *
  844. * <b> Return Value </b>
  845. * @n None
  846. *
  847. * <b> Pre Condition </b>
  848. * @n CSL_SRIO_Open() must be called
  849. *
  850. * <b> Post Condition </b>
  851. * @n None
  852. *
  853. * @b Writes
  854. * @n SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM;SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM;
  855. * SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM
  856. *
  857. * @b Example
  858. * @verbatim
  859. CSL_SrioHandle hSrio;
  860. // Open the CSL SRIO Module 0
  861. hSrio = CSL_SRIO_Open (0);
  862. // Set the Transmit Credit Threshold as 8 for priority 2
  863. CSL_SRIO_SetTxCreditThreshold (hSrio, 2, 8);
  864. ...
  865. @endverbatim
  866. * =============================================================================
  867. */
  868. static inline void CSL_SRIO_SetTxCreditThreshold (CSL_SrioHandle hSrio,Uint8 priority,Uint8 credit)
  869. {
  870. if (priority == 2)
  871. {
  872. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM, credit);
  873. }
  874. else if (priority == 1)
  875. {
  876. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM, credit);
  877. }
  878. else if (priority == 0)
  879. {
  880. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM, credit);
  881. }
  882. }
  883. /** ============================================================================
  884. * @n@b CSL_SRIO_GetTxCreditThreshold
  885. *
  886. * @b Description
  887. * @n This function gets the transmit credit threshold for priority packets
  888. *
  889. * @b Arguments
  890. @verbatim
  891. hSrio Handle of the SRIO device
  892. priority Priority of the Transmit Buffers
  893. credit Credit Threshold for the priority which is populated by this API
  894. @endverbatim
  895. *
  896. * <b> Return Value </b>
  897. * @n None
  898. *
  899. * <b> Pre Condition </b>
  900. * @n CSL_SRIO_Open() must be called
  901. *
  902. * <b> Post Condition </b>
  903. * @n None
  904. *
  905. * @b Reads
  906. * @n SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM;SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM;
  907. * SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM
  908. *
  909. * @b Example
  910. * @verbatim
  911. CSL_SrioHandle hSrio;
  912. Uint8 credit;
  913. // Open the CSL SRIO Module 0
  914. hSrio = CSL_SRIO_Open (0);
  915. // Get the Transmit Credit Threshold for priority 2
  916. CSL_SRIO_GetTxCreditThreshold (hSrio, 2, &credit);
  917. ...
  918. @endverbatim
  919. * =============================================================================
  920. */
  921. static inline void CSL_SRIO_GetTxCreditThreshold (CSL_SrioHandle hSrio,Uint8 priority,Uint8* credit)
  922. {
  923. if (priority == 2)
  924. {
  925. *credit = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI2_WM);
  926. }
  927. else if (priority == 1)
  928. {
  929. *credit = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI1_WM);
  930. }
  931. else if (priority == 0)
  932. {
  933. *credit = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_TX_PRI0_WM);
  934. }
  935. }
  936. /** ============================================================================
  937. * @n@b CSL_SRIO_SetTransactionPriority
  938. *
  939. * @b Description
  940. * @n This function sets the DSP System transaction priority. 0 implies
  941. * Highest Priority while 7 implies lowest.
  942. *
  943. * @b Arguments
  944. @verbatim
  945. hSrio Handle of the SRIO device
  946. priority Priority to be configured.
  947. @endverbatim
  948. *
  949. * <b> Return Value </b>
  950. * @n None
  951. *
  952. * <b> Pre Condition </b>
  953. * @n CSL_SRIO_Open() must be called
  954. *
  955. * <b> Post Condition </b>
  956. * @n None
  957. *
  958. * @b Writes
  959. * @n SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI
  960. *
  961. * @b Example
  962. * @verbatim
  963. CSL_SrioHandle hSrio;
  964. // Open the CSL SRIO Module 0
  965. hSrio = CSL_SRIO_Open (0);
  966. // Set the transaction priority to be HIGHEST
  967. CSL_SRIO_SetTransactionPriority (hSrio, 0);
  968. ...
  969. @endverbatim
  970. * =============================================================================
  971. */
  972. static inline void CSL_SRIO_SetTransactionPriority (CSL_SrioHandle hSrio,Uint8 priority)
  973. {
  974. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI, priority);
  975. }
  976. /** ============================================================================
  977. * @n@b CSL_SRIO_GetTransactionPriority
  978. *
  979. * @b Description
  980. * @n This function gets the DSP System transaction priority.
  981. *
  982. * @b Arguments
  983. @verbatim
  984. hSrio Handle of the SRIO device
  985. priority Priority to be configured.
  986. @endverbatim
  987. *
  988. * <b> Return Value </b>
  989. * @n None
  990. *
  991. * <b> Pre Condition </b>
  992. * @n CSL_SRIO_Open() must be called
  993. *
  994. * <b> Post Condition </b>
  995. * @n None
  996. *
  997. * @b Reads
  998. * @n SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI
  999. *
  1000. * @b Example
  1001. * @verbatim
  1002. CSL_SrioHandle hSrio;
  1003. Uint8 priority;
  1004. // Open the CSL SRIO Module 0
  1005. hSrio = CSL_SRIO_Open (0);
  1006. // Get the transaction priority
  1007. CSL_SRIO_GetTransactionPriority (hSrio, &priority);
  1008. ...
  1009. @endverbatim
  1010. * =============================================================================
  1011. */
  1012. static inline void CSL_SRIO_GetTransactionPriority (CSL_SrioHandle hSrio,Uint8 *priority)
  1013. {
  1014. *priority = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_CBA_TRANS_PRI);
  1015. }
  1016. /** ============================================================================
  1017. * @n@b CSL_SRIO_SetPrescalarSelect
  1018. *
  1019. * @b Description
  1020. * @n This function sets the prescalar select for SRIO
  1021. *
  1022. * @b Arguments
  1023. @verbatim
  1024. hSrio Handle of the SRIO device
  1025. prescalarSelect Prescalar Select which is to be configured.
  1026. @endverbatim
  1027. *
  1028. * <b> Return Value </b>
  1029. * @n None
  1030. *
  1031. * <b> Pre Condition </b>
  1032. * @n CSL_SRIO_Open() must be called
  1033. *
  1034. * <b> Post Condition </b>
  1035. * @n None
  1036. *
  1037. * @b Writes
  1038. * @n SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT
  1039. *
  1040. * @b Example
  1041. * @verbatim
  1042. CSL_SrioHandle hSrio;
  1043. // Open the CSL SRIO Module 0
  1044. hSrio = CSL_SRIO_Open (0);
  1045. // Set the SRIO Prescalar select to operate in the range of 44.7 to 89.5
  1046. CSL_SRIO_SetPrescalarSelect (hSrio, 0);
  1047. ...
  1048. @endverbatim
  1049. * =============================================================================
  1050. */
  1051. static inline void CSL_SRIO_SetPrescalarSelect (CSL_SrioHandle hSrio, Uint8 prescalarSelect)
  1052. {
  1053. CSL_FINS(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT, prescalarSelect);
  1054. }
  1055. /** ============================================================================
  1056. * @n@b CSL_SRIO_GetPrescalarSelect
  1057. *
  1058. * @b Description
  1059. * @n This function gets the prescalar select for SRIO
  1060. *
  1061. * @b Arguments
  1062. @verbatim
  1063. hSrio Handle of the SRIO device
  1064. prescalarSelect Prescalar Select which is to be retrieved.
  1065. @endverbatim
  1066. *
  1067. * <b> Return Value </b>
  1068. * @n None
  1069. *
  1070. * <b> Pre Condition </b>
  1071. * @n CSL_SRIO_Open() must be called
  1072. *
  1073. * <b> Post Condition </b>
  1074. * @n None
  1075. *
  1076. * @b Reads
  1077. * @n SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT
  1078. *
  1079. * @b Example
  1080. * @verbatim
  1081. CSL_SrioHandle hSrio;
  1082. Uint8 prescalarSelect;
  1083. // Open the CSL SRIO Module 0
  1084. hSrio = CSL_SRIO_Open (0);
  1085. // Get the SRIO Prescalar select.
  1086. CSL_SRIO_GetPrescalarSelect (hSrio, &prescalarSelect);
  1087. ...
  1088. @endverbatim
  1089. * =============================================================================
  1090. */
  1091. static inline void CSL_SRIO_GetPrescalarSelect (CSL_SrioHandle hSrio, Uint8* prescalarSelect)
  1092. {
  1093. *prescalarSelect = CSL_FEXT(hSrio->RIO_PER_SET_CNTL, SRIO_RIO_PER_SET_CNTL_PRESCALER_SELECT);
  1094. }
  1095. /** ============================================================================
  1096. * @n@b CSL_SRIO_SetResponseCRF
  1097. *
  1098. * @b Description
  1099. * @n This function sets the CRF value in the response
  1100. *
  1101. * @b Arguments
  1102. @verbatim
  1103. hSrio Handle of the SRIO device
  1104. value CRF value to be set in the response.
  1105. @endverbatim
  1106. *
  1107. * <b> Return Value </b>
  1108. * @n None
  1109. *
  1110. * <b> Pre Condition </b>
  1111. * @n CSL_SRIO_Open() must be called
  1112. *
  1113. * <b> Post Condition </b>
  1114. * @n None
  1115. *
  1116. * @b Writes
  1117. * @n SRIO_RIO_PER_SET_CNTL1_CRF
  1118. *
  1119. * @b Example
  1120. * @verbatim
  1121. CSL_SrioHandle hSrio;
  1122. // Open the CSL SRIO Module 0
  1123. hSrio = CSL_SRIO_Open (0);
  1124. // Set the Response CRF to be always set to 1
  1125. CSL_SRIO_SetResponseCRF (hSrio, 1);
  1126. ...
  1127. @endverbatim
  1128. * =============================================================================
  1129. */
  1130. static inline void CSL_SRIO_SetResponseCRF (CSL_SrioHandle hSrio, Uint8 value)
  1131. {
  1132. CSL_FINS(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_CRF, value);
  1133. }
  1134. /** ============================================================================
  1135. * @n@b CSL_SRIO_GetResponseCRF
  1136. *
  1137. * @b Description
  1138. * @n This function gets the CRF value in the response
  1139. *
  1140. * @b Arguments
  1141. @verbatim
  1142. hSrio Handle of the SRIO device
  1143. value CRF value populated by this API
  1144. @endverbatim
  1145. *
  1146. * <b> Return Value </b>
  1147. * @n None
  1148. *
  1149. * <b> Pre Condition </b>
  1150. * @n CSL_SRIO_Open() must be called
  1151. *
  1152. * <b> Post Condition </b>
  1153. * @n None
  1154. *
  1155. * @b Reads
  1156. * @n SRIO_RIO_PER_SET_CNTL1_CRF
  1157. *
  1158. * @b Example
  1159. * @verbatim
  1160. CSL_SrioHandle hSrio;
  1161. Uint8 crfValue;
  1162. // Open the CSL SRIO Module 0
  1163. hSrio = CSL_SRIO_Open (0);
  1164. // Get the Response CRF
  1165. CSL_SRIO_GetResponseCRF (hSrio, &crfValue);
  1166. ...
  1167. @endverbatim
  1168. * =============================================================================
  1169. */
  1170. static inline void CSL_SRIO_GetResponseCRF (CSL_SrioHandle hSrio, Uint8* value)
  1171. {
  1172. *value = CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_CRF);
  1173. }
  1174. /** ============================================================================
  1175. * @n@b CSL_SRIO_SetRXUWatermark
  1176. *
  1177. * @b Description
  1178. * @n This function sets the RXU Watermark value.
  1179. *
  1180. * @b Arguments
  1181. @verbatim
  1182. hSrio Handle of the SRIO device
  1183. value 0/1 to disable/enable RXU context assignment based on
  1184. priority.
  1185. @endverbatim
  1186. *
  1187. * <b> Return Value </b>
  1188. * @n None
  1189. *
  1190. * <b> Pre Condition </b>
  1191. * @n CSL_SRIO_Open() must be called
  1192. *
  1193. * <b> Post Condition </b>
  1194. * @n None
  1195. *
  1196. * @b Writes
  1197. * @n SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK
  1198. *
  1199. * @b Example
  1200. * @verbatim
  1201. CSL_SrioHandle hSrio;
  1202. // Open the CSL SRIO Module 0
  1203. hSrio = CSL_SRIO_Open (0);
  1204. // Set the RXU Watermark to to 1
  1205. CSL_SRIO_SetRXUWatermark (hSrio, 1);
  1206. ...
  1207. @endverbatim
  1208. * =============================================================================
  1209. */
  1210. static inline void CSL_SRIO_SetRXUWatermark (CSL_SrioHandle hSrio, Uint8 value)
  1211. {
  1212. CSL_FINS(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK, value);
  1213. }
  1214. /** ============================================================================
  1215. * @n@b CSL_SRIO_GetRXUWatermark
  1216. *
  1217. * @b Description
  1218. * @n This function gets the RXU Watermark setting
  1219. *
  1220. * @b Arguments
  1221. @verbatim
  1222. hSrio Handle of the SRIO device
  1223. value RXU Watermark setting read
  1224. @endverbatim
  1225. *
  1226. * <b> Return Value </b>
  1227. * @n None
  1228. *
  1229. * <b> Pre Condition </b>
  1230. * @n CSL_SRIO_Open() must be called
  1231. *
  1232. * <b> Post Condition </b>
  1233. * @n None
  1234. *
  1235. * @b Reads
  1236. * @n SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK
  1237. *
  1238. * @b Example
  1239. * @verbatim
  1240. CSL_SrioHandle hSrio;
  1241. Uint8 value;
  1242. // Open the CSL SRIO Module 0
  1243. hSrio = CSL_SRIO_Open (0);
  1244. // Get the RXU Watermark
  1245. CSL_SRIO_GetRXUWatermark (hSrio, &value);
  1246. ...
  1247. @endverbatim
  1248. * =============================================================================
  1249. */
  1250. static inline void CSL_SRIO_GetRXUWatermark (CSL_SrioHandle hSrio, Uint8* value)
  1251. {
  1252. *value = CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_RXU_WATERMARK);
  1253. }
  1254. /** ============================================================================
  1255. * @n@b CSL_SRIO_SetSysClkSel
  1256. *
  1257. * @b Description
  1258. * @n This function sets the SYS_CLK source
  1259. *
  1260. * @b Arguments
  1261. @verbatim
  1262. hSrio Handle of the SRIO device
  1263. value SYS_CLK source to configure
  1264. @endverbatim
  1265. *
  1266. * <b> Return Value </b>
  1267. * @n None
  1268. *
  1269. * <b> Pre Condition </b>
  1270. * @n CSL_SRIO_Open() must be called
  1271. *
  1272. * <b> Post Condition </b>
  1273. * @n None
  1274. *
  1275. * @b Writes
  1276. * @n SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL
  1277. *
  1278. * @b Example
  1279. * @verbatim
  1280. CSL_SrioHandle hSrio;
  1281. // Open the CSL SRIO Module 0
  1282. hSrio = CSL_SRIO_Open (0);
  1283. // Set the SYS_CLK source to 1
  1284. CSL_SRIO_SetSysClkSel (hSrio, 1);
  1285. ...
  1286. @endverbatim
  1287. * =============================================================================
  1288. */
  1289. static inline void CSL_SRIO_SetSysClkSel (CSL_SrioHandle hSrio, Uint8 value)
  1290. {
  1291. CSL_FINS(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL, value);
  1292. }
  1293. /** ============================================================================
  1294. * @n@b CSL_SRIO_GetSysClkSel
  1295. *
  1296. * @b Description
  1297. * @n This function retrieves the SYS_CLK source for the port.
  1298. *
  1299. * @b Arguments
  1300. @verbatim
  1301. hSrio Handle of the SRIO device
  1302. value SYS_CLK source read
  1303. @endverbatim
  1304. *
  1305. * <b> Return Value </b>
  1306. * @n None
  1307. *
  1308. * <b> Pre Condition </b>
  1309. * @n CSL_SRIO_Open() must be called
  1310. *
  1311. * <b> Post Condition </b>
  1312. * @n None
  1313. *
  1314. * @b Reads
  1315. * @n SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL
  1316. *
  1317. * @b Example
  1318. * @verbatim
  1319. CSL_SrioHandle hSrio;
  1320. Uint8 value;
  1321. // Open the CSL SRIO Module 0
  1322. hSrio = CSL_SRIO_Open (0);
  1323. // Get the SYS_CLK source
  1324. CSL_SRIO_GetSysClkSel (hSrio, &value);
  1325. ...
  1326. @endverbatim
  1327. * =============================================================================
  1328. */
  1329. static inline void CSL_SRIO_GetSysClkSel (CSL_SrioHandle hSrio, Uint8* value)
  1330. {
  1331. *value = CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_SYS_CLK_SEL);
  1332. }
  1333. /** ============================================================================
  1334. * @n@b CSL_SRIO_SetLoopbackMode
  1335. *
  1336. * @b Description
  1337. * @n This function sets the port to operate in loopback mode.
  1338. *
  1339. * @b Arguments
  1340. @verbatim
  1341. hSrio Handle of the SRIO device
  1342. portNum Port Number for which loopback mode must be enabled
  1343. @endverbatim
  1344. *
  1345. * <b> Return Value </b>
  1346. * @n None
  1347. *
  1348. * <b> Pre Condition </b>
  1349. * @n CSL_SRIO_Open() must be called
  1350. *
  1351. * <b> Post Condition </b>
  1352. * @n None
  1353. *
  1354. * @b Writes
  1355. * @n SRIO_RIO_PER_SET_CNTL1_LOOPBACK
  1356. *
  1357. * @b Example
  1358. * @verbatim
  1359. CSL_SrioHandle hSrio;
  1360. // Open the CSL SRIO Module 0
  1361. hSrio = CSL_SRIO_Open (0);
  1362. // Set the Port 0 to work in loopback mode.
  1363. CSL_SRIO_SetLoopbackMode (hSrio, 0);
  1364. ...
  1365. @endverbatim
  1366. * =============================================================================
  1367. */
  1368. static inline void CSL_SRIO_SetLoopbackMode (CSL_SrioHandle hSrio,Uint8 portNum)
  1369. {
  1370. CSL_FINSR (hSrio->RIO_PER_SET_CNTL1,
  1371. CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum,
  1372. 1);
  1373. }
  1374. /** ============================================================================
  1375. * @n@b CSL_SRIO_SetNormalMode
  1376. *
  1377. * @b Description
  1378. * @n This function sets the port to operate in Normal mode.
  1379. *
  1380. * @b Arguments
  1381. @verbatim
  1382. hSrio Handle of the SRIO device
  1383. portNum Port Number for which normal mode must be enabled
  1384. @endverbatim
  1385. *
  1386. * <b> Return Value </b>
  1387. * @n None
  1388. *
  1389. * <b> Pre Condition </b>
  1390. * @n CSL_SRIO_Open() must be called
  1391. *
  1392. * <b> Post Condition </b>
  1393. * @n None
  1394. *
  1395. * @b Writes
  1396. * @n SRIO_RIO_PER_SET_CNTL1_LOOPBACK
  1397. *
  1398. * @b Example
  1399. * @verbatim
  1400. CSL_SrioHandle hSrio;
  1401. // Open the CSL SRIO Module 0
  1402. hSrio = CSL_SRIO_Open (0);
  1403. // Set the port 0 to work in normal mode.
  1404. CSL_SRIO_SetNormalMode (hSrio, 0);
  1405. ...
  1406. @endverbatim
  1407. * =============================================================================
  1408. */
  1409. static inline void CSL_SRIO_SetNormalMode (CSL_SrioHandle hSrio,Uint8 portNum)
  1410. {
  1411. CSL_FINSR (hSrio->RIO_PER_SET_CNTL1,
  1412. CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum,
  1413. 0);
  1414. }
  1415. /** ============================================================================
  1416. * @n@b CSL_SRIO_IsLoopbackMode
  1417. *
  1418. * @b Description
  1419. * @n This function checks if the port specified is operating in loopback
  1420. * mode or not?
  1421. *
  1422. * @b Arguments
  1423. @verbatim
  1424. hSrio Handle of the SRIO device
  1425. portNum Port Number for which mode settings must be retrieved
  1426. @endverbatim
  1427. *
  1428. * <b> Return Value </b>
  1429. * @n TRUE - Port is operating in loopback mode
  1430. * @n FALSE - Port is operating in Normal Mode.
  1431. *
  1432. * <b> Pre Condition </b>
  1433. * @n CSL_SRIO_Open() must be called
  1434. *
  1435. * <b> Post Condition </b>
  1436. * @n None
  1437. *
  1438. * @b Reads
  1439. * @n SRIO_RIO_PER_SET_CNTL1_LOOPBACK
  1440. *
  1441. * @b Example
  1442. * @verbatim
  1443. CSL_SrioHandle hSrio;
  1444. // Open the CSL SRIO Module 0
  1445. hSrio = CSL_SRIO_Open (0);
  1446. // Set the port 0 to work in normal mode.
  1447. if (CSL_SRIO_IsLoopbackMode(hSrio, 0) == TRUE)
  1448. {
  1449. // Port 0 is operating in loopback mode.
  1450. }
  1451. else
  1452. {
  1453. // Port 0 is operating in normal mode.
  1454. }
  1455. ...
  1456. @endverbatim
  1457. * =============================================================================
  1458. */
  1459. static inline Bool CSL_SRIO_IsLoopbackMode (CSL_SrioHandle hSrio,Uint8 portNum)
  1460. {
  1461. if (CSL_FEXTR (hSrio->RIO_PER_SET_CNTL1,
  1462. CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum, CSL_SRIO_RIO_PER_SET_CNTL1_LOOPBACK_SHIFT + portNum) == 1)
  1463. {
  1464. return TRUE;
  1465. }
  1466. return FALSE;
  1467. }
  1468. /** ============================================================================
  1469. * @n@b CSL_SRIO_EnableCOS
  1470. *
  1471. * @b Description
  1472. * @n This function enables Class of Service
  1473. *
  1474. * @b Arguments
  1475. @verbatim
  1476. hSrio Handle of the SRIO device
  1477. @endverbatim
  1478. *
  1479. * <b> Return Value </b>
  1480. * @n None
  1481. *
  1482. * <b> Pre Condition </b>
  1483. * @n CSL_SRIO_Open() must be called
  1484. *
  1485. * <b> Post Condition </b>
  1486. * @n None
  1487. *
  1488. * @b Writes
  1489. * @n SRIO_RIO_PER_SET_CNTL1_COS_EN=1
  1490. *
  1491. * @b Example
  1492. * @verbatim
  1493. CSL_SrioHandle hSrio;
  1494. // Open the CSL SRIO Module 0
  1495. hSrio = CSL_SRIO_Open (0);
  1496. // Enable Class of Service
  1497. CSL_SRIO_EnableCOS (hSrio);
  1498. ...
  1499. @endverbatim
  1500. * =============================================================================
  1501. */
  1502. static inline void CSL_SRIO_EnableCOS (CSL_SrioHandle hSrio)
  1503. {
  1504. CSL_FINS (hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_COS_EN, 1);
  1505. }
  1506. /** ============================================================================
  1507. * @n@b CSL_SRIO_DisableCOS
  1508. *
  1509. * @b Description
  1510. * @n This function disables Class of Service for the device.
  1511. *
  1512. * @b Arguments
  1513. @verbatim
  1514. hSrio Handle of the SRIO device
  1515. @endverbatim
  1516. *
  1517. * <b> Return Value </b>
  1518. * @n None
  1519. *
  1520. * <b> Pre Condition </b>
  1521. * @n CSL_SRIO_Open() must be called
  1522. *
  1523. * <b> Post Condition </b>
  1524. * @n None
  1525. *
  1526. * @b Writes
  1527. * @n SRIO_RIO_PER_SET_CNTL1_COS_EN=0
  1528. *
  1529. * @b Example
  1530. * @verbatim
  1531. CSL_SrioHandle hSrio;
  1532. // Open the CSL SRIO Module 0
  1533. hSrio = CSL_SRIO_Open (0);
  1534. // Disable COS.
  1535. CSL_SRIO_DisableCOS (hSrio);
  1536. ...
  1537. @endverbatim
  1538. * =============================================================================
  1539. */
  1540. static inline void CSL_SRIO_DisableCOS (CSL_SrioHandle hSrio)
  1541. {
  1542. CSL_FINS (hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_COS_EN, 0);
  1543. }
  1544. /** ============================================================================
  1545. * @n@b CSL_SRIO_IsCOSEnabled
  1546. *
  1547. * @b Description
  1548. * @n This function checks if COS has been enabled or not for the device?
  1549. *
  1550. * @b Arguments
  1551. @verbatim
  1552. hSrio Handle of the SRIO device
  1553. @endverbatim
  1554. *
  1555. * <b> Return Value </b>
  1556. * @n TRUE - COS is enabled
  1557. * @n FALSE - COS is disabled.
  1558. *
  1559. * <b> Pre Condition </b>
  1560. * @n CSL_SRIO_Open() must be called
  1561. *
  1562. * <b> Post Condition </b>
  1563. * @n None
  1564. *
  1565. * @b Reads
  1566. * @n SRIO_RIO_PER_SET_CNTL1_COS_EN
  1567. *
  1568. * @b Example
  1569. * @verbatim
  1570. CSL_SrioHandle hSrio;
  1571. // Open the CSL SRIO Module 0
  1572. hSrio = CSL_SRIO_Open (0);
  1573. // Check if COS is enabled
  1574. if (CSL_SRIO_IsCOSEnabled (hSrio) == TRUE)
  1575. {
  1576. // COS is ENABLED
  1577. }
  1578. else
  1579. {
  1580. // COS is DISABLED
  1581. }
  1582. ...
  1583. @endverbatim
  1584. * =============================================================================
  1585. */
  1586. static inline Bool CSL_SRIO_IsCOSEnabled (CSL_SrioHandle hSrio)
  1587. {
  1588. if (CSL_FEXT(hSrio->RIO_PER_SET_CNTL1, SRIO_RIO_PER_SET_CNTL1_COS_EN) == 1)
  1589. return TRUE;
  1590. return FALSE;
  1591. }
  1592. /** ============================================================================
  1593. * @n@b CSL_SRIO_GlobalEnable
  1594. *
  1595. * @b Description
  1596. * @n This function globally enables the SRIO peripheral and all blocks.
  1597. *
  1598. * @b Arguments
  1599. @verbatim
  1600. hSrio Handle of the SRIO device
  1601. @endverbatim
  1602. *
  1603. * <b> Return Value </b>
  1604. * @n None
  1605. *
  1606. * <b> Pre Condition </b>
  1607. * @n CSL_SRIO_Open() must be called
  1608. *
  1609. * <b> Post Condition </b>
  1610. * @n None
  1611. *
  1612. * @b Writes
  1613. * @n SRIO_RIO_GBL_EN_EN=1
  1614. *
  1615. * @b Example
  1616. * @verbatim
  1617. CSL_SrioHandle hSrio;
  1618. // Open the CSL SRIO Module 0
  1619. hSrio = CSL_SRIO_Open (0);
  1620. // Globally Enable the SRIO peripheral.
  1621. CSL_SRIO_GlobalEnable (hSrio);
  1622. ...
  1623. @endverbatim
  1624. * =============================================================================
  1625. */
  1626. static inline void CSL_SRIO_GlobalEnable (CSL_SrioHandle hSrio)
  1627. {
  1628. CSL_FINS (hSrio->RIO_GBL_EN, SRIO_RIO_GBL_EN_EN, 1);
  1629. }
  1630. /** ============================================================================
  1631. * @n@b CSL_SRIO_GlobalDisable
  1632. *
  1633. * @b Description
  1634. * @n This function globally disables the SRIO peripheral and all blocks.
  1635. *
  1636. * @b Arguments
  1637. @verbatim
  1638. hSrio Handle of the SRIO device
  1639. @endverbatim
  1640. *
  1641. * <b> Return Value </b>
  1642. * @n None
  1643. *
  1644. * <b> Pre Condition </b>
  1645. * @n CSL_SRIO_Open() must be called
  1646. *
  1647. * <b> Post Condition </b>
  1648. * @n None
  1649. *
  1650. * @b Writes
  1651. * @n SRIO_RIO_GBL_EN_EN=0
  1652. *
  1653. * @b Example
  1654. * @verbatim
  1655. CSL_SrioHandle hSrio;
  1656. // Open the CSL SRIO Module 0
  1657. hSrio = CSL_SRIO_Open (0);
  1658. // Globally Disable the SRIO peripheral.
  1659. CSL_SRIO_GlobalDisable (hSrio);
  1660. ...
  1661. @endverbatim
  1662. * =============================================================================
  1663. */
  1664. static inline void CSL_SRIO_GlobalDisable (CSL_SrioHandle hSrio)
  1665. {
  1666. CSL_FINS (hSrio->RIO_GBL_EN, SRIO_RIO_GBL_EN_EN, 0);
  1667. }
  1668. /** ============================================================================
  1669. * @n@b CSL_SRIO_IsSRIOEnabled
  1670. *
  1671. * @b Description
  1672. * @n This function checks if the SRIO peripheral has been globally enabled or
  1673. * not?
  1674. *
  1675. * @b Arguments
  1676. @verbatim
  1677. hSrio Handle of the SRIO device
  1678. @endverbatim
  1679. *
  1680. * <b> Return Value </b>
  1681. * @n TRUE - SRIO Peripheral is enabled
  1682. * @n FALSE - SRIO Peripheral is disabled.
  1683. *
  1684. * <b> Pre Condition </b>
  1685. * @n CSL_SRIO_Open() must be called
  1686. *
  1687. * <b> Post Condition </b>
  1688. * @n None
  1689. *
  1690. * @b Reads
  1691. * @n SRIO_RIO_GBL_EN_STAT_GBL_EN_STAT
  1692. *
  1693. * @b Example
  1694. * @verbatim
  1695. CSL_SrioHandle hSrio;
  1696. // Open the CSL SRIO Module 0
  1697. hSrio = CSL_SRIO_Open (0);
  1698. // Ensure that the SRIO Peripheral is enabled or disabled.
  1699. if (CSL_SRIO_IsSRIOEnabled (hSrio) == TRUE)
  1700. {
  1701. // SRIO Peripheral is ENABLED
  1702. }
  1703. else
  1704. {
  1705. // SRIO Peripheral is DISABLED
  1706. }
  1707. ...
  1708. @endverbatim
  1709. * =============================================================================
  1710. */
  1711. static inline Bool CSL_SRIO_IsSRIOEnabled (CSL_SrioHandle hSrio)
  1712. {
  1713. if (CSL_FEXT(hSrio->RIO_GBL_EN_STAT, SRIO_RIO_GBL_EN_STAT_GBL_EN_STAT) == 1)
  1714. return TRUE;
  1715. return FALSE;
  1716. }
  1717. /** ============================================================================
  1718. * @n@b CSL_SRIO_EnableBlock
  1719. *
  1720. * @b Description
  1721. * @n This function enables the specific block in the SRIO peripheral.
  1722. *
  1723. * @b Arguments
  1724. @verbatim
  1725. hSrio Handle of the SRIO device
  1726. blockNum Block Number to be enabled.
  1727. @endverbatim
  1728. *
  1729. * <b> Return Value </b>
  1730. * @n None
  1731. *
  1732. * <b> Pre Condition </b>
  1733. * @n CSL_SRIO_Open() must be called
  1734. *
  1735. * <b> Post Condition </b>
  1736. * @n None
  1737. *
  1738. * @b Writes
  1739. * @n SRIO_RIO_BLK_EN_EN=1
  1740. *
  1741. * @b Example
  1742. * @verbatim
  1743. CSL_SrioHandle hSrio;
  1744. // Open the CSL SRIO Module 0
  1745. hSrio = CSL_SRIO_Open (0);
  1746. // Enable the SRIO block for LSU .
  1747. CSL_SRIO_GlobalEnable (hSrio, 1);
  1748. ...
  1749. @endverbatim
  1750. * =============================================================================
  1751. */
  1752. static inline void CSL_SRIO_EnableBlock (CSL_SrioHandle hSrio, Uint16 blockNumber)
  1753. {
  1754. CSL_FINS (hSrio->BLOCK_ENABLE_STATUS[blockNumber].RIO_BLK_EN, SRIO_RIO_BLK_EN_EN, 1);
  1755. }
  1756. /** ============================================================================
  1757. * @n@b CSL_SRIO_DisableBlock
  1758. *
  1759. * @b Description
  1760. * @n This function disables the specific block in the SRIO peripheral.
  1761. *
  1762. * @b Arguments
  1763. @verbatim
  1764. hSrio Handle of the SRIO device
  1765. blockNum Block Number to be disabled.
  1766. @endverbatim
  1767. *
  1768. * <b> Return Value </b>
  1769. * @n None
  1770. *
  1771. * <b> Pre Condition </b>
  1772. * @n CSL_SRIO_Open() must be called
  1773. *
  1774. * <b> Post Condition </b>
  1775. * @n None
  1776. *
  1777. * @b Writes
  1778. * @n SRIO_RIO_BLK_EN_EN=0
  1779. *
  1780. * @b Example
  1781. * @verbatim
  1782. CSL_SrioHandle hSrio;
  1783. // Open the CSL SRIO Module 0
  1784. hSrio = CSL_SRIO_Open (0);
  1785. // Disable the SRIO Block 1 for LSU.
  1786. CSL_SRIO_DisableBlock (hSrio, 1);
  1787. ...
  1788. @endverbatim
  1789. * =============================================================================
  1790. */
  1791. static inline void CSL_SRIO_DisableBlock (CSL_SrioHandle hSrio, Uint16 blockNumber)
  1792. {
  1793. CSL_FINS (hSrio->BLOCK_ENABLE_STATUS[blockNumber].RIO_BLK_EN, SRIO_RIO_BLK_EN_EN, 0);
  1794. }
  1795. /** ============================================================================
  1796. * @n@b CSL_SRIO_IsSRIOBlockEnabled
  1797. *
  1798. * @b Description
  1799. * @n This function checks if the SRIO block is enabled or disabled?
  1800. *
  1801. * @b Arguments
  1802. @verbatim
  1803. hSrio Handle of the SRIO device
  1804. blockNumber SRIO Block Number to be checked.
  1805. @endverbatim
  1806. *
  1807. * <b> Return Value </b>
  1808. * @n TRUE - SRIO Block is enabled
  1809. * @n FALSE - SRIO Block is disabled.
  1810. *
  1811. * <b> Pre Condition </b>
  1812. * @n CSL_SRIO_Open() must be called
  1813. *
  1814. * <b> Post Condition </b>
  1815. * @n None
  1816. *
  1817. * @b Reads
  1818. * @n SRIO_RIO_BLK_EN_STAT_EN_STATUS
  1819. *
  1820. * @b Example
  1821. * @verbatim
  1822. CSL_SrioHandle hSrio;
  1823. // Open the CSL SRIO Module 0
  1824. hSrio = CSL_SRIO_Open (0);
  1825. // Ensure that the SRIO Block 1 for LSU is enabled or not?
  1826. if (CSL_SRIO_IsSRIOBlockEnabled (hSrio, 1) == TRUE)
  1827. {
  1828. // SRIO Block 1 for LSU is ENABLED
  1829. }
  1830. else
  1831. {
  1832. // SRIO Block 1 for LSU is DISABLED
  1833. }
  1834. ...
  1835. @endverbatim
  1836. * =============================================================================
  1837. */
  1838. static inline Bool CSL_SRIO_IsSRIOBlockEnabled (CSL_SrioHandle hSrio, Uint16 blockNumber)
  1839. {
  1840. return (Bool)CSL_FEXT(hSrio->BLOCK_ENABLE_STATUS[blockNumber].RIO_BLK_EN_STAT,
  1841. SRIO_RIO_BLK_EN_STAT_EN_STATUS);
  1842. }
  1843. /** ============================================================================
  1844. * @n@b CSL_SRIO_SetDeviceID
  1845. *
  1846. * @b Description
  1847. * @n This function sets the DEVICE ID Register. There are multiple device
  1848. * ID registers which can exist in the system. The index parameter is used
  1849. * to indicate which register is to be configured.
  1850. *
  1851. * @b Arguments
  1852. @verbatim
  1853. hSrio Handle of the SRIO device
  1854. index Index of the Device ID register to be configured (0-Based)
  1855. NodeId8bit 8 Bit Device Identifier to be configured
  1856. NodeId16bit 16 Bit Device Identifier to be configured.
  1857. @endverbatim
  1858. *
  1859. * <b> Return Value </b>
  1860. * @n None
  1861. *
  1862. * <b> Pre Condition </b>
  1863. * @n CSL_SRIO_Open() must be called
  1864. *
  1865. * <b> Post Condition </b>
  1866. * @n None
  1867. *
  1868. * @b Writes
  1869. * @n SRIO_RIO_MULTIID_REG_8B_NODEID,SRIO_RIO_MULTIID_REG_16B_NODEID
  1870. *
  1871. * @b Example
  1872. * @verbatim
  1873. CSL_SrioHandle hSrio;
  1874. // Open the CSL SRIO Module 0
  1875. hSrio = CSL_SRIO_Open (0);
  1876. // Configure the First Device ID register with a 16 bit identifer as 0xDEAD
  1877. // and no 8 bit identifier.
  1878. CSL_SRIO_SetDeviceID (hSrio, 0, 0x0, 0xDEAD);
  1879. ...
  1880. @endverbatim
  1881. * =============================================================================
  1882. */
  1883. static inline void CSL_SRIO_SetDeviceID
  1884. (
  1885. CSL_SrioHandle hSrio,
  1886. Uint8 index,
  1887. Uint8 NodeId8bit,
  1888. Uint16 NodeId16bit
  1889. )
  1890. {
  1891. /* Set the 8bit and 16bit device identifiers. */
  1892. hSrio->RIO_MULTIID_REG[index] =
  1893. CSL_FMK(SRIO_RIO_MULTIID_REG_8B_NODEID, NodeId8bit) |
  1894. CSL_FMK(SRIO_RIO_MULTIID_REG_16B_NODEID, NodeId16bit);
  1895. }
  1896. /** ============================================================================
  1897. * @n@b CSL_SRIO_GetDeviceID
  1898. *
  1899. * @b Description
  1900. * @n This function gets the DEVICE ID Register. There are multiple device
  1901. * ID registers which can exist in the system. The index parameter is used
  1902. * to indicate which register is to be retreived.
  1903. *
  1904. * @b Arguments
  1905. @verbatim
  1906. hSrio Handle of the SRIO device
  1907. index Index of the Device ID register to be configured (0-Based)
  1908. NodeId8bit 8 Bit Device Identifier to be populated by this API
  1909. NodeId16bit 16 Bit Device Identifier to be populated by this API
  1910. @endverbatim
  1911. *
  1912. * <b> Return Value </b>
  1913. * @n None
  1914. *
  1915. * <b> Pre Condition </b>
  1916. * @n CSL_SRIO_Open() must be called
  1917. *
  1918. * <b> Post Condition </b>
  1919. * @n None
  1920. *
  1921. * @b Reads
  1922. * @n SRIO_RIO_MULTIID_REG_8B_NODEID,SRIO_RIO_MULTIID_REG_16B_NODEID
  1923. *
  1924. * @b Example
  1925. * @verbatim
  1926. CSL_SrioHandle hSrio;
  1927. Uint8 NodeId8bit;
  1928. Uint16 NodeId16bit;
  1929. // Open the CSL SRIO Module 0
  1930. hSrio = CSL_SRIO_Open (0);
  1931. // Get the Device ID register contents
  1932. CSL_SRIO_GetDeviceID (hSrio, 0, &NodeId8bit, &NodeId16bit);
  1933. ...
  1934. @endverbatim
  1935. * =============================================================================
  1936. */
  1937. static inline void CSL_SRIO_GetDeviceID
  1938. (
  1939. CSL_SrioHandle hSrio,
  1940. Uint8 index,
  1941. Uint8* NodeId8bit,
  1942. Uint16* NodeId16bit
  1943. )
  1944. {
  1945. Uint32 value;
  1946. /* Get the value from the register */
  1947. value = hSrio->RIO_MULTIID_REG[index];
  1948. /* Populate the 8bit and 16bit device identifiers. */
  1949. *NodeId8bit = CSL_FEXT(value, SRIO_RIO_MULTIID_REG_8B_NODEID);
  1950. *NodeId16bit = CSL_FEXT(value, SRIO_RIO_MULTIID_REG_16B_NODEID);
  1951. return;
  1952. }
  1953. /** ============================================================================
  1954. * @n@b CSL_SRIO_SetPacketForwarding
  1955. *
  1956. * @b Description
  1957. * @n The function sets the packet forwarding for the SRIO peripheral. There
  1958. * exist multiple packet forwarding registers and the parameter index is to used
  1959. * to select which register is to be configured.
  1960. *
  1961. * @b Arguments
  1962. @verbatim
  1963. hSrio Handle of the SRIO device
  1964. index Index of the Packet forwarding register to be configured (0-Based)
  1965. low16bitDeviceID Lower bound 16bit Device Identifier which can use this
  1966. up16bitDeviceID Upper bound 16bit Device Identifier which can use this
  1967. low8bitDeviceID Lower bound 8bit Device Identifier which can use this
  1968. up8bitDeviceID Upper bound 8bit Device Identifier which can use this
  1969. outPort Outgoing SRIO port to be used.
  1970. @endverbatim
  1971. *
  1972. * <b> Return Value </b>
  1973. * @n None
  1974. *
  1975. * <b> Pre Condition </b>
  1976. * @n CSL_SRIO_Open() must be called
  1977. *
  1978. * <b> Post Condition </b>
  1979. * @n None
  1980. *
  1981. * @b Writes
  1982. * @n SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP, SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO,
  1983. * SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO,SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP,
  1984. * SRIO_RIO_PF_8B_CNTL_OUT_PORT
  1985. *
  1986. * @b Example
  1987. * @verbatim
  1988. CSL_SrioHandle hSrio;
  1989. // Open the CSL SRIO Module 0
  1990. hSrio = CSL_SRIO_Open (0);
  1991. // Create a packet forwarding entry for device ID 0xBEEF to be forwarded
  1992. // to port 1; we dont care about the 8-bit identifiers hence these are
  1993. // set to reset values.
  1994. CSL_SRIO_SetPacketForwarding (hSrio, 0, 0xBEEF, 0xBEEF, 0xFF, 0xFF, 1);
  1995. ...
  1996. @endverbatim
  1997. * =============================================================================
  1998. */
  1999. static inline void CSL_SRIO_SetPacketForwarding
  2000. (
  2001. CSL_SrioHandle hSrio,
  2002. Uint8 index,
  2003. Uint16 low16bitDeviceID,
  2004. Uint16 up16bitDeviceID,
  2005. Uint8 low8bitDeviceID,
  2006. Uint8 up8bitDeviceID,
  2007. Uint8 outPort
  2008. )
  2009. {
  2010. hSrio->PF_CNTL[index].RIO_PF_16B_CNTL =
  2011. CSL_FMK(SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP, up16bitDeviceID) |
  2012. CSL_FMK(SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO, low16bitDeviceID);
  2013. hSrio->PF_CNTL[index].RIO_PF_8B_CNTL =
  2014. CSL_FMK(SRIO_RIO_PF_8B_CNTL_OUT_PORT, outPort) |
  2015. CSL_FMK(SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP, up8bitDeviceID) |
  2016. CSL_FMK(SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO, low8bitDeviceID);
  2017. }
  2018. /** ============================================================================
  2019. * @n@b CSL_SRIO_GetPacketForwarding
  2020. *
  2021. * @b Description
  2022. * @n The function gets the packet forwarding for the SRIO peripheral. There
  2023. * exist multiple packet forwarding registers and the parameter index is to used
  2024. * to select which register is to be retreived.
  2025. *
  2026. * @b Arguments
  2027. @verbatim
  2028. hSrio Handle of the SRIO device
  2029. index Index of the Packet forwarding register to be configured (0-Based)
  2030. low16bitDeviceID Lower bound 16bit Device Identifier populated by this API
  2031. up16bitDeviceID Upper bound 16bit Device Identifier populated by this API
  2032. low8bitDeviceID Lower bound 8bit Device Identifier populated by this API
  2033. up8bitDeviceID Upper bound 8bit Device Identifier populated by this API
  2034. outPort Outgoing SRIO port populated by this API
  2035. @endverbatim
  2036. *
  2037. * <b> Return Value </b>
  2038. * @n None
  2039. *
  2040. * <b> Pre Condition </b>
  2041. * @n CSL_SRIO_Open() must be called
  2042. *
  2043. * <b> Post Condition </b>
  2044. * @n None
  2045. *
  2046. * @b Reads
  2047. * @n SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO, SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP,
  2048. * SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO,SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP,
  2049. * SRIO_RIO_PF_8B_CNTL_OUT_PORT
  2050. *
  2051. * @b Example
  2052. * @verbatim
  2053. CSL_SrioHandle hSrio;
  2054. Uint16 low16bitDeviceID;
  2055. Uint16 up16bitDeviceID;
  2056. Uint8 low8bitDeviceID;
  2057. Uint8 up8bitDeviceID;
  2058. Uint8 outPort;
  2059. // Open the CSL SRIO Module 0
  2060. hSrio = CSL_SRIO_Open (0);
  2061. // Get the packet forwarding entry 0.
  2062. CSL_SRIO_GetPacketForwarding (hSrio, 0, &low16bitDeviceID, &up16bitDeviceID,
  2063. &low8bitDeviceID, &up8bitDeviceID, &outPort);
  2064. ...
  2065. @endverbatim
  2066. * =============================================================================
  2067. */
  2068. static inline void CSL_SRIO_GetPacketForwarding
  2069. (
  2070. CSL_SrioHandle hSrio,
  2071. Uint8 index,
  2072. Uint16* low16bitDeviceID,
  2073. Uint16* up16bitDeviceID,
  2074. Uint8* low8bitDeviceID,
  2075. Uint8* up8bitDeviceID,
  2076. Uint8* outPort
  2077. )
  2078. {
  2079. Uint32 value = hSrio->PF_CNTL[index].RIO_PF_16B_CNTL;
  2080. *up16bitDeviceID = CSL_FEXT(value, SRIO_RIO_PF_16B_CNTL_DEVID_16B_UP);
  2081. *low16bitDeviceID = CSL_FEXT(value, SRIO_RIO_PF_16B_CNTL_DEVID_16B_LO);
  2082. value = hSrio->PF_CNTL[index].RIO_PF_8B_CNTL;
  2083. *outPort = CSL_FEXT(value, SRIO_RIO_PF_8B_CNTL_OUT_PORT);
  2084. *up8bitDeviceID = CSL_FEXT(value, SRIO_RIO_PF_8B_CNTL_DEVID_8B_UP);
  2085. *low8bitDeviceID = CSL_FEXT(value, SRIO_RIO_PF_8B_CNTL_DEVID_8B_LO);
  2086. }
  2087. /** ============================================================================
  2088. * @n@b CSL_SRIO_GetDoorbellPendingInterrupt
  2089. *
  2090. * @b Description
  2091. * @n The function reads the DOORBELL status register to determine if there
  2092. * are any pending door bell interrupts or not?
  2093. *
  2094. * @b Arguments
  2095. @verbatim
  2096. hSrio Handle of the SRIO device
  2097. port SRIO Port (Zero Based) for which the doorbell status is required.
  2098. doorbellStatus Door Bell Status populated by this API
  2099. @endverbatim
  2100. *
  2101. * <b> Return Value </b>
  2102. * @n None
  2103. *
  2104. * <b> Pre Condition </b>
  2105. * @n CSL_SRIO_Open() must be called
  2106. *
  2107. * <b> Post Condition </b>
  2108. * @n None
  2109. *
  2110. * @b Reads
  2111. * @n SRIO_RIO_DOORBELL_ICSR_RIO_DOORBELL
  2112. *
  2113. * @b Example
  2114. * @verbatim
  2115. CSL_SrioHandle hSrio;
  2116. Uint16 doorbellStatus;
  2117. // Open the CSL SRIO Module 0
  2118. hSrio = CSL_SRIO_Open (0);
  2119. // Get the status of doorbell interrupts for port 0
  2120. CSL_SRIO_GetDoorbellPendingInterrupt (hSrio, 0, &doorbellStatus);
  2121. if (doorbellStatus != 0)
  2122. {
  2123. // Door bell Interrupts were pending and need to be serviced.
  2124. }
  2125. else
  2126. {
  2127. // There are no door bell interrupts pending.
  2128. }
  2129. ...
  2130. @endverbatim
  2131. * =============================================================================
  2132. */
  2133. static inline void CSL_SRIO_GetDoorbellPendingInterrupt
  2134. (
  2135. CSL_SrioHandle hSrio,
  2136. Uint8 port,
  2137. Uint16* doorbellStatus
  2138. )
  2139. {
  2140. *doorbellStatus = CSL_FEXT(hSrio->DOORBELL_ICSR_ICCR[port].RIO_DOORBELL_ICSR,
  2141. SRIO_RIO_DOORBELL_ICSR_RIO_DOORBELL);
  2142. }
  2143. /** ============================================================================
  2144. * @n@b CSL_SRIO_ClearDoorbellPendingInterrupt
  2145. *
  2146. * @b Description
  2147. * @n The function clears a specific door bell interrupt in the specified door
  2148. * bell interrupt register.
  2149. *
  2150. * @b Arguments
  2151. @verbatim
  2152. hSrio Handle of the SRIO device
  2153. port SRIO Port (Zero Based) for which the doorbell status is required.
  2154. doorbellInterrupt Door Bell Interrupt to be cleared.
  2155. @endverbatim
  2156. *
  2157. * <b> Return Value </b>
  2158. * @n None
  2159. *
  2160. * <b> Pre Condition </b>
  2161. * @n CSL_SRIO_Open() must be called
  2162. *
  2163. * <b> Post Condition </b>
  2164. * @n None
  2165. *
  2166. * @b Writes
  2167. * @n SRIO_RIO_DOORBELL_ICCR
  2168. *
  2169. * @b Affects
  2170. * @n SRIO_RIO_DOORBELL_ICSR_RIO_DOORBELL=0
  2171. *
  2172. * @b Example
  2173. * @verbatim
  2174. CSL_SrioHandle hSrio;
  2175. Uint16 doorbellStatus;
  2176. // Open the CSL SRIO Module 0
  2177. hSrio = CSL_SRIO_Open (0);
  2178. // Get the status of doorbell interrupts for port 0
  2179. CSL_SRIO_GetDoorbellPendingInterrupt (hSrio, 0, &doorbellStatus);
  2180. if (doorbellStatus != 0)
  2181. {
  2182. // Door bell Interrupts were pending and need to be serviced.
  2183. ...
  2184. // Clear the Door Bell Pending Interrupts.
  2185. CSL_SRIO_ClearDoorbellPendingInterrupt (hSrio, 0, doorbellStatus);
  2186. }
  2187. else
  2188. {
  2189. // There are no door bell interrupts pending.
  2190. }
  2191. ...
  2192. @endverbatim
  2193. * =============================================================================
  2194. */
  2195. static inline void CSL_SRIO_ClearDoorbellPendingInterrupt
  2196. (
  2197. CSL_SrioHandle hSrio,
  2198. Uint8 port,
  2199. Uint16 doorbellInterrupt
  2200. )
  2201. {
  2202. /* Clear all the specified doorbell interrupts. */
  2203. hSrio->DOORBELL_ICSR_ICCR[port].RIO_DOORBELL_ICCR = doorbellInterrupt;
  2204. }
  2205. /** ============================================================================
  2206. * @n@b CSL_SRIO_GetLSUPendingInterrupt
  2207. *
  2208. * @b Description
  2209. * @n The function returns the LSU pending interrupt status.
  2210. *
  2211. * @b Arguments
  2212. @verbatim
  2213. hSrio Handle of the SRIO device
  2214. lsuStatus1 LSU Pending Status populated by this API
  2215. lsuStatus2 LSU Pending Status populated by this API
  2216. @endverbatim
  2217. *
  2218. * <b> Return Value </b>
  2219. * @n None
  2220. *
  2221. * <b> Pre Condition </b>
  2222. * @n CSL_SRIO_Open() must be called
  2223. *
  2224. * <b> Post Condition </b>
  2225. * @n None
  2226. *
  2227. * @b Reads
  2228. * @n SRIO_RIO_LSU_ICSR
  2229. *
  2230. * @b Example
  2231. * @verbatim
  2232. CSL_SrioHandle hSrio;
  2233. Uint32 lsuStatus1;
  2234. Uint32 lsuStatus2;
  2235. // Open the CSL SRIO Module 0
  2236. hSrio = CSL_SRIO_Open (0);
  2237. // Check the LSU Pending Interrupt Status.
  2238. CSL_SRIO_GetLSUPendingInterrupt (hSrio, &lsuStatus1, &lsuStatus2);
  2239. ...
  2240. @endverbatim
  2241. * =============================================================================
  2242. */
  2243. static inline void CSL_SRIO_GetLSUPendingInterrupt
  2244. (
  2245. CSL_SrioHandle hSrio,
  2246. Uint32* lsuStatus1,
  2247. Uint32* lsuStatus2
  2248. )
  2249. {
  2250. *lsuStatus1 = hSrio->LSU_ICSR_ICCR[0].RIO_LSU_ICSR;
  2251. *lsuStatus2 = hSrio->LSU_ICSR_ICCR[1].RIO_LSU_ICSR;
  2252. }
  2253. /** ============================================================================
  2254. * @n@b CSL_SRIO_ClearLSUPendingInterrupt
  2255. *
  2256. * @b Description
  2257. * @n The function clears the LSU pending interrupt
  2258. *
  2259. * @b Arguments
  2260. @verbatim
  2261. hSrio Handle of the SRIO device
  2262. lsuInterrupt1 LSU Interrupt to be cleared.
  2263. lsuInterrupt2 LSU Interrupt to be cleared.
  2264. @endverbatim
  2265. *
  2266. * <b> Return Value </b>
  2267. * @n None
  2268. *
  2269. * <b> Pre Condition </b>
  2270. * @n CSL_SRIO_Open() must be called
  2271. *
  2272. * <b> Post Condition </b>
  2273. * @n None
  2274. *
  2275. * @b Writes
  2276. * @n SRIO_RIO_LSU_ICCR
  2277. *
  2278. * @b Example
  2279. * @verbatim
  2280. CSL_SrioHandle hSrio;
  2281. Uint32 lsuStatus1;
  2282. Uint32 lsuStatus2;
  2283. // Open the CSL SRIO Module 0
  2284. hSrio = CSL_SRIO_Open (0);
  2285. // Check the LSU Pending Interrupt Status.
  2286. CSL_SRIO_GetLSUPendingInterrupt (hSrio, &lsuStatus1, &lsuStatus2);
  2287. ...
  2288. // Clear the pending interrupts.
  2289. CSL_SRIO_ClearLSUPendingInterrupt (hSrio, lsuStatus1, lsuStatus);
  2290. @endverbatim
  2291. * =============================================================================
  2292. */
  2293. static inline void CSL_SRIO_ClearLSUPendingInterrupt
  2294. (
  2295. CSL_SrioHandle hSrio,
  2296. Uint32 lsuInterrupt1,
  2297. Uint32 lsuInterrupt2
  2298. )
  2299. {
  2300. hSrio->LSU_ICSR_ICCR[0].RIO_LSU_ICCR = lsuInterrupt1;
  2301. hSrio->LSU_ICSR_ICCR[1].RIO_LSU_ICCR = lsuInterrupt2;
  2302. }
  2303. /** ============================================================================
  2304. * @n@b CSL_SRIO_ClearLSU0PendingInterrupt
  2305. *
  2306. * @b Description
  2307. * @n The function clears the LSU0 pending interrupt
  2308. *
  2309. * @b Arguments
  2310. @verbatim
  2311. hSrio Handle of the SRIO device
  2312. lsuInterrupt LSU Interrupt to be cleared.
  2313. @endverbatim
  2314. *
  2315. * <b> Return Value </b>
  2316. * @n None
  2317. *
  2318. * <b> Pre Condition </b>
  2319. * @n CSL_SRIO_Open() must be called
  2320. *
  2321. * <b> Post Condition </b>
  2322. * @n None
  2323. *
  2324. * @b Writes
  2325. * @n SRIO_RIO_LSU_ICCR
  2326. *
  2327. * @b Example
  2328. * @verbatim
  2329. CSL_SrioHandle hSrio;
  2330. // Open the CSL SRIO Module 0
  2331. hSrio = CSL_SRIO_Open (0);
  2332. ...
  2333. // Clear the ICS0 indicating that the SRCID0 Transaction was successfully complete.
  2334. CSL_SRIO_ClearLSU0PendingInterrupt (hSrio, 0x1);
  2335. @endverbatim
  2336. * =============================================================================
  2337. */
  2338. static inline void CSL_SRIO_ClearLSU0PendingInterrupt
  2339. (
  2340. CSL_SrioHandle hSrio,
  2341. Uint32 lsuInterrupt
  2342. )
  2343. {
  2344. hSrio->LSU_ICSR_ICCR[0].RIO_LSU_ICCR = lsuInterrupt;
  2345. }
  2346. /** ============================================================================
  2347. * @n@b CSL_SRIO_GetErrorPendingInterrupt
  2348. *
  2349. * @b Description
  2350. * @n The function returns the interrupt status of any error interrupts
  2351. * which are pending.
  2352. *
  2353. * @b Arguments
  2354. @verbatim
  2355. hSrio Handle of the SRIO device
  2356. errStatus Error Pending Status populated by this API
  2357. @endverbatim
  2358. *
  2359. * <b> Return Value </b>
  2360. * @n None
  2361. *
  2362. * <b> Pre Condition </b>
  2363. * @n CSL_SRIO_Open() must be called
  2364. *
  2365. * <b> Post Condition </b>
  2366. * @n None
  2367. *
  2368. * @b Reads
  2369. * @n SRIO_RIO_ERR_RST_EVNT_ICSR_MCAST_INT_RECEIVED,
  2370. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT_WRITE_IN_RECEIVED,
  2371. * SRIO_RIO_ERR_RST_EVNT_ICSR_LLERR_CAPTURE,
  2372. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT0_ERR,
  2373. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT1_ERR,
  2374. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT2_ERR,
  2375. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT3_ERR,
  2376. * SRIO_RIO_ERR_RST_EVNT_ICSR_DEVICE_RST_INT
  2377. *
  2378. * @b Example
  2379. * @verbatim
  2380. CSL_SrioHandle hSrio;
  2381. Uint32 errStatus;
  2382. // Open the CSL SRIO Module 0
  2383. hSrio = CSL_SRIO_Open (0);
  2384. // Get any pending errors
  2385. CSL_SRIO_GetErrorPendingInterrupt (hSrio, &errStatus);
  2386. ...
  2387. @endverbatim
  2388. * =============================================================================
  2389. */
  2390. static inline void CSL_SRIO_GetErrorPendingInterrupt
  2391. (
  2392. CSL_SrioHandle hSrio,
  2393. Uint32* errStatus
  2394. )
  2395. {
  2396. /* All the errors are present in the lower order 17 bits. */
  2397. *errStatus = CSL_FEXTR(hSrio->RIO_ERR_RST_EVNT_ICSR, 16, 0);
  2398. }
  2399. /** ============================================================================
  2400. * @n@b CSL_SRIO_ClearErrorPendingInterrupt
  2401. *
  2402. * @b Description
  2403. * @n The function clears the pending error interrupts
  2404. *
  2405. * @b Arguments
  2406. @verbatim
  2407. hSrio Handle of the SRIO device
  2408. errStatus Error Status to be cleared.
  2409. @endverbatim
  2410. *
  2411. * <b> Return Value </b>
  2412. * @n None
  2413. *
  2414. * <b> Pre Condition </b>
  2415. * @n CSL_SRIO_Open() must be called
  2416. *
  2417. * <b> Post Condition </b>
  2418. * @n None
  2419. *
  2420. * @b Writes
  2421. * @n SRIO_RIO_ERR_RST_EVNT_ICCR_MCAST_INT_RECEIVED,
  2422. * SRIO_RIO_ERR_RST_EVNT_ICCR_PORT_WRITE_IN_REQUEST_RECEIVED,
  2423. * SRIO_RIO_ERR_RST_EVNT_ICCR_LOGICAL_LAYER_ERROR_MANAGEMENT_EVENT_CAPTURE,
  2424. * SRIO_RIO_ERR_RST_EVNT_ICCR_PORT0_ERROR,
  2425. * SRIO_RIO_ERR_RST_EVNT_ICCR_PORT1_ERROR,
  2426. * SRIO_RIO_ERR_RST_EVNT_ICCR_PORT2_ERROR,
  2427. * SRIO_RIO_ERR_RST_EVNT_ICCR_PORT3_ERROR,
  2428. * SRIO_RIO_ERR_RST_EVNT_ICCR_DEVICE_RST_INT
  2429. *
  2430. * @b Affects
  2431. * @n SRIO_RIO_ERR_RST_EVNT_ICSR_MCAST_INT_RECEIVED=0,
  2432. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT_WRITE_IN_RECEIVED=0,
  2433. * SRIO_RIO_ERR_RST_EVNT_ICSR_LLERR_CAPTURE=0,
  2434. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT0_ERR=0,
  2435. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT1_ERR=0,
  2436. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT2_ERR=0,
  2437. * SRIO_RIO_ERR_RST_EVNT_ICSR_PORT3_ERR=0,
  2438. * SRIO_RIO_ERR_RST_EVNT_ICSR_DEVICE_RST_INT=0
  2439. *
  2440. * @b Example
  2441. * @verbatim
  2442. CSL_SrioHandle hSrio;
  2443. Uint32 errStatus;
  2444. // Open the CSL SRIO Module 0
  2445. hSrio = CSL_SRIO_Open (0);
  2446. // Get any pending error status.
  2447. CSL_SRIO_GetErrorPendingInterrupt (hSrio,&errStatus);
  2448. if (errStatus != 0)
  2449. {
  2450. // Pending error interrupts detected.
  2451. ...
  2452. // Clear the pending interrupts.
  2453. CSL_SRIO_ClearErrorPendingInterrupt (hSrio, errStatus);
  2454. }
  2455. else
  2456. {
  2457. // No pending error status
  2458. }
  2459. ...
  2460. @endverbatim
  2461. * =============================================================================
  2462. */
  2463. static inline void CSL_SRIO_ClearErrorPendingInterrupt
  2464. (
  2465. CSL_SrioHandle hSrio,
  2466. Uint32 errStatus
  2467. )
  2468. {
  2469. CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICCR, 16, 0, errStatus);
  2470. }
  2471. /** ============================================================================
  2472. * @n@b CSL_SRIO_GetAMUPendingInterrupt
  2473. *
  2474. * @b Description
  2475. * @n The function returns the interrupt status of any AMU interrupts.
  2476. *
  2477. * @b Arguments
  2478. @verbatim
  2479. hSrio Handle of the SRIO device
  2480. amuIntrStatus AMU Interrupt Pending Status populated by this API
  2481. @endverbatim
  2482. *
  2483. * <b> Return Value </b>
  2484. * @n None
  2485. *
  2486. * <b> Pre Condition </b>
  2487. * @n CSL_SRIO_Open() must be called
  2488. *
  2489. * <b> Post Condition </b>
  2490. * @n None
  2491. *
  2492. * @b Reads
  2493. * @n SRIO_RIO_AMU_ICSR_CPRIVID
  2494. *
  2495. * @b Example
  2496. * @verbatim
  2497. CSL_SrioHandle hSrio;
  2498. Uint16 amuIntrStatus;
  2499. // Open the CSL SRIO Module 0
  2500. hSrio = CSL_SRIO_Open (0);
  2501. // Get the pending AMU interrupt status
  2502. CSL_SRIO_GetAMUPendingInterrupt (hSrio, &amuIntrStatus);
  2503. ...
  2504. @endverbatim
  2505. * =============================================================================
  2506. */
  2507. static inline void CSL_SRIO_GetAMUPendingInterrupt
  2508. (
  2509. CSL_SrioHandle hSrio,
  2510. Uint16* amuIntrStatus
  2511. )
  2512. {
  2513. *amuIntrStatus = CSL_FEXT(hSrio->RIO_AMU_ICSR, SRIO_RIO_AMU_ICSR_CPRIVID);
  2514. }
  2515. /** ============================================================================
  2516. * @n@b CSL_SRIO_ClearAMUPendingInterrupt
  2517. *
  2518. * @b Description
  2519. * @n The function clears the AMU pending interrupts.
  2520. *
  2521. * @b Arguments
  2522. @verbatim
  2523. hSrio Handle of the SRIO device
  2524. amuIntrStatus AMU pending interrupt status to be cleared.
  2525. @endverbatim
  2526. *
  2527. * <b> Return Value </b>
  2528. * @n None
  2529. *
  2530. * <b> Pre Condition </b>
  2531. * @n CSL_SRIO_Open() must be called
  2532. *
  2533. * <b> Post Condition </b>
  2534. * @n None
  2535. *
  2536. * @b Writes
  2537. * @n SRIO_RIO_AMU_ICCR_CPRIVID
  2538. *
  2539. * @b Affects
  2540. * @n SRIO_RIO_AMU_ICSR_CPRIVID=0
  2541. *
  2542. * @b Example
  2543. * @verbatim
  2544. CSL_SrioHandle hSrio;
  2545. Uint16 amuIntrStatus;
  2546. // Open the CSL SRIO Module 0
  2547. hSrio = CSL_SRIO_Open (0);
  2548. // Get the pending AMU interrupt status
  2549. CSL_SRIO_GetAMUPendingInterrupt (hSrio, &amuIntrStatus);
  2550. if (amuIntrStatus != 0)
  2551. {
  2552. // Pending AMU interrupts detected.
  2553. ...
  2554. // Clear the pending interrupts.
  2555. CSL_SRIO_ClearAMUPendingInterrupt (hSrio, amuIntrStatus);
  2556. }
  2557. else
  2558. {
  2559. // No AMU interrupts were pending.
  2560. }
  2561. ...
  2562. @endverbatim
  2563. * =============================================================================
  2564. */
  2565. static inline void CSL_SRIO_ClearAMUPendingInterrupt
  2566. (
  2567. CSL_SrioHandle hSrio,
  2568. Uint16 amuIntrStatus
  2569. )
  2570. {
  2571. CSL_FINS(hSrio->RIO_AMU_ICCR, SRIO_RIO_AMU_ICCR_CPRIVID, amuIntrStatus);
  2572. }
  2573. /** ============================================================================
  2574. * @n@b CSL_SRIO_RouteDoorbellInterrupts
  2575. *
  2576. * @b Description
  2577. * @n The function routes the doorbell interrupts for the specified doorbell
  2578. * register to a specific destination.
  2579. *
  2580. * @b Arguments
  2581. @verbatim
  2582. hSrio Handle of the SRIO device
  2583. regNum Doorbell Register Number
  2584. doorBellBit Doorbell bit which is to be routed
  2585. destination Destination to which the interrupt bit is routed.
  2586. @endverbatim
  2587. *
  2588. * <b> Return Value </b>
  2589. * @n None
  2590. *
  2591. * <b> Pre Condition </b>
  2592. * @n CSL_SRIO_Open() must be called
  2593. *
  2594. * <b> Post Condition </b>
  2595. * @n None
  2596. *
  2597. * @b Writes
  2598. * @n SRIO_RIO_DOORBELL_ICRR1_ICR0,SRIO_RIO_DOORBELL_ICRR1_ICR1,
  2599. * SRIO_RIO_DOORBELL_ICRR1_ICR2,SRIO_RIO_DOORBELL_ICRR1_ICR3,
  2600. * SRIO_RIO_DOORBELL_ICRR1_ICR4,SRIO_RIO_DOORBELL_ICRR1_ICR5,
  2601. * SRIO_RIO_DOORBELL_ICRR1_ICR6,SRIO_RIO_DOORBELL_ICRR1_ICR7;
  2602. * @n SRIO_RIO_DOORBELL_ICRR2_ICR8,SRIO_RIO_DOORBELL_ICRR2_ICR9,
  2603. * SRIO_RIO_DOORBELL_ICRR2_ICR10,SRIO_RIO_DOORBELL_ICRR2_ICR11,
  2604. * SRIO_RIO_DOORBELL_ICRR2_ICR12,SRIO_RIO_DOORBELL_ICRR2_ICR13,
  2605. * SRIO_RIO_DOORBELL_ICRR2_ICR14,SRIO_RIO_DOORBELL_ICRR2_ICR15
  2606. *
  2607. * @b Example
  2608. * @verbatim
  2609. CSL_SrioHandle hSrio;
  2610. // Open the CSL SRIO Module 0
  2611. hSrio = CSL_SRIO_Open (0);
  2612. // Route the Doorbell bits 1 for Doorbell 2 to destination 2
  2613. CSL_SRIO_RouteDoorbellInterrupts (hSrio, 2, 1, 2);
  2614. ...
  2615. @endverbatim
  2616. * =============================================================================
  2617. */
  2618. static inline void CSL_SRIO_RouteDoorbellInterrupts
  2619. (
  2620. CSL_SrioHandle hSrio,
  2621. Uint8 regNum,
  2622. Uint8 doorBellBit,
  2623. Uint8 destination
  2624. )
  2625. {
  2626. if (doorBellBit < 8)
  2627. {
  2628. /* This handles interrupts requests between 0 and 7 */
  2629. CSL_FINSR (hSrio->DOORBELL_ICRR[regNum].RIO_DOORBELL_ICRR1,
  2630. ((doorBellBit << 2) + 3), (doorBellBit << 2), destination);
  2631. }
  2632. else
  2633. {
  2634. /* This handles interrupts requests between 8 and 15 */
  2635. doorBellBit = doorBellBit - 8;
  2636. CSL_FINSR (hSrio->DOORBELL_ICRR[regNum].RIO_DOORBELL_ICRR2,
  2637. ((doorBellBit << 2) + 3), (doorBellBit << 2), destination);
  2638. }
  2639. }
  2640. /** ============================================================================
  2641. * @n@b CSL_SRIO_RouteLSUInterrupts
  2642. *
  2643. * @b Description
  2644. * @n The function routes the LSU interrupts to a specific destination.
  2645. *
  2646. * @b Arguments
  2647. @verbatim
  2648. hSrio Handle of the SRIO device
  2649. lsuIntrReq LSU Interrupt request which is to be routed
  2650. destination Destination to which the interrupt bit is routed.
  2651. @endverbatim
  2652. *
  2653. * <b> Return Value </b>
  2654. * @n None
  2655. *
  2656. * <b> Pre Condition </b>
  2657. * @n CSL_SRIO_Open() must be called
  2658. *
  2659. * <b> Post Condition </b>
  2660. * @n None
  2661. *
  2662. * @b Writes
  2663. * @n SRIO_LSU_ICRR
  2664. *
  2665. * @b Example
  2666. * @verbatim
  2667. CSL_SrioHandle hSrio;
  2668. // Open the CSL SRIO Module 0
  2669. hSrio = CSL_SRIO_Open (0);
  2670. // Route the LSU Interrupts 1 to destination 6
  2671. CSL_SRIO_RouteLSUInterrupts (hSrio, 1, 6);
  2672. ...
  2673. @endverbatim
  2674. * =============================================================================
  2675. */
  2676. static inline void CSL_SRIO_RouteLSUInterrupts
  2677. (
  2678. CSL_SrioHandle hSrio,
  2679. Uint8 lsuIntrReq,
  2680. Uint8 destination
  2681. )
  2682. {
  2683. if (lsuIntrReq < 8)
  2684. {
  2685. /* This handles interrupts requests between 0 and 7 */
  2686. CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[0], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
  2687. }
  2688. else if (lsuIntrReq < 16)
  2689. {
  2690. /* This handles interrupts requests between 8 and 15 */
  2691. lsuIntrReq = lsuIntrReq - 8;
  2692. CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[1], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
  2693. }
  2694. else if (lsuIntrReq < 24)
  2695. {
  2696. /* This handles interrupts requests between 16 and 23 */
  2697. lsuIntrReq = lsuIntrReq - 16;
  2698. CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[2], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
  2699. }
  2700. else
  2701. {
  2702. /* This handles interrupts requests between 24 and 31 */
  2703. lsuIntrReq = lsuIntrReq - 24;
  2704. CSL_FINSR(hSrio->RIO_LSU0_MODULE_ICRR[3], ((lsuIntrReq << 2) + 3), (lsuIntrReq << 2), destination);
  2705. }
  2706. }
  2707. /** ============================================================================
  2708. * @n@b CSL_SRIO_RouteErrorInterrupts
  2709. *
  2710. * @b Description
  2711. * @n The function routes the error interrupts to a specific destination.
  2712. *
  2713. * @b Arguments
  2714. @verbatim
  2715. hSrio Handle of the SRIO device
  2716. errIntrReq Error Interrupt request which is to be routed
  2717. destination Destination to which the interrupt bit is routed.
  2718. @endverbatim
  2719. *
  2720. * <b> Return Value </b>
  2721. * @n None
  2722. *
  2723. * <b> Pre Condition </b>
  2724. * @n CSL_SRIO_Open() must be called
  2725. *
  2726. * <b> Post Condition </b>
  2727. * @n None
  2728. *
  2729. * @b Writes
  2730. * @n SRIO_RIO_ERR_RST_EVNT_ICRR_ICR0;SRIO_RIO_ERR_RST_EVNT_ICRR_ICR1;
  2731. * SRIO_RIO_ERR_RST_EVNT_ICRR_ICR2;
  2732. * @n SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR8;SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR9;
  2733. * SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR10;SRIO_RIO_ERR_RST_EVNT_ICRR2_ICR11;
  2734. * @n SRIO_RIO_ERR_RST_EVNT_ICRR3_ICR16
  2735. *
  2736. *
  2737. * @b Example
  2738. * @verbatim
  2739. CSL_SrioHandle hSrio;
  2740. // Open the CSL SRIO Module 0
  2741. hSrio = CSL_SRIO_Open (0);
  2742. // Route the Error Interrupts 1 to destination 6
  2743. CSL_SRIO_RouteErrorInterrupts (hSrio, 1, 6);
  2744. ...
  2745. @endverbatim
  2746. * =============================================================================
  2747. */
  2748. static inline void CSL_SRIO_RouteErrorInterrupts
  2749. (
  2750. CSL_SrioHandle hSrio,
  2751. Uint8 errIntrReq,
  2752. Uint8 destination
  2753. )
  2754. {
  2755. if (errIntrReq < 3)
  2756. {
  2757. /* This handles interrupts requests between 0 and 2 */
  2758. CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICRR, ((errIntrReq << 2) + 3), (errIntrReq << 2), destination);
  2759. }
  2760. else if (errIntrReq < 12)
  2761. {
  2762. /* This handles interrupts requests between 8 and 15; note that 3 to 7 are not used. */
  2763. errIntrReq = errIntrReq - 8;
  2764. CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICRR2, ((errIntrReq << 2) + 3), (errIntrReq << 2), destination);
  2765. }
  2766. else
  2767. {
  2768. /* This handles interrupts request 16; all else is reserved.*/
  2769. errIntrReq = errIntrReq - 16;
  2770. CSL_FINSR(hSrio->RIO_ERR_RST_EVNT_ICRR3, ((errIntrReq << 2) + 3), (errIntrReq << 2), destination);
  2771. }
  2772. }
  2773. /** ============================================================================
  2774. * @n@b CSL_SRIO_RouteAMUInterrupts
  2775. *
  2776. * @b Description
  2777. * @n The function routes the AMU interrupts to a specific destination.
  2778. *
  2779. * @b Arguments
  2780. @verbatim
  2781. hSrio Handle of the SRIO device
  2782. amuIntr AMU Interrupt request which is to be routed
  2783. destination Destination to which the interrupt bit is routed.
  2784. @endverbatim
  2785. *
  2786. * <b> Return Value </b>
  2787. * @n None
  2788. *
  2789. * <b> Pre Condition </b>
  2790. * @n CSL_SRIO_Open() must be called
  2791. *
  2792. * <b> Post Condition </b>
  2793. * @n None
  2794. *
  2795. * @b Writes
  2796. * @n SRIO_RIO_AMU_ICRR1_ICR0;SRIO_RIO_AMU_ICRR1_ICR1;SRIO_RIO_AMU_ICRR1_ICR2;
  2797. * SRIO_RIO_AMU_ICRR1_ICR3;SRIO_RIO_AMU_ICRR1_ICR4;SRIO_RIO_AMU_ICRR1_ICR5;
  2798. * SRIO_RIO_AMU_ICRR1_ICR6;SRIO_RIO_AMU_ICRR1_ICR7;
  2799. * SRIO_RIO_AMU_ICRR2_ICR8;SRIO_RIO_AMU_ICRR2_ICR9;SRIO_RIO_AMU_ICRR2_ICR10;
  2800. * SRIO_RIO_AMU_ICRR2_ICR11;SRIO_RIO_AMU_ICRR2_ICR12;SRIO_RIO_AMU_ICRR2_ICR13;
  2801. * SRIO_RIO_AMU_ICRR2_ICR14;SRIO_RIO_AMU_ICRR2_ICR15
  2802. *
  2803. * @b Example
  2804. * @verbatim
  2805. CSL_SrioHandle hSrio;
  2806. // Open the CSL SRIO Module 0
  2807. hSrio = CSL_SRIO_Open (0);
  2808. // Route the AMU Interrupts 1 to destination 6
  2809. CSL_SRIO_RouteAMUInterrupts (hSrio, 1, 6);
  2810. ...
  2811. @endverbatim
  2812. * =============================================================================
  2813. */
  2814. static inline void CSL_SRIO_RouteAMUInterrupts
  2815. (
  2816. CSL_SrioHandle hSrio,
  2817. Uint8 amuIntr,
  2818. Uint8 destination
  2819. )
  2820. {
  2821. if (amuIntr < 8)
  2822. {
  2823. /* This handles AMU interrupts requests between 0 and 7 */
  2824. CSL_FINSR(hSrio->RIO_AMU_ICRR1, ((amuIntr << 2) + 3), (amuIntr << 2), destination);
  2825. }
  2826. else
  2827. {
  2828. /* This handles AMU interrupts requests between 8 and 15.*/
  2829. amuIntr = amuIntr - 8;
  2830. CSL_FINSR(hSrio->RIO_AMU_ICRR2, ((amuIntr << 2) + 3), (amuIntr << 2), destination);
  2831. }
  2832. }
  2833. /** ============================================================================
  2834. * @n@b CSL_SRIO_GetDoorbellRoute
  2835. *
  2836. * @b Description
  2837. * @n The function gets the doorbell routing information.
  2838. *
  2839. * @b Arguments
  2840. @verbatim
  2841. hSrio Handle of the SRIO device
  2842. route Routing Information populated by this API
  2843. @endverbatim
  2844. *
  2845. * <b> Return Value </b>
  2846. * @n None
  2847. *
  2848. * <b> Pre Condition </b>
  2849. * @n CSL_SRIO_Open() must be called
  2850. *
  2851. * <b> Post Condition </b>
  2852. * @n None
  2853. *
  2854. * @b Reads
  2855. * @n SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE
  2856. *
  2857. * @b Example
  2858. * @verbatim
  2859. CSL_SrioHandle hSrio;
  2860. Uint8 routeInfo;
  2861. // Open the CSL SRIO Module 0
  2862. hSrio = CSL_SRIO_Open (0);
  2863. // Get the Doorbell routing information
  2864. CSL_SRIO_GetDoorbellRoute (hSrio, &routeInfo);
  2865. ...
  2866. @endverbatim
  2867. * =============================================================================
  2868. */
  2869. static inline void CSL_SRIO_GetDoorbellRoute
  2870. (
  2871. CSL_SrioHandle hSrio,
  2872. Uint8* routeInfo
  2873. )
  2874. {
  2875. *routeInfo = CSL_FEXT(hSrio->RIO_INTERRUPT_CTL, SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE);
  2876. }
  2877. /** ============================================================================
  2878. * @n@b CSL_SRIO_SetDoorbellRoute
  2879. *
  2880. * @b Description
  2881. * @n The function sets the doorbell routing information.
  2882. *
  2883. * @b Arguments
  2884. @verbatim
  2885. hSrio Handle of the SRIO device
  2886. route Routing Information to be configured
  2887. @endverbatim
  2888. *
  2889. * <b> Return Value </b>
  2890. * @n None
  2891. *
  2892. * <b> Pre Condition </b>
  2893. * @n CSL_SRIO_Open() must be called
  2894. *
  2895. * <b> Post Condition </b>
  2896. * @n None
  2897. *
  2898. * @b Reads
  2899. * @n SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE
  2900. *
  2901. * @b Example
  2902. * @verbatim
  2903. CSL_SrioHandle hSrio;
  2904. Uint8 routeInfo;
  2905. // Open the CSL SRIO Module 0
  2906. hSrio = CSL_SRIO_Open (0);
  2907. // Set the Doorbell routing information to use dedicated interrupts.
  2908. CSL_SRIO_SetDoorbellRoute (hSrio, 0);
  2909. ...
  2910. @endverbatim
  2911. * =============================================================================
  2912. */
  2913. static inline void CSL_SRIO_SetDoorbellRoute
  2914. (
  2915. CSL_SrioHandle hSrio,
  2916. Uint8 routeInfo
  2917. )
  2918. {
  2919. hSrio->RIO_INTERRUPT_CTL = CSL_FMK(SRIO_RIO_INTERRUPT_CTL_DBLL_ROUTE, routeInfo);
  2920. }
  2921. /** ============================================================================
  2922. * @n@b CSL_SRIO_GetInterruptStatusDecode
  2923. *
  2924. * @b Description
  2925. * @n The function gets the interrupt status for a specified interrupt
  2926. * destination
  2927. *
  2928. * @b Arguments
  2929. @verbatim
  2930. hSrio Handle of the SRIO device
  2931. intrDst Interrupt Destination for which the status is required.
  2932. status Decode Status populated by this API
  2933. @endverbatim
  2934. *
  2935. * <b> Return Value </b>
  2936. * @n None
  2937. *
  2938. * <b> Pre Condition </b>
  2939. * @n CSL_SRIO_Open() must be called
  2940. *
  2941. * <b> Post Condition </b>
  2942. * @n None
  2943. *
  2944. * @b Reads
  2945. * @n SRIO_RIO_INTDST_DECODE
  2946. *
  2947. * @b Example
  2948. * @verbatim
  2949. CSL_SrioHandle hSrio;
  2950. Uint32 status;
  2951. // Open the CSL SRIO Module 0
  2952. hSrio = CSL_SRIO_Open (0);
  2953. // Get the Interrupt Status for destination 0
  2954. CSL_SRIO_GetInterruptStatusDecode (hSrio, 0, &status);
  2955. ...
  2956. @endverbatim
  2957. * =============================================================================
  2958. */
  2959. static inline void CSL_SRIO_GetInterruptStatusDecode
  2960. (
  2961. CSL_SrioHandle hSrio,
  2962. Uint8 intrDst,
  2963. Uint32* status
  2964. )
  2965. {
  2966. *status = hSrio->RIO_INTDST_DECODE[intrDst];
  2967. }
  2968. /** ============================================================================
  2969. * @n@b CSL_SRIO_EnableInterruptPacing
  2970. *
  2971. * @b Description
  2972. * @n The function enables interrupt pacing for the specific destination.
  2973. *
  2974. * @b Arguments
  2975. @verbatim
  2976. hSrio Handle of the SRIO device
  2977. destination Destination Address for which interrupt pacing is enabled.
  2978. @endverbatim
  2979. *
  2980. * <b> Return Value </b>
  2981. * @n None
  2982. *
  2983. * <b> Pre Condition </b>
  2984. * @n CSL_SRIO_Open() must be called
  2985. *
  2986. * <b> Post Condition </b>
  2987. * @n None
  2988. *
  2989. * @b Writes
  2990. * @n SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;
  2991. * SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_IO_INTDST_RATE_DIS_RATEN_DIS=0;
  2992. * SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;
  2993. * SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=0;
  2994. *
  2995. * @b Example
  2996. * @verbatim
  2997. CSL_SrioHandle hSrio;
  2998. Uint32 rate;
  2999. // Open the CSL SRIO Module 0
  3000. hSrio = CSL_SRIO_Open (0);
  3001. // Enable Interrupt Pacing for Destination 4.
  3002. CSL_SRIO_EnableInterruptPacing (hSrio, 4);
  3003. ...
  3004. @endverbatim
  3005. * =============================================================================
  3006. */
  3007. static inline void CSL_SRIO_EnableInterruptPacing
  3008. (
  3009. CSL_SrioHandle hSrio,
  3010. Uint8 destination
  3011. )
  3012. {
  3013. CSL_FINSR(hSrio->RIO_INTDST_RATE_DIS, destination, destination, 0);
  3014. }
  3015. /** ============================================================================
  3016. * @n@b CSL_SRIO_DisableInterruptPacing
  3017. *
  3018. * @b Description
  3019. * @n The function disables interrupt pacing for the specific destination.
  3020. *
  3021. * @b Arguments
  3022. @verbatim
  3023. hSrio Handle of the SRIO device
  3024. destination Destination Address for which interrupt pacing is disabled.
  3025. @endverbatim
  3026. *
  3027. * <b> Return Value </b>
  3028. * @n None
  3029. *
  3030. * <b> Pre Condition </b>
  3031. * @n CSL_SRIO_Open() must be called
  3032. *
  3033. * <b> Post Condition </b>
  3034. * @n None
  3035. *
  3036. * @b Writes
  3037. * @n SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;
  3038. * SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;
  3039. * SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;
  3040. * SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1;SRIO_RIO_INTDST_RATE_DIS_RATEN_DIS=1
  3041. * @b Example
  3042. * @verbatim
  3043. CSL_SrioHandle hSrio;
  3044. Uint32 rate;
  3045. // Open the CSL SRIO Module 0
  3046. hSrio = CSL_SRIO_Open (0);
  3047. // Disable Interrupt Pacing for Destination 5.
  3048. CSL_SRIO_DisableInterruptPacing (hSrio, 5);
  3049. ...
  3050. @endverbatim
  3051. * =============================================================================
  3052. */
  3053. static inline void CSL_SRIO_DisableInterruptPacing
  3054. (
  3055. CSL_SrioHandle hSrio,
  3056. Uint8 destination
  3057. )
  3058. {
  3059. CSL_FINSR(hSrio->RIO_INTDST_RATE_DIS, destination, destination, 1);
  3060. }
  3061. /** ============================================================================
  3062. * @n@b CSL_SRIO_SetInterruptRate
  3063. *
  3064. * @b Description
  3065. * @n The function sets the rate for each interrupt destination.
  3066. *
  3067. * @b Arguments
  3068. @verbatim
  3069. hSrio Handle of the SRIO device
  3070. destination Destination Address for which the status is read.
  3071. rate Interrupt Rate to be configured.
  3072. @endverbatim
  3073. *
  3074. * <b> Return Value </b>
  3075. * @n None
  3076. *
  3077. * <b> Pre Condition </b>
  3078. * @n CSL_SRIO_Open() must be called
  3079. *
  3080. * <b> Post Condition </b>
  3081. * @n None
  3082. *
  3083. * @b Writes
  3084. * @n SRIO_RIO_INTDST_RATE_CNT_COUNT_DOWN_VALUE
  3085. *
  3086. * @b Example
  3087. * @verbatim
  3088. CSL_SrioHandle hSrio;
  3089. // Open the CSL SRIO Module 0
  3090. hSrio = CSL_SRIO_Open (0);
  3091. // Enable Interrupt Pacing for Destination 2.
  3092. CSL_SRIO_EnableInterruptPacing (hSrio, 2);
  3093. // Set the slowest Interrupt Rate for destination 2.
  3094. CSL_SRIO_SetInterruptRate (hSrio, 2, 0xFFFFFFFF);
  3095. ...
  3096. @endverbatim
  3097. * =============================================================================
  3098. */
  3099. static inline void CSL_SRIO_SetInterruptPacing
  3100. (
  3101. CSL_SrioHandle hSrio,
  3102. Uint8 destination,
  3103. Uint32 rate
  3104. )
  3105. {
  3106. hSrio->RIO_INTDST_RATE_CNT[destination] = rate;
  3107. }
  3108. /** ============================================================================
  3109. * @n@b CSL_SRIO_GetInterruptPacing
  3110. *
  3111. * @b Description
  3112. * @n The function gets the rate for each interrupt destination.
  3113. *
  3114. * @b Arguments
  3115. @verbatim
  3116. hSrio Handle of the SRIO device
  3117. destination Destination Address for which the status is read.
  3118. rate Interrupt Rate to be configured.
  3119. @endverbatim
  3120. *
  3121. * <b> Return Value </b>
  3122. * @n None
  3123. *
  3124. * <b> Pre Condition </b>
  3125. * @n CSL_SRIO_Open() must be called
  3126. *
  3127. * <b> Post Condition </b>
  3128. * @n None
  3129. *
  3130. * @b Reads
  3131. * @n SRIO_RIO_INTDST_RATE_CNT_COUNT_DOWN_VALUE
  3132. *
  3133. * @b Example
  3134. * @verbatim
  3135. CSL_SrioHandle hSrio;
  3136. Uint32 rate;
  3137. // Open the CSL SRIO Module 0
  3138. hSrio = CSL_SRIO_Open (0);
  3139. // Enable Interrupt Pacing for Destination 4.
  3140. CSL_SRIO_EnableInterruptPacing (hSrio, 4);
  3141. ...
  3142. // Get the Interrupt rate for destination 4
  3143. CSL_SRIO_GetInterruptRate (hSrio, 4, &rate);
  3144. ...
  3145. @endverbatim
  3146. * =============================================================================
  3147. */
  3148. static inline void CSL_SRIO_GetInterruptRate
  3149. (
  3150. CSL_SrioHandle hSrio,
  3151. Uint8 destination,
  3152. Uint32* rate
  3153. )
  3154. {
  3155. *rate = hSrio->RIO_INTDST_RATE_CNT[destination];
  3156. }
  3157. /** ============================================================================
  3158. * @n@b CSL_SRIO_SetType11PSInfo
  3159. *
  3160. * @b Description
  3161. * @n The function creates the type11 protocol specific information.
  3162. *
  3163. * @b Arguments
  3164. @verbatim
  3165. psInfo - 8 bytes of PS information populated by this API
  3166. dstID - Destination Identifier.
  3167. srcId - Source Identifier.
  3168. mbox - Mail Box
  3169. ltr - Letter
  3170. tt - Identifies if 8 bit or 16 bit identifiers are to be used.
  3171. ssize - Standard Message Payload Size
  3172. retryCount - Total Number of retries allowed for this message.
  3173. @endverbatim
  3174. *
  3175. * <b> Return Value </b>
  3176. * @n None
  3177. *
  3178. * <b> Pre Condition </b>
  3179. * @n None
  3180. *
  3181. * <b> Post Condition </b>
  3182. * @n None
  3183. *
  3184. * @b Example
  3185. * @verbatim
  3186. CSL_SrioHandle hSrio;
  3187. Uint32 psInfo[2];
  3188. // Open the CSL SRIO Module 0
  3189. hSrio = CSL_SRIO_Open (0);
  3190. // Create the Protocol Specific Information.
  3191. CSL_SRIO_SetType11PSInfo(psInfo, 0xDEAD, 0xBEED, 0x1, 0x2, 0x1, 0xe, 0x0);
  3192. // Set the PS Information into the Buffer Descriptor.
  3193. ...
  3194. @endverbatim
  3195. * =============================================================================
  3196. */
  3197. static inline void CSL_SRIO_SetType11PSInfo
  3198. (
  3199. Uint32 psInfo[2],
  3200. Uint16 dstId,
  3201. Uint16 srcId,
  3202. Uint8 mbox,
  3203. Uint8 letter,
  3204. Uint8 tt,
  3205. Uint8 ssize,
  3206. Uint8 retryCount
  3207. )
  3208. {
  3209. psInfo[0] = CSL_FMKR(31, 16, srcId) |
  3210. CSL_FMKR(15, 0, dstId);
  3211. psInfo[1] = CSL_FMKR(5, 0, mbox) |
  3212. CSL_FMKR(8, 6, letter) |
  3213. CSL_FMKR(10, 9, tt) |
  3214. CSL_FMKR(20, 17, ssize) |
  3215. CSL_FMKR(26, 21, retryCount);
  3216. }
  3217. /** ============================================================================
  3218. * @n@b CSL_SRIO_ExtractType11PSInfo
  3219. *
  3220. * @b Description
  3221. * @n The function extracts the type11 fields from the Protocol Specific
  3222. * information.
  3223. *
  3224. * @b Arguments
  3225. @verbatim
  3226. psInfo - 8 bytes of PS information from the descriptor
  3227. dstID - Destination Identifier populated by the API
  3228. srcId - Source Identifier populated by the API
  3229. mbox - Mail Box populated by the API
  3230. ltr - Letter populated by the API
  3231. tt - Identifies if 8 bit or 16 bit identifiers are being used.
  3232. pri - Message Priority populated by the API
  3233. cc - Completion Code populated by the API
  3234. @endverbatim
  3235. *
  3236. * <b> Return Value </b>
  3237. * @n None
  3238. *
  3239. * <b> Pre Condition </b>
  3240. * @n None
  3241. *
  3242. * <b> Post Condition </b>
  3243. * @n None
  3244. *
  3245. * @b Example
  3246. * @verbatim
  3247. CSL_SrioHandle hSrio;
  3248. Uint32 psInfo[2];
  3249. Uint16 dstId;
  3250. Uint16 srcId;
  3251. Uint8 mbox;
  3252. Uint8 letter;
  3253. Uint8 tt;
  3254. Uint8 pri;
  3255. Uint8 cc;
  3256. // Open the CSL SRIO Module 0
  3257. hSrio = CSL_SRIO_Open (0);
  3258. // Get the PS Information from the buffer descriptor.
  3259. ...
  3260. // Populate the Type11 fields from the PS Information.
  3261. CSL_SRIO_ExtractType11PSInfo(psInfo, &dstId, &srcId, &mbox, &letter, &tt, &pri, &cc);
  3262. ...
  3263. @endverbatim
  3264. * =============================================================================
  3265. */
  3266. static inline void CSL_SRIO_ExtractType11PSInfo
  3267. (
  3268. Uint32 psInfo[2],
  3269. Uint16* dstId,
  3270. Uint16* srcId,
  3271. Uint8* mbox,
  3272. Uint8* letter,
  3273. Uint8* tt,
  3274. Uint8* pri,
  3275. Uint8* cc
  3276. )
  3277. {
  3278. *srcId = CSL_FEXTR(psInfo[0], 31, 16);
  3279. *dstId = CSL_FEXTR(psInfo[0], 15, 0);
  3280. *mbox = CSL_FEXTR(psInfo[1], 5, 0);
  3281. *letter = CSL_FEXTR(psInfo[1], 8, 6);
  3282. *tt = CSL_FEXTR(psInfo[1], 10, 9);
  3283. *pri = CSL_FEXTR(psInfo[1], 14, 11);
  3284. *cc = CSL_FEXTR(psInfo[1], 16, 15);
  3285. }
  3286. /** ============================================================================
  3287. * @n@b CSL_SRIO_MapMessageToQueue
  3288. *
  3289. * @b Description
  3290. * @n The function maps a specific RIO message to the specific queue
  3291. *
  3292. * @b Arguments
  3293. @verbatim
  3294. hSrio Handle of the SRIO device
  3295. index Index of the MAP register
  3296. message Message Information which is compared with incoming
  3297. packet.
  3298. queueId Destination Queue to which the message is sent
  3299. @endverbatim
  3300. *
  3301. * <b> Return Value </b>
  3302. * @n None
  3303. *
  3304. * <b> Pre Condition </b>
  3305. * @n CSL_SRIO_Open() must be called
  3306. *
  3307. * <b> Post Condition </b>
  3308. * @n None
  3309. *
  3310. * @b Writes
  3311. * @n SRIO_RIO_RXU_MAP_L_SRCID,SRIO_RIO_RXU_MAP_L_MBX,SRIO_RIO_RXU_MAP_L_LTR
  3312. * SRIO_RIO_RXU_MAP_L_MBX_MASK,SRIO_RIO_RXU_MAP_L_LTR_MASK,
  3313. * @n SRIO_RIO_RXU_MAP_H_SEG_MAP,SRIO_RIO_RXU_MAP_H_SRC_PROM,SRIO_RIO_RXU_MAP_H_TT,
  3314. * SRIO_RIO_RXU_MAP_H_DEST_PROM,SRIO_RIO_RXU_MAP_H_DEST_ID,
  3315. * @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
  3316. *
  3317. * @b Example
  3318. * @verbatim
  3319. CSL_SrioHandle hSrio;
  3320. SRIO_MESSAGE message;
  3321. // Open the CSL SRIO Module 0
  3322. hSrio = CSL_SRIO_Open (0);
  3323. message.srcID = 0xBEEF;
  3324. message.mbx = 0;
  3325. message.ltr = 0;
  3326. message.mbxMask = 0;
  3327. message.ltrMask = 0;
  3328. message.segMap = 0; // Single Segment
  3329. message.srcProm = 1; // Full Access to the Queue for any Source ID
  3330. message.tt = 1; // Match 16bits for Source ID.
  3331. message.dstProm = 0; // Access to the Queue for the specified Destination ID
  3332. message.dstId = 0xDEAD;// The destination ID which indicates us.
  3333. message.flowId = 0x0;
  3334. // Map the above message to Queue 4. This is the first mapping which is being done
  3335. CSL_SRIO_MapMessageToQueue (hSrio, 0, &message, 4);
  3336. ...
  3337. @endverbatim
  3338. * =============================================================================
  3339. */
  3340. static inline void CSL_SRIO_MapMessageToQueue
  3341. (
  3342. CSL_SrioHandle hSrio,
  3343. Uint8 index,
  3344. SRIO_MESSAGE* ptrMessage,
  3345. Uint16 queueId
  3346. )
  3347. {
  3348. /* Initialize the RXU MAPL register. */
  3349. hSrio->RXU_MAP[index].RIO_RXU_MAP_L =
  3350. CSL_FMK(SRIO_RIO_RXU_MAP_L_SRCID, ptrMessage->srcId) |
  3351. CSL_FMK(SRIO_RIO_RXU_MAP_L_MBX, ptrMessage->mbx) |
  3352. CSL_FMK(SRIO_RIO_RXU_MAP_L_LTR, ptrMessage->ltr) |
  3353. CSL_FMK(SRIO_RIO_RXU_MAP_L_MBX_MASK, ptrMessage->mbxMask) |
  3354. CSL_FMK(SRIO_RIO_RXU_MAP_L_LTR_MASK, ptrMessage->ltrMask);
  3355. /* Initialize the RXU MAPH register. */
  3356. hSrio->RXU_MAP[index].RIO_RXU_MAP_H =
  3357. CSL_FMK(SRIO_RIO_RXU_MAP_H_SEG_MAP, ptrMessage->segMap) |
  3358. CSL_FMK(SRIO_RIO_RXU_MAP_H_SRC_PROM, ptrMessage->srcProm) |
  3359. CSL_FMK(SRIO_RIO_RXU_MAP_H_TT, ptrMessage->tt) |
  3360. CSL_FMK(SRIO_RIO_RXU_MAP_H_DEST_PROM, ptrMessage->dstProm) |
  3361. CSL_FMK(SRIO_RIO_RXU_MAP_H_DEST_ID, ptrMessage->dstId);
  3362. /* Initialize the RXU QID register. */
  3363. hSrio->RXU_MAP[index].RIO_RXU_MAP_QID =
  3364. CSL_FMK(SRIO_RIO_RXU_MAP_QID_DEST_QID, queueId) |
  3365. CSL_FMK(SRIO_RIO_RXU_MAP_QID_FLOWID, ptrMessage->flowId);
  3366. }
  3367. /** ============================================================================
  3368. * @n@b CSL_SRIO_GetMessageToQueueMapping
  3369. *
  3370. * @b Description
  3371. * @n The function gets information about the SRIO Message and Queue to which
  3372. * it is mapped by reading the specified MAP 'index' register.
  3373. *
  3374. * @b Arguments
  3375. @verbatim
  3376. hSrio Handle of the SRIO device
  3377. index Index of the MAP register
  3378. message Message Information populated by this API
  3379. queueId Destination Queue to which the message is mapped
  3380. populated by this API
  3381. @endverbatim
  3382. *
  3383. * <b> Return Value </b>
  3384. * @n None
  3385. *
  3386. * <b> Pre Condition </b>
  3387. * @n CSL_SRIO_Open() must be called
  3388. *
  3389. * <b> Post Condition </b>
  3390. * @n None
  3391. *
  3392. * @b Reads
  3393. * @n SRIO_RIO_RXU_MAP_L_SRCID,SRIO_RIO_RXU_MAP_L_MBX,SRIO_RIO_RXU_MAP_L_LTR
  3394. * SRIO_RIO_RXU_MAP_L_MBX_MASK,SRIO_RIO_RXU_MAP_L_LTR_MASK,
  3395. * @n SRIO_RIO_RXU_MAP_H_SEG_MAP,SRIO_RIO_RXU_MAP_H_SRC_PROM,SRIO_RIO_RXU_MAP_H_TT,
  3396. * SRIO_RIO_RXU_MAP_H_DEST_PROM,SRIO_RIO_RXU_MAP_H_DEST_ID,
  3397. * @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
  3398. *
  3399. * @b Example
  3400. * @verbatim
  3401. CSL_SrioHandle hSrio;
  3402. SRIO_MESSAGE message;
  3403. Uint16 queueId;
  3404. // Open the CSL SRIO Module 0
  3405. hSrio = CSL_SRIO_Open (0);
  3406. // Get the mapping information for the 'first' mapping.
  3407. CSL_SRIO_GetMessageToQueueMapping (hSrio, 0, &message, &queueId);
  3408. ...
  3409. @endverbatim
  3410. * =============================================================================
  3411. */
  3412. static inline void CSL_SRIO_GetMessageToQueueMapping
  3413. (
  3414. CSL_SrioHandle hSrio,
  3415. Uint8 index,
  3416. SRIO_MESSAGE* ptrMessage,
  3417. Uint16* queueId
  3418. )
  3419. {
  3420. Uint32 value;
  3421. /* Get the RXU MAPL register. */
  3422. value = hSrio->RXU_MAP[index].RIO_RXU_MAP_L;
  3423. ptrMessage->srcId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_SRCID);
  3424. ptrMessage->mbx = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_MBX);
  3425. ptrMessage->ltr = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_LTR);
  3426. ptrMessage->mbxMask = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_MBX_MASK);
  3427. ptrMessage->ltrMask = CSL_FEXT(value, SRIO_RIO_RXU_MAP_L_LTR_MASK);
  3428. /* Get the RXU MAPH register. */
  3429. value = hSrio->RXU_MAP[index].RIO_RXU_MAP_H;
  3430. ptrMessage->segMap = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_SEG_MAP);
  3431. ptrMessage->srcProm = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_SRC_PROM);
  3432. ptrMessage->tt = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_TT);
  3433. ptrMessage->dstProm = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_DEST_PROM);
  3434. ptrMessage->dstId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_H_DEST_ID);
  3435. /* Get the RXU QID register. */
  3436. value = hSrio->RXU_MAP[index].RIO_RXU_MAP_QID;
  3437. *queueId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_DEST_QID);
  3438. ptrMessage->flowId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_FLOWID);
  3439. }
  3440. /** ============================================================================
  3441. * @n@b CSL_SRIO_SetType9PSInfo
  3442. *
  3443. * @b Description
  3444. * @n The function creates the type9 protocol specific information.
  3445. *
  3446. * @b Arguments
  3447. @verbatim
  3448. psInfo - 8 bytes of PS information populated by this API
  3449. dstID - Destination Identifier.
  3450. srcId - Source Identifier.
  3451. cos - Class of Service
  3452. cosMask - Class of Service Mask
  3453. tt - Identifies if 8 bit or 16 bit identifiers are to be used.
  3454. streamId - Stream ID for the transaction
  3455. @endverbatim
  3456. *
  3457. * <b> Return Value </b>
  3458. * @n None
  3459. *
  3460. * <b> Pre Condition </b>
  3461. * @n None
  3462. *
  3463. * <b> Post Condition </b>
  3464. * @n None
  3465. *
  3466. * @b Example
  3467. * @verbatim
  3468. CSL_SrioHandle hSrio;
  3469. Uint32 psInfo[2];
  3470. // Open the CSL SRIO Module 0
  3471. hSrio = CSL_SRIO_Open (0);
  3472. // Create the Protocol Specific Information.
  3473. CSL_SRIO_SetType9PSInfo(psInfo, 0xDEAD, 0xBEED, 0x4, 0x1, 0x1, 0xABCD);
  3474. // Set the PS Information into the Buffer Descriptor.
  3475. ...
  3476. @endverbatim
  3477. * =============================================================================
  3478. */
  3479. static inline void CSL_SRIO_SetType9PSInfo
  3480. (
  3481. Uint32 psInfo[2],
  3482. Uint16 dstId,
  3483. Uint16 srcId,
  3484. Uint8 cos,
  3485. Uint8 cosMask,
  3486. Uint8 tt,
  3487. Uint16 streamId
  3488. )
  3489. {
  3490. psInfo[0] = CSL_FMKR(31, 16, srcId) |
  3491. CSL_FMKR(15, 0, dstId);
  3492. psInfo[1] = CSL_FMKR(7, 0, cos) |
  3493. CSL_FMKR(8, 8, cosMask) |
  3494. CSL_FMKR(10, 9, tt) |
  3495. CSL_FMKR(31, 16, streamId);
  3496. }
  3497. /** ============================================================================
  3498. * @n@b CSL_SRIO_ExtractType9PSInfo
  3499. *
  3500. * @b Description
  3501. * @n The function extracts the type9 protocol specific information.
  3502. *
  3503. * @b Arguments
  3504. @verbatim
  3505. psInfo - 8 bytes of PS information
  3506. dstID - Destination Identifier populated by this API
  3507. srcId - Source Identifier populated by this API
  3508. cos - Class of Service populated by this API
  3509. cc - Completion Code populated by this API
  3510. tt - Identifies if 8 bit or 16 bit identifiers are to be used.
  3511. pri - Message Priority populated by this API
  3512. streamId - Stream Id populated by this API
  3513. @endverbatim
  3514. *
  3515. * <b> Return Value </b>
  3516. * @n None
  3517. *
  3518. * <b> Pre Condition </b>
  3519. * @n None
  3520. *
  3521. * <b> Post Condition </b>
  3522. * @n None
  3523. *
  3524. * @b Example
  3525. * @verbatim
  3526. CSL_SrioHandle hSrio;
  3527. Uint32 psInfo[2];
  3528. Uint16 dstId;
  3529. Uint16 srcId;
  3530. Uint8 cos;
  3531. Uint8 cc;
  3532. Uint8 tt;
  3533. Uint8 pri;
  3534. Uint16 streamId;
  3535. // Open the CSL SRIO Module 0
  3536. hSrio = CSL_SRIO_Open (0);
  3537. // Get the PS Information into the Buffer Descriptor.
  3538. ...
  3539. // Extract the Type9 fields from the PS Information.
  3540. CSL_SRIO_ExtractType9PSInfo(psInfo, &dstId, &srcId, &cos, &cc, &tt, &pri, &streamId);
  3541. ...
  3542. @endverbatim
  3543. * =============================================================================
  3544. */
  3545. static inline void CSL_SRIO_ExtractType9PSInfo
  3546. (
  3547. Uint32 psInfo[2],
  3548. Uint16* dstId,
  3549. Uint16* srcId,
  3550. Uint8* cos,
  3551. Uint8* cc,
  3552. Uint8* tt,
  3553. Uint8* pri,
  3554. Uint16* streamId
  3555. )
  3556. {
  3557. *srcId = CSL_FEXTR(psInfo[0], 31, 16);
  3558. *dstId = CSL_FEXTR(psInfo[0], 15, 0);
  3559. *cos = CSL_FEXTR(psInfo[1], 7, 0);
  3560. *cc = CSL_FEXTR(psInfo[1], 9, 8);
  3561. *tt = CSL_FEXTR(psInfo[1], 10, 10);
  3562. *pri = CSL_FEXTR(psInfo[1], 14, 11);
  3563. *streamId = CSL_FEXTR(psInfo[1], 31, 16);
  3564. }
  3565. /** ============================================================================
  3566. * @n@b CSL_SRIO_MapType9MessageToQueue
  3567. *
  3568. * @b Description
  3569. * @n The function maps the specific TYPE9 message to the queue
  3570. *
  3571. * @b Arguments
  3572. @verbatim
  3573. hSrio Handle of the SRIO device
  3574. index Index of the MAP register
  3575. message Type9-Message Information
  3576. queueId Destination Queue
  3577. @endverbatim
  3578. *
  3579. * <b> Return Value </b>
  3580. * @n None
  3581. *
  3582. * <b> Pre Condition </b>
  3583. * @n CSL_SRIO_Open() must be called
  3584. *
  3585. * <b> Post Condition </b>
  3586. * @n None
  3587. *
  3588. * @b Writes
  3589. * @n SRIO_RIO_RXU_TYPE9_MAP0_SRCID,SRIO_RIO_RXU_TYPE9_MAP0_COS,
  3590. * SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK,
  3591. * @n SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM,SRIO_RIO_RXU_TYPE9_MAP1_TT,
  3592. * SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM,SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID,
  3593. * @n SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID,SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK,
  3594. * @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
  3595. *
  3596. * @b Example
  3597. * @verbatim
  3598. CSL_SrioHandle hSrio;
  3599. SRIO_TYPE9_MESSAGE message;
  3600. // Open the CSL SRIO Module 0
  3601. hSrio = CSL_SRIO_Open (0);
  3602. message.srcId = 0xBEEF;
  3603. message.cos = 0;
  3604. message.cosMask = 0;
  3605. message.srcProm = 0;
  3606. message.tt = 1; // Match 16bits for Source ID.
  3607. message.dstProm = 0;
  3608. message.dstId = 0xDEAD;
  3609. message.streamId = 0;
  3610. message.streamMask = 0;
  3611. message.flowId = 0;
  3612. // Map the above message to Queue 5. This is the first mapping which is being done
  3613. CSL_SRIO_MapType9MessageToQueue (hSrio, 0, &message, 5);
  3614. ...
  3615. @endverbatim
  3616. * =============================================================================
  3617. */
  3618. static inline void CSL_SRIO_MapType9MessageToQueue
  3619. (
  3620. CSL_SrioHandle hSrio,
  3621. Uint8 index,
  3622. SRIO_TYPE9_MESSAGE* ptrMessage,
  3623. Uint16 queueId
  3624. )
  3625. {
  3626. /* Initialize the RXU TYPE9 MAP0 register. */
  3627. hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP0 =
  3628. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP0_SRCID, ptrMessage->srcId) |
  3629. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP0_COS, ptrMessage->cos) |
  3630. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK, ptrMessage->cosMask);
  3631. /* Initialize the RXU TYPE9 MAP1 register. */
  3632. hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP1 =
  3633. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM, ptrMessage->srcProm) |
  3634. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_TT, ptrMessage->tt) |
  3635. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM,ptrMessage->dstProm) |
  3636. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID, ptrMessage->dstId);
  3637. /* Initialize the RXU TYPE9 MAP2 register. */
  3638. hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP2 =
  3639. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID, ptrMessage->streamId) |
  3640. CSL_FMK(SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK,ptrMessage->streamMask);
  3641. /* Initialize the RXU QID register: The specification states that this is shared between Type9 and Type11 */
  3642. hSrio->RXU_MAP[index].RIO_RXU_MAP_QID =
  3643. CSL_FMK(SRIO_RIO_RXU_MAP_QID_DEST_QID, queueId) |
  3644. CSL_FMK(SRIO_RIO_RXU_MAP_QID_FLOWID, ptrMessage->flowId);
  3645. }
  3646. /** ============================================================================
  3647. * @n@b CSL_SRIO_GetType9MessageToQueueMapping
  3648. *
  3649. * @b Description
  3650. * @n The function gets information about the SRIO TYPE9 Message and Queue
  3651. * to which it is mapped by reading the specified MAP 'index' register.
  3652. *
  3653. * @b Arguments
  3654. @verbatim
  3655. hSrio Handle of the SRIO device
  3656. index Index of the MAP register
  3657. message Type9-Message Information populated by this API
  3658. queueId Destination Queue populated by this API
  3659. @endverbatim
  3660. *
  3661. * <b> Return Value </b>
  3662. * @n None
  3663. *
  3664. * <b> Pre Condition </b>
  3665. * @n CSL_SRIO_Open() must be called
  3666. *
  3667. * <b> Post Condition </b>
  3668. * @n None
  3669. *
  3670. * @b Reads
  3671. * @n SRIO_RIO_RXU_TYPE9_MAP0_SRCID,SRIO_RIO_RXU_TYPE9_MAP0_COS,
  3672. * SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK,
  3673. * @n SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM,SRIO_RIO_RXU_TYPE9_MAP1_TT,
  3674. * SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM,SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID,
  3675. * @n SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID,SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK,
  3676. * @n SRIO_RIO_RXU_MAP_QID_DEST_QID,SRIO_RIO_RXU_MAP_QID_FLOWID
  3677. *
  3678. * @b Example
  3679. * @verbatim
  3680. CSL_SrioHandle hSrio;
  3681. SRIO_TYPE9_MESSAGE message;
  3682. Uint16 queueId;
  3683. // Open the CSL SRIO Module 0
  3684. hSrio = CSL_SRIO_Open (0);
  3685. ...
  3686. // Get the first mapping information.
  3687. CSL_SRIO_GetType9MessageToQueueMapping (hSrio, 0, &message, &queueId);
  3688. ...
  3689. @endverbatim
  3690. * =============================================================================
  3691. */
  3692. static inline void CSL_SRIO_GetType9MessageToQueueMapping
  3693. (
  3694. CSL_SrioHandle hSrio,
  3695. Uint8 index,
  3696. SRIO_TYPE9_MESSAGE* ptrMessage,
  3697. Uint16* queueId
  3698. )
  3699. {
  3700. Uint32 value;
  3701. /* Get the RXU TYPE9 MAP0 register. */
  3702. value = hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP0;
  3703. ptrMessage->srcId = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP0_SRCID);
  3704. ptrMessage->cos = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP0_COS);
  3705. ptrMessage->cosMask = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP0_COS_MASK);
  3706. /* Get the RXU TYPE9 MAP1 register. */
  3707. value = hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP1;
  3708. ptrMessage->srcProm = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_SRC_PROM);
  3709. ptrMessage->tt = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_TT);
  3710. ptrMessage->dstProm = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_DEST_PROM);
  3711. ptrMessage->dstId = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP1_DEST_ID);
  3712. /* Get the RXU TYPE9 MAP2 register. */
  3713. value = hSrio->RXU_TYPE9_MAP[index].RIO_RXU_TYPE9_MAP2;
  3714. ptrMessage->streamId = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP2_STRM_ID);
  3715. ptrMessage->streamMask = CSL_FEXT(value, SRIO_RIO_RXU_TYPE9_MAP2_STRM_MASK);
  3716. /* Get the RXU QID register: This is shared between the Type9 and Type11 */
  3717. value = hSrio->RXU_MAP[index].RIO_RXU_MAP_QID;
  3718. *queueId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_DEST_QID);
  3719. ptrMessage->flowId = CSL_FEXT(value, SRIO_RIO_RXU_MAP_QID_FLOWID);
  3720. }
  3721. /** ============================================================================
  3722. * @n@b CSL_SRIO_MapAMUPrivIdToSourceId
  3723. *
  3724. * @b Description
  3725. * @n The function maps the AMU Priv ID to a specific Source ID.
  3726. *
  3727. * @b Arguments
  3728. @verbatim
  3729. hSrio Handle of the SRIO device
  3730. privId AMU Priv ID which is being mapped
  3731. srcId Source ID to which the priv ID is being mapped to.
  3732. @endverbatim
  3733. *
  3734. * <b> Return Value </b>
  3735. * @n None
  3736. *
  3737. * <b> Pre Condition </b>
  3738. * @n CSL_SRIO_Open() must be called
  3739. *
  3740. * <b> Post Condition </b>
  3741. * @n None
  3742. *
  3743. * @b Writes
  3744. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID0_8;SRIO_RIO_AMU_SRCID_MAP_CPRIVID1_9;
  3745. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID2_10;SRIO_RIO_AMU_SRCID_MAP_CPRIVID3_11;
  3746. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID4_12;SRIO_RIO_AMU_SRCID_MAP_CPRIVID5_13;
  3747. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID6_14;SRIO_RIO_AMU_SRCID_MAP_CPRIVID7_15;
  3748. *
  3749. * @b Example
  3750. * @verbatim
  3751. CSL_SrioHandle hSrio;
  3752. // Open the CSL SRIO Module 0
  3753. hSrio = CSL_SRIO_Open (0);
  3754. ...
  3755. // Map the PRIV-ID 1 to Source ID 3
  3756. CSL_SRIO_MapAMUPrivIdToSourceId (hSrio, 1, 5);
  3757. ...
  3758. @endverbatim
  3759. * =============================================================================
  3760. */
  3761. static inline void CSL_SRIO_MapAMUPrivIdToSourceId
  3762. (
  3763. CSL_SrioHandle hSrio,
  3764. Uint8 privId,
  3765. Uint8 srcId
  3766. )
  3767. {
  3768. if (privId < 8)
  3769. {
  3770. CSL_FINSR (hSrio->RIO_AMU_SRCID_MAP[0], (privId << 2) + 3, (privId << 2), srcId);
  3771. }
  3772. else
  3773. {
  3774. privId = privId - 8;
  3775. CSL_FINSR (hSrio->RIO_AMU_SRCID_MAP[1], (privId << 2) + 3, (privId << 2), srcId);
  3776. }
  3777. }
  3778. /** ============================================================================
  3779. * @n@b CSL_SRIO_GetAMUPrivIdToSourceIdMapping
  3780. *
  3781. * @b Description
  3782. * @n The function gets the mapping of a specific AMU privID to source Id
  3783. *
  3784. * @b Arguments
  3785. @verbatim
  3786. hSrio Handle of the SRIO device
  3787. privId AMU Priv ID for which the mapping is required.
  3788. srcId Source ID to which the priv ID has been mapped to
  3789. populated by this API
  3790. @endverbatim
  3791. *
  3792. * <b> Return Value </b>
  3793. * @n None
  3794. *
  3795. * <b> Pre Condition </b>
  3796. * @n CSL_SRIO_Open() must be called
  3797. *
  3798. * <b> Post Condition </b>
  3799. * @n None
  3800. *
  3801. * @b Reads
  3802. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID0_8;SRIO_RIO_AMU_SRCID_MAP_CPRIVID1_9;
  3803. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID2_10;SRIO_RIO_AMU_SRCID_MAP_CPRIVID3_11;
  3804. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID4_12;SRIO_RIO_AMU_SRCID_MAP_CPRIVID5_13;
  3805. * @n SRIO_RIO_AMU_SRCID_MAP_CPRIVID6_14;SRIO_RIO_AMU_SRCID_MAP_CPRIVID7_15;
  3806. *
  3807. * @b Example
  3808. * @verbatim
  3809. CSL_SrioHandle hSrio;
  3810. Uint8 srcId;
  3811. // Open the CSL SRIO Module 0
  3812. hSrio = CSL_SRIO_Open (0);
  3813. ...
  3814. // Get the mapping for Priv ID 1
  3815. CSL_SRIO_GetAMUPrivIdToSourceIdMapping (hSrio, 1, &srcId);
  3816. ...
  3817. @endverbatim
  3818. * =============================================================================
  3819. */
  3820. static inline void CSL_SRIO_GetAMUPrivIdToSourceIdMapping
  3821. (
  3822. CSL_SrioHandle hSrio,
  3823. Uint8 privId,
  3824. Uint8* srcId
  3825. )
  3826. {
  3827. if (privId < 8)
  3828. {
  3829. *srcId = CSL_FEXTR (hSrio->RIO_AMU_SRCID_MAP[0], (privId << 2) + 3, (privId << 2));
  3830. }
  3831. else
  3832. {
  3833. privId = privId - 8;
  3834. *srcId = CSL_FEXTR (hSrio->RIO_AMU_SRCID_MAP[1], (privId << 2) + 3, (privId << 2));
  3835. }
  3836. }
  3837. /** ============================================================================
  3838. * @n@b CSL_SRIO_MapVBUSPriorityToRIO
  3839. *
  3840. * @b Description
  3841. * @n The function maps the VBUS Priority to RIO Priority.
  3842. *
  3843. * @b Arguments
  3844. @verbatim
  3845. hSrio Handle of the SRIO device
  3846. vbusPriority VBUS Priority which is to be mapped
  3847. priority RIO Priority to be mapped to.
  3848. @endverbatim
  3849. *
  3850. * <b> Return Value </b>
  3851. * @n None
  3852. *
  3853. * <b> Pre Condition </b>
  3854. * @n CSL_SRIO_Open() must be called
  3855. *
  3856. * <b> Post Condition </b>
  3857. * @n None
  3858. *
  3859. * @b Writes
  3860. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI0;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI1;
  3861. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI2;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI3;
  3862. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI4;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI5;
  3863. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI6;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI7
  3864. *
  3865. * @b Example
  3866. * @verbatim
  3867. CSL_SrioHandle hSrio;
  3868. // Open the CSL SRIO Module 0
  3869. hSrio = CSL_SRIO_Open (0);
  3870. ...
  3871. // Map the VBUS Priority 0 to CRITICAL Flow High Priority i.e. 7
  3872. CSL_SRIO_MapVBUSPriorityToRIO (hSrio, 0, 7);
  3873. ...
  3874. @endverbatim
  3875. * =============================================================================
  3876. */
  3877. static inline void CSL_SRIO_MapVBUSPriorityToRIO
  3878. (
  3879. CSL_SrioHandle hSrio,
  3880. Uint8 vbusPriority,
  3881. Uint8 priority
  3882. )
  3883. {
  3884. CSL_FINSR (hSrio->RIO_AMU_PRIORITY_MAP, (vbusPriority << 2) + 3, (vbusPriority << 2), priority);
  3885. }
  3886. /** ============================================================================
  3887. * @n@b CSL_SRIO_GetVBUSPriorityToRIOMapping
  3888. *
  3889. * @b Description
  3890. * @n The function gets the mapping between the VBUS Priority to RIO Priority.
  3891. *
  3892. * @b Arguments
  3893. @verbatim
  3894. hSrio Handle of the SRIO device
  3895. vbusPriority VBUS Priority for which the mapping is required.
  3896. priority Priority level populated by this API
  3897. @endverbatim
  3898. *
  3899. * <b> Return Value </b>
  3900. * @n None
  3901. *
  3902. * <b> Pre Condition </b>
  3903. * @n CSL_SRIO_Open() must be called
  3904. *
  3905. * <b> Post Condition </b>
  3906. * @n None
  3907. *
  3908. * @b Reads
  3909. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI0;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI1;
  3910. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI2;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI3;
  3911. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI4;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI5;
  3912. * @n SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI6;SRIO_RIO_AMU_PRIORITY_MAP_DMA_PRI7
  3913. *
  3914. * @b Example
  3915. * @verbatim
  3916. CSL_SrioHandle hSrio;
  3917. Uint8 priority;
  3918. // Open the CSL SRIO Module 0
  3919. hSrio = CSL_SRIO_Open (0);
  3920. ...
  3921. // Get the RIO Priority Level for VBUS Priority 0
  3922. CSL_SRIO_GetVBUSPriorityToRIOMapping (hSrio, 0, &priority);
  3923. ...
  3924. @endverbatim
  3925. * =============================================================================
  3926. */
  3927. static inline void CSL_SRIO_GetVBUSPriorityToRIOMapping
  3928. (
  3929. CSL_SrioHandle hSrio,
  3930. Uint8 vbusPriority,
  3931. Uint8* priority
  3932. )
  3933. {
  3934. *priority = CSL_FEXTR (hSrio->RIO_AMU_PRIORITY_MAP, (vbusPriority << 2) + 3, (vbusPriority << 2));
  3935. }
  3936. /** ============================================================================
  3937. * @n@b CSL_SRIO_GetAMUErrorCaptureInfo
  3938. *
  3939. * @b Description
  3940. * @n The function is used to get access to the AMU Error capture information.
  3941. *
  3942. * @b Arguments
  3943. @verbatim
  3944. hSrio Handle of the SRIO device
  3945. transAddress Transaction Address which caused the error.
  3946. privId Priv ID which caused the error
  3947. mstID Master ID which caused the error.
  3948. doorbellInfo Doorbell Info
  3949. @endverbatim
  3950. *
  3951. * <b> Return Value </b>
  3952. * @n None
  3953. *
  3954. * <b> Pre Condition </b>
  3955. * @n CSL_SRIO_Open() must be called
  3956. *
  3957. * <b> Post Condition </b>
  3958. * @n None
  3959. *
  3960. * @b Reads
  3961. * @n SRIO_RIO_AMU_CAPT0_MAP,SRIO_RIO_AMU_CAPT1_MAP_CPRIVID,
  3962. * SRIO_RIO_AMU_CAPT1_MAP_CMSTID,SRIO_RIO_AMU_CAPT1_MAP_DOORBELL_INFO
  3963. *
  3964. * @b Example
  3965. * @verbatim
  3966. CSL_SrioHandle hSrio;
  3967. Uint32 transAddress;
  3968. Uint8 privId;
  3969. Uint8 mstID;
  3970. Uint16 doorbellInfo;
  3971. // Open the CSL SRIO Module 0
  3972. hSrio = CSL_SRIO_Open (0);
  3973. ...
  3974. // Get the AMU Error Capture Information
  3975. CSL_SRIO_GetAMUErrorCaptureInfo (hSrio, &transAddress, &privId, &mstID, &doorbellInfo);
  3976. ...
  3977. @endverbatim
  3978. * =============================================================================
  3979. */
  3980. static inline void CSL_SRIO_GetAMUErrorCaptureInfo
  3981. (
  3982. CSL_SrioHandle hSrio,
  3983. Uint32* transAddress,
  3984. Uint8* privId,
  3985. Uint8* mstID,
  3986. Uint16* doorbellInfo
  3987. )
  3988. {
  3989. *transAddress = hSrio->RIO_AMU_CAPT0_MAP;
  3990. *privId = CSL_FEXT (hSrio->RIO_AMU_CAPT1_MAP, SRIO_RIO_AMU_CAPT1_MAP_CPRIVID);
  3991. *mstID = CSL_FEXT (hSrio->RIO_AMU_CAPT1_MAP, SRIO_RIO_AMU_CAPT1_MAP_CMSTID);
  3992. *doorbellInfo = CSL_FEXT (hSrio->RIO_AMU_CAPT1_MAP, SRIO_RIO_AMU_CAPT1_MAP_DOORBELL_INFO);
  3993. }
  3994. /** ============================================================================
  3995. * @n@b CSL_SRIO_SetAMUWindow
  3996. *
  3997. * @b Description
  3998. * @n The function configures the specific AMU Window register
  3999. *
  4000. * @b Arguments
  4001. @verbatim
  4002. hSrio Handle of the SRIO device
  4003. index AMU Window to be configured
  4004. amuWindow AMU Window Properties to be configured.
  4005. @endverbatim
  4006. *
  4007. * <b> Return Value </b>
  4008. * @n None
  4009. *
  4010. * <b> Pre Condition </b>
  4011. * @n CSL_SRIO_Open() must be called
  4012. *
  4013. * <b> Post Condition </b>
  4014. * @n None
  4015. *
  4016. * @b Writes
  4017. * @n SRIO_RIO_AMU_WINDOW_REG0_XAMBS,SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT,
  4018. * SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE,SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE,
  4019. * SRIO_RIO_AMU_WINDOW_REG1,SRIO_RIO_AMU_WINDOW_REG2
  4020. *
  4021. * @b Example
  4022. * @verbatim
  4023. CSL_SrioHandle hSrio;
  4024. SRIO_AMU_WINDOW amuWindow;
  4025. // Open the CSL SRIO Module 0
  4026. hSrio = CSL_SRIO_Open (0);
  4027. ...
  4028. // Configure the AMU Window Properties for AMU Window 1
  4029. CSL_SRIO_SetAMUWindow (hSrio, 1, &amuWindow);
  4030. ...
  4031. @endverbatim
  4032. * =============================================================================
  4033. */
  4034. static inline void CSL_SRIO_SetAMUWindow
  4035. (
  4036. CSL_SrioHandle hSrio,
  4037. Uint8 index,
  4038. SRIO_AMU_WINDOW* amuWindow
  4039. )
  4040. {
  4041. /* Configure the Window0 Register. */
  4042. hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG0 =
  4043. CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_XAMBS, amuWindow->xambs) |
  4044. CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT, amuWindow->paneCount) |
  4045. CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE, amuWindow->paneSize) |
  4046. CSL_FMK (SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE,amuWindow->winSize);
  4047. /* Configure the WINDOW1 and WINDOW2 registers. */
  4048. hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG1 = amuWindow->rapidIOMsb;
  4049. hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG2 = amuWindow->rapidIOLsb;
  4050. }
  4051. /** ============================================================================
  4052. * @n@b CSL_SRIO_GetAMUWindow
  4053. *
  4054. * @b Description
  4055. * @n The function gets the specific AMU Window register
  4056. *
  4057. * @b Arguments
  4058. @verbatim
  4059. hSrio Handle of the SRIO device
  4060. index AMU Window Index
  4061. amuWindow AMU Window Properties populated by this API
  4062. @endverbatim
  4063. *
  4064. * <b> Return Value </b>
  4065. * @n None
  4066. *
  4067. * <b> Pre Condition </b>
  4068. * @n CSL_SRIO_Open() must be called
  4069. *
  4070. * <b> Post Condition </b>
  4071. * @n None
  4072. *
  4073. * @b Reads
  4074. * @n SRIO_RIO_AMU_WINDOW_REG0_XAMBS,SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT,
  4075. * SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE,SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE,
  4076. * SRIO_RIO_AMU_WINDOW_REG1,SRIO_RIO_AMU_WINDOW_REG2
  4077. *
  4078. * @b Example
  4079. * @verbatim
  4080. CSL_SrioHandle hSrio;
  4081. SRIO_AMU_WINDOW amuWindow;
  4082. // Open the CSL SRIO Module 0
  4083. hSrio = CSL_SRIO_Open (0);
  4084. ...
  4085. // Get the AMU Window Properties for AMU Window 1
  4086. CSL_SRIO_GetAMUWindow (hSrio, 1, &amuWindow);
  4087. ...
  4088. @endverbatim
  4089. * =============================================================================
  4090. */
  4091. static inline void CSL_SRIO_GetAMUWindow
  4092. (
  4093. CSL_SrioHandle hSrio,
  4094. Uint8 index,
  4095. SRIO_AMU_WINDOW* amuWindow
  4096. )
  4097. {
  4098. Uint32 value = hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG0;
  4099. /* Get the Window0 Register. */
  4100. amuWindow->xambs = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_XAMBS);
  4101. amuWindow->paneCount = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_PANE_COUNT);
  4102. amuWindow->paneSize = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_PANE_SIZE);
  4103. amuWindow->winSize = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_REG0_WINDOW_SIZE);
  4104. /* Get the WINDOW1 and WINDOW2 registers. */
  4105. amuWindow->rapidIOMsb = hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG1;
  4106. amuWindow->rapidIOLsb = hSrio->AMU_WINDOW[index].RIO_AMU_WINDOW_REG2;
  4107. }
  4108. /** ============================================================================
  4109. * @n@b CSL_SRIO_SetAMUPane
  4110. *
  4111. * @b Description
  4112. * @n The function configures the specific AMU Pane
  4113. *
  4114. * @b Arguments
  4115. @verbatim
  4116. hSrio Handle of the SRIO device
  4117. index AMU Pane to be configured
  4118. amuPane AMU Pane Properties to be configured.
  4119. @endverbatim
  4120. *
  4121. * <b> Return Value </b>
  4122. * @n None
  4123. *
  4124. * <b> Pre Condition </b>
  4125. * @n CSL_SRIO_Open() must be called
  4126. *
  4127. * <b> Post Condition </b>
  4128. * @n None
  4129. *
  4130. * @b Writes
  4131. * @n SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC,SRIO_RIO_AMU_WINDOW_PANE_PORT_ID,
  4132. * SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE,SRIO_RIO_AMU_WINDOW_PANE_DESTID
  4133. *
  4134. * @b Example
  4135. * @verbatim
  4136. CSL_SrioHandle hSrio;
  4137. SRIO_AMU_PANE amuPane;
  4138. // Open the CSL SRIO Module 0
  4139. hSrio = CSL_SRIO_Open (0);
  4140. ...
  4141. // Configure the AMU Pane Properties for AMU Pane 1
  4142. CSL_SRIO_SetAMUPane (hSrio, 1, &amuPane);
  4143. ...
  4144. @endverbatim
  4145. * =============================================================================
  4146. */
  4147. static inline void CSL_SRIO_SetAMUPane
  4148. (
  4149. CSL_SrioHandle hSrio,
  4150. Uint8 index,
  4151. SRIO_AMU_PANE* amuPane
  4152. )
  4153. {
  4154. /* Configure the Pane Register. */
  4155. hSrio->RIO_AMU_WINDOW_PANE[index] =
  4156. CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC,amuPane->cmdEnc) |
  4157. CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_PORT_ID,amuPane->portId) |
  4158. CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE,amuPane->idSize) |
  4159. CSL_FMK (SRIO_RIO_AMU_WINDOW_PANE_DESTID, amuPane->dstID);
  4160. }
  4161. /** ============================================================================
  4162. * @n@b CSL_SRIO_GetAMUPane
  4163. *
  4164. * @b Description
  4165. * @n The function gets the specific AMU Pane properties
  4166. *
  4167. * @b Arguments
  4168. @verbatim
  4169. hSrio Handle of the SRIO device
  4170. index AMU Pane Index
  4171. amuPane AMU Pane Properties populated by this API
  4172. @endverbatim
  4173. *
  4174. * <b> Return Value </b>
  4175. * @n None
  4176. *
  4177. * <b> Pre Condition </b>
  4178. * @n CSL_SRIO_Open() must be called
  4179. *
  4180. * <b> Post Condition </b>
  4181. * @n None
  4182. *
  4183. * @b Reads
  4184. * @n SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC,SRIO_RIO_AMU_WINDOW_PANE_PORT_ID,
  4185. * SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE,SRIO_RIO_AMU_WINDOW_PANE_DESTID
  4186. *
  4187. * @b Example
  4188. * @verbatim
  4189. CSL_SrioHandle hSrio;
  4190. SRIO_AMU_PANE amuPane;
  4191. // Open the CSL SRIO Module 0
  4192. hSrio = CSL_SRIO_Open (0);
  4193. ...
  4194. // Get the AMU Pane Properties for AMU Pane 2
  4195. CSL_SRIO_GetAMUPane (hSrio, 2, &amuPane);
  4196. ...
  4197. @endverbatim
  4198. * =============================================================================
  4199. */
  4200. static inline void CSL_SRIO_GetAMUPane
  4201. (
  4202. CSL_SrioHandle hSrio,
  4203. Uint8 index,
  4204. SRIO_AMU_PANE* amuPane
  4205. )
  4206. {
  4207. Uint32 value = hSrio->RIO_AMU_WINDOW_PANE[index];
  4208. /* Get the Pane properties. */
  4209. amuPane->cmdEnc = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_CMD_ENC);
  4210. amuPane->portId = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_PORT_ID);
  4211. amuPane->idSize = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_ID_SIZE);
  4212. amuPane->dstID = CSL_FEXT (value, SRIO_RIO_AMU_WINDOW_PANE_DESTID);
  4213. }
  4214. /** ============================================================================
  4215. * @n@b CSL_SRIO_SetAMUFlowMask
  4216. *
  4217. * @b Description
  4218. * @n The function configures the AMU Flow Mask
  4219. *
  4220. * @b Arguments
  4221. @verbatim
  4222. hSrio Handle of the SRIO device
  4223. flowMask Flow Mask to be configured.
  4224. @endverbatim
  4225. *
  4226. * <b> Return Value </b>
  4227. * @n None
  4228. *
  4229. * <b> Pre Condition </b>
  4230. * @n CSL_SRIO_Open() must be called
  4231. *
  4232. * <b> Post Condition </b>
  4233. * @n None
  4234. *
  4235. * @b Writes
  4236. * @n SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK
  4237. *
  4238. * @b Example
  4239. * @verbatim
  4240. CSL_SrioHandle hSrio;
  4241. // Open the CSL SRIO Module 0
  4242. hSrio = CSL_SRIO_Open (0);
  4243. ...
  4244. // Configure the AMU Flow Mask
  4245. CSL_SRIO_SetAMUFlowMask (hSrio, 0x0);
  4246. ...
  4247. @endverbatim
  4248. * =============================================================================
  4249. */
  4250. static inline void CSL_SRIO_SetAMUFlowMask
  4251. (
  4252. CSL_SrioHandle hSrio,
  4253. Uint16 flowMask
  4254. )
  4255. {
  4256. hSrio->RIO_AMU_FLOW_MASKS0 = CSL_FMK(SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK, flowMask);
  4257. }
  4258. /** ============================================================================
  4259. * @n@b CSL_SRIO_GetAMUFlowMask
  4260. *
  4261. * @b Description
  4262. * @n The function gets the AMU Flow Mask
  4263. *
  4264. * @b Arguments
  4265. @verbatim
  4266. hSrio Handle of the SRIO device
  4267. flowMask Flow Mask to be populated by this API.
  4268. @endverbatim
  4269. *
  4270. * <b> Return Value </b>
  4271. * @n None
  4272. *
  4273. * <b> Pre Condition </b>
  4274. * @n CSL_SRIO_Open() must be called
  4275. *
  4276. * <b> Post Condition </b>
  4277. * @n None
  4278. *
  4279. * @b Reads
  4280. * @n SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK
  4281. *
  4282. * @b Example
  4283. * @verbatim
  4284. CSL_SrioHandle hSrio;
  4285. Uint32 flowMask;
  4286. // Open the CSL SRIO Module 0
  4287. hSrio = CSL_SRIO_Open (0);
  4288. ...
  4289. // Get the AMU Flow Mask
  4290. CSL_SRIO_GetAMUFlowMask (hSrio, &flowMask);
  4291. ...
  4292. @endverbatim
  4293. * =============================================================================
  4294. */
  4295. static inline void CSL_SRIO_GetAMUFlowMask
  4296. (
  4297. CSL_SrioHandle hSrio,
  4298. Uint16* flowMask
  4299. )
  4300. {
  4301. *flowMask = CSL_FEXT(hSrio->RIO_AMU_FLOW_MASKS0, SRIO_RIO_AMU_FLOW_MASKS0_AMU_FLOW_MASK);
  4302. }
  4303. /** ============================================================================
  4304. * @n@b CSL_SRIO_SetLSUTransfer
  4305. *
  4306. * @b Description
  4307. * @n The function sets the specified LSU for a DIO Transfer.
  4308. *
  4309. * @b Arguments
  4310. @verbatim
  4311. hSrio Handle of the SRIO device
  4312. lsu LSU Number which is to be used for the transfer.
  4313. lsuTransfer LSU Transfer Information
  4314. @endverbatim
  4315. *
  4316. * <b> Return Value </b>
  4317. * @n None
  4318. *
  4319. * <b> Pre Condition </b>
  4320. * @n CSL_SRIO_Open() must be called
  4321. *
  4322. * <b> Post Condition </b>
  4323. * @n None
  4324. *
  4325. * @b Writes
  4326. * @n SRIO_RIO_LSU_REG0_RIO_ADDRESS_MSB,
  4327. * @n SRIO_RIO_LSU_REG1_RIO_ADDRESS_LSB,
  4328. * @n SRIO_RIO_LSU_REG2_DSP_ADDRESS,
  4329. * @n SRIO_RIO_LSU_REG3_BYTE_COUNT,SRIO_RIO_LSU_REG3_DRBLL_VALUE,
  4330. * @n SRIO_RIO_LSU_REG4_INT_REQ,SRIO_RIO_LSU_REG4_SUP_GINT,SRIO_RIO_LSU_REG4_XAMBS,
  4331. * @n SRIO_RIO_LSU_REG4_PRIORITY,SRIO_RIO_LSU_REG4_OUTPORTID,SRIO_RIO_LSU_REG4_ID_SIZE,
  4332. * @n SRIO_RIO_LSU_REG4_SRCID_MAP,SRIO_RIO_LSU_REG4_DESTID,
  4333. * @n SRIO_RIO_LSU_REG5_TTYPE,SRIO_RIO_LSU_REG5_FTYPE,SRIO_RIO_LSU_REG5_HOP_COUNT,
  4334. * SRIO_RIO_LSU_REG5_DRBLL_INFO
  4335. *
  4336. * @b Example
  4337. * @verbatim
  4338. CSL_SrioHandle hSrio;
  4339. SRIO_LSU_TRANSFER lsuTransfer;
  4340. // Open the CSL SRIO Module 0
  4341. hSrio = CSL_SRIO_Open (0);
  4342. ...
  4343. // Populate the Transfer Information.
  4344. lsuTransfer.rapidIOMSB = 0x0;
  4345. lsuTransfer.rapidIOLSB = (Uint32)&tx_buffer[0];
  4346. lsuTransfer.dspAddress = (Uint32)&rx_buffer[0];
  4347. lsuTransfer.bytecount = 256;
  4348. lsuTransfer.doorbellValid = 0;
  4349. lsuTransfer.intrRequest = 1;
  4350. lsuTransfer.supInt = 0;
  4351. lsuTransfer.xambs = 0;
  4352. lsuTransfer.priority = 2;
  4353. lsuTransfer.outPortID = 1;
  4354. lsuTransfer.idSize = 1;
  4355. lsuTransfer.srcIDMap = 0;
  4356. lsuTransfer.dstID = 0xDEAD;
  4357. lsuTransfer.ttype = 4;
  4358. lsuTransfer.ftype = 5;
  4359. lsuTransfer.hopCount = 0;
  4360. lsuTransfer.doorbellInfo = 0;
  4361. // Send the transfer on LSU 1
  4362. CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
  4363. ...
  4364. @endverbatim
  4365. * =============================================================================
  4366. */
  4367. static inline void CSL_SRIO_SetLSUTransfer
  4368. (
  4369. CSL_SrioHandle hSrio,
  4370. Uint8 lsu,
  4371. SRIO_LSU_TRANSFER* lsuTransfer
  4372. )
  4373. {
  4374. /* Configure the Source and Destination Address. */
  4375. hSrio->LSU_CMD[lsu].RIO_LSU_REG0 = lsuTransfer->rapidIOMSB;
  4376. hSrio->LSU_CMD[lsu].RIO_LSU_REG1 = lsuTransfer->rapidIOLSB;
  4377. hSrio->LSU_CMD[lsu].RIO_LSU_REG2 = lsuTransfer->dspAddress;
  4378. /* Configure the number of bytes which need to be transferred. */
  4379. hSrio->LSU_CMD[lsu].RIO_LSU_REG3 =
  4380. CSL_FMK (SRIO_RIO_LSU_REG3_BYTE_COUNT, lsuTransfer->bytecount) |
  4381. CSL_FMK (SRIO_RIO_LSU_REG3_DRBLL_VALUE,lsuTransfer->doorbellValid);
  4382. /* Configure outgoing port ID, Priority and other RIO parameters. */
  4383. hSrio->LSU_CMD[lsu].RIO_LSU_REG4 =
  4384. CSL_FMK(SRIO_RIO_LSU_REG4_INT_REQ, lsuTransfer->intrRequest) |
  4385. CSL_FMK(SRIO_RIO_LSU_REG4_SRCID_MAP, lsuTransfer->srcIDMap) |
  4386. CSL_FMK(SRIO_RIO_LSU_REG4_SUP_GINT, lsuTransfer->supInt) |
  4387. CSL_FMK(SRIO_RIO_LSU_REG4_DESTID, lsuTransfer->dstID) |
  4388. CSL_FMK(SRIO_RIO_LSU_REG4_ID_SIZE, lsuTransfer->idSize) |
  4389. CSL_FMK(SRIO_RIO_LSU_REG4_XAMBS, lsuTransfer->xambs) |
  4390. CSL_FMK(SRIO_RIO_LSU_REG4_PRIORITY, lsuTransfer->priority) |
  4391. CSL_FMK(SRIO_RIO_LSU_REG4_OUTPORTID, lsuTransfer->outPortID);
  4392. /* Configure the type of request, doorbell information etc. */
  4393. hSrio->LSU_CMD[lsu].RIO_LSU_REG5 =
  4394. CSL_FMK(SRIO_RIO_LSU_REG5_TTYPE, lsuTransfer->ttype) |
  4395. CSL_FMK(SRIO_RIO_LSU_REG5_FTYPE, lsuTransfer->ftype) |
  4396. CSL_FMK(SRIO_RIO_LSU_REG5_HOP_COUNT, lsuTransfer->hopCount) |
  4397. CSL_FMK(SRIO_RIO_LSU_REG5_DRBLL_INFO, lsuTransfer->doorbellInfo);
  4398. }
  4399. /** ============================================================================
  4400. * @n@b CSL_SRIO_SetLSUReg0
  4401. *
  4402. * @b Description
  4403. * @n The function configures the REG0 of the specified LSU
  4404. *
  4405. * @b Arguments
  4406. @verbatim
  4407. hSrio Handle of the SRIO device
  4408. lsu LSU Number
  4409. rapidIOMSB Address to be configured in the REG0
  4410. @endverbatim
  4411. *
  4412. * <b> Return Value </b>
  4413. * @n None
  4414. *
  4415. * <b> Pre Condition </b>
  4416. * @n CSL_SRIO_Open() must be called
  4417. *
  4418. * <b> Post Condition </b>
  4419. * @n None
  4420. *
  4421. * @b Writes
  4422. * @n SRIO_RIO_LSU_REG0_RIO_ADDRESS_MSB
  4423. *
  4424. * @b Example
  4425. * @verbatim
  4426. CSL_SrioHandle hSrio;
  4427. // Open the CSL SRIO Module 0
  4428. hSrio = CSL_SRIO_Open (0);
  4429. ...
  4430. // Configure REG0 of LSU 0
  4431. CSL_SRIO_SetLSUReg0(hSrio, 0, 0x0);
  4432. ...
  4433. @endverbatim
  4434. * =============================================================================
  4435. */
  4436. static inline void CSL_SRIO_SetLSUReg0
  4437. (
  4438. CSL_SrioHandle hSrio,
  4439. Uint8 lsu,
  4440. Uint32 rapidIOMSB
  4441. )
  4442. {
  4443. hSrio->LSU_CMD[lsu].RIO_LSU_REG0 = rapidIOMSB;
  4444. }
  4445. /** ============================================================================
  4446. * @n@b CSL_SRIO_SetLSUReg1
  4447. *
  4448. * @b Description
  4449. * @n The function configures the REG1 of the specified LSU
  4450. *
  4451. * @b Arguments
  4452. @verbatim
  4453. hSrio Handle of the SRIO device
  4454. lsu LSU Number
  4455. rapidIOLSB Address to be configured in the REG1
  4456. @endverbatim
  4457. *
  4458. * <b> Return Value </b>
  4459. * @n None
  4460. *
  4461. * <b> Pre Condition </b>
  4462. * @n CSL_SRIO_Open() must be called
  4463. *
  4464. * <b> Post Condition </b>
  4465. * @n None
  4466. *
  4467. * @b Writes
  4468. * @n SRIO_RIO_LSU_REG1_RIO_ADDRESS_LSB
  4469. *
  4470. * @b Example
  4471. * @verbatim
  4472. CSL_SrioHandle hSrio;
  4473. // Open the CSL SRIO Module 0
  4474. hSrio = CSL_SRIO_Open (0);
  4475. ...
  4476. // Configure REG1 of LSU 0
  4477. CSL_SRIO_SetLSUReg1(hSrio, 0, 0x0);
  4478. ...
  4479. @endverbatim
  4480. * =============================================================================
  4481. */
  4482. static inline void CSL_SRIO_SetLSUReg1
  4483. (
  4484. CSL_SrioHandle hSrio,
  4485. Uint8 lsu,
  4486. Uint32 rapidIOLSB
  4487. )
  4488. {
  4489. hSrio->LSU_CMD[lsu].RIO_LSU_REG1 = rapidIOLSB;
  4490. }
  4491. /** ============================================================================
  4492. * @n@b CSL_SRIO_SetLSUReg2
  4493. *
  4494. * @b Description
  4495. * @n The function configures the REG2 of the specified LSU
  4496. *
  4497. * @b Arguments
  4498. @verbatim
  4499. hSrio Handle of the SRIO device
  4500. lsu LSU Number
  4501. dspAddress Address to be configured in the REG2
  4502. @endverbatim
  4503. *
  4504. * <b> Return Value </b>
  4505. * @n None
  4506. *
  4507. * <b> Pre Condition </b>
  4508. * @n CSL_SRIO_Open() must be called
  4509. *
  4510. * <b> Post Condition </b>
  4511. * @n None
  4512. *
  4513. * @b Writes
  4514. * @n SRIO_RIO_LSU_REG2_DSP_ADDRESS
  4515. *
  4516. * @b Example
  4517. * @verbatim
  4518. CSL_SrioHandle hSrio;
  4519. // Open the CSL SRIO Module 0
  4520. hSrio = CSL_SRIO_Open (0);
  4521. ...
  4522. // Configure REG2 of LSU 0
  4523. CSL_SRIO_SetLSUReg2(hSrio, 0, &myBuffer);
  4524. ...
  4525. @endverbatim
  4526. * =============================================================================
  4527. */
  4528. static inline void CSL_SRIO_SetLSUReg2
  4529. (
  4530. CSL_SrioHandle hSrio,
  4531. Uint8 lsu,
  4532. Uint32 dspAddress
  4533. )
  4534. {
  4535. hSrio->LSU_CMD[lsu].RIO_LSU_REG2 = dspAddress;
  4536. }
  4537. /** ============================================================================
  4538. * @n@b CSL_SRIO_SetLSUReg3
  4539. *
  4540. * @b Description
  4541. * @n The function configures the REG3 of the specified LSU
  4542. *
  4543. * @b Arguments
  4544. @verbatim
  4545. hSrio Handle of the SRIO device
  4546. lsu LSU Number
  4547. byteCount Byte Count
  4548. doorbellValid Doorbell valid flag
  4549. @endverbatim
  4550. *
  4551. * <b> Return Value </b>
  4552. * @n None
  4553. *
  4554. * <b> Pre Condition </b>
  4555. * @n CSL_SRIO_Open() must be called
  4556. *
  4557. * <b> Post Condition </b>
  4558. * @n None
  4559. *
  4560. * @b Writes
  4561. * @n SRIO_RIO_LSU_REG3_BYTE_COUNT,SRIO_RIO_LSU_REG3_DRBLL_VALUE
  4562. *
  4563. * @b Example
  4564. * @verbatim
  4565. CSL_SrioHandle hSrio;
  4566. // Open the CSL SRIO Module 0
  4567. hSrio = CSL_SRIO_Open (0);
  4568. ...
  4569. // Configure REG3 of LSU 0
  4570. CSL_SRIO_SetLSUReg3(hSrio, 0, 100, 1);
  4571. ...
  4572. @endverbatim
  4573. * =============================================================================
  4574. */
  4575. static inline void CSL_SRIO_SetLSUReg3
  4576. (
  4577. CSL_SrioHandle hSrio,
  4578. Uint8 lsu,
  4579. Uint32 byteCount,
  4580. Uint8 doorbellValid
  4581. )
  4582. {
  4583. hSrio->LSU_CMD[lsu].RIO_LSU_REG3 =
  4584. CSL_FMK (SRIO_RIO_LSU_REG3_BYTE_COUNT, byteCount) |
  4585. CSL_FMK (SRIO_RIO_LSU_REG3_DRBLL_VALUE,doorbellValid);
  4586. }
  4587. /** ============================================================================
  4588. * @n@b CSL_SRIO_SetLSUReg4
  4589. *
  4590. * @b Description
  4591. * @n The function configures the REG4 of the specified LSU
  4592. *
  4593. * @b Arguments
  4594. @verbatim
  4595. hSrio Handle of the SRIO device
  4596. lsu LSU Number
  4597. byteCount Byte Count
  4598. doorbellValid Doorbell valid flag
  4599. @endverbatim
  4600. *
  4601. * <b> Return Value </b>
  4602. * @n None
  4603. *
  4604. * <b> Pre Condition </b>
  4605. * @n CSL_SRIO_Open() must be called
  4606. *
  4607. * <b> Post Condition </b>
  4608. * @n None
  4609. *
  4610. * @b Writes
  4611. * @n SRIO_RIO_LSU_REG4_DESTID, SRIO_RIO_LSU_REG4_SRCID_MAP, SRIO_RIO_LSU_REG4_ID_SIZE,
  4612. * @n SRIO_RIO_LSU_REG4_OUTPORTID, SRIO_RIO_LSU_REG4_PRIORITY, SRIO_RIO_LSU_REG4_XAMBS,
  4613. * @n SRIO_RIO_LSU_REG4_SUP_GINT, SRIO_RIO_LSU_REG4_INT_REQ
  4614. *
  4615. * @b Example
  4616. * @verbatim
  4617. CSL_SrioHandle hSrio;
  4618. // Open the CSL SRIO Module 0
  4619. hSrio = CSL_SRIO_Open (0);
  4620. ...
  4621. // Configure REG4 of LSU 0
  4622. CSL_SRIO_SetLSUReg4(hSrio, 0, 0xBEEF, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0);
  4623. ...
  4624. @endverbatim
  4625. * =============================================================================
  4626. */
  4627. static inline void CSL_SRIO_SetLSUReg4
  4628. (
  4629. CSL_SrioHandle hSrio,
  4630. Uint8 lsu,
  4631. Uint16 dstId,
  4632. Uint8 srcIdMap,
  4633. Uint8 idSize,
  4634. Uint8 outPortId,
  4635. Uint8 priority,
  4636. Uint8 xambs,
  4637. Uint8 supGoodInt,
  4638. Uint8 intRequest
  4639. )
  4640. {
  4641. hSrio->LSU_CMD[lsu].RIO_LSU_REG4 =
  4642. CSL_FMK(SRIO_RIO_LSU_REG4_INT_REQ, intRequest) |
  4643. CSL_FMK(SRIO_RIO_LSU_REG4_SRCID_MAP, srcIdMap) |
  4644. CSL_FMK(SRIO_RIO_LSU_REG4_SUP_GINT, supGoodInt) |
  4645. CSL_FMK(SRIO_RIO_LSU_REG4_DESTID, dstId) |
  4646. CSL_FMK(SRIO_RIO_LSU_REG4_ID_SIZE, idSize) |
  4647. CSL_FMK(SRIO_RIO_LSU_REG4_XAMBS, xambs) |
  4648. CSL_FMK(SRIO_RIO_LSU_REG4_PRIORITY, priority) |
  4649. CSL_FMK(SRIO_RIO_LSU_REG4_OUTPORTID, outPortId);
  4650. }
  4651. /** ============================================================================
  4652. * @n@b CSL_SRIO_SetLSUReg5
  4653. *
  4654. * @b Description
  4655. * @n The function configures the REG5 of the specified LSU
  4656. *
  4657. * @b Arguments
  4658. @verbatim
  4659. hSrio Handle of the SRIO device
  4660. lsu LSU Number
  4661. ttype TTYPE value
  4662. ftype FTYPE value
  4663. hopCount Hop Count
  4664. doorBellInfo Doorbell Information
  4665. @endverbatim
  4666. *
  4667. * <b> Return Value </b>
  4668. * @n None
  4669. *
  4670. * <b> Pre Condition </b>
  4671. * @n CSL_SRIO_Open() must be called
  4672. *
  4673. * <b> Post Condition </b>
  4674. * @n None
  4675. *
  4676. * @b Writes
  4677. * @n SRIO_RIO_LSU_REG5_TTYPE, SRIO_RIO_LSU_REG5_FTYPE,
  4678. * @n SRIO_RIO_LSU_REG5_HOP_COUNT, SRIO_RIO_LSU_REG5_DRBLL_INFO
  4679. *
  4680. * @b Example
  4681. * @verbatim
  4682. CSL_SrioHandle hSrio;
  4683. // Open the CSL SRIO Module 0
  4684. hSrio = CSL_SRIO_Open (0);
  4685. ...
  4686. // Configure REG5 of LSU 0
  4687. CSL_SRIO_SetLSUReg5(hSrio, 0, 4, 5, 1, 0);
  4688. ...
  4689. @endverbatim
  4690. * =============================================================================
  4691. */
  4692. static inline void CSL_SRIO_SetLSUReg5
  4693. (
  4694. CSL_SrioHandle hSrio,
  4695. Uint8 lsu,
  4696. Uint8 ttype,
  4697. Uint8 ftype,
  4698. Uint8 hopCount,
  4699. Uint16 doorbellInfo
  4700. )
  4701. {
  4702. hSrio->LSU_CMD[lsu].RIO_LSU_REG5 =
  4703. CSL_FMK(SRIO_RIO_LSU_REG5_TTYPE, ttype) |
  4704. CSL_FMK(SRIO_RIO_LSU_REG5_FTYPE, ftype) |
  4705. CSL_FMK(SRIO_RIO_LSU_REG5_HOP_COUNT, hopCount) |
  4706. CSL_FMK(SRIO_RIO_LSU_REG5_DRBLL_INFO, doorbellInfo);
  4707. }
  4708. /** ============================================================================
  4709. * @n@b CSL_SRIO_IsLSUFull
  4710. *
  4711. * @b Description
  4712. * @n The function checks if the specific LSU is BUSY or not?
  4713. *
  4714. * @b Arguments
  4715. @verbatim
  4716. hSrio Handle of the SRIO device
  4717. lsu LSU Number which is to checked
  4718. @endverbatim
  4719. *
  4720. * <b> Return Value </b>
  4721. * @n TRUE - All the LSU Shadow Registers are being used
  4722. * @n FALSE - There is space in the LSU Shadow Registers
  4723. *
  4724. * <b> Pre Condition </b>
  4725. * @n CSL_SRIO_Open() must be called
  4726. *
  4727. * <b> Post Condition </b>
  4728. * @n None
  4729. *
  4730. * @b Reads
  4731. * @n SRIO_RIO_LSU_REG6_FULL
  4732. *
  4733. * @b Example
  4734. * @verbatim
  4735. CSL_SrioHandle hSrio;
  4736. SRIO_LSU_TRANSFER lsuTransfer;
  4737. // Open the CSL SRIO Module 0
  4738. hSrio = CSL_SRIO_Open (0);
  4739. ...
  4740. // Wait around till there is space to write
  4741. while (1)
  4742. {
  4743. if (CSL_SRIO_IsLSUFull (hSrio, 1) == FALSE)
  4744. break;
  4745. }
  4746. // Populate the Transfer Information.
  4747. lsuTransfer.rapidIOMSB = 0x0;
  4748. lsuTransfer.rapidIOLSB = (Uint32)&tx_buffer[0];
  4749. lsuTransfer.dspAddress = (Uint32)&rx_buffer[0];
  4750. lsuTransfer.bytecount = 256;
  4751. lsuTransfer.doorbellValid = 0;
  4752. lsuTransfer.intrRequest = 1;
  4753. lsuTransfer.supInt = 0;
  4754. lsuTransfer.xambs = 0;
  4755. lsuTransfer.priority = 2;
  4756. lsuTransfer.outPortID = 1;
  4757. lsuTransfer.idSize = 1;
  4758. lsuTransfer.srcIDMap = 0;
  4759. lsuTransfer.dstID = 0xDEAD;
  4760. lsuTransfer.ttype = 4;
  4761. lsuTransfer.ftype = 5;
  4762. lsuTransfer.hopCount = 0;
  4763. lsuTransfer.doorbellInfo = 0;
  4764. // Send the transfer on LSU 1
  4765. CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
  4766. @endverbatim
  4767. * =============================================================================
  4768. */
  4769. static inline Bool CSL_SRIO_IsLSUFull
  4770. (
  4771. CSL_SrioHandle hSrio,
  4772. Uint8 lsu
  4773. )
  4774. {
  4775. if (CSL_FEXT(hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_FULL) == 1)
  4776. return TRUE;
  4777. return FALSE;
  4778. }
  4779. /** ============================================================================
  4780. * @n@b CSL_SRIO_IsLSUBusy
  4781. *
  4782. * @b Description
  4783. * @n The function checks if the specific LSU is BUSY or not?
  4784. *
  4785. * @b Arguments
  4786. @verbatim
  4787. hSrio Handle of the SRIO device
  4788. lsu LSU Number which is to checked
  4789. @endverbatim
  4790. *
  4791. * <b> Return Value </b>
  4792. * @n TRUE - LSU is Busy
  4793. * @n FALSE - LSU is Free
  4794. *
  4795. * <b> Pre Condition </b>
  4796. * @n CSL_SRIO_Open() must be called
  4797. *
  4798. * <b> Post Condition </b>
  4799. * @n None
  4800. *
  4801. * @b Reads
  4802. * @n SRIO_RIO_LSU_REG6_BUSY
  4803. *
  4804. * @b Example
  4805. * @verbatim
  4806. CSL_SrioHandle hSrio;
  4807. SRIO_LSU_TRANSFER lsuTransfer;
  4808. // Open the CSL SRIO Module 0
  4809. hSrio = CSL_SRIO_Open (0);
  4810. ...
  4811. // Populate the Transfer Information.
  4812. lsuTransfer.rapidIOMSB = 0x0;
  4813. lsuTransfer.rapidIOLSB = (Uint32)&tx_buffer[0];
  4814. lsuTransfer.dspAddress = (Uint32)&rx_buffer[0];
  4815. lsuTransfer.bytecount = 256;
  4816. lsuTransfer.doorbellValid = 0;
  4817. lsuTransfer.intrRequest = 1;
  4818. lsuTransfer.supInt = 0;
  4819. lsuTransfer.xambs = 0;
  4820. lsuTransfer.priority = 2;
  4821. lsuTransfer.outPortID = 1;
  4822. lsuTransfer.idSize = 1;
  4823. lsuTransfer.srcIDMap = 0;
  4824. lsuTransfer.dstID = 0xDEAD;
  4825. lsuTransfer.ttype = 4;
  4826. lsuTransfer.ftype = 5;
  4827. lsuTransfer.hopCount = 0;
  4828. lsuTransfer.doorbellInfo = 0;
  4829. // Send the transfer on LSU 1
  4830. CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
  4831. // Wait around till the transfer is completed.
  4832. while (1)
  4833. {
  4834. if (CSL_SRIO_IsLSUBusy (hSrio, 1) == FALSE)
  4835. break;
  4836. }
  4837. // Control comes here indicating that the transfer was completed.
  4838. ...
  4839. @endverbatim
  4840. * =============================================================================
  4841. */
  4842. static inline Bool CSL_SRIO_IsLSUBusy
  4843. (
  4844. CSL_SrioHandle hSrio,
  4845. Uint8 lsu
  4846. )
  4847. {
  4848. if (CSL_FEXT(hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_BUSY) == 1)
  4849. return TRUE;
  4850. return FALSE;
  4851. }
  4852. /** ============================================================================
  4853. * @n@b CSL_SRIO_GetLSUContextTransaction
  4854. *
  4855. * @b Description
  4856. * @n The function gets the LSU Context bit which can be used by the
  4857. * transaction to identify if the context of the completion code is with
  4858. * respect to the current transaction or not
  4859. *
  4860. * @b Arguments
  4861. @verbatim
  4862. hSrio Handle of the SRIO device
  4863. lsu LSU Index
  4864. context Context Information populated by this API
  4865. transID Transaction ID populated by this API
  4866. @endverbatim
  4867. *
  4868. * <b> Return Value </b>
  4869. * @n None
  4870. *
  4871. * <b> Pre Condition </b>
  4872. * @n CSL_SRIO_Open() must be called
  4873. *
  4874. * <b> Post Condition </b>
  4875. * @n None
  4876. *
  4877. * @b Reads
  4878. * @n SRIO_RIO_LSU_REG6_LCB,SRIO_RIO_LSU_REG6_LTID
  4879. *
  4880. * @b Example
  4881. * @verbatim
  4882. CSL_SrioHandle hSrio;
  4883. Uint8 context;
  4884. Uint8 transID;
  4885. // Open the CSL SRIO Module 0
  4886. hSrio = CSL_SRIO_Open (0);
  4887. ...
  4888. // Get the LSU Context and Transaction Information.
  4889. CSL_SRIO_GetLSUContextTransaction (hSrio, &context, &transID);
  4890. ...
  4891. @endverbatim
  4892. * =============================================================================
  4893. */
  4894. static inline void CSL_SRIO_GetLSUContextTransaction
  4895. (
  4896. CSL_SrioHandle hSrio,
  4897. Uint8 lsu,
  4898. Uint8* context,
  4899. Uint8* transID
  4900. )
  4901. {
  4902. Uint32 value = hSrio->LSU_CMD[lsu].RIO_LSU_REG6;
  4903. /* Populate the context and transaction identifier. */
  4904. *context = CSL_FEXT (value, SRIO_RIO_LSU_REG6_LCB);
  4905. *transID = CSL_FEXT (value, SRIO_RIO_LSU_REG6_LTID);
  4906. }
  4907. /** ============================================================================
  4908. * @n@b CSL_SRIO_CancelLSUTransaction
  4909. *
  4910. * @b Description
  4911. * @n The function is used to cancel an LSU Transaction previously submitted.
  4912. *
  4913. * @b Arguments
  4914. @verbatim
  4915. hSrio Handle of the SRIO device
  4916. lsu LSU Index
  4917. privID Priv ID of the original transaction submitter.
  4918. @endverbatim
  4919. *
  4920. * <b> Return Value </b>
  4921. * @n None
  4922. *
  4923. * <b> Pre Condition </b>
  4924. * @n CSL_SRIO_Open() must be called
  4925. *
  4926. * <b> Post Condition </b>
  4927. * @n None
  4928. *
  4929. * @b Writes
  4930. * @n SRIO_RIO_LSU_REG6_CBUSY = 1,
  4931. * @n SRIO_RIO_LSU_REG6_PRIVID
  4932. *
  4933. * @b Example
  4934. * @verbatim
  4935. CSL_SrioHandle hSrio;
  4936. // Open the CSL SRIO Module 0
  4937. hSrio = CSL_SRIO_Open (0);
  4938. ...
  4939. // Cancel the LSU Transaction for LSU 0 for PRIV-ID 1
  4940. CSL_SRIO_CancelLSUTransaction (hSrio, 0, 1);
  4941. ...
  4942. @endverbatim
  4943. * =============================================================================
  4944. */
  4945. static inline void CSL_SRIO_CancelLSUTransaction
  4946. (
  4947. CSL_SrioHandle hSrio,
  4948. Uint8 lsu,
  4949. Uint8 privID
  4950. )
  4951. {
  4952. hSrio->LSU_CMD[lsu].RIO_LSU_REG6 =
  4953. CSL_FMK(SRIO_RIO_LSU_REG6_CBUSY, 1) |
  4954. CSL_FMK(SRIO_RIO_LSU_REG6_PRIVID, privID);
  4955. }
  4956. /** ============================================================================
  4957. * @n@b CSL_SRIO_RestartLSUTransaction
  4958. *
  4959. * @b Description
  4960. * @n The function is used to restart an LSU Transaction which had been halted
  4961. * due to an error condition.
  4962. *
  4963. * @b Arguments
  4964. @verbatim
  4965. hSrio Handle of the SRIO device
  4966. lsu LSU Index which needs to be restarted
  4967. @endverbatim
  4968. *
  4969. * <b> Return Value </b>
  4970. * @n None
  4971. *
  4972. * <b> Pre Condition </b>
  4973. * @n CSL_SRIO_Open() must be called
  4974. *
  4975. * <b> Post Condition </b>
  4976. * @n None
  4977. *
  4978. * @b Writes
  4979. * @n SRIO_RIO_LSU_REG6_RESTART=1
  4980. *
  4981. * @b Example
  4982. * @verbatim
  4983. CSL_SrioHandle hSrio;
  4984. // Open the CSL SRIO Module 0
  4985. hSrio = CSL_SRIO_Open (0);
  4986. ...
  4987. // Restart the LSU transaction 1
  4988. CSL_SRIO_RestartLSUTransaction (hSrio, 1);
  4989. ...
  4990. @endverbatim
  4991. * =============================================================================
  4992. */
  4993. static inline void CSL_SRIO_RestartLSUTransaction
  4994. (
  4995. CSL_SrioHandle hSrio,
  4996. Uint8 lsu
  4997. )
  4998. {
  4999. hSrio->LSU_CMD[lsu].RIO_LSU_REG6 = CSL_FMK (SRIO_RIO_LSU_REG6_RESTART, 1);
  5000. }
  5001. /** ============================================================================
  5002. * @n@b CSL_SRIO_FlushLSUTransaction
  5003. *
  5004. * @b Description
  5005. * @n The function is used to flush an LSU Transaction previously submitted
  5006. * and which matches the SRCID specified here.
  5007. *
  5008. * @b Arguments
  5009. @verbatim
  5010. hSrio Handle of the SRIO device
  5011. lsu LSU Index which needs to be flushed
  5012. srcIDMap Source ID
  5013. @endverbatim
  5014. *
  5015. * <b> Return Value </b>
  5016. * @n None
  5017. *
  5018. * <b> Pre Condition </b>
  5019. * @n CSL_SRIO_Open() must be called
  5020. *
  5021. * <b> Post Condition </b>
  5022. * @n None
  5023. *
  5024. * @b Writes
  5025. * @n SRIO_RIO_LSU_REG6_SCRID_MAP, SRIO_RIO_LSU_REG6_FLUSH=1
  5026. *
  5027. * @b Example
  5028. * @verbatim
  5029. CSL_SrioHandle hSrio;
  5030. // Open the CSL SRIO Module 0
  5031. hSrio = CSL_SRIO_Open (0);
  5032. ...
  5033. // Flush the LSU transaction on LSU 1 with SRC ID 0x0
  5034. CSL_SRIO_FlushLSUTransaction (hSrio, 1, 0x0);
  5035. ...
  5036. @endverbatim
  5037. * =============================================================================
  5038. */
  5039. static inline void CSL_SRIO_FlushLSUTransaction
  5040. (
  5041. CSL_SrioHandle hSrio,
  5042. Uint8 lsu,
  5043. Uint8 srcIDMap
  5044. )
  5045. {
  5046. CSL_FINS (hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_SCRID_MAP, srcIDMap);
  5047. CSL_FINS (hSrio->LSU_CMD[lsu].RIO_LSU_REG6, SRIO_RIO_LSU_REG6_FLUSH, 1);
  5048. }
  5049. /** ============================================================================
  5050. * @n@b CSL_SRIO_SetLSUShadowRegs
  5051. *
  5052. * @b Description
  5053. * @n The function is used to configure the number of LSU Shadow Registers.
  5054. *
  5055. * @b Arguments
  5056. @verbatim
  5057. hSrio Handle of the SRIO device
  5058. shadowGrp0 Number of Shadow Registers associated with LSU0-3
  5059. shadowGrp1 Number of Shadow Registers associated with LSU4-7
  5060. @endverbatim
  5061. *
  5062. * <b> Return Value </b>
  5063. * @n None
  5064. *
  5065. * <b> Pre Condition </b>
  5066. * @n CSL_SRIO_Open() must be called
  5067. *
  5068. * <b> Post Condition </b>
  5069. * @n None
  5070. *
  5071. * @b Writes
  5072. * @n SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP0, SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP1
  5073. *
  5074. * @b Example
  5075. * @verbatim
  5076. CSL_SrioHandle hSrio;
  5077. // Open the CSL SRIO Module 0
  5078. hSrio = CSL_SRIO_Open (0);
  5079. ...
  5080. // Set the LSU Shadow Regs as 4 for LSU 0-3 and 4 for LSU 4-7
  5081. CSL_SRIO_SetLSUShadowRegs (hSrio, 0x0, 0x0);
  5082. ...
  5083. @endverbatim
  5084. * =============================================================================
  5085. */
  5086. static inline void CSL_SRIO_SetLSUShadowRegs
  5087. (
  5088. CSL_SrioHandle hSrio,
  5089. Uint32 shadowGrp0,
  5090. Uint32 shadowGrp1
  5091. )
  5092. {
  5093. hSrio->RIO_LSU_SETUP_REG0 = CSL_FMK(SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP0, shadowGrp0) |
  5094. CSL_FMK(SRIO_RIO_LSU_SETUP_REG0_SHADOW_GRP1, shadowGrp1);
  5095. }
  5096. /** ============================================================================
  5097. * @n@b CSL_SRIO_GetLSUShadowRegs
  5098. *
  5099. * @b Description
  5100. * @n The function is used to get the number of shadow registers associated
  5101. * with each LSU.
  5102. *
  5103. * @b Arguments
  5104. @verbatim
  5105. hSrio Handle of the SRIO device
  5106. lsu LSU Index for which the count is required
  5107. count Number of Shadow Registers associated with the specified LSU
  5108. populated by this API
  5109. @endverbatim
  5110. *
  5111. * <b> Return Value </b>
  5112. * @n None
  5113. *
  5114. * <b> Pre Condition </b>
  5115. * @n CSL_SRIO_Open() must be called
  5116. *
  5117. * <b> Post Condition </b>
  5118. * @n None
  5119. *
  5120. * @b Reads
  5121. * @n SRIO_RIO_LSU_SETUP_REG0_LSU0_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU1_CNT;
  5122. * SRIO_RIO_LSU_SETUP_REG0_LSU2_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU3_CNT;
  5123. * SRIO_RIO_LSU_SETUP_REG0_LSU4_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU5_CNT;
  5124. * SRIO_RIO_LSU_SETUP_REG0_LSU6_CNT;SRIO_RIO_LSU_SETUP_REG0_LSU7_CNT
  5125. *
  5126. * @b Example
  5127. * @verbatim
  5128. CSL_SrioHandle hSrio;
  5129. Uint8 count;
  5130. // Open the CSL SRIO Module 0
  5131. hSrio = CSL_SRIO_Open (0);
  5132. ...
  5133. // Get the number of shadow register for LSU 1
  5134. CSL_SRIO_GetLSUShadowRegs (hSrio, 1, &count);
  5135. ...
  5136. @endverbatim
  5137. * =============================================================================
  5138. */
  5139. static inline void CSL_SRIO_GetLSUShadowRegs
  5140. (
  5141. CSL_SrioHandle hSrio,
  5142. Uint8 index,
  5143. Uint8* count
  5144. )
  5145. {
  5146. if (index == 0)
  5147. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU0_CNT);
  5148. else if (index == 1)
  5149. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU1_CNT);
  5150. else if (index == 2)
  5151. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU2_CNT);
  5152. else if (index == 3)
  5153. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU3_CNT);
  5154. else if (index == 4)
  5155. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU4_CNT);
  5156. else if (index == 5)
  5157. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU5_CNT);
  5158. else if (index == 6)
  5159. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU6_CNT);
  5160. else if (index == 7)
  5161. *count = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG0, SRIO_RIO_LSU_SETUP_REG0_LSU7_CNT);
  5162. }
  5163. /** ============================================================================
  5164. * @n@b CSL_SRIO_EnableSrcIDInterrupts
  5165. *
  5166. * @b Description
  5167. * @n The function is used to enable the LSU interrupts to based on the SRCID
  5168. * and not on the LSU specific interrupt bit.
  5169. *
  5170. * @b Arguments
  5171. @verbatim
  5172. hSrio Handle of the SRIO device
  5173. index LSU Index to be configured.
  5174. @endverbatim
  5175. *
  5176. * <b> Return Value </b>
  5177. * @n None
  5178. *
  5179. * <b> Pre Condition </b>
  5180. * @n CSL_SRIO_Open() must be called
  5181. *
  5182. * <b> Post Condition </b>
  5183. * @n None
  5184. *
  5185. * @b Writes
  5186. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;
  5187. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;
  5188. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=06;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0;
  5189. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=0
  5190. *
  5191. * @b Example
  5192. * @verbatim
  5193. CSL_SrioHandle hSrio;
  5194. // Open the CSL SRIO Module 0
  5195. hSrio = CSL_SRIO_Open (0);
  5196. ...
  5197. // Enable Source ID interrupts for LSU 1
  5198. CSL_SRIO_EnableSrcIDInterrupts (hSrio, 1);
  5199. ...
  5200. @endverbatim
  5201. * =============================================================================
  5202. */
  5203. static inline void CSL_SRIO_EnableSrcIDInterrupts
  5204. (
  5205. CSL_SrioHandle hSrio,
  5206. Uint8 index
  5207. )
  5208. {
  5209. if (index == 0)
  5210. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 0, 0, 0);
  5211. else if (index == 1)
  5212. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 1, 1, 0);
  5213. else if (index == 2)
  5214. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 2, 2, 0);
  5215. else if (index == 3)
  5216. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 3, 3, 0);
  5217. else if (index == 4)
  5218. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 4, 4, 0);
  5219. else if (index == 5)
  5220. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 5, 5, 0);
  5221. else if (index == 6)
  5222. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 6, 6, 0);
  5223. else if (index == 7)
  5224. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 7, 7, 0);
  5225. }
  5226. /** ============================================================================
  5227. * @n@b CSL_SRIO_DisableSrcIDInterrupts
  5228. *
  5229. * @b Description
  5230. * @n The function is used to enable the LSU interrupts to based on the LSU
  5231. * specific interrupt bit and not on the SRCID.
  5232. *
  5233. * @b Arguments
  5234. @verbatim
  5235. hSrio Handle of the SRIO device
  5236. index LSU Index to be configured.
  5237. @endverbatim
  5238. *
  5239. * <b> Return Value </b>
  5240. * @n None
  5241. *
  5242. * <b> Pre Condition </b>
  5243. * @n CSL_SRIO_Open() must be called
  5244. *
  5245. * <b> Post Condition </b>
  5246. * @n None
  5247. *
  5248. * @b Writes
  5249. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=1;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=2;
  5250. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=4;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=8;
  5251. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=16;SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=32;
  5252. * @n SRIO_RIO_LSU_SETUP_REG1_LSU_EDMA=64
  5253. *
  5254. * @b Example
  5255. * @verbatim
  5256. CSL_SrioHandle hSrio;
  5257. // Open the CSL SRIO Module 0
  5258. hSrio = CSL_SRIO_Open (0);
  5259. ...
  5260. // Disable SRC ID interrupts for LSU 2
  5261. CSL_SRIO_DisableSrcIDInterrupts (hSrio, 2);
  5262. ...
  5263. @endverbatim
  5264. * =============================================================================
  5265. */
  5266. static inline void CSL_SRIO_DisableSrcIDInterrupts
  5267. (
  5268. CSL_SrioHandle hSrio,
  5269. Uint8 index
  5270. )
  5271. {
  5272. if (index == 0)
  5273. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 0, 0, 1);
  5274. else if (index == 1)
  5275. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 1, 1, 1);
  5276. else if (index == 2)
  5277. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 2, 2, 1);
  5278. else if (index == 3)
  5279. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 3, 3, 1);
  5280. else if (index == 4)
  5281. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 4, 4, 1);
  5282. else if (index == 5)
  5283. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 5, 5, 1);
  5284. else if (index == 6)
  5285. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 6, 6, 1);
  5286. else if (index == 7)
  5287. CSL_FINSR (hSrio->RIO_LSU_SETUP_REG1, 7, 7, 1);
  5288. }
  5289. /** ============================================================================
  5290. * @n@b CSL_SRIO_SetTimeoutCnt
  5291. *
  5292. * @b Description
  5293. * @n The function is used to set the number of timecode changes after an error
  5294. * condition before the current LSU transaction is discarded and a new
  5295. * transaction is loaded from the shadow register.
  5296. *
  5297. * @b Arguments
  5298. @verbatim
  5299. hSrio Handle of the SRIO device
  5300. timeoutCnt Time out count to be configured.
  5301. @endverbatim
  5302. *
  5303. * <b> Return Value </b>
  5304. * @n None
  5305. *
  5306. * <b> Pre Condition </b>
  5307. * @n CSL_SRIO_Open() must be called
  5308. *
  5309. * <b> Post Condition </b>
  5310. * @n None
  5311. *
  5312. * @b Writes
  5313. * @n SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT
  5314. *
  5315. * @b Example
  5316. * @verbatim
  5317. CSL_SrioHandle hSrio;
  5318. // Open the CSL SRIO Module 0
  5319. hSrio = CSL_SRIO_Open (0);
  5320. ...
  5321. // Set the Timeout Count to be 1
  5322. CSL_SRIO_SetTimeoutCnt (hSrio, 2);
  5323. ...
  5324. @endverbatim
  5325. * =============================================================================
  5326. */
  5327. static inline void CSL_SRIO_SetTimeoutCnt
  5328. (
  5329. CSL_SrioHandle hSrio,
  5330. Uint8 timeoutCnt
  5331. )
  5332. {
  5333. CSL_FINS (hSrio->RIO_LSU_SETUP_REG1, SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT, timeoutCnt);
  5334. }
  5335. /** ============================================================================
  5336. * @n@b CSL_SRIO_GetTimeoutCnt
  5337. *
  5338. * @b Description
  5339. * @n The function is used to get the number of timecode changes after an error
  5340. * condition before the current LSU transaction is discarded and a new
  5341. * transaction is loaded from the shadow register.
  5342. *
  5343. * @b Arguments
  5344. @verbatim
  5345. hSrio Handle of the SRIO device
  5346. timeoutCnt Time out count to be populated by this API.
  5347. @endverbatim
  5348. *
  5349. * <b> Return Value </b>
  5350. * @n None
  5351. *
  5352. * <b> Pre Condition </b>
  5353. * @n CSL_SRIO_Open() must be called
  5354. *
  5355. * <b> Post Condition </b>
  5356. * @n None
  5357. *
  5358. * @b Reads
  5359. * @n SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT
  5360. *
  5361. * @b Example
  5362. * @verbatim
  5363. CSL_SrioHandle hSrio;
  5364. Uint8 timeoutCnt;
  5365. // Open the CSL SRIO Module 0
  5366. hSrio = CSL_SRIO_Open (0);
  5367. ...
  5368. // Get the Timeout Count
  5369. CSL_SRIO_GetTimeoutCnt (hSrio, &timeoutCnt);
  5370. ...
  5371. @endverbatim
  5372. * =============================================================================
  5373. */
  5374. static inline void CSL_SRIO_GetTimeoutCnt
  5375. (
  5376. CSL_SrioHandle hSrio,
  5377. Uint8* timeoutCnt
  5378. )
  5379. {
  5380. *timeoutCnt = CSL_FEXT (hSrio->RIO_LSU_SETUP_REG1, SRIO_RIO_LSU_SETUP_REG1_TIMEOUT_CNT);
  5381. }
  5382. /** ============================================================================
  5383. * @n@b CSL_SRIO_GetLSUCompletionCode
  5384. *
  5385. * @b Description
  5386. * @n The function gets the completion code for a previous executed transfer.
  5387. *
  5388. * @b Arguments
  5389. @verbatim
  5390. hSrio Handle of the SRIO device
  5391. lsu LSU Number which is to checked
  5392. transId Transaction ID for which the completion code is
  5393. required.
  5394. compCode Completion Code populated by this API
  5395. contextBit Context Bit populated by this API
  5396. @endverbatim
  5397. *
  5398. * <b> Return Value </b>
  5399. * @n None
  5400. *
  5401. * <b> Pre Condition </b>
  5402. * @n None
  5403. *
  5404. * <b> Post Condition </b>
  5405. * @n None
  5406. *
  5407. * @b Reads
  5408. * @n SRIO_LSU_STAT_REG
  5409. * @b Example
  5410. * @verbatim
  5411. CSL_SrioHandle hSrio;
  5412. Uint8 context;
  5413. Uint8 transID;
  5414. SRIO_LSU_TRANSFER lsuTransfer;
  5415. Uint8 compCode;
  5416. Uint8 contextBit;
  5417. // Open the CSL SRIO Module 0
  5418. hSrio = CSL_SRIO_Open (0);
  5419. ...
  5420. // Get the LSU Context and Transaction Information.
  5421. CSL_SRIO_GetLSUContextTransaction (hSrio, &context, &transID);
  5422. ...
  5423. // Send the transfer on LSU 1
  5424. CSL_SRIO_SetLSUTransfer (hSrio, 1, &lsuTransfer);
  5425. // Wait around till the transfer is completed.
  5426. while (1)
  5427. {
  5428. if (CSL_SRIO_IsLSUBusy (hSrio, 1) == FALSE)
  5429. break;
  5430. }
  5431. // Get the completion code.
  5432. CSL_SRIO_GetLSUCompletionCode (hSrio, 1, transID, &compCode, &contextBit);
  5433. ...
  5434. @endverbatim
  5435. * =============================================================================
  5436. */
  5437. static inline void CSL_SRIO_GetLSUCompletionCode
  5438. (
  5439. CSL_SrioHandle hSrio,
  5440. Uint8 lsu,
  5441. Uint8 transID,
  5442. Uint8* compCode,
  5443. Uint8* contextBit
  5444. )
  5445. {
  5446. Uint8 lsuRegIndex;
  5447. /* Check the LSU for which the completion code is required. */
  5448. if ((lsu == 0) || (lsu == 4))
  5449. {
  5450. /* LSU0 or LSU4: Determine which register index we need to access.
  5451. * For LSU0 the register index is 0 and 1; but for LSU4 the register index is 3 and 4 */
  5452. if (lsu == 0)
  5453. lsuRegIndex = 0;
  5454. else
  5455. lsuRegIndex = 3;
  5456. /* There are 9 pending LSU Transaction ID for this. */
  5457. if (transID < 8)
  5458. {
  5459. /* Transaction ID 0-7 are handled here. */
  5460. *compCode = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 3), ((transID << 2) + 1));
  5461. *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], (transID << 2), (transID << 2));
  5462. }
  5463. else
  5464. {
  5465. /* Transaction ID 8 is handled here. */
  5466. *compCode = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], 3, 1);
  5467. *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], 0, 0);
  5468. }
  5469. }
  5470. else if ((lsu == 1) || (lsu == 5))
  5471. {
  5472. /* LSU1 or LSU5: Determine which register index we need to access.
  5473. * For LSU1 the register index is 1; but for LSU5 the register index is 4 */
  5474. if (lsu == 1)
  5475. lsuRegIndex = 1;
  5476. else
  5477. lsuRegIndex = 4;
  5478. /* There are 6 pending LSU Transaction ID for this. */
  5479. *compCode = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 7), ((transID << 2) + 5));
  5480. *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 4), ((transID << 2) + 4));
  5481. }
  5482. else if ((lsu == 2) || (lsu == 6))
  5483. {
  5484. /* LSU2 or LSU6: Determine which register index we need to access.
  5485. * For LSU2 the register index is 1 and 2; but for LSU5 the register index is 4 and 5 */
  5486. if (lsu == 2)
  5487. lsuRegIndex = 1;
  5488. else
  5489. lsuRegIndex = 4;
  5490. /* There are 5 pending LSU Transaction ID for this. */
  5491. if (transID == 0)
  5492. {
  5493. /* Transaction ID 0 is handled here. */
  5494. *compCode = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], 31, 29);
  5495. *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], 28, 28);
  5496. }
  5497. else
  5498. {
  5499. /* Transaction ID 1-4 are handled here. */
  5500. *compCode = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], ((transID << 2) - 1), ((transID << 2) - 3));
  5501. *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex+1], ((transID << 2) - 4), ((transID << 2) - 4));
  5502. }
  5503. }
  5504. else if ((lsu == 3) || (lsu == 7))
  5505. {
  5506. /* LSU3 or LSU7: Determine which register index we need to access.
  5507. * For LSU3 the register index is 2; but for LSU5 the register index is 5 */
  5508. if (lsu == 3)
  5509. lsuRegIndex = 2;
  5510. else
  5511. lsuRegIndex = 5;
  5512. /* There are 4 pending LSU Transaction ID for this. */
  5513. *compCode = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 19), ((transID << 2) + 17));
  5514. *contextBit = CSL_FEXTR(hSrio->LSU_STAT_REG[lsuRegIndex], ((transID << 2) + 16), ((transID << 2) + 16));
  5515. }
  5516. }
  5517. /** ============================================================================
  5518. * @n@b CSL_SRIO_SetLSUFlowMask
  5519. *
  5520. * @b Description
  5521. * @n The function is used to set the LSU Flow Masks
  5522. *
  5523. * @b Arguments
  5524. @verbatim
  5525. hSrio Handle of the SRIO device
  5526. lsu LSU Number for which flow mask is to be configured
  5527. flowMask Flow Mask to be configured.
  5528. @endverbatim
  5529. *
  5530. * <b> Return Value </b>
  5531. * @n None
  5532. *
  5533. * <b> Pre Condition </b>
  5534. * @n CSL_SRIO_Open() must be called
  5535. *
  5536. * <b> Post Condition </b>
  5537. * @n None
  5538. *
  5539. * @b Writes
  5540. * @n SRIO_RIO_LSU_FLOW_MASKS_LSU_EVEN_FLOW_MASK;SRIO_RIO_LSU_FLOW_MASKS_LSU_ODD_FLOW_MASK
  5541. *
  5542. * @b Example
  5543. * @verbatim
  5544. CSL_SrioHandle hSrio;
  5545. // Open the CSL SRIO Module 0
  5546. hSrio = CSL_SRIO_Open (0);
  5547. ...
  5548. // Set the LSU Flow Mask for LSU 0 to use Flow 1
  5549. CSL_SRIO_SetLSUFlowMask (hSrio, 0, 1);
  5550. ...
  5551. @endverbatim
  5552. * =============================================================================
  5553. */
  5554. static inline void CSL_SRIO_SetLSUFlowMask
  5555. (
  5556. CSL_SrioHandle hSrio,
  5557. Uint8 lsu,
  5558. Uint16 flowMask
  5559. )
  5560. {
  5561. switch (lsu)
  5562. {
  5563. case 0:
  5564. {
  5565. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[0], 15, 0, flowMask);
  5566. break;
  5567. }
  5568. case 1:
  5569. {
  5570. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[0], 31, 16,flowMask);
  5571. break;
  5572. }
  5573. case 2:
  5574. {
  5575. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[1], 15, 0, flowMask);
  5576. break;
  5577. }
  5578. case 3:
  5579. {
  5580. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[1], 31, 16,flowMask);
  5581. break;
  5582. }
  5583. case 4:
  5584. {
  5585. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[2], 15, 0, flowMask);
  5586. break;
  5587. }
  5588. case 5:
  5589. {
  5590. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[2], 31, 16,flowMask);
  5591. break;
  5592. }
  5593. case 6:
  5594. {
  5595. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[3], 15, 0, flowMask);
  5596. break;
  5597. }
  5598. case 7:
  5599. {
  5600. CSL_FINSR(hSrio->RIO_LSU_FLOW_MASKS[3], 31, 16,flowMask);
  5601. break;
  5602. }
  5603. }
  5604. }
  5605. /** ============================================================================
  5606. * @n@b CSL_SRIO_GetLSUFlowMask
  5607. *
  5608. * @b Description
  5609. * @n The function is used to get the LSU Flow Masks
  5610. *
  5611. * @b Arguments
  5612. @verbatim
  5613. hSrio Handle of the SRIO device
  5614. lsu LSU Number for which flow mask is to be retreived.
  5615. flowMask Flow Mask to be populated by this API
  5616. @endverbatim
  5617. *
  5618. * <b> Return Value </b>
  5619. * @n None
  5620. *
  5621. * <b> Pre Condition </b>
  5622. * @n CSL_SRIO_Open() must be called
  5623. *
  5624. * <b> Post Condition </b>
  5625. * @n None
  5626. *
  5627. * @b Reads
  5628. * @n SRIO_RIO_LSU_FLOW_MASKS_LSU_FLOW_MASK
  5629. *
  5630. * @b Example
  5631. * @verbatim
  5632. CSL_SrioHandle hSrio;
  5633. Uint16 flowMask;
  5634. // Open the CSL SRIO Module 0
  5635. hSrio = CSL_SRIO_Open (0);
  5636. ...
  5637. // Get the LSU Flow Mask for LSU 0
  5638. CSL_SRIO_GetLSUFlowMask (hSrio, 0, &flowMask);
  5639. ...
  5640. @endverbatim
  5641. * =============================================================================
  5642. */
  5643. static inline void CSL_SRIO_GetLSUFlowMask
  5644. (
  5645. CSL_SrioHandle hSrio,
  5646. Uint8 lsu,
  5647. Uint16* flowMask
  5648. )
  5649. {
  5650. switch (lsu)
  5651. {
  5652. case 0:
  5653. {
  5654. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[0], 15, 0);
  5655. break;
  5656. }
  5657. case 1:
  5658. {
  5659. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[0], 31, 16);
  5660. break;
  5661. }
  5662. case 2:
  5663. {
  5664. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[1], 15, 0);
  5665. break;
  5666. }
  5667. case 3:
  5668. {
  5669. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[1], 31, 16);
  5670. break;
  5671. }
  5672. case 4:
  5673. {
  5674. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[2], 15, 0);
  5675. break;
  5676. }
  5677. case 5:
  5678. {
  5679. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[2], 31, 16);
  5680. break;
  5681. }
  5682. case 6:
  5683. {
  5684. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[3], 15, 0);
  5685. break;
  5686. }
  5687. case 7:
  5688. {
  5689. *flowMask = CSL_FEXTR(hSrio->RIO_LSU_FLOW_MASKS[3], 31, 16);
  5690. break;
  5691. }
  5692. }
  5693. }
  5694. /** ============================================================================
  5695. * @n@b CSL_SRIO_SetSupervisorPerms
  5696. *
  5697. * @b Description
  5698. * @n The function is used to set the supervisor permissions
  5699. *
  5700. * @b Arguments
  5701. @verbatim
  5702. hSrio Handle of the SRIO device
  5703. supervisor16ID 16 bit Supervisor ID
  5704. supervisor8ID 8 bit Supervisor ID
  5705. @endverbatim
  5706. *
  5707. * <b> Return Value </b>
  5708. * @n None
  5709. *
  5710. * <b> Pre Condition </b>
  5711. * @n CSL_SRIO_Open() must be called
  5712. *
  5713. * <b> Post Condition </b>
  5714. * @n None
  5715. *
  5716. * @b Writes
  5717. * @n SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID,SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID
  5718. *
  5719. * @b Example
  5720. * @verbatim
  5721. CSL_SrioHandle hSrio;
  5722. // Open the CSL SRIO Module 0
  5723. hSrio = CSL_SRIO_Open (0);
  5724. ...
  5725. // Set the Supervisor Permissions for Source ID 0xBEEF
  5726. CSL_SRIO_SetSupervisorPerms (hSrio, 0xBEEF, 0x0);
  5727. ...
  5728. @endverbatim
  5729. * =============================================================================
  5730. */
  5731. static inline void CSL_SRIO_SetSupervisorPerms
  5732. (
  5733. CSL_SrioHandle hSrio,
  5734. Uint16 supervisor16ID,
  5735. Uint8 supervisor8ID
  5736. )
  5737. {
  5738. hSrio->RIO_SUPERVISOR_ID = CSL_FMK(SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID,supervisor16ID) |
  5739. CSL_FMK(SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID, supervisor8ID);
  5740. }
  5741. /** ============================================================================
  5742. * @n@b CSL_SRIO_GetSupervisorPerms
  5743. *
  5744. * @b Description
  5745. * @n The function is used to get the supervisor source ID.
  5746. *
  5747. * @b Arguments
  5748. @verbatim
  5749. hSrio Handle of the SRIO device
  5750. supervisor16ID 16 bit Supervisor ID populated by this API
  5751. supervisor8ID 8 bit Supervisor ID populated by this API
  5752. @endverbatim
  5753. *
  5754. * <b> Return Value </b>
  5755. * @n None
  5756. *
  5757. * <b> Pre Condition </b>
  5758. * @n CSL_SRIO_Open() must be called
  5759. *
  5760. * <b> Post Condition </b>
  5761. * @n None
  5762. *
  5763. * @b Reads
  5764. * @n SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID,SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID
  5765. *
  5766. * @b Example
  5767. * @verbatim
  5768. CSL_SrioHandle hSrio;
  5769. Uint8 super8ID;
  5770. Uint16 super16ID;
  5771. // Open the CSL SRIO Module 0
  5772. hSrio = CSL_SRIO_Open (0);
  5773. ...
  5774. // Get the Supervisor Permissions.
  5775. CSL_SRIO_GetSupervisorPerms (hSrio, &super16ID, &super8ID);
  5776. ...
  5777. @endverbatim
  5778. * =============================================================================
  5779. */
  5780. static inline void CSL_SRIO_GetSupervisorPerms
  5781. (
  5782. CSL_SrioHandle hSrio,
  5783. Uint16* supervisor16ID,
  5784. Uint8* supervisor8ID
  5785. )
  5786. {
  5787. *supervisor16ID = CSL_FEXT (hSrio->RIO_SUPERVISOR_ID, SRIO_RIO_SUPERVISOR_ID_16B_SUPRVSR_ID);
  5788. *supervisor8ID = CSL_FEXT (hSrio->RIO_SUPERVISOR_ID, SRIO_RIO_SUPERVISOR_ID_8B_SUPRVSR_ID);
  5789. }
  5790. /** ============================================================================
  5791. * @n@b CSL_SRIO_SetFlowControl
  5792. *
  5793. * @b Description
  5794. * @n The function is used to set the RIO flow control.
  5795. *
  5796. * @b Arguments
  5797. @verbatim
  5798. hSrio Handle of the SRIO device
  5799. flowControlIdx Flow Control Index which is to be configured.
  5800. tt Flag which defines 16 bit or 8 bit identifiers. Set to
  5801. 1 for 16 bit identifiers 0 for 8 bit.
  5802. dstID Destination ID matching the flow
  5803. @endverbatim
  5804. *
  5805. * <b> Return Value </b>
  5806. * @n None
  5807. *
  5808. * <b> Pre Condition </b>
  5809. * @n CSL_SRIO_Open() must be called
  5810. *
  5811. * <b> Post Condition </b>
  5812. * @n None
  5813. *
  5814. * @b Writes
  5815. * @n SRIO_RIO_FLOW_CNTL_TT, SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID
  5816. *
  5817. * @b Example
  5818. * @verbatim
  5819. CSL_SrioHandle hSrio;
  5820. // Open the CSL SRIO Module 0
  5821. hSrio = CSL_SRIO_Open (0);
  5822. ...
  5823. // Set the SRIO Flow Control 0 for Destination ID 0xBEEF
  5824. // since the destination ID is 16 bit we set the TT flag as 1
  5825. CSL_SRIO_SetFlowControl (hSrio, 0, 1, 0xBEEF);
  5826. ...
  5827. @endverbatim
  5828. * =============================================================================
  5829. */
  5830. static inline void CSL_SRIO_SetFlowControl
  5831. (
  5832. CSL_SrioHandle hSrio,
  5833. Uint8 flowControlIdx,
  5834. Uint8 tt,
  5835. Uint16 dstID
  5836. )
  5837. {
  5838. hSrio->RIO_FLOW_CNTL[flowControlIdx] = CSL_FMK(SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID,dstID) |
  5839. CSL_FMK(SRIO_RIO_FLOW_CNTL_TT, tt);
  5840. }
  5841. /** ============================================================================
  5842. * @n@b CSL_SRIO_GetFlowControl
  5843. *
  5844. * @b Description
  5845. * @n The function is used to get the RIO flow control.
  5846. *
  5847. * @b Arguments
  5848. @verbatim
  5849. hSrio Handle of the SRIO device
  5850. flowControlIdx Flow Control Index for which the configuration is required.
  5851. tt Flag which defines 16 bit or 8 bit identifiers populated by
  5852. the API
  5853. dstID Destination ID matching the flow populated by the API
  5854. @endverbatim
  5855. *
  5856. * <b> Return Value </b>
  5857. * @n None
  5858. *
  5859. * <b> Pre Condition </b>
  5860. * @n CSL_SRIO_Open() must be called
  5861. *
  5862. * <b> Post Condition </b>
  5863. * @n None
  5864. *
  5865. * @b Reads
  5866. * @n SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID,SRIO_RIO_FLOW_CNTL_TT
  5867. *
  5868. * @b Example
  5869. * @verbatim
  5870. CSL_SrioHandle hSrio;
  5871. Uint8 tt;
  5872. Uint16 dstID;
  5873. // Open the CSL SRIO Module 0
  5874. hSrio = CSL_SRIO_Open (0);
  5875. ...
  5876. // Get the SRIO Flow Control 0
  5877. CSL_SRIO_GetFlowControl (hSrio, 0, &tt, &dstID);
  5878. ...
  5879. @endverbatim
  5880. * =============================================================================
  5881. */
  5882. static inline void CSL_SRIO_GetFlowControl
  5883. (
  5884. CSL_SrioHandle hSrio,
  5885. Uint8 flowControlIdx,
  5886. Uint8* tt,
  5887. Uint16* dstID
  5888. )
  5889. {
  5890. Uint32 value = hSrio->RIO_FLOW_CNTL[flowControlIdx];
  5891. /* Extract the fields from the RIO Flow Control */
  5892. *dstID = CSL_FEXT(value, SRIO_RIO_FLOW_CNTL_FLOW_CNTL_ID);
  5893. *tt = CSL_FEXT(value, SRIO_RIO_FLOW_CNTL_TT);
  5894. }
  5895. /** ============================================================================
  5896. * @n@b CSL_SRIO_SetTxCPPIFlowMask
  5897. *
  5898. * @b Description
  5899. * @n The function is used to set the Transmit CPPI Flow Masks
  5900. *
  5901. * @b Arguments
  5902. @verbatim
  5903. hSrio Handle of the SRIO device
  5904. txCPPI Transmit CPPI Flow Index
  5905. flowMask Flow Mask to be configured.
  5906. @endverbatim
  5907. *
  5908. * <b> Return Value </b>
  5909. * @n None
  5910. *
  5911. * <b> Pre Condition </b>
  5912. * @n CSL_SRIO_Open() must be called
  5913. *
  5914. * <b> Post Condition </b>
  5915. * @n None
  5916. *
  5917. * @b Writes
  5918. * @n SRIO_RIO_TX_CPPI_FLOW_MASKS_TX_QUEUE_EVEN_FLOW_MASK;
  5919. * @n SRIO_RIO_TX_CPPI_FLOW_MASKS_TX_QUEUE_ODD_FLOW_MASK
  5920. *
  5921. * @b Example
  5922. * @verbatim
  5923. CSL_SrioHandle hSrio;
  5924. // Open the CSL SRIO Module 0
  5925. hSrio = CSL_SRIO_Open (0);
  5926. ...
  5927. // Set the Transmit CPPI Flow Mask for 0 to use Flow 1
  5928. CSL_SRIO_SetTxCPPIFlowMask (hSrio, 0, 1);
  5929. ...
  5930. @endverbatim
  5931. * =============================================================================
  5932. */
  5933. static inline void CSL_SRIO_SetTxCPPIFlowMask
  5934. (
  5935. CSL_SrioHandle hSrio,
  5936. Uint8 txCPPI,
  5937. Uint16 flowMask
  5938. )
  5939. {
  5940. switch (txCPPI)
  5941. {
  5942. case 0:
  5943. {
  5944. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 15, 0, flowMask);
  5945. break;
  5946. }
  5947. case 1:
  5948. {
  5949. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 31, 16, flowMask);
  5950. break;
  5951. }
  5952. case 2:
  5953. {
  5954. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 15, 0, flowMask);
  5955. break;
  5956. }
  5957. case 3:
  5958. {
  5959. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 31, 16, flowMask);
  5960. break;
  5961. }
  5962. case 4:
  5963. {
  5964. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 15, 0, flowMask);
  5965. break;
  5966. }
  5967. case 5:
  5968. {
  5969. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 31, 16, flowMask);
  5970. break;
  5971. }
  5972. case 6:
  5973. {
  5974. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 15, 0, flowMask);
  5975. break;
  5976. }
  5977. case 7:
  5978. {
  5979. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 31, 16, flowMask);
  5980. break;
  5981. }
  5982. case 8:
  5983. {
  5984. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 15, 0, flowMask);
  5985. break;
  5986. }
  5987. case 9:
  5988. {
  5989. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 31, 16, flowMask);
  5990. break;
  5991. }
  5992. case 10:
  5993. {
  5994. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 15, 0, flowMask);
  5995. break;
  5996. }
  5997. case 11:
  5998. {
  5999. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 31, 16, flowMask);
  6000. break;
  6001. }
  6002. case 12:
  6003. {
  6004. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 15, 0, flowMask);
  6005. break;
  6006. }
  6007. case 13:
  6008. {
  6009. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 31, 16, flowMask);
  6010. break;
  6011. }
  6012. case 14:
  6013. {
  6014. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 15, 0, flowMask);
  6015. break;
  6016. }
  6017. case 15:
  6018. {
  6019. CSL_FINSR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 31, 16, flowMask);
  6020. break;
  6021. }
  6022. }
  6023. }
  6024. /** ============================================================================
  6025. * @n@b CSL_SRIO_GetTxCPPIFlowMask
  6026. *
  6027. * @b Description
  6028. * @n The function is used to get the Transmit CPPI Flow Masks
  6029. *
  6030. * @b Arguments
  6031. @verbatim
  6032. hSrio Handle of the SRIO device
  6033. txCPPI Transmit CPPI Flow Index
  6034. flowMask Flow Mask to be populated by this API.
  6035. @endverbatim
  6036. *
  6037. * <b> Return Value </b>
  6038. * @n None
  6039. *
  6040. * <b> Pre Condition </b>
  6041. * @n CSL_SRIO_Open() must be called
  6042. *
  6043. * <b> Post Condition </b>
  6044. * @n None
  6045. *
  6046. * @b Reads
  6047. * @n SRIO_RIO_TX_CPPI_FLOW_MASKS_TX_QUEUE_FLOW_MASK
  6048. *
  6049. * @b Example
  6050. * @verbatim
  6051. CSL_SrioHandle hSrio;
  6052. Uint16 flowMask;
  6053. // Open the CSL SRIO Module 0
  6054. hSrio = CSL_SRIO_Open (0);
  6055. ...
  6056. // Get the Transmit CPPI Flow Mask for 0 to use Flow 1
  6057. CSL_SRIO_GetTxCPPIFlowMask (hSrio, 0, &flowMask);
  6058. ...
  6059. @endverbatim
  6060. * =============================================================================
  6061. */
  6062. static inline void CSL_SRIO_GetTxCPPIFlowMask
  6063. (
  6064. CSL_SrioHandle hSrio,
  6065. Uint8 txCPPI,
  6066. Uint16* flowMask
  6067. )
  6068. {
  6069. switch (txCPPI)
  6070. {
  6071. case 0:
  6072. {
  6073. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 15, 0);
  6074. break;
  6075. }
  6076. case 1:
  6077. {
  6078. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[0], 31, 16);
  6079. break;
  6080. }
  6081. case 2:
  6082. {
  6083. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 15, 0);
  6084. break;
  6085. }
  6086. case 3:
  6087. {
  6088. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[1], 31, 16);
  6089. break;
  6090. }
  6091. case 4:
  6092. {
  6093. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 15, 0);
  6094. break;
  6095. }
  6096. case 5:
  6097. {
  6098. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[2], 31, 16);
  6099. break;
  6100. }
  6101. case 6:
  6102. {
  6103. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 15, 0);
  6104. break;
  6105. }
  6106. case 7:
  6107. {
  6108. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[3], 31, 16);
  6109. break;
  6110. }
  6111. case 8:
  6112. {
  6113. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 15, 0);
  6114. break;
  6115. }
  6116. case 9:
  6117. {
  6118. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[4], 31, 16);
  6119. break;
  6120. }
  6121. case 10:
  6122. {
  6123. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 15, 0);
  6124. break;
  6125. }
  6126. case 11:
  6127. {
  6128. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[5], 31, 16);
  6129. break;
  6130. }
  6131. case 12:
  6132. {
  6133. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 15, 0);
  6134. break;
  6135. }
  6136. case 13:
  6137. {
  6138. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[6], 31, 16);
  6139. break;
  6140. }
  6141. case 14:
  6142. {
  6143. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 15, 0);
  6144. break;
  6145. }
  6146. case 15:
  6147. {
  6148. *flowMask = CSL_FEXTR(hSrio->RIO_TX_CPPI_FLOW_MASKS[7], 31, 16);
  6149. break;
  6150. }
  6151. }
  6152. }
  6153. /** ============================================================================
  6154. * @n@b CSL_SRIO_SetTxQueueSchedInfo
  6155. *
  6156. * @b Description
  6157. * @n The function is used to set the port and scheduler information for a
  6158. * specific transmit queue.
  6159. *
  6160. * @b Arguments
  6161. @verbatim
  6162. hSrio Handle of the SRIO device
  6163. txQueue Transmit Queue Index for which information is configured.
  6164. portNum Port Number to which the queue is mapped.
  6165. crf Critical Resource Flow Value
  6166. @endverbatim
  6167. *
  6168. * <b> Return Value </b>
  6169. * @n None
  6170. *
  6171. * <b> Pre Condition </b>
  6172. * @n CSL_SRIO_Open() must be called
  6173. *
  6174. * <b> Post Condition </b>
  6175. * @n None
  6176. *
  6177. * @b Writes
  6178. * @n SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
  6179. * SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
  6180. * SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
  6181. *
  6182. * @b Example
  6183. * @verbatim
  6184. CSL_SrioHandle hSrio;
  6185. // Open the CSL SRIO Module 0
  6186. hSrio = CSL_SRIO_Open (0);
  6187. ...
  6188. // Set the Tx Queue 0 Scheduler Information
  6189. // - The Queue needs to be mapped to SRIO Port 1
  6190. // - The Queue sets the CRF Bit.
  6191. CSL_SRIO_SetTxQueueSchedInfo (hSrio, 0, 1, 1);
  6192. ...
  6193. @endverbatim
  6194. * =============================================================================
  6195. */
  6196. static inline void CSL_SRIO_SetTxQueueSchedInfo
  6197. (
  6198. CSL_SrioHandle hSrio,
  6199. Uint8 txQueue,
  6200. Uint8 portNum,
  6201. Uint8 crf
  6202. )
  6203. {
  6204. if (txQueue < 4)
  6205. {
  6206. /* Transmit Queue 0, 1, 2 and 3 are handed in RIO_TX_QUEUE_SCH_INFO[0] */
  6207. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[0], (txQueue << 3), (txQueue << 3), crf);
  6208. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[0], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
  6209. }
  6210. else if (txQueue < 8)
  6211. {
  6212. /* Transmit Queue 4, 5, 6 and 7 are handed in RIO_TX_QUEUE_SCH_INFO[1] */
  6213. txQueue = txQueue - 4;
  6214. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[1], (txQueue << 3), (txQueue << 3), crf);
  6215. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[1], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
  6216. }
  6217. else if (txQueue < 12)
  6218. {
  6219. /* Transmit Queue 8, 9, 10 and 11 are handed in RIO_TX_QUEUE_SCH_INFO[2] */
  6220. txQueue = txQueue - 8;
  6221. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[2], (txQueue << 3), (txQueue << 3), crf);
  6222. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[2], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
  6223. }
  6224. else if (txQueue < 16)
  6225. {
  6226. /* Transmit Queue 12, 13, 14 and 15 are handed in RIO_TX_QUEUE_SCH_INFO[2] */
  6227. txQueue = txQueue - 12;
  6228. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[3], (txQueue << 3), (txQueue << 3), crf);
  6229. CSL_FINSR(hSrio->RIO_TX_QUEUE_SCH_INFO[3], (txQueue << 3) + 7, (txQueue << 3) + 4, portNum);
  6230. }
  6231. }
  6232. /** ============================================================================
  6233. * @n@b CSL_SRIO_GetTxQueueSchedInfo
  6234. *
  6235. * @b Description
  6236. * @n The function is used to get the port and scheduler information for a
  6237. * specific transmit queue.
  6238. *
  6239. * @b Arguments
  6240. @verbatim
  6241. hSrio Handle of the SRIO device
  6242. txQueue Transmit Queue Index for which information is configured.
  6243. portNum Port Number to which the queue is mapped populated by this API
  6244. priority Priority of the Transmit Queue populated by this API
  6245. crf Critical Resource Flow Value populated by this API
  6246. @endverbatim
  6247. *
  6248. * <b> Return Value </b>
  6249. * @n None
  6250. *
  6251. * <b> Pre Condition </b>
  6252. * @n CSL_SRIO_Open() must be called
  6253. *
  6254. * <b> Post Condition </b>
  6255. * @n None
  6256. *
  6257. * @b Reads
  6258. * @n SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
  6259. * SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
  6260. * SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE0_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE1_INFO,SRIO_RIO_TX_QUEUE_SCH_INFO_QUEUE2_INFO;
  6261. *
  6262. *
  6263. * @b Example
  6264. * @verbatim
  6265. CSL_SrioHandle hSrio;
  6266. Uint8 portNum;
  6267. Uint8 priority;
  6268. Uint8 crf;
  6269. // Open the CSL SRIO Module 0
  6270. hSrio = CSL_SRIO_Open (0);
  6271. ...
  6272. // Get the Tx Queue 1 Information.
  6273. CSL_SRIO_GetTxQueueSchedInfo (hSrio, 1, &portNum, &priority, &crf);
  6274. ...
  6275. @endverbatim
  6276. * =============================================================================
  6277. */
  6278. static inline void CSL_SRIO_GetTxQueueSchedInfo
  6279. (
  6280. CSL_SrioHandle hSrio,
  6281. Uint8 txQueue,
  6282. Uint8* portNum,
  6283. Uint8* priority,
  6284. Uint8* crf
  6285. )
  6286. {
  6287. Uint32 value;
  6288. if (txQueue < 4)
  6289. {
  6290. /* Transmit Queue 0, 1, 2 and 3 are handed in RIO_TX_QUEUE_SCH_INFO[0] */
  6291. value = hSrio->RIO_TX_QUEUE_SCH_INFO[0];
  6292. *crf = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
  6293. *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
  6294. *portNum = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
  6295. }
  6296. else if (txQueue < 8)
  6297. {
  6298. /* Transmit Queue 4, 5, 6 and 7 are handed in RIO_TX_QUEUE_SCH_INFO[1] */
  6299. txQueue = txQueue - 4;
  6300. value = hSrio->RIO_TX_QUEUE_SCH_INFO[1];
  6301. *crf = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
  6302. *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
  6303. *portNum = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
  6304. }
  6305. else if (txQueue < 12)
  6306. {
  6307. /* Transmit Queue 8, 9, 10 and 11 are handed in RIO_TX_QUEUE_SCH_INFO[2] */
  6308. txQueue = txQueue - 8;
  6309. value = hSrio->RIO_TX_QUEUE_SCH_INFO[2];
  6310. *crf = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
  6311. *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
  6312. *portNum = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
  6313. }
  6314. else if (txQueue < 16)
  6315. {
  6316. /* Transmit Queue 12, 13, 14 and 15 are handed in RIO_TX_QUEUE_SCH_INFO[3] */
  6317. txQueue = txQueue - 12;
  6318. value = hSrio->RIO_TX_QUEUE_SCH_INFO[3];
  6319. *crf = CSL_FEXTR(value, (txQueue << 3), (txQueue << 3));
  6320. *priority = CSL_FEXTR(value, (txQueue << 3) + 2, (txQueue << 3) + 1);
  6321. *portNum = CSL_FEXTR(value, (txQueue << 3) + 7, (txQueue << 3) + 4);
  6322. }
  6323. }
  6324. /** ============================================================================
  6325. * @n@b CSL_SRIO_SetTxGarbageCollectionInfo
  6326. *
  6327. * @b Description
  6328. * @n The function sets the Transmit Garbage collection information.
  6329. *
  6330. * @b Arguments
  6331. @verbatim
  6332. hSrio Handle of the SRIO device
  6333. qidLength Length mismatch between size in the UDI to be configured.
  6334. qidTimeout Timeout on receiving the segments to be configured.
  6335. qidRetry Excessive retries to be configured
  6336. qidTransErr Transaction Error to be configured
  6337. qidProg Programming Error queue to be configured
  6338. qidSsize Queue ID Ssize to be configured
  6339. @endverbatim
  6340. *
  6341. * <b> Return Value </b>
  6342. * @n None
  6343. *
  6344. * <b> Pre Condition </b>
  6345. * @n CSL_SRIO_Open() must be called
  6346. *
  6347. * <b> Post Condition </b>
  6348. * @n None
  6349. *
  6350. * @b Writes
  6351. * @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN,
  6352. * @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT,
  6353. * @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY,
  6354. * @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR,
  6355. * @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG,
  6356. * @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE
  6357. *
  6358. * @b Example
  6359. * @verbatim
  6360. CSL_SrioHandle hSrio;
  6361. // Open the CSL SRIO Module 0
  6362. hSrio = CSL_SRIO_Open (0);
  6363. ...
  6364. // Set the Transmit Garbage Collection Information.
  6365. CSL_SRIO_SetTxGarbageCollectionInfo (hSrio, 2, 3, 4, 5, 6, 10);
  6366. ...
  6367. @endverbatim
  6368. * =============================================================================
  6369. */
  6370. static inline void CSL_SRIO_SetTxGarbageCollectionInfo
  6371. (
  6372. CSL_SrioHandle hSrio,
  6373. Uint16 qidLength,
  6374. Uint16 qidTimeout,
  6375. Uint16 qidRetry,
  6376. Uint16 qidTransErr,
  6377. Uint16 qidProg,
  6378. Uint16 qidSsize
  6379. )
  6380. {
  6381. hSrio->RIO_GARBAGE_COLL_QID0 =
  6382. CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN, qidLength) |
  6383. CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT, qidTimeout);
  6384. hSrio->RIO_GARBAGE_COLL_QID1 =
  6385. CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY, qidRetry) |
  6386. CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR, qidTransErr);
  6387. hSrio->RIO_GARBAGE_COLL_QID2 =
  6388. CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG, qidProg) |
  6389. CSL_FMK (SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE, qidSsize);
  6390. }
  6391. /** ============================================================================
  6392. * @n@b CSL_SRIO_GetTxGarbageCollectionInfo
  6393. *
  6394. * @b Description
  6395. * @n The function gets the Transmit Garbage collection information. Descriptors
  6396. * are placed into the Garbage collection queue when there is an error
  6397. * response detected.
  6398. *
  6399. * @b Arguments
  6400. @verbatim
  6401. hSrio Handle of the SRIO device
  6402. qidLength Length mismatch between size in the UDI
  6403. packet and receieved payload populated by this API
  6404. qidTimeout Timeout on receiving the segments populated by this API
  6405. qidRetry Excessive retries populated by this API
  6406. qidTransErr Transaction Error populated by this API
  6407. qidProg Programming error queue read
  6408. qidSsize Queue ID Ssize populated by this API
  6409. @endverbatim
  6410. *
  6411. * <b> Return Value </b>
  6412. * @n None
  6413. *
  6414. * <b> Pre Condition </b>
  6415. * @n CSL_SRIO_Open() must be called
  6416. *
  6417. * <b> Post Condition </b>
  6418. * @n None
  6419. *
  6420. * @b Reads
  6421. * @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN,
  6422. * @n SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT,
  6423. * @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY,
  6424. * @n SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR,
  6425. * @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG,
  6426. * @n SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE
  6427. *
  6428. * @b Example
  6429. * @verbatim
  6430. CSL_SrioHandle hSrio;
  6431. Uint16 qidLength;
  6432. Uint16 qidTimeout;
  6433. Uint16 qidRetry;
  6434. Uint16 qidTransErr;
  6435. Uint16 qidProg;
  6436. Uint16 qidSsize;
  6437. // Open the CSL SRIO Module 0
  6438. hSrio = CSL_SRIO_Open (0);
  6439. ...
  6440. // Get the Transmit Garbage Collection Information.
  6441. CSL_SRIO_GetTxGarbageCollectionInfo (hSrio, &qidLength, &qidTimeout,
  6442. &qidRetry, &qidTransErr, &qidProg, &qidSsize);
  6443. ...
  6444. @endverbatim
  6445. * =============================================================================
  6446. */
  6447. static inline void CSL_SRIO_GetTxGarbageCollectionInfo
  6448. (
  6449. CSL_SrioHandle hSrio,
  6450. Uint16* qidLength,
  6451. Uint16* qidTimeout,
  6452. Uint16* qidRetry,
  6453. Uint16* qidTransErr,
  6454. Uint16* qidProg,
  6455. Uint16* qidSsize
  6456. )
  6457. {
  6458. *qidLength = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID0, SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_LEN);
  6459. *qidTimeout = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID0, SRIO_RIO_GARBAGE_COLL_QID0_GARBAGE_QID_TOUT);
  6460. *qidRetry = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID1, SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_RETRY);
  6461. *qidTransErr= CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID1, SRIO_RIO_GARBAGE_COLL_QID1_GARBAGE_QID_TRANS_ERR);
  6462. *qidProg = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID2, SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_PROG);
  6463. *qidSsize = CSL_FEXT (hSrio->RIO_GARBAGE_COLL_QID2, SRIO_RIO_GARBAGE_COLL_QID2_GARBAGE_QID_SSIZE);
  6464. }
  6465. /** ============================================================================
  6466. * @n@b CSL_SRIO_GetQMBaseAddress
  6467. *
  6468. * @b Description
  6469. * @n The function gets the QM base address
  6470. *
  6471. * @b Arguments
  6472. @verbatim
  6473. hSrio Handle of the SRIO device
  6474. qmIndex Index of the Queue Manager whose base address is needed
  6475. qmBaseAddress QM Base Address populated by this API
  6476. @endverbatim
  6477. *
  6478. * <b> Return Value </b>
  6479. * @n None
  6480. *
  6481. * <b> Pre Condition </b>
  6482. * @n CSL_SRIO_Open() must be called
  6483. *
  6484. * <b> Post Condition </b>
  6485. * @n None
  6486. *
  6487. * @b Reads
  6488. * @n SRIO_QM_BASE_ADDRESS_REG
  6489. *
  6490. * @b Example
  6491. * @verbatim
  6492. CSL_SrioHandle hSrio;
  6493. Uint32 qmBaseAddress;
  6494. // Open the CSL SRIO Module 0
  6495. hSrio = CSL_SRIO_Open (0);
  6496. ...
  6497. // Get the QM Base Address information for 0
  6498. CSL_SRIO_GetQMBaseAddress(hSrio, 0, &qmBaseAddress);
  6499. ...
  6500. @endverbatim
  6501. * =============================================================================
  6502. */
  6503. static inline void CSL_SRIO_GetQMBaseAddress
  6504. (
  6505. CSL_SrioHandle hSrio,
  6506. Uint8 qmIndex,
  6507. Uint32* qmBaseAddress
  6508. )
  6509. {
  6510. *qmBaseAddress = hSrio->QM_BASE_ADDRESS_REG[qmIndex];
  6511. }
  6512. /** ============================================================================
  6513. * @n@b CSL_SRIO_SetQMBaseAddress
  6514. *
  6515. * @b Description
  6516. * @n The function sets the QM base address
  6517. *
  6518. * @b Arguments
  6519. @verbatim
  6520. hSrio Handle of the SRIO device
  6521. qmIndex Index of the Queue Manager whose base address is to be set
  6522. qmBaseAddress QM Base Address to be configured
  6523. @endverbatim
  6524. *
  6525. * <b> Return Value </b>
  6526. * @n None
  6527. *
  6528. * <b> Pre Condition </b>
  6529. * @n CSL_SRIO_Open() must be called
  6530. *
  6531. * <b> Post Condition </b>
  6532. * @n None
  6533. *
  6534. * @b Writes
  6535. * @n SRIO_QM_BASE_ADDRESS_REG
  6536. *
  6537. * @b Example
  6538. * @verbatim
  6539. CSL_SrioHandle hSrio;
  6540. // Open the CSL SRIO Module 0
  6541. hSrio = CSL_SRIO_Open (0);
  6542. ...
  6543. // Set the QM Base Address information for 0
  6544. CSL_SRIO_SetQMBaseAddress(hSrio, 0, 0x10800000);
  6545. ...
  6546. @endverbatim
  6547. * =============================================================================
  6548. */
  6549. static inline void CSL_SRIO_SetQMBaseAddress
  6550. (
  6551. CSL_SrioHandle hSrio,
  6552. Uint8 qmIndex,
  6553. Uint32 qmBaseAddress
  6554. )
  6555. {
  6556. hSrio->QM_BASE_ADDRESS_REG[qmIndex] = qmBaseAddress;
  6557. }
  6558. /**
  6559. @}
  6560. */
  6561. #ifdef __cplusplus
  6562. }
  6563. #endif
  6564. #endif /* CSL_SRIOAUX_H_ */