mcdi_pcol.h 526 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242
  1. /****************************************************************************
  2. * Driver for Solarflare network controllers and boards
  3. * Copyright 2009-2013 Solarflare Communications Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published
  7. * by the Free Software Foundation, incorporated herein by reference.
  8. */
  9. #ifndef MCDI_PCOL_H
  10. #define MCDI_PCOL_H
  11. /* Values to be written into FMCR_CZ_RESET_STATE_REG to control boot. */
  12. /* Power-on reset state */
  13. #define MC_FW_STATE_POR (1)
  14. /* If this is set in MC_RESET_STATE_REG then it should be
  15. * possible to jump into IMEM without loading code from flash. */
  16. #define MC_FW_WARM_BOOT_OK (2)
  17. /* The MC main image has started to boot. */
  18. #define MC_FW_STATE_BOOTING (4)
  19. /* The Scheduler has started. */
  20. #define MC_FW_STATE_SCHED (8)
  21. /* If this is set in MC_RESET_STATE_REG then it should be
  22. * possible to jump into IMEM without loading code from flash.
  23. * Unlike a warm boot, assume DMEM has been reloaded, so that
  24. * the MC persistent data must be reinitialised. */
  25. #define MC_FW_TEPID_BOOT_OK (16)
  26. /* We have entered the main firmware via recovery mode. This
  27. * means that MC persistent data must be reinitialised, but that
  28. * we shouldn't touch PCIe config. */
  29. #define MC_FW_RECOVERY_MODE_PCIE_INIT_OK (32)
  30. /* BIST state has been initialized */
  31. #define MC_FW_BIST_INIT_OK (128)
  32. /* Siena MC shared memmory offsets */
  33. /* The 'doorbell' addresses are hard-wired to alert the MC when written */
  34. #define MC_SMEM_P0_DOORBELL_OFST 0x000
  35. #define MC_SMEM_P1_DOORBELL_OFST 0x004
  36. /* The rest of these are firmware-defined */
  37. #define MC_SMEM_P0_PDU_OFST 0x008
  38. #define MC_SMEM_P1_PDU_OFST 0x108
  39. #define MC_SMEM_PDU_LEN 0x100
  40. #define MC_SMEM_P0_PTP_TIME_OFST 0x7f0
  41. #define MC_SMEM_P0_STATUS_OFST 0x7f8
  42. #define MC_SMEM_P1_STATUS_OFST 0x7fc
  43. /* Values to be written to the per-port status dword in shared
  44. * memory on reboot and assert */
  45. #define MC_STATUS_DWORD_REBOOT (0xb007b007)
  46. #define MC_STATUS_DWORD_ASSERT (0xdeaddead)
  47. /* Check whether an mcfw version (in host order) belongs to a bootloader */
  48. #define MC_FW_VERSION_IS_BOOTLOADER(_v) (((_v) >> 16) == 0xb007)
  49. /* The current version of the MCDI protocol.
  50. *
  51. * Note that the ROM burnt into the card only talks V0, so at the very
  52. * least every driver must support version 0 and MCDI_PCOL_VERSION
  53. */
  54. #define MCDI_PCOL_VERSION 2
  55. /* Unused commands: 0x23, 0x27, 0x30, 0x31 */
  56. /* MCDI version 1
  57. *
  58. * Each MCDI request starts with an MCDI_HEADER, which is a 32bit
  59. * structure, filled in by the client.
  60. *
  61. * 0 7 8 16 20 22 23 24 31
  62. * | CODE | R | LEN | SEQ | Rsvd | E | R | XFLAGS |
  63. * | | |
  64. * | | \--- Response
  65. * | \------- Error
  66. * \------------------------------ Resync (always set)
  67. *
  68. * The client writes it's request into MC shared memory, and rings the
  69. * doorbell. Each request is completed by either by the MC writting
  70. * back into shared memory, or by writting out an event.
  71. *
  72. * All MCDI commands support completion by shared memory response. Each
  73. * request may also contain additional data (accounted for by HEADER.LEN),
  74. * and some response's may also contain additional data (again, accounted
  75. * for by HEADER.LEN).
  76. *
  77. * Some MCDI commands support completion by event, in which any associated
  78. * response data is included in the event.
  79. *
  80. * The protocol requires one response to be delivered for every request, a
  81. * request should not be sent unless the response for the previous request
  82. * has been received (either by polling shared memory, or by receiving
  83. * an event).
  84. */
  85. /** Request/Response structure */
  86. #define MCDI_HEADER_OFST 0
  87. #define MCDI_HEADER_CODE_LBN 0
  88. #define MCDI_HEADER_CODE_WIDTH 7
  89. #define MCDI_HEADER_RESYNC_LBN 7
  90. #define MCDI_HEADER_RESYNC_WIDTH 1
  91. #define MCDI_HEADER_DATALEN_LBN 8
  92. #define MCDI_HEADER_DATALEN_WIDTH 8
  93. #define MCDI_HEADER_SEQ_LBN 16
  94. #define MCDI_HEADER_SEQ_WIDTH 4
  95. #define MCDI_HEADER_RSVD_LBN 20
  96. #define MCDI_HEADER_RSVD_WIDTH 1
  97. #define MCDI_HEADER_NOT_EPOCH_LBN 21
  98. #define MCDI_HEADER_NOT_EPOCH_WIDTH 1
  99. #define MCDI_HEADER_ERROR_LBN 22
  100. #define MCDI_HEADER_ERROR_WIDTH 1
  101. #define MCDI_HEADER_RESPONSE_LBN 23
  102. #define MCDI_HEADER_RESPONSE_WIDTH 1
  103. #define MCDI_HEADER_XFLAGS_LBN 24
  104. #define MCDI_HEADER_XFLAGS_WIDTH 8
  105. /* Request response using event */
  106. #define MCDI_HEADER_XFLAGS_EVREQ 0x01
  107. /* Maximum number of payload bytes */
  108. #define MCDI_CTL_SDU_LEN_MAX_V1 0xfc
  109. #define MCDI_CTL_SDU_LEN_MAX_V2 0x400
  110. #define MCDI_CTL_SDU_LEN_MAX MCDI_CTL_SDU_LEN_MAX_V2
  111. /* The MC can generate events for two reasons:
  112. * - To complete a shared memory request if XFLAGS_EVREQ was set
  113. * - As a notification (link state, i2c event), controlled
  114. * via MC_CMD_LOG_CTRL
  115. *
  116. * Both events share a common structure:
  117. *
  118. * 0 32 33 36 44 52 60
  119. * | Data | Cont | Level | Src | Code | Rsvd |
  120. * |
  121. * \ There is another event pending in this notification
  122. *
  123. * If Code==CMDDONE, then the fields are further interpreted as:
  124. *
  125. * - LEVEL==INFO Command succeeded
  126. * - LEVEL==ERR Command failed
  127. *
  128. * 0 8 16 24 32
  129. * | Seq | Datalen | Errno | Rsvd |
  130. *
  131. * These fields are taken directly out of the standard MCDI header, i.e.,
  132. * LEVEL==ERR, Datalen == 0 => Reboot
  133. *
  134. * Events can be squirted out of the UART (using LOG_CTRL) without a
  135. * MCDI header. An event can be distinguished from a MCDI response by
  136. * examining the first byte which is 0xc0. This corresponds to the
  137. * non-existent MCDI command MC_CMD_DEBUG_LOG.
  138. *
  139. * 0 7 8
  140. * | command | Resync | = 0xc0
  141. *
  142. * Since the event is written in big-endian byte order, this works
  143. * providing bits 56-63 of the event are 0xc0.
  144. *
  145. * 56 60 63
  146. * | Rsvd | Code | = 0xc0
  147. *
  148. * Which means for convenience the event code is 0xc for all MC
  149. * generated events.
  150. */
  151. #define FSE_AZ_EV_CODE_MCDI_EVRESPONSE 0xc
  152. /* Operation not permitted. */
  153. #define MC_CMD_ERR_EPERM 1
  154. /* Non-existent command target */
  155. #define MC_CMD_ERR_ENOENT 2
  156. /* assert() has killed the MC */
  157. #define MC_CMD_ERR_EINTR 4
  158. /* I/O failure */
  159. #define MC_CMD_ERR_EIO 5
  160. /* Already exists */
  161. #define MC_CMD_ERR_EEXIST 6
  162. /* Try again */
  163. #define MC_CMD_ERR_EAGAIN 11
  164. /* Out of memory */
  165. #define MC_CMD_ERR_ENOMEM 12
  166. /* Caller does not hold required locks */
  167. #define MC_CMD_ERR_EACCES 13
  168. /* Resource is currently unavailable (e.g. lock contention) */
  169. #define MC_CMD_ERR_EBUSY 16
  170. /* No such device */
  171. #define MC_CMD_ERR_ENODEV 19
  172. /* Invalid argument to target */
  173. #define MC_CMD_ERR_EINVAL 22
  174. /* Broken pipe */
  175. #define MC_CMD_ERR_EPIPE 32
  176. /* Read-only */
  177. #define MC_CMD_ERR_EROFS 30
  178. /* Out of range */
  179. #define MC_CMD_ERR_ERANGE 34
  180. /* Non-recursive resource is already acquired */
  181. #define MC_CMD_ERR_EDEADLK 35
  182. /* Operation not implemented */
  183. #define MC_CMD_ERR_ENOSYS 38
  184. /* Operation timed out */
  185. #define MC_CMD_ERR_ETIME 62
  186. /* Link has been severed */
  187. #define MC_CMD_ERR_ENOLINK 67
  188. /* Protocol error */
  189. #define MC_CMD_ERR_EPROTO 71
  190. /* Operation not supported */
  191. #define MC_CMD_ERR_ENOTSUP 95
  192. /* Address not available */
  193. #define MC_CMD_ERR_EADDRNOTAVAIL 99
  194. /* Not connected */
  195. #define MC_CMD_ERR_ENOTCONN 107
  196. /* Operation already in progress */
  197. #define MC_CMD_ERR_EALREADY 114
  198. /* Resource allocation failed. */
  199. #define MC_CMD_ERR_ALLOC_FAIL 0x1000
  200. /* V-adaptor not found. */
  201. #define MC_CMD_ERR_NO_VADAPTOR 0x1001
  202. /* EVB port not found. */
  203. #define MC_CMD_ERR_NO_EVB_PORT 0x1002
  204. /* V-switch not found. */
  205. #define MC_CMD_ERR_NO_VSWITCH 0x1003
  206. /* Too many VLAN tags. */
  207. #define MC_CMD_ERR_VLAN_LIMIT 0x1004
  208. /* Bad PCI function number. */
  209. #define MC_CMD_ERR_BAD_PCI_FUNC 0x1005
  210. /* Invalid VLAN mode. */
  211. #define MC_CMD_ERR_BAD_VLAN_MODE 0x1006
  212. /* Invalid v-switch type. */
  213. #define MC_CMD_ERR_BAD_VSWITCH_TYPE 0x1007
  214. /* Invalid v-port type. */
  215. #define MC_CMD_ERR_BAD_VPORT_TYPE 0x1008
  216. /* MAC address exists. */
  217. #define MC_CMD_ERR_MAC_EXIST 0x1009
  218. /* Slave core not present */
  219. #define MC_CMD_ERR_SLAVE_NOT_PRESENT 0x100a
  220. /* The datapath is disabled. */
  221. #define MC_CMD_ERR_DATAPATH_DISABLED 0x100b
  222. /* The requesting client is not a function */
  223. #define MC_CMD_ERR_CLIENT_NOT_FN 0x100c
  224. /* The requested operation might require the
  225. command to be passed between MCs, and the
  226. transport doesn't support that. Should
  227. only ever been seen over the UART. */
  228. #define MC_CMD_ERR_TRANSPORT_NOPROXY 0x100d
  229. /* VLAN tag(s) exists */
  230. #define MC_CMD_ERR_VLAN_EXIST 0x100e
  231. /* No MAC address assigned to an EVB port */
  232. #define MC_CMD_ERR_NO_MAC_ADDR 0x100f
  233. /* Notifies the driver that the request has been relayed
  234. * to an admin function for authorization. The driver should
  235. * wait for a PROXY_RESPONSE event and then resend its request.
  236. * This error code is followed by a 32-bit handle that
  237. * helps matching it with the respective PROXY_RESPONSE event. */
  238. #define MC_CMD_ERR_PROXY_PENDING 0x1010
  239. #define MC_CMD_ERR_PROXY_PENDING_HANDLE_OFST 4
  240. /* The request cannot be passed for authorization because
  241. * another request from the same function is currently being
  242. * authorized. The drvier should try again later. */
  243. #define MC_CMD_ERR_PROXY_INPROGRESS 0x1011
  244. /* Returned by MC_CMD_PROXY_COMPLETE if the caller is not the function
  245. * that has enabled proxying or BLOCK_INDEX points to a function that
  246. * doesn't await an authorization. */
  247. #define MC_CMD_ERR_PROXY_UNEXPECTED 0x1012
  248. /* This code is currently only used internally in FW. Its meaning is that
  249. * an operation failed due to lack of SR-IOV privilege.
  250. * Normally it is translated to EPERM by send_cmd_err(),
  251. * but it may also be used to trigger some special mechanism
  252. * for handling such case, e.g. to relay the failed request
  253. * to a designated admin function for authorization. */
  254. #define MC_CMD_ERR_NO_PRIVILEGE 0x1013
  255. /* Workaround 26807 could not be turned on/off because some functions
  256. * have already installed filters. See the comment at
  257. * MC_CMD_WORKAROUND_BUG26807. */
  258. #define MC_CMD_ERR_FILTERS_PRESENT 0x1014
  259. /* The clock whose frequency you've attempted to set set
  260. * doesn't exist on this NIC */
  261. #define MC_CMD_ERR_NO_CLOCK 0x1015
  262. /* Returned by MC_CMD_TESTASSERT if the action that should
  263. * have caused an assertion failed to do so. */
  264. #define MC_CMD_ERR_UNREACHABLE 0x1016
  265. #define MC_CMD_ERR_CODE_OFST 0
  266. /* We define 8 "escape" commands to allow
  267. for command number space extension */
  268. #define MC_CMD_CMD_SPACE_ESCAPE_0 0x78
  269. #define MC_CMD_CMD_SPACE_ESCAPE_1 0x79
  270. #define MC_CMD_CMD_SPACE_ESCAPE_2 0x7A
  271. #define MC_CMD_CMD_SPACE_ESCAPE_3 0x7B
  272. #define MC_CMD_CMD_SPACE_ESCAPE_4 0x7C
  273. #define MC_CMD_CMD_SPACE_ESCAPE_5 0x7D
  274. #define MC_CMD_CMD_SPACE_ESCAPE_6 0x7E
  275. #define MC_CMD_CMD_SPACE_ESCAPE_7 0x7F
  276. /* Vectors in the boot ROM */
  277. /* Point to the copycode entry point. */
  278. #define SIENA_MC_BOOTROM_COPYCODE_VEC (0x800 - 3 * 0x4)
  279. #define HUNT_MC_BOOTROM_COPYCODE_VEC (0x8000 - 3 * 0x4)
  280. #define MEDFORD_MC_BOOTROM_COPYCODE_VEC (0x10000 - 3 * 0x4)
  281. /* Points to the recovery mode entry point. */
  282. #define SIENA_MC_BOOTROM_NOFLASH_VEC (0x800 - 2 * 0x4)
  283. #define HUNT_MC_BOOTROM_NOFLASH_VEC (0x8000 - 2 * 0x4)
  284. #define MEDFORD_MC_BOOTROM_NOFLASH_VEC (0x10000 - 2 * 0x4)
  285. /* The command set exported by the boot ROM (MCDI v0) */
  286. #define MC_CMD_GET_VERSION_V0_SUPPORTED_FUNCS { \
  287. (1 << MC_CMD_READ32) | \
  288. (1 << MC_CMD_WRITE32) | \
  289. (1 << MC_CMD_COPYCODE) | \
  290. (1 << MC_CMD_GET_VERSION), \
  291. 0, 0, 0 }
  292. #define MC_CMD_SENSOR_INFO_OUT_OFFSET_OFST(_x) \
  293. (MC_CMD_SENSOR_ENTRY_OFST + (_x))
  294. #define MC_CMD_DBI_WRITE_IN_ADDRESS_OFST(n) \
  295. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  296. MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST + \
  297. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  298. #define MC_CMD_DBI_WRITE_IN_BYTE_MASK_OFST(n) \
  299. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  300. MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_OFST + \
  301. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  302. #define MC_CMD_DBI_WRITE_IN_VALUE_OFST(n) \
  303. (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
  304. MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST + \
  305. (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
  306. /* This may be ORed with an EVB_PORT_ID_xxx constant to pass a non-default
  307. * stack ID (which must be in the range 1-255) along with an EVB port ID.
  308. */
  309. #define EVB_STACK_ID(n) (((n) & 0xff) << 16)
  310. /* Version 2 adds an optional argument to error returns: the errno value
  311. * may be followed by the (0-based) number of the first argument that
  312. * could not be processed.
  313. */
  314. #define MC_CMD_ERR_ARG_OFST 4
  315. /* No space */
  316. #define MC_CMD_ERR_ENOSPC 28
  317. /* MCDI_EVENT structuredef */
  318. #define MCDI_EVENT_LEN 8
  319. #define MCDI_EVENT_CONT_LBN 32
  320. #define MCDI_EVENT_CONT_WIDTH 1
  321. #define MCDI_EVENT_LEVEL_LBN 33
  322. #define MCDI_EVENT_LEVEL_WIDTH 3
  323. /* enum: Info. */
  324. #define MCDI_EVENT_LEVEL_INFO 0x0
  325. /* enum: Warning. */
  326. #define MCDI_EVENT_LEVEL_WARN 0x1
  327. /* enum: Error. */
  328. #define MCDI_EVENT_LEVEL_ERR 0x2
  329. /* enum: Fatal. */
  330. #define MCDI_EVENT_LEVEL_FATAL 0x3
  331. #define MCDI_EVENT_DATA_OFST 0
  332. #define MCDI_EVENT_CMDDONE_SEQ_LBN 0
  333. #define MCDI_EVENT_CMDDONE_SEQ_WIDTH 8
  334. #define MCDI_EVENT_CMDDONE_DATALEN_LBN 8
  335. #define MCDI_EVENT_CMDDONE_DATALEN_WIDTH 8
  336. #define MCDI_EVENT_CMDDONE_ERRNO_LBN 16
  337. #define MCDI_EVENT_CMDDONE_ERRNO_WIDTH 8
  338. #define MCDI_EVENT_LINKCHANGE_LP_CAP_LBN 0
  339. #define MCDI_EVENT_LINKCHANGE_LP_CAP_WIDTH 16
  340. #define MCDI_EVENT_LINKCHANGE_SPEED_LBN 16
  341. #define MCDI_EVENT_LINKCHANGE_SPEED_WIDTH 4
  342. /* enum: 100Mbs */
  343. #define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1
  344. /* enum: 1Gbs */
  345. #define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2
  346. /* enum: 10Gbs */
  347. #define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3
  348. /* enum: 40Gbs */
  349. #define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4
  350. #define MCDI_EVENT_LINKCHANGE_FCNTL_LBN 20
  351. #define MCDI_EVENT_LINKCHANGE_FCNTL_WIDTH 4
  352. #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_LBN 24
  353. #define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_WIDTH 8
  354. #define MCDI_EVENT_SENSOREVT_MONITOR_LBN 0
  355. #define MCDI_EVENT_SENSOREVT_MONITOR_WIDTH 8
  356. #define MCDI_EVENT_SENSOREVT_STATE_LBN 8
  357. #define MCDI_EVENT_SENSOREVT_STATE_WIDTH 8
  358. #define MCDI_EVENT_SENSOREVT_VALUE_LBN 16
  359. #define MCDI_EVENT_SENSOREVT_VALUE_WIDTH 16
  360. #define MCDI_EVENT_FWALERT_DATA_LBN 8
  361. #define MCDI_EVENT_FWALERT_DATA_WIDTH 24
  362. #define MCDI_EVENT_FWALERT_REASON_LBN 0
  363. #define MCDI_EVENT_FWALERT_REASON_WIDTH 8
  364. /* enum: SRAM Access. */
  365. #define MCDI_EVENT_FWALERT_REASON_SRAM_ACCESS 0x1
  366. #define MCDI_EVENT_FLR_VF_LBN 0
  367. #define MCDI_EVENT_FLR_VF_WIDTH 8
  368. #define MCDI_EVENT_TX_ERR_TXQ_LBN 0
  369. #define MCDI_EVENT_TX_ERR_TXQ_WIDTH 12
  370. #define MCDI_EVENT_TX_ERR_TYPE_LBN 12
  371. #define MCDI_EVENT_TX_ERR_TYPE_WIDTH 4
  372. /* enum: Descriptor loader reported failure */
  373. #define MCDI_EVENT_TX_ERR_DL_FAIL 0x1
  374. /* enum: Descriptor ring empty and no EOP seen for packet */
  375. #define MCDI_EVENT_TX_ERR_NO_EOP 0x2
  376. /* enum: Overlength packet */
  377. #define MCDI_EVENT_TX_ERR_2BIG 0x3
  378. /* enum: Malformed option descriptor */
  379. #define MCDI_EVENT_TX_BAD_OPTDESC 0x5
  380. /* enum: Option descriptor part way through a packet */
  381. #define MCDI_EVENT_TX_OPT_IN_PKT 0x8
  382. /* enum: DMA or PIO data access error */
  383. #define MCDI_EVENT_TX_ERR_BAD_DMA_OR_PIO 0x9
  384. #define MCDI_EVENT_TX_ERR_INFO_LBN 16
  385. #define MCDI_EVENT_TX_ERR_INFO_WIDTH 16
  386. #define MCDI_EVENT_TX_FLUSH_TO_DRIVER_LBN 12
  387. #define MCDI_EVENT_TX_FLUSH_TO_DRIVER_WIDTH 1
  388. #define MCDI_EVENT_TX_FLUSH_TXQ_LBN 0
  389. #define MCDI_EVENT_TX_FLUSH_TXQ_WIDTH 12
  390. #define MCDI_EVENT_PTP_ERR_TYPE_LBN 0
  391. #define MCDI_EVENT_PTP_ERR_TYPE_WIDTH 8
  392. /* enum: PLL lost lock */
  393. #define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1
  394. /* enum: Filter overflow (PDMA) */
  395. #define MCDI_EVENT_PTP_ERR_FILTER 0x2
  396. /* enum: FIFO overflow (FPGA) */
  397. #define MCDI_EVENT_PTP_ERR_FIFO 0x3
  398. /* enum: Merge queue overflow */
  399. #define MCDI_EVENT_PTP_ERR_QUEUE 0x4
  400. #define MCDI_EVENT_AOE_ERR_TYPE_LBN 0
  401. #define MCDI_EVENT_AOE_ERR_TYPE_WIDTH 8
  402. /* enum: AOE failed to load - no valid image? */
  403. #define MCDI_EVENT_AOE_NO_LOAD 0x1
  404. /* enum: AOE FC reported an exception */
  405. #define MCDI_EVENT_AOE_FC_ASSERT 0x2
  406. /* enum: AOE FC watchdogged */
  407. #define MCDI_EVENT_AOE_FC_WATCHDOG 0x3
  408. /* enum: AOE FC failed to start */
  409. #define MCDI_EVENT_AOE_FC_NO_START 0x4
  410. /* enum: Generic AOE fault - likely to have been reported via other means too
  411. * but intended for use by aoex driver.
  412. */
  413. #define MCDI_EVENT_AOE_FAULT 0x5
  414. /* enum: Results of reprogramming the CPLD (status in AOE_ERR_DATA) */
  415. #define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6
  416. /* enum: AOE loaded successfully */
  417. #define MCDI_EVENT_AOE_LOAD 0x7
  418. /* enum: AOE DMA operation completed (LSB of HOST_HANDLE in AOE_ERR_DATA) */
  419. #define MCDI_EVENT_AOE_DMA 0x8
  420. /* enum: AOE byteblaster connected/disconnected (Connection status in
  421. * AOE_ERR_DATA)
  422. */
  423. #define MCDI_EVENT_AOE_BYTEBLASTER 0x9
  424. /* enum: DDR ECC status update */
  425. #define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa
  426. /* enum: PTP status update */
  427. #define MCDI_EVENT_AOE_PTP_STATUS 0xb
  428. #define MCDI_EVENT_AOE_ERR_DATA_LBN 8
  429. #define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8
  430. #define MCDI_EVENT_RX_ERR_RXQ_LBN 0
  431. #define MCDI_EVENT_RX_ERR_RXQ_WIDTH 12
  432. #define MCDI_EVENT_RX_ERR_TYPE_LBN 12
  433. #define MCDI_EVENT_RX_ERR_TYPE_WIDTH 4
  434. #define MCDI_EVENT_RX_ERR_INFO_LBN 16
  435. #define MCDI_EVENT_RX_ERR_INFO_WIDTH 16
  436. #define MCDI_EVENT_RX_FLUSH_TO_DRIVER_LBN 12
  437. #define MCDI_EVENT_RX_FLUSH_TO_DRIVER_WIDTH 1
  438. #define MCDI_EVENT_RX_FLUSH_RXQ_LBN 0
  439. #define MCDI_EVENT_RX_FLUSH_RXQ_WIDTH 12
  440. #define MCDI_EVENT_MC_REBOOT_COUNT_LBN 0
  441. #define MCDI_EVENT_MC_REBOOT_COUNT_WIDTH 16
  442. #define MCDI_EVENT_MUM_ERR_TYPE_LBN 0
  443. #define MCDI_EVENT_MUM_ERR_TYPE_WIDTH 8
  444. /* enum: MUM failed to load - no valid image? */
  445. #define MCDI_EVENT_MUM_NO_LOAD 0x1
  446. /* enum: MUM f/w reported an exception */
  447. #define MCDI_EVENT_MUM_ASSERT 0x2
  448. /* enum: MUM not kicking watchdog */
  449. #define MCDI_EVENT_MUM_WATCHDOG 0x3
  450. #define MCDI_EVENT_MUM_ERR_DATA_LBN 8
  451. #define MCDI_EVENT_MUM_ERR_DATA_WIDTH 8
  452. #define MCDI_EVENT_DATA_LBN 0
  453. #define MCDI_EVENT_DATA_WIDTH 32
  454. #define MCDI_EVENT_SRC_LBN 36
  455. #define MCDI_EVENT_SRC_WIDTH 8
  456. #define MCDI_EVENT_EV_CODE_LBN 60
  457. #define MCDI_EVENT_EV_CODE_WIDTH 4
  458. #define MCDI_EVENT_CODE_LBN 44
  459. #define MCDI_EVENT_CODE_WIDTH 8
  460. /* enum: Event generated by host software */
  461. #define MCDI_EVENT_SW_EVENT 0x0
  462. /* enum: Bad assert. */
  463. #define MCDI_EVENT_CODE_BADSSERT 0x1
  464. /* enum: PM Notice. */
  465. #define MCDI_EVENT_CODE_PMNOTICE 0x2
  466. /* enum: Command done. */
  467. #define MCDI_EVENT_CODE_CMDDONE 0x3
  468. /* enum: Link change. */
  469. #define MCDI_EVENT_CODE_LINKCHANGE 0x4
  470. /* enum: Sensor Event. */
  471. #define MCDI_EVENT_CODE_SENSOREVT 0x5
  472. /* enum: Schedule error. */
  473. #define MCDI_EVENT_CODE_SCHEDERR 0x6
  474. /* enum: Reboot. */
  475. #define MCDI_EVENT_CODE_REBOOT 0x7
  476. /* enum: Mac stats DMA. */
  477. #define MCDI_EVENT_CODE_MAC_STATS_DMA 0x8
  478. /* enum: Firmware alert. */
  479. #define MCDI_EVENT_CODE_FWALERT 0x9
  480. /* enum: Function level reset. */
  481. #define MCDI_EVENT_CODE_FLR 0xa
  482. /* enum: Transmit error */
  483. #define MCDI_EVENT_CODE_TX_ERR 0xb
  484. /* enum: Tx flush has completed */
  485. #define MCDI_EVENT_CODE_TX_FLUSH 0xc
  486. /* enum: PTP packet received timestamp */
  487. #define MCDI_EVENT_CODE_PTP_RX 0xd
  488. /* enum: PTP NIC failure */
  489. #define MCDI_EVENT_CODE_PTP_FAULT 0xe
  490. /* enum: PTP PPS event */
  491. #define MCDI_EVENT_CODE_PTP_PPS 0xf
  492. /* enum: Rx flush has completed */
  493. #define MCDI_EVENT_CODE_RX_FLUSH 0x10
  494. /* enum: Receive error */
  495. #define MCDI_EVENT_CODE_RX_ERR 0x11
  496. /* enum: AOE fault */
  497. #define MCDI_EVENT_CODE_AOE 0x12
  498. /* enum: Network port calibration failed (VCAL). */
  499. #define MCDI_EVENT_CODE_VCAL_FAIL 0x13
  500. /* enum: HW PPS event */
  501. #define MCDI_EVENT_CODE_HW_PPS 0x14
  502. /* enum: The MC has rebooted (huntington and later, siena uses CODE_REBOOT and
  503. * a different format)
  504. */
  505. #define MCDI_EVENT_CODE_MC_REBOOT 0x15
  506. /* enum: the MC has detected a parity error */
  507. #define MCDI_EVENT_CODE_PAR_ERR 0x16
  508. /* enum: the MC has detected a correctable error */
  509. #define MCDI_EVENT_CODE_ECC_CORR_ERR 0x17
  510. /* enum: the MC has detected an uncorrectable error */
  511. #define MCDI_EVENT_CODE_ECC_FATAL_ERR 0x18
  512. /* enum: The MC has entered offline BIST mode */
  513. #define MCDI_EVENT_CODE_MC_BIST 0x19
  514. /* enum: PTP tick event providing current NIC time */
  515. #define MCDI_EVENT_CODE_PTP_TIME 0x1a
  516. /* enum: MUM fault */
  517. #define MCDI_EVENT_CODE_MUM 0x1b
  518. /* enum: notify the designated PF of a new authorization request */
  519. #define MCDI_EVENT_CODE_PROXY_REQUEST 0x1c
  520. /* enum: notify a function that awaits an authorization that its request has
  521. * been processed and it may now resend the command
  522. */
  523. #define MCDI_EVENT_CODE_PROXY_RESPONSE 0x1d
  524. /* enum: Artificial event generated by host and posted via MC for test
  525. * purposes.
  526. */
  527. #define MCDI_EVENT_CODE_TESTGEN 0xfa
  528. #define MCDI_EVENT_CMDDONE_DATA_OFST 0
  529. #define MCDI_EVENT_CMDDONE_DATA_LBN 0
  530. #define MCDI_EVENT_CMDDONE_DATA_WIDTH 32
  531. #define MCDI_EVENT_LINKCHANGE_DATA_OFST 0
  532. #define MCDI_EVENT_LINKCHANGE_DATA_LBN 0
  533. #define MCDI_EVENT_LINKCHANGE_DATA_WIDTH 32
  534. #define MCDI_EVENT_SENSOREVT_DATA_OFST 0
  535. #define MCDI_EVENT_SENSOREVT_DATA_LBN 0
  536. #define MCDI_EVENT_SENSOREVT_DATA_WIDTH 32
  537. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_OFST 0
  538. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_LBN 0
  539. #define MCDI_EVENT_MAC_STATS_DMA_GENERATION_WIDTH 32
  540. #define MCDI_EVENT_TX_ERR_DATA_OFST 0
  541. #define MCDI_EVENT_TX_ERR_DATA_LBN 0
  542. #define MCDI_EVENT_TX_ERR_DATA_WIDTH 32
  543. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the seconds field of
  544. * timestamp
  545. */
  546. #define MCDI_EVENT_PTP_SECONDS_OFST 0
  547. #define MCDI_EVENT_PTP_SECONDS_LBN 0
  548. #define MCDI_EVENT_PTP_SECONDS_WIDTH 32
  549. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the major field of
  550. * timestamp
  551. */
  552. #define MCDI_EVENT_PTP_MAJOR_OFST 0
  553. #define MCDI_EVENT_PTP_MAJOR_LBN 0
  554. #define MCDI_EVENT_PTP_MAJOR_WIDTH 32
  555. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the nanoseconds field
  556. * of timestamp
  557. */
  558. #define MCDI_EVENT_PTP_NANOSECONDS_OFST 0
  559. #define MCDI_EVENT_PTP_NANOSECONDS_LBN 0
  560. #define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32
  561. /* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the minor field of
  562. * timestamp
  563. */
  564. #define MCDI_EVENT_PTP_MINOR_OFST 0
  565. #define MCDI_EVENT_PTP_MINOR_LBN 0
  566. #define MCDI_EVENT_PTP_MINOR_WIDTH 32
  567. /* For CODE_PTP_RX events, the lowest four bytes of sourceUUID from PTP packet
  568. */
  569. #define MCDI_EVENT_PTP_UUID_OFST 0
  570. #define MCDI_EVENT_PTP_UUID_LBN 0
  571. #define MCDI_EVENT_PTP_UUID_WIDTH 32
  572. #define MCDI_EVENT_RX_ERR_DATA_OFST 0
  573. #define MCDI_EVENT_RX_ERR_DATA_LBN 0
  574. #define MCDI_EVENT_RX_ERR_DATA_WIDTH 32
  575. #define MCDI_EVENT_PAR_ERR_DATA_OFST 0
  576. #define MCDI_EVENT_PAR_ERR_DATA_LBN 0
  577. #define MCDI_EVENT_PAR_ERR_DATA_WIDTH 32
  578. #define MCDI_EVENT_ECC_CORR_ERR_DATA_OFST 0
  579. #define MCDI_EVENT_ECC_CORR_ERR_DATA_LBN 0
  580. #define MCDI_EVENT_ECC_CORR_ERR_DATA_WIDTH 32
  581. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_OFST 0
  582. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_LBN 0
  583. #define MCDI_EVENT_ECC_FATAL_ERR_DATA_WIDTH 32
  584. /* For CODE_PTP_TIME events, the major value of the PTP clock */
  585. #define MCDI_EVENT_PTP_TIME_MAJOR_OFST 0
  586. #define MCDI_EVENT_PTP_TIME_MAJOR_LBN 0
  587. #define MCDI_EVENT_PTP_TIME_MAJOR_WIDTH 32
  588. /* For CODE_PTP_TIME events, bits 19-26 of the minor value of the PTP clock */
  589. #define MCDI_EVENT_PTP_TIME_MINOR_26_19_LBN 36
  590. #define MCDI_EVENT_PTP_TIME_MINOR_26_19_WIDTH 8
  591. /* For CODE_PTP_TIME events where report sync status is enabled, indicates
  592. * whether the NIC clock has ever been set
  593. */
  594. #define MCDI_EVENT_PTP_TIME_NIC_CLOCK_VALID_LBN 36
  595. #define MCDI_EVENT_PTP_TIME_NIC_CLOCK_VALID_WIDTH 1
  596. /* For CODE_PTP_TIME events where report sync status is enabled, indicates
  597. * whether the NIC and System clocks are in sync
  598. */
  599. #define MCDI_EVENT_PTP_TIME_HOST_NIC_IN_SYNC_LBN 37
  600. #define MCDI_EVENT_PTP_TIME_HOST_NIC_IN_SYNC_WIDTH 1
  601. /* For CODE_PTP_TIME events where report sync status is enabled, bits 21-26 of
  602. * the minor value of the PTP clock
  603. */
  604. #define MCDI_EVENT_PTP_TIME_MINOR_26_21_LBN 38
  605. #define MCDI_EVENT_PTP_TIME_MINOR_26_21_WIDTH 6
  606. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_OFST 0
  607. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_LBN 0
  608. #define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_WIDTH 32
  609. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_OFST 0
  610. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_LBN 0
  611. #define MCDI_EVENT_PROXY_RESPONSE_HANDLE_WIDTH 32
  612. /* Zero means that the request has been completed or authorized, and the driver
  613. * should resend it. A non-zero value means that the authorization has been
  614. * denied, and gives the reason. Typically it will be EPERM.
  615. */
  616. #define MCDI_EVENT_PROXY_RESPONSE_RC_LBN 36
  617. #define MCDI_EVENT_PROXY_RESPONSE_RC_WIDTH 8
  618. /* FCDI_EVENT structuredef */
  619. #define FCDI_EVENT_LEN 8
  620. #define FCDI_EVENT_CONT_LBN 32
  621. #define FCDI_EVENT_CONT_WIDTH 1
  622. #define FCDI_EVENT_LEVEL_LBN 33
  623. #define FCDI_EVENT_LEVEL_WIDTH 3
  624. /* enum: Info. */
  625. #define FCDI_EVENT_LEVEL_INFO 0x0
  626. /* enum: Warning. */
  627. #define FCDI_EVENT_LEVEL_WARN 0x1
  628. /* enum: Error. */
  629. #define FCDI_EVENT_LEVEL_ERR 0x2
  630. /* enum: Fatal. */
  631. #define FCDI_EVENT_LEVEL_FATAL 0x3
  632. #define FCDI_EVENT_DATA_OFST 0
  633. #define FCDI_EVENT_LINK_STATE_STATUS_LBN 0
  634. #define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1
  635. #define FCDI_EVENT_LINK_DOWN 0x0 /* enum */
  636. #define FCDI_EVENT_LINK_UP 0x1 /* enum */
  637. #define FCDI_EVENT_DATA_LBN 0
  638. #define FCDI_EVENT_DATA_WIDTH 32
  639. #define FCDI_EVENT_SRC_LBN 36
  640. #define FCDI_EVENT_SRC_WIDTH 8
  641. #define FCDI_EVENT_EV_CODE_LBN 60
  642. #define FCDI_EVENT_EV_CODE_WIDTH 4
  643. #define FCDI_EVENT_CODE_LBN 44
  644. #define FCDI_EVENT_CODE_WIDTH 8
  645. /* enum: The FC was rebooted. */
  646. #define FCDI_EVENT_CODE_REBOOT 0x1
  647. /* enum: Bad assert. */
  648. #define FCDI_EVENT_CODE_ASSERT 0x2
  649. /* enum: DDR3 test result. */
  650. #define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3
  651. /* enum: Link status. */
  652. #define FCDI_EVENT_CODE_LINK_STATE 0x4
  653. /* enum: A timed read is ready to be serviced. */
  654. #define FCDI_EVENT_CODE_TIMED_READ 0x5
  655. /* enum: One or more PPS IN events */
  656. #define FCDI_EVENT_CODE_PPS_IN 0x6
  657. /* enum: Tick event from PTP clock */
  658. #define FCDI_EVENT_CODE_PTP_TICK 0x7
  659. /* enum: ECC error counters */
  660. #define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8
  661. /* enum: Current status of PTP */
  662. #define FCDI_EVENT_CODE_PTP_STATUS 0x9
  663. /* enum: Port id config to map MC-FC port idx */
  664. #define FCDI_EVENT_CODE_PORT_CONFIG 0xa
  665. /* enum: Boot result or error code */
  666. #define FCDI_EVENT_CODE_BOOT_RESULT 0xb
  667. #define FCDI_EVENT_REBOOT_SRC_LBN 36
  668. #define FCDI_EVENT_REBOOT_SRC_WIDTH 8
  669. #define FCDI_EVENT_REBOOT_FC_FW 0x0 /* enum */
  670. #define FCDI_EVENT_REBOOT_FC_BOOTLOADER 0x1 /* enum */
  671. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0
  672. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0
  673. #define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32
  674. #define FCDI_EVENT_ASSERT_TYPE_LBN 36
  675. #define FCDI_EVENT_ASSERT_TYPE_WIDTH 8
  676. #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_LBN 36
  677. #define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_WIDTH 8
  678. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_OFST 0
  679. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LBN 0
  680. #define FCDI_EVENT_DDR_TEST_RESULT_RESULT_WIDTH 32
  681. #define FCDI_EVENT_LINK_STATE_DATA_OFST 0
  682. #define FCDI_EVENT_LINK_STATE_DATA_LBN 0
  683. #define FCDI_EVENT_LINK_STATE_DATA_WIDTH 32
  684. #define FCDI_EVENT_PTP_STATE_OFST 0
  685. #define FCDI_EVENT_PTP_UNDEFINED 0x0 /* enum */
  686. #define FCDI_EVENT_PTP_SETUP_FAILED 0x1 /* enum */
  687. #define FCDI_EVENT_PTP_OPERATIONAL 0x2 /* enum */
  688. #define FCDI_EVENT_PTP_STATE_LBN 0
  689. #define FCDI_EVENT_PTP_STATE_WIDTH 32
  690. #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_LBN 36
  691. #define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_WIDTH 8
  692. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0
  693. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0
  694. #define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32
  695. /* Index of MC port being referred to */
  696. #define FCDI_EVENT_PORT_CONFIG_SRC_LBN 36
  697. #define FCDI_EVENT_PORT_CONFIG_SRC_WIDTH 8
  698. /* FC Port index that matches the MC port index in SRC */
  699. #define FCDI_EVENT_PORT_CONFIG_DATA_OFST 0
  700. #define FCDI_EVENT_PORT_CONFIG_DATA_LBN 0
  701. #define FCDI_EVENT_PORT_CONFIG_DATA_WIDTH 32
  702. #define FCDI_EVENT_BOOT_RESULT_OFST 0
  703. /* Enum values, see field(s): */
  704. /* MC_CMD_AOE/MC_CMD_AOE_OUT_INFO/FC_BOOT_RESULT */
  705. #define FCDI_EVENT_BOOT_RESULT_LBN 0
  706. #define FCDI_EVENT_BOOT_RESULT_WIDTH 32
  707. /* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events
  708. * to the MC. Note that this structure | is overlayed over a normal FCDI event
  709. * such that bits 32-63 containing | event code, level, source etc remain the
  710. * same. In this case the data | field of the header is defined to be the
  711. * number of timestamps
  712. */
  713. #define FCDI_EXTENDED_EVENT_PPS_LENMIN 16
  714. #define FCDI_EXTENDED_EVENT_PPS_LENMAX 248
  715. #define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num))
  716. /* Number of timestamps following */
  717. #define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0
  718. #define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0
  719. #define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32
  720. /* Seconds field of a timestamp record */
  721. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8
  722. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64
  723. #define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32
  724. /* Nanoseconds field of a timestamp record */
  725. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12
  726. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96
  727. #define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32
  728. /* Timestamp records comprising the event */
  729. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_OFST 8
  730. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LEN 8
  731. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LO_OFST 8
  732. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_HI_OFST 12
  733. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MINNUM 1
  734. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MAXNUM 30
  735. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LBN 64
  736. #define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_WIDTH 64
  737. /* MUM_EVENT structuredef */
  738. #define MUM_EVENT_LEN 8
  739. #define MUM_EVENT_CONT_LBN 32
  740. #define MUM_EVENT_CONT_WIDTH 1
  741. #define MUM_EVENT_LEVEL_LBN 33
  742. #define MUM_EVENT_LEVEL_WIDTH 3
  743. /* enum: Info. */
  744. #define MUM_EVENT_LEVEL_INFO 0x0
  745. /* enum: Warning. */
  746. #define MUM_EVENT_LEVEL_WARN 0x1
  747. /* enum: Error. */
  748. #define MUM_EVENT_LEVEL_ERR 0x2
  749. /* enum: Fatal. */
  750. #define MUM_EVENT_LEVEL_FATAL 0x3
  751. #define MUM_EVENT_DATA_OFST 0
  752. #define MUM_EVENT_SENSOR_ID_LBN 0
  753. #define MUM_EVENT_SENSOR_ID_WIDTH 8
  754. /* Enum values, see field(s): */
  755. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  756. #define MUM_EVENT_SENSOR_STATE_LBN 8
  757. #define MUM_EVENT_SENSOR_STATE_WIDTH 8
  758. #define MUM_EVENT_PORT_PHY_READY_LBN 0
  759. #define MUM_EVENT_PORT_PHY_READY_WIDTH 1
  760. #define MUM_EVENT_PORT_PHY_LINK_UP_LBN 1
  761. #define MUM_EVENT_PORT_PHY_LINK_UP_WIDTH 1
  762. #define MUM_EVENT_PORT_PHY_TX_LOL_LBN 2
  763. #define MUM_EVENT_PORT_PHY_TX_LOL_WIDTH 1
  764. #define MUM_EVENT_PORT_PHY_RX_LOL_LBN 3
  765. #define MUM_EVENT_PORT_PHY_RX_LOL_WIDTH 1
  766. #define MUM_EVENT_PORT_PHY_TX_LOS_LBN 4
  767. #define MUM_EVENT_PORT_PHY_TX_LOS_WIDTH 1
  768. #define MUM_EVENT_PORT_PHY_RX_LOS_LBN 5
  769. #define MUM_EVENT_PORT_PHY_RX_LOS_WIDTH 1
  770. #define MUM_EVENT_PORT_PHY_TX_FAULT_LBN 6
  771. #define MUM_EVENT_PORT_PHY_TX_FAULT_WIDTH 1
  772. #define MUM_EVENT_DATA_LBN 0
  773. #define MUM_EVENT_DATA_WIDTH 32
  774. #define MUM_EVENT_SRC_LBN 36
  775. #define MUM_EVENT_SRC_WIDTH 8
  776. #define MUM_EVENT_EV_CODE_LBN 60
  777. #define MUM_EVENT_EV_CODE_WIDTH 4
  778. #define MUM_EVENT_CODE_LBN 44
  779. #define MUM_EVENT_CODE_WIDTH 8
  780. /* enum: The MUM was rebooted. */
  781. #define MUM_EVENT_CODE_REBOOT 0x1
  782. /* enum: Bad assert. */
  783. #define MUM_EVENT_CODE_ASSERT 0x2
  784. /* enum: Sensor failure. */
  785. #define MUM_EVENT_CODE_SENSOR 0x3
  786. /* enum: Link fault has been asserted, or has cleared. */
  787. #define MUM_EVENT_CODE_QSFP_LASI_INTERRUPT 0x4
  788. #define MUM_EVENT_SENSOR_DATA_OFST 0
  789. #define MUM_EVENT_SENSOR_DATA_LBN 0
  790. #define MUM_EVENT_SENSOR_DATA_WIDTH 32
  791. #define MUM_EVENT_PORT_PHY_FLAGS_OFST 0
  792. #define MUM_EVENT_PORT_PHY_FLAGS_LBN 0
  793. #define MUM_EVENT_PORT_PHY_FLAGS_WIDTH 32
  794. #define MUM_EVENT_PORT_PHY_COPPER_LEN_OFST 0
  795. #define MUM_EVENT_PORT_PHY_COPPER_LEN_LBN 0
  796. #define MUM_EVENT_PORT_PHY_COPPER_LEN_WIDTH 32
  797. #define MUM_EVENT_PORT_PHY_CAPS_OFST 0
  798. #define MUM_EVENT_PORT_PHY_CAPS_LBN 0
  799. #define MUM_EVENT_PORT_PHY_CAPS_WIDTH 32
  800. #define MUM_EVENT_PORT_PHY_TECH_OFST 0
  801. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_UNKNOWN 0x0 /* enum */
  802. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_OPTICAL 0x1 /* enum */
  803. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE 0x2 /* enum */
  804. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE_EQUALIZED 0x3 /* enum */
  805. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_ACTIVE_LIMITING 0x4 /* enum */
  806. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_ACTIVE_LINEAR 0x5 /* enum */
  807. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_BASE_T 0x6 /* enum */
  808. #define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_LOOPBACK_PASSIVE 0x7 /* enum */
  809. #define MUM_EVENT_PORT_PHY_TECH_LBN 0
  810. #define MUM_EVENT_PORT_PHY_TECH_WIDTH 32
  811. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_LBN 36
  812. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_WIDTH 4
  813. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_FLAGS 0x0 /* enum */
  814. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_COPPER_LEN 0x1 /* enum */
  815. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_CAPS 0x2 /* enum */
  816. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_TECH 0x3 /* enum */
  817. #define MUM_EVENT_PORT_PHY_SRC_DATA_ID_MAX 0x4 /* enum */
  818. #define MUM_EVENT_PORT_PHY_SRC_PORT_NO_LBN 40
  819. #define MUM_EVENT_PORT_PHY_SRC_PORT_NO_WIDTH 4
  820. /***********************************/
  821. /* MC_CMD_READ32
  822. * Read multiple 32byte words from MC memory.
  823. */
  824. #define MC_CMD_READ32 0x1
  825. #define MC_CMD_0x1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  826. /* MC_CMD_READ32_IN msgrequest */
  827. #define MC_CMD_READ32_IN_LEN 8
  828. #define MC_CMD_READ32_IN_ADDR_OFST 0
  829. #define MC_CMD_READ32_IN_NUMWORDS_OFST 4
  830. /* MC_CMD_READ32_OUT msgresponse */
  831. #define MC_CMD_READ32_OUT_LENMIN 4
  832. #define MC_CMD_READ32_OUT_LENMAX 252
  833. #define MC_CMD_READ32_OUT_LEN(num) (0+4*(num))
  834. #define MC_CMD_READ32_OUT_BUFFER_OFST 0
  835. #define MC_CMD_READ32_OUT_BUFFER_LEN 4
  836. #define MC_CMD_READ32_OUT_BUFFER_MINNUM 1
  837. #define MC_CMD_READ32_OUT_BUFFER_MAXNUM 63
  838. /***********************************/
  839. /* MC_CMD_WRITE32
  840. * Write multiple 32byte words to MC memory.
  841. */
  842. #define MC_CMD_WRITE32 0x2
  843. #define MC_CMD_0x2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  844. /* MC_CMD_WRITE32_IN msgrequest */
  845. #define MC_CMD_WRITE32_IN_LENMIN 8
  846. #define MC_CMD_WRITE32_IN_LENMAX 252
  847. #define MC_CMD_WRITE32_IN_LEN(num) (4+4*(num))
  848. #define MC_CMD_WRITE32_IN_ADDR_OFST 0
  849. #define MC_CMD_WRITE32_IN_BUFFER_OFST 4
  850. #define MC_CMD_WRITE32_IN_BUFFER_LEN 4
  851. #define MC_CMD_WRITE32_IN_BUFFER_MINNUM 1
  852. #define MC_CMD_WRITE32_IN_BUFFER_MAXNUM 62
  853. /* MC_CMD_WRITE32_OUT msgresponse */
  854. #define MC_CMD_WRITE32_OUT_LEN 0
  855. /***********************************/
  856. /* MC_CMD_COPYCODE
  857. * Copy MC code between two locations and jump.
  858. */
  859. #define MC_CMD_COPYCODE 0x3
  860. #define MC_CMD_0x3_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  861. /* MC_CMD_COPYCODE_IN msgrequest */
  862. #define MC_CMD_COPYCODE_IN_LEN 16
  863. /* Source address
  864. *
  865. * The main image should be entered via a copy of a single word from and to a
  866. * magic address, which controls various aspects of the boot. The magic address
  867. * is a bitfield, with each bit as documented below.
  868. */
  869. #define MC_CMD_COPYCODE_IN_SRC_ADDR_OFST 0
  870. /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT (see below) */
  871. #define MC_CMD_COPYCODE_HUNT_NO_MAGIC_ADDR 0x10000
  872. /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT and
  873. * BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED (see below)
  874. */
  875. #define MC_CMD_COPYCODE_HUNT_NO_DATAPATH_MAGIC_ADDR 0x1d0d0
  876. /* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT,
  877. * BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED and BOOT_MAGIC_IGNORE_CONFIG (see
  878. * below)
  879. */
  880. #define MC_CMD_COPYCODE_HUNT_IGNORE_CONFIG_MAGIC_ADDR 0x1badc
  881. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_PRESENT_LBN 17
  882. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_PRESENT_WIDTH 1
  883. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED_LBN 2
  884. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED_WIDTH 1
  885. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_IGNORE_CONFIG_LBN 3
  886. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_IGNORE_CONFIG_WIDTH 1
  887. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_LBN 4
  888. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_WIDTH 1
  889. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_LBN 5
  890. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_WIDTH 1
  891. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_LBN 6
  892. #define MC_CMD_COPYCODE_IN_BOOT_MAGIC_DISABLE_XIP_WIDTH 1
  893. /* Destination address */
  894. #define MC_CMD_COPYCODE_IN_DEST_ADDR_OFST 4
  895. #define MC_CMD_COPYCODE_IN_NUMWORDS_OFST 8
  896. /* Address of where to jump after copy. */
  897. #define MC_CMD_COPYCODE_IN_JUMP_OFST 12
  898. /* enum: Control should return to the caller rather than jumping */
  899. #define MC_CMD_COPYCODE_JUMP_NONE 0x1
  900. /* MC_CMD_COPYCODE_OUT msgresponse */
  901. #define MC_CMD_COPYCODE_OUT_LEN 0
  902. /***********************************/
  903. /* MC_CMD_SET_FUNC
  904. * Select function for function-specific commands.
  905. */
  906. #define MC_CMD_SET_FUNC 0x4
  907. #define MC_CMD_0x4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  908. /* MC_CMD_SET_FUNC_IN msgrequest */
  909. #define MC_CMD_SET_FUNC_IN_LEN 4
  910. /* Set function */
  911. #define MC_CMD_SET_FUNC_IN_FUNC_OFST 0
  912. /* MC_CMD_SET_FUNC_OUT msgresponse */
  913. #define MC_CMD_SET_FUNC_OUT_LEN 0
  914. /***********************************/
  915. /* MC_CMD_GET_BOOT_STATUS
  916. * Get the instruction address from which the MC booted.
  917. */
  918. #define MC_CMD_GET_BOOT_STATUS 0x5
  919. #define MC_CMD_0x5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  920. /* MC_CMD_GET_BOOT_STATUS_IN msgrequest */
  921. #define MC_CMD_GET_BOOT_STATUS_IN_LEN 0
  922. /* MC_CMD_GET_BOOT_STATUS_OUT msgresponse */
  923. #define MC_CMD_GET_BOOT_STATUS_OUT_LEN 8
  924. /* ?? */
  925. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_OFST 0
  926. /* enum: indicates that the MC wasn't flash booted */
  927. #define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef
  928. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_OFST 4
  929. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_LBN 0
  930. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_WIDTH 1
  931. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_LBN 1
  932. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_PRIMARY_WIDTH 1
  933. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_BACKUP_LBN 2
  934. #define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_BACKUP_WIDTH 1
  935. /***********************************/
  936. /* MC_CMD_GET_ASSERTS
  937. * Get (and optionally clear) the current assertion status. Only
  938. * OUT.GLOBAL_FLAGS is guaranteed to exist in the completion payload. The other
  939. * fields will only be present if OUT.GLOBAL_FLAGS != NO_FAILS
  940. */
  941. #define MC_CMD_GET_ASSERTS 0x6
  942. #define MC_CMD_0x6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  943. /* MC_CMD_GET_ASSERTS_IN msgrequest */
  944. #define MC_CMD_GET_ASSERTS_IN_LEN 4
  945. /* Set to clear assertion */
  946. #define MC_CMD_GET_ASSERTS_IN_CLEAR_OFST 0
  947. /* MC_CMD_GET_ASSERTS_OUT msgresponse */
  948. #define MC_CMD_GET_ASSERTS_OUT_LEN 140
  949. /* Assertion status flag. */
  950. #define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_OFST 0
  951. /* enum: No assertions have failed. */
  952. #define MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS 0x1
  953. /* enum: A system-level assertion has failed. */
  954. #define MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL 0x2
  955. /* enum: A thread-level assertion has failed. */
  956. #define MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL 0x3
  957. /* enum: The system was reset by the watchdog. */
  958. #define MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED 0x4
  959. /* enum: An illegal address trap stopped the system (huntington and later) */
  960. #define MC_CMD_GET_ASSERTS_FLAGS_ADDR_TRAP 0x5
  961. /* Failing PC value */
  962. #define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_OFST 4
  963. /* Saved GP regs */
  964. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST 8
  965. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_LEN 4
  966. #define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_NUM 31
  967. /* enum: A magic value hinting that the value in this register at the time of
  968. * the failure has likely been lost.
  969. */
  970. #define MC_CMD_GET_ASSERTS_REG_NO_DATA 0xda7a1057
  971. /* Failing thread address */
  972. #define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_OFST 132
  973. #define MC_CMD_GET_ASSERTS_OUT_RESERVED_OFST 136
  974. /***********************************/
  975. /* MC_CMD_LOG_CTRL
  976. * Configure the output stream for log events such as link state changes,
  977. * sensor notifications and MCDI completions
  978. */
  979. #define MC_CMD_LOG_CTRL 0x7
  980. #define MC_CMD_0x7_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  981. /* MC_CMD_LOG_CTRL_IN msgrequest */
  982. #define MC_CMD_LOG_CTRL_IN_LEN 8
  983. /* Log destination */
  984. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_OFST 0
  985. /* enum: UART. */
  986. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_UART 0x1
  987. /* enum: Event queue. */
  988. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ 0x2
  989. /* Legacy argument. Must be zero. */
  990. #define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_OFST 4
  991. /* MC_CMD_LOG_CTRL_OUT msgresponse */
  992. #define MC_CMD_LOG_CTRL_OUT_LEN 0
  993. /***********************************/
  994. /* MC_CMD_GET_VERSION
  995. * Get version information about the MC firmware.
  996. */
  997. #define MC_CMD_GET_VERSION 0x8
  998. #define MC_CMD_0x8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  999. /* MC_CMD_GET_VERSION_IN msgrequest */
  1000. #define MC_CMD_GET_VERSION_IN_LEN 0
  1001. /* MC_CMD_GET_VERSION_EXT_IN msgrequest: Asks for the extended version */
  1002. #define MC_CMD_GET_VERSION_EXT_IN_LEN 4
  1003. /* placeholder, set to 0 */
  1004. #define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_OFST 0
  1005. /* MC_CMD_GET_VERSION_V0_OUT msgresponse: deprecated version format */
  1006. #define MC_CMD_GET_VERSION_V0_OUT_LEN 4
  1007. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0
  1008. /* enum: Reserved version number to indicate "any" version. */
  1009. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff
  1010. /* enum: Bootrom version value for Siena. */
  1011. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000
  1012. /* enum: Bootrom version value for Huntington. */
  1013. #define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001
  1014. /* MC_CMD_GET_VERSION_OUT msgresponse */
  1015. #define MC_CMD_GET_VERSION_OUT_LEN 32
  1016. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
  1017. /* Enum values, see field(s): */
  1018. /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
  1019. #define MC_CMD_GET_VERSION_OUT_PCOL_OFST 4
  1020. /* 128bit mask of functions supported by the current firmware */
  1021. #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_OFST 8
  1022. #define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_LEN 16
  1023. #define MC_CMD_GET_VERSION_OUT_VERSION_OFST 24
  1024. #define MC_CMD_GET_VERSION_OUT_VERSION_LEN 8
  1025. #define MC_CMD_GET_VERSION_OUT_VERSION_LO_OFST 24
  1026. #define MC_CMD_GET_VERSION_OUT_VERSION_HI_OFST 28
  1027. /* MC_CMD_GET_VERSION_EXT_OUT msgresponse */
  1028. #define MC_CMD_GET_VERSION_EXT_OUT_LEN 48
  1029. /* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
  1030. /* Enum values, see field(s): */
  1031. /* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
  1032. #define MC_CMD_GET_VERSION_EXT_OUT_PCOL_OFST 4
  1033. /* 128bit mask of functions supported by the current firmware */
  1034. #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_OFST 8
  1035. #define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_LEN 16
  1036. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_OFST 24
  1037. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LEN 8
  1038. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LO_OFST 24
  1039. #define MC_CMD_GET_VERSION_EXT_OUT_VERSION_HI_OFST 28
  1040. /* extra info */
  1041. #define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_OFST 32
  1042. #define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_LEN 16
  1043. /***********************************/
  1044. /* MC_CMD_PTP
  1045. * Perform PTP operation
  1046. */
  1047. #define MC_CMD_PTP 0xb
  1048. #define MC_CMD_0xb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1049. /* MC_CMD_PTP_IN msgrequest */
  1050. #define MC_CMD_PTP_IN_LEN 1
  1051. /* PTP operation code */
  1052. #define MC_CMD_PTP_IN_OP_OFST 0
  1053. #define MC_CMD_PTP_IN_OP_LEN 1
  1054. /* enum: Enable PTP packet timestamping operation. */
  1055. #define MC_CMD_PTP_OP_ENABLE 0x1
  1056. /* enum: Disable PTP packet timestamping operation. */
  1057. #define MC_CMD_PTP_OP_DISABLE 0x2
  1058. /* enum: Send a PTP packet. */
  1059. #define MC_CMD_PTP_OP_TRANSMIT 0x3
  1060. /* enum: Read the current NIC time. */
  1061. #define MC_CMD_PTP_OP_READ_NIC_TIME 0x4
  1062. /* enum: Get the current PTP status. */
  1063. #define MC_CMD_PTP_OP_STATUS 0x5
  1064. /* enum: Adjust the PTP NIC's time. */
  1065. #define MC_CMD_PTP_OP_ADJUST 0x6
  1066. /* enum: Synchronize host and NIC time. */
  1067. #define MC_CMD_PTP_OP_SYNCHRONIZE 0x7
  1068. /* enum: Basic manufacturing tests. */
  1069. #define MC_CMD_PTP_OP_MANFTEST_BASIC 0x8
  1070. /* enum: Packet based manufacturing tests. */
  1071. #define MC_CMD_PTP_OP_MANFTEST_PACKET 0x9
  1072. /* enum: Reset some of the PTP related statistics */
  1073. #define MC_CMD_PTP_OP_RESET_STATS 0xa
  1074. /* enum: Debug operations to MC. */
  1075. #define MC_CMD_PTP_OP_DEBUG 0xb
  1076. /* enum: Read an FPGA register */
  1077. #define MC_CMD_PTP_OP_FPGAREAD 0xc
  1078. /* enum: Write an FPGA register */
  1079. #define MC_CMD_PTP_OP_FPGAWRITE 0xd
  1080. /* enum: Apply an offset to the NIC clock */
  1081. #define MC_CMD_PTP_OP_CLOCK_OFFSET_ADJUST 0xe
  1082. /* enum: Change Apply an offset to the NIC clock */
  1083. #define MC_CMD_PTP_OP_CLOCK_FREQ_ADJUST 0xf
  1084. /* enum: Set the MC packet filter VLAN tags for received PTP packets */
  1085. #define MC_CMD_PTP_OP_RX_SET_VLAN_FILTER 0x10
  1086. /* enum: Set the MC packet filter UUID for received PTP packets */
  1087. #define MC_CMD_PTP_OP_RX_SET_UUID_FILTER 0x11
  1088. /* enum: Set the MC packet filter Domain for received PTP packets */
  1089. #define MC_CMD_PTP_OP_RX_SET_DOMAIN_FILTER 0x12
  1090. /* enum: Set the clock source */
  1091. #define MC_CMD_PTP_OP_SET_CLK_SRC 0x13
  1092. /* enum: Reset value of Timer Reg. */
  1093. #define MC_CMD_PTP_OP_RST_CLK 0x14
  1094. /* enum: Enable the forwarding of PPS events to the host */
  1095. #define MC_CMD_PTP_OP_PPS_ENABLE 0x15
  1096. /* enum: Get the time format used by this NIC for PTP operations */
  1097. #define MC_CMD_PTP_OP_GET_TIME_FORMAT 0x16
  1098. /* enum: Get the clock attributes. NOTE- extended version of
  1099. * MC_CMD_PTP_OP_GET_TIME_FORMAT
  1100. */
  1101. #define MC_CMD_PTP_OP_GET_ATTRIBUTES 0x16
  1102. /* enum: Get corrections that should be applied to the various different
  1103. * timestamps
  1104. */
  1105. #define MC_CMD_PTP_OP_GET_TIMESTAMP_CORRECTIONS 0x17
  1106. /* enum: Subscribe to receive periodic time events indicating the current NIC
  1107. * time
  1108. */
  1109. #define MC_CMD_PTP_OP_TIME_EVENT_SUBSCRIBE 0x18
  1110. /* enum: Unsubscribe to stop receiving time events */
  1111. #define MC_CMD_PTP_OP_TIME_EVENT_UNSUBSCRIBE 0x19
  1112. /* enum: PPS based manfacturing tests. Requires PPS output to be looped to PPS
  1113. * input on the same NIC.
  1114. */
  1115. #define MC_CMD_PTP_OP_MANFTEST_PPS 0x1a
  1116. /* enum: Set the PTP sync status. Status is used by firmware to report to event
  1117. * subscribers.
  1118. */
  1119. #define MC_CMD_PTP_OP_SET_SYNC_STATUS 0x1b
  1120. /* enum: Above this for future use. */
  1121. #define MC_CMD_PTP_OP_MAX 0x1c
  1122. /* MC_CMD_PTP_IN_ENABLE msgrequest */
  1123. #define MC_CMD_PTP_IN_ENABLE_LEN 16
  1124. #define MC_CMD_PTP_IN_CMD_OFST 0
  1125. #define MC_CMD_PTP_IN_PERIPH_ID_OFST 4
  1126. /* Event queue for PTP events */
  1127. #define MC_CMD_PTP_IN_ENABLE_QUEUE_OFST 8
  1128. /* PTP timestamping mode */
  1129. #define MC_CMD_PTP_IN_ENABLE_MODE_OFST 12
  1130. /* enum: PTP, version 1 */
  1131. #define MC_CMD_PTP_MODE_V1 0x0
  1132. /* enum: PTP, version 1, with VLAN headers - deprecated */
  1133. #define MC_CMD_PTP_MODE_V1_VLAN 0x1
  1134. /* enum: PTP, version 2 */
  1135. #define MC_CMD_PTP_MODE_V2 0x2
  1136. /* enum: PTP, version 2, with VLAN headers - deprecated */
  1137. #define MC_CMD_PTP_MODE_V2_VLAN 0x3
  1138. /* enum: PTP, version 2, with improved UUID filtering */
  1139. #define MC_CMD_PTP_MODE_V2_ENHANCED 0x4
  1140. /* enum: FCoE (seconds and microseconds) */
  1141. #define MC_CMD_PTP_MODE_FCOE 0x5
  1142. /* MC_CMD_PTP_IN_DISABLE msgrequest */
  1143. #define MC_CMD_PTP_IN_DISABLE_LEN 8
  1144. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1145. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1146. /* MC_CMD_PTP_IN_TRANSMIT msgrequest */
  1147. #define MC_CMD_PTP_IN_TRANSMIT_LENMIN 13
  1148. #define MC_CMD_PTP_IN_TRANSMIT_LENMAX 252
  1149. #define MC_CMD_PTP_IN_TRANSMIT_LEN(num) (12+1*(num))
  1150. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1151. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1152. /* Transmit packet length */
  1153. #define MC_CMD_PTP_IN_TRANSMIT_LENGTH_OFST 8
  1154. /* Transmit packet data */
  1155. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_OFST 12
  1156. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_LEN 1
  1157. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_MINNUM 1
  1158. #define MC_CMD_PTP_IN_TRANSMIT_PACKET_MAXNUM 240
  1159. /* MC_CMD_PTP_IN_READ_NIC_TIME msgrequest */
  1160. #define MC_CMD_PTP_IN_READ_NIC_TIME_LEN 8
  1161. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1162. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1163. /* MC_CMD_PTP_IN_STATUS msgrequest */
  1164. #define MC_CMD_PTP_IN_STATUS_LEN 8
  1165. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1166. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1167. /* MC_CMD_PTP_IN_ADJUST msgrequest */
  1168. #define MC_CMD_PTP_IN_ADJUST_LEN 24
  1169. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1170. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1171. /* Frequency adjustment 40 bit fixed point ns */
  1172. #define MC_CMD_PTP_IN_ADJUST_FREQ_OFST 8
  1173. #define MC_CMD_PTP_IN_ADJUST_FREQ_LEN 8
  1174. #define MC_CMD_PTP_IN_ADJUST_FREQ_LO_OFST 8
  1175. #define MC_CMD_PTP_IN_ADJUST_FREQ_HI_OFST 12
  1176. /* enum: Number of fractional bits in frequency adjustment */
  1177. #define MC_CMD_PTP_IN_ADJUST_BITS 0x28
  1178. /* Time adjustment in seconds */
  1179. #define MC_CMD_PTP_IN_ADJUST_SECONDS_OFST 16
  1180. /* Time adjustment major value */
  1181. #define MC_CMD_PTP_IN_ADJUST_MAJOR_OFST 16
  1182. /* Time adjustment in nanoseconds */
  1183. #define MC_CMD_PTP_IN_ADJUST_NANOSECONDS_OFST 20
  1184. /* Time adjustment minor value */
  1185. #define MC_CMD_PTP_IN_ADJUST_MINOR_OFST 20
  1186. /* MC_CMD_PTP_IN_SYNCHRONIZE msgrequest */
  1187. #define MC_CMD_PTP_IN_SYNCHRONIZE_LEN 20
  1188. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1189. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1190. /* Number of time readings to capture */
  1191. #define MC_CMD_PTP_IN_SYNCHRONIZE_NUMTIMESETS_OFST 8
  1192. /* Host address in which to write "synchronization started" indication (64
  1193. * bits)
  1194. */
  1195. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_OFST 12
  1196. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LEN 8
  1197. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LO_OFST 12
  1198. #define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_HI_OFST 16
  1199. /* MC_CMD_PTP_IN_MANFTEST_BASIC msgrequest */
  1200. #define MC_CMD_PTP_IN_MANFTEST_BASIC_LEN 8
  1201. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1202. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1203. /* MC_CMD_PTP_IN_MANFTEST_PACKET msgrequest */
  1204. #define MC_CMD_PTP_IN_MANFTEST_PACKET_LEN 12
  1205. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1206. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1207. /* Enable or disable packet testing */
  1208. #define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_OFST 8
  1209. /* MC_CMD_PTP_IN_RESET_STATS msgrequest */
  1210. #define MC_CMD_PTP_IN_RESET_STATS_LEN 8
  1211. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1212. /* Reset PTP statistics */
  1213. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1214. /* MC_CMD_PTP_IN_DEBUG msgrequest */
  1215. #define MC_CMD_PTP_IN_DEBUG_LEN 12
  1216. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1217. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1218. /* Debug operations */
  1219. #define MC_CMD_PTP_IN_DEBUG_DEBUG_PARAM_OFST 8
  1220. /* MC_CMD_PTP_IN_FPGAREAD msgrequest */
  1221. #define MC_CMD_PTP_IN_FPGAREAD_LEN 16
  1222. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1223. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1224. #define MC_CMD_PTP_IN_FPGAREAD_ADDR_OFST 8
  1225. #define MC_CMD_PTP_IN_FPGAREAD_NUMBYTES_OFST 12
  1226. /* MC_CMD_PTP_IN_FPGAWRITE msgrequest */
  1227. #define MC_CMD_PTP_IN_FPGAWRITE_LENMIN 13
  1228. #define MC_CMD_PTP_IN_FPGAWRITE_LENMAX 252
  1229. #define MC_CMD_PTP_IN_FPGAWRITE_LEN(num) (12+1*(num))
  1230. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1231. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1232. #define MC_CMD_PTP_IN_FPGAWRITE_ADDR_OFST 8
  1233. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_OFST 12
  1234. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_LEN 1
  1235. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_MINNUM 1
  1236. #define MC_CMD_PTP_IN_FPGAWRITE_BUFFER_MAXNUM 240
  1237. /* MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST msgrequest */
  1238. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_LEN 16
  1239. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1240. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1241. /* Time adjustment in seconds */
  1242. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_SECONDS_OFST 8
  1243. /* Time adjustment major value */
  1244. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MAJOR_OFST 8
  1245. /* Time adjustment in nanoseconds */
  1246. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_NANOSECONDS_OFST 12
  1247. /* Time adjustment minor value */
  1248. #define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MINOR_OFST 12
  1249. /* MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST msgrequest */
  1250. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_LEN 16
  1251. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1252. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1253. /* Frequency adjustment 40 bit fixed point ns */
  1254. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_OFST 8
  1255. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LEN 8
  1256. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LO_OFST 8
  1257. #define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_HI_OFST 12
  1258. /* enum: Number of fractional bits in frequency adjustment */
  1259. /* MC_CMD_PTP_IN_ADJUST_BITS 0x28 */
  1260. /* MC_CMD_PTP_IN_RX_SET_VLAN_FILTER msgrequest */
  1261. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_LEN 24
  1262. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1263. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1264. /* Number of VLAN tags, 0 if not VLAN */
  1265. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_NUM_VLAN_TAGS_OFST 8
  1266. /* Set of VLAN tags to filter against */
  1267. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_OFST 12
  1268. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_LEN 4
  1269. #define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_NUM 3
  1270. /* MC_CMD_PTP_IN_RX_SET_UUID_FILTER msgrequest */
  1271. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_LEN 20
  1272. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1273. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1274. /* 1 to enable UUID filtering, 0 to disable */
  1275. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_ENABLE_OFST 8
  1276. /* UUID to filter against */
  1277. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_OFST 12
  1278. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LEN 8
  1279. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LO_OFST 12
  1280. #define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_HI_OFST 16
  1281. /* MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER msgrequest */
  1282. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_LEN 16
  1283. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1284. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1285. /* 1 to enable Domain filtering, 0 to disable */
  1286. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_ENABLE_OFST 8
  1287. /* Domain number to filter against */
  1288. #define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_DOMAIN_OFST 12
  1289. /* MC_CMD_PTP_IN_SET_CLK_SRC msgrequest */
  1290. #define MC_CMD_PTP_IN_SET_CLK_SRC_LEN 12
  1291. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1292. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1293. /* Set the clock source. */
  1294. #define MC_CMD_PTP_IN_SET_CLK_SRC_CLK_OFST 8
  1295. /* enum: Internal. */
  1296. #define MC_CMD_PTP_CLK_SRC_INTERNAL 0x0
  1297. /* enum: External. */
  1298. #define MC_CMD_PTP_CLK_SRC_EXTERNAL 0x1
  1299. /* MC_CMD_PTP_IN_RST_CLK msgrequest */
  1300. #define MC_CMD_PTP_IN_RST_CLK_LEN 8
  1301. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1302. /* Reset value of Timer Reg. */
  1303. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1304. /* MC_CMD_PTP_IN_PPS_ENABLE msgrequest */
  1305. #define MC_CMD_PTP_IN_PPS_ENABLE_LEN 12
  1306. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1307. /* Enable or disable */
  1308. #define MC_CMD_PTP_IN_PPS_ENABLE_OP_OFST 4
  1309. /* enum: Enable */
  1310. #define MC_CMD_PTP_ENABLE_PPS 0x0
  1311. /* enum: Disable */
  1312. #define MC_CMD_PTP_DISABLE_PPS 0x1
  1313. /* Queue id to send events back */
  1314. #define MC_CMD_PTP_IN_PPS_ENABLE_QUEUE_ID_OFST 8
  1315. /* MC_CMD_PTP_IN_GET_TIME_FORMAT msgrequest */
  1316. #define MC_CMD_PTP_IN_GET_TIME_FORMAT_LEN 8
  1317. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1318. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1319. /* MC_CMD_PTP_IN_GET_ATTRIBUTES msgrequest */
  1320. #define MC_CMD_PTP_IN_GET_ATTRIBUTES_LEN 8
  1321. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1322. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1323. /* MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS msgrequest */
  1324. #define MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS_LEN 8
  1325. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1326. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1327. /* MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE msgrequest */
  1328. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_LEN 12
  1329. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1330. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1331. /* Original field containing queue ID. Now extended to include flags. */
  1332. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_OFST 8
  1333. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_ID_LBN 0
  1334. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_ID_WIDTH 16
  1335. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_REPORT_SYNC_STATUS_LBN 31
  1336. #define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_REPORT_SYNC_STATUS_WIDTH 1
  1337. /* MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE msgrequest */
  1338. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_LEN 16
  1339. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1340. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1341. /* Unsubscribe options */
  1342. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_CONTROL_OFST 8
  1343. /* enum: Unsubscribe a single queue */
  1344. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_SINGLE 0x0
  1345. /* enum: Unsubscribe all queues */
  1346. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_ALL 0x1
  1347. /* Event queue ID */
  1348. #define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE_OFST 12
  1349. /* MC_CMD_PTP_IN_MANFTEST_PPS msgrequest */
  1350. #define MC_CMD_PTP_IN_MANFTEST_PPS_LEN 12
  1351. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1352. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1353. /* 1 to enable PPS test mode, 0 to disable and return result. */
  1354. #define MC_CMD_PTP_IN_MANFTEST_PPS_TEST_ENABLE_OFST 8
  1355. /* MC_CMD_PTP_IN_SET_SYNC_STATUS msgrequest */
  1356. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_LEN 24
  1357. /* MC_CMD_PTP_IN_CMD_OFST 0 */
  1358. /* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
  1359. /* NIC - Host System Clock Synchronization status */
  1360. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_STATUS_OFST 8
  1361. /* enum: Host System clock and NIC clock are not in sync */
  1362. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_NOT_IN_SYNC 0x0
  1363. /* enum: Host System clock and NIC clock are synchronized */
  1364. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_IN_SYNC 0x1
  1365. /* If synchronized, number of seconds until clocks should be considered to be
  1366. * no longer in sync.
  1367. */
  1368. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_TIMEOUT_OFST 12
  1369. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED0_OFST 16
  1370. #define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED1_OFST 20
  1371. /* MC_CMD_PTP_OUT msgresponse */
  1372. #define MC_CMD_PTP_OUT_LEN 0
  1373. /* MC_CMD_PTP_OUT_TRANSMIT msgresponse */
  1374. #define MC_CMD_PTP_OUT_TRANSMIT_LEN 8
  1375. /* Value of seconds timestamp */
  1376. #define MC_CMD_PTP_OUT_TRANSMIT_SECONDS_OFST 0
  1377. /* Timestamp major value */
  1378. #define MC_CMD_PTP_OUT_TRANSMIT_MAJOR_OFST 0
  1379. /* Value of nanoseconds timestamp */
  1380. #define MC_CMD_PTP_OUT_TRANSMIT_NANOSECONDS_OFST 4
  1381. /* Timestamp minor value */
  1382. #define MC_CMD_PTP_OUT_TRANSMIT_MINOR_OFST 4
  1383. /* MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE msgresponse */
  1384. #define MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE_LEN 0
  1385. /* MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE msgresponse */
  1386. #define MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE_LEN 0
  1387. /* MC_CMD_PTP_OUT_READ_NIC_TIME msgresponse */
  1388. #define MC_CMD_PTP_OUT_READ_NIC_TIME_LEN 8
  1389. /* Value of seconds timestamp */
  1390. #define MC_CMD_PTP_OUT_READ_NIC_TIME_SECONDS_OFST 0
  1391. /* Timestamp major value */
  1392. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MAJOR_OFST 0
  1393. /* Value of nanoseconds timestamp */
  1394. #define MC_CMD_PTP_OUT_READ_NIC_TIME_NANOSECONDS_OFST 4
  1395. /* Timestamp minor value */
  1396. #define MC_CMD_PTP_OUT_READ_NIC_TIME_MINOR_OFST 4
  1397. /* MC_CMD_PTP_OUT_STATUS msgresponse */
  1398. #define MC_CMD_PTP_OUT_STATUS_LEN 64
  1399. /* Frequency of NIC's hardware clock */
  1400. #define MC_CMD_PTP_OUT_STATUS_CLOCK_FREQ_OFST 0
  1401. /* Number of packets transmitted and timestamped */
  1402. #define MC_CMD_PTP_OUT_STATUS_STATS_TX_OFST 4
  1403. /* Number of packets received and timestamped */
  1404. #define MC_CMD_PTP_OUT_STATUS_STATS_RX_OFST 8
  1405. /* Number of packets timestamped by the FPGA */
  1406. #define MC_CMD_PTP_OUT_STATUS_STATS_TS_OFST 12
  1407. /* Number of packets filter matched */
  1408. #define MC_CMD_PTP_OUT_STATUS_STATS_FM_OFST 16
  1409. /* Number of packets not filter matched */
  1410. #define MC_CMD_PTP_OUT_STATUS_STATS_NFM_OFST 20
  1411. /* Number of PPS overflows (noise on input?) */
  1412. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFLOW_OFST 24
  1413. /* Number of PPS bad periods */
  1414. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_BAD_OFST 28
  1415. /* Minimum period of PPS pulse in nanoseconds */
  1416. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MIN_OFST 32
  1417. /* Maximum period of PPS pulse in nanoseconds */
  1418. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MAX_OFST 36
  1419. /* Last period of PPS pulse in nanoseconds */
  1420. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_LAST_OFST 40
  1421. /* Mean period of PPS pulse in nanoseconds */
  1422. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MEAN_OFST 44
  1423. /* Minimum offset of PPS pulse in nanoseconds (signed) */
  1424. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MIN_OFST 48
  1425. /* Maximum offset of PPS pulse in nanoseconds (signed) */
  1426. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MAX_OFST 52
  1427. /* Last offset of PPS pulse in nanoseconds (signed) */
  1428. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_LAST_OFST 56
  1429. /* Mean offset of PPS pulse in nanoseconds (signed) */
  1430. #define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MEAN_OFST 60
  1431. /* MC_CMD_PTP_OUT_SYNCHRONIZE msgresponse */
  1432. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMIN 20
  1433. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMAX 240
  1434. #define MC_CMD_PTP_OUT_SYNCHRONIZE_LEN(num) (0+20*(num))
  1435. /* A set of host and NIC times */
  1436. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_OFST 0
  1437. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_LEN 20
  1438. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MINNUM 1
  1439. #define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MAXNUM 12
  1440. /* Host time immediately before NIC's hardware clock read */
  1441. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTSTART_OFST 0
  1442. /* Value of seconds timestamp */
  1443. #define MC_CMD_PTP_OUT_SYNCHRONIZE_SECONDS_OFST 4
  1444. /* Timestamp major value */
  1445. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MAJOR_OFST 4
  1446. /* Value of nanoseconds timestamp */
  1447. #define MC_CMD_PTP_OUT_SYNCHRONIZE_NANOSECONDS_OFST 8
  1448. /* Timestamp minor value */
  1449. #define MC_CMD_PTP_OUT_SYNCHRONIZE_MINOR_OFST 8
  1450. /* Host time immediately after NIC's hardware clock read */
  1451. #define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTEND_OFST 12
  1452. /* Number of nanoseconds waited after reading NIC's hardware clock */
  1453. #define MC_CMD_PTP_OUT_SYNCHRONIZE_WAITNS_OFST 16
  1454. /* MC_CMD_PTP_OUT_MANFTEST_BASIC msgresponse */
  1455. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_LEN 8
  1456. /* Results of testing */
  1457. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_RESULT_OFST 0
  1458. /* enum: Successful test */
  1459. #define MC_CMD_PTP_MANF_SUCCESS 0x0
  1460. /* enum: FPGA load failed */
  1461. #define MC_CMD_PTP_MANF_FPGA_LOAD 0x1
  1462. /* enum: FPGA version invalid */
  1463. #define MC_CMD_PTP_MANF_FPGA_VERSION 0x2
  1464. /* enum: FPGA registers incorrect */
  1465. #define MC_CMD_PTP_MANF_FPGA_REGISTERS 0x3
  1466. /* enum: Oscillator possibly not working? */
  1467. #define MC_CMD_PTP_MANF_OSCILLATOR 0x4
  1468. /* enum: Timestamps not increasing */
  1469. #define MC_CMD_PTP_MANF_TIMESTAMPS 0x5
  1470. /* enum: Mismatched packet count */
  1471. #define MC_CMD_PTP_MANF_PACKET_COUNT 0x6
  1472. /* enum: Mismatched packet count (Siena filter and FPGA) */
  1473. #define MC_CMD_PTP_MANF_FILTER_COUNT 0x7
  1474. /* enum: Not enough packets to perform timestamp check */
  1475. #define MC_CMD_PTP_MANF_PACKET_ENOUGH 0x8
  1476. /* enum: Timestamp trigger GPIO not working */
  1477. #define MC_CMD_PTP_MANF_GPIO_TRIGGER 0x9
  1478. /* enum: Insufficient PPS events to perform checks */
  1479. #define MC_CMD_PTP_MANF_PPS_ENOUGH 0xa
  1480. /* enum: PPS time event period not sufficiently close to 1s. */
  1481. #define MC_CMD_PTP_MANF_PPS_PERIOD 0xb
  1482. /* enum: PPS time event nS reading not sufficiently close to zero. */
  1483. #define MC_CMD_PTP_MANF_PPS_NS 0xc
  1484. /* enum: PTP peripheral registers incorrect */
  1485. #define MC_CMD_PTP_MANF_REGISTERS 0xd
  1486. /* enum: Failed to read time from PTP peripheral */
  1487. #define MC_CMD_PTP_MANF_CLOCK_READ 0xe
  1488. /* Presence of external oscillator */
  1489. #define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_EXTOSC_OFST 4
  1490. /* MC_CMD_PTP_OUT_MANFTEST_PACKET msgresponse */
  1491. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_LEN 12
  1492. /* Results of testing */
  1493. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_RESULT_OFST 0
  1494. /* Number of packets received by FPGA */
  1495. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FPGACOUNT_OFST 4
  1496. /* Number of packets received by Siena filters */
  1497. #define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FILTERCOUNT_OFST 8
  1498. /* MC_CMD_PTP_OUT_FPGAREAD msgresponse */
  1499. #define MC_CMD_PTP_OUT_FPGAREAD_LENMIN 1
  1500. #define MC_CMD_PTP_OUT_FPGAREAD_LENMAX 252
  1501. #define MC_CMD_PTP_OUT_FPGAREAD_LEN(num) (0+1*(num))
  1502. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_OFST 0
  1503. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_LEN 1
  1504. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MINNUM 1
  1505. #define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MAXNUM 252
  1506. /* MC_CMD_PTP_OUT_GET_TIME_FORMAT msgresponse */
  1507. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_LEN 4
  1508. /* Time format required/used by for this NIC. Applies to all PTP MCDI
  1509. * operations that pass times between the host and firmware. If this operation
  1510. * is not supported (older firmware) a format of seconds and nanoseconds should
  1511. * be assumed.
  1512. */
  1513. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_FORMAT_OFST 0
  1514. /* enum: Times are in seconds and nanoseconds */
  1515. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_NANOSECONDS 0x0
  1516. /* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
  1517. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_16SECONDS_8NANOSECONDS 0x1
  1518. /* enum: Major register has units of seconds, minor 2^-27s per tick */
  1519. #define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_27FRACTION 0x2
  1520. /* MC_CMD_PTP_OUT_GET_ATTRIBUTES msgresponse */
  1521. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_LEN 24
  1522. /* Time format required/used by for this NIC. Applies to all PTP MCDI
  1523. * operations that pass times between the host and firmware. If this operation
  1524. * is not supported (older firmware) a format of seconds and nanoseconds should
  1525. * be assumed.
  1526. */
  1527. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT_OFST 0
  1528. /* enum: Times are in seconds and nanoseconds */
  1529. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS 0x0
  1530. /* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
  1531. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_16SECONDS_8NANOSECONDS 0x1
  1532. /* enum: Major register has units of seconds, minor 2^-27s per tick */
  1533. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_27FRACTION 0x2
  1534. /* Minimum acceptable value for a corrected synchronization timeset. When
  1535. * comparing host and NIC clock times, the MC returns a set of samples that
  1536. * contain the host start and end time, the MC time when the host start was
  1537. * detected and the time the MC waited between reading the time and detecting
  1538. * the host end. The corrected sync window is the difference between the host
  1539. * end and start times minus the time that the MC waited for host end.
  1540. */
  1541. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SYNC_WINDOW_MIN_OFST 4
  1542. /* Various PTP capabilities */
  1543. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_CAPABILITIES_OFST 8
  1544. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_LBN 0
  1545. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_WIDTH 1
  1546. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RX_TSTAMP_OOB_LBN 1
  1547. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RX_TSTAMP_OOB_WIDTH 1
  1548. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED0_OFST 12
  1549. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED1_OFST 16
  1550. #define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED2_OFST 20
  1551. /* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS msgresponse */
  1552. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_LEN 16
  1553. /* Uncorrected error on PTP transmit timestamps in NIC clock format */
  1554. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT_OFST 0
  1555. /* Uncorrected error on PTP receive timestamps in NIC clock format */
  1556. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_RECEIVE_OFST 4
  1557. /* Uncorrected error on PPS output in NIC clock format */
  1558. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_OUT_OFST 8
  1559. /* Uncorrected error on PPS input in NIC clock format */
  1560. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_IN_OFST 12
  1561. /* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2 msgresponse */
  1562. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_LEN 24
  1563. /* Uncorrected error on PTP transmit timestamps in NIC clock format */
  1564. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_TX_OFST 0
  1565. /* Uncorrected error on PTP receive timestamps in NIC clock format */
  1566. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PTP_RX_OFST 4
  1567. /* Uncorrected error on PPS output in NIC clock format */
  1568. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_OUT_OFST 8
  1569. /* Uncorrected error on PPS input in NIC clock format */
  1570. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_PPS_IN_OFST 12
  1571. /* Uncorrected error on non-PTP transmit timestamps in NIC clock format */
  1572. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_TX_OFST 16
  1573. /* Uncorrected error on non-PTP receive timestamps in NIC clock format */
  1574. #define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_V2_GENERAL_RX_OFST 20
  1575. /* MC_CMD_PTP_OUT_MANFTEST_PPS msgresponse */
  1576. #define MC_CMD_PTP_OUT_MANFTEST_PPS_LEN 4
  1577. /* Results of testing */
  1578. #define MC_CMD_PTP_OUT_MANFTEST_PPS_TEST_RESULT_OFST 0
  1579. /* Enum values, see field(s): */
  1580. /* MC_CMD_PTP_OUT_MANFTEST_BASIC/TEST_RESULT */
  1581. /* MC_CMD_PTP_OUT_SET_SYNC_STATUS msgresponse */
  1582. #define MC_CMD_PTP_OUT_SET_SYNC_STATUS_LEN 0
  1583. /***********************************/
  1584. /* MC_CMD_CSR_READ32
  1585. * Read 32bit words from the indirect memory map.
  1586. */
  1587. #define MC_CMD_CSR_READ32 0xc
  1588. #define MC_CMD_0xc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1589. /* MC_CMD_CSR_READ32_IN msgrequest */
  1590. #define MC_CMD_CSR_READ32_IN_LEN 12
  1591. /* Address */
  1592. #define MC_CMD_CSR_READ32_IN_ADDR_OFST 0
  1593. #define MC_CMD_CSR_READ32_IN_STEP_OFST 4
  1594. #define MC_CMD_CSR_READ32_IN_NUMWORDS_OFST 8
  1595. /* MC_CMD_CSR_READ32_OUT msgresponse */
  1596. #define MC_CMD_CSR_READ32_OUT_LENMIN 4
  1597. #define MC_CMD_CSR_READ32_OUT_LENMAX 252
  1598. #define MC_CMD_CSR_READ32_OUT_LEN(num) (0+4*(num))
  1599. /* The last dword is the status, not a value read */
  1600. #define MC_CMD_CSR_READ32_OUT_BUFFER_OFST 0
  1601. #define MC_CMD_CSR_READ32_OUT_BUFFER_LEN 4
  1602. #define MC_CMD_CSR_READ32_OUT_BUFFER_MINNUM 1
  1603. #define MC_CMD_CSR_READ32_OUT_BUFFER_MAXNUM 63
  1604. /***********************************/
  1605. /* MC_CMD_CSR_WRITE32
  1606. * Write 32bit dwords to the indirect memory map.
  1607. */
  1608. #define MC_CMD_CSR_WRITE32 0xd
  1609. #define MC_CMD_0xd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1610. /* MC_CMD_CSR_WRITE32_IN msgrequest */
  1611. #define MC_CMD_CSR_WRITE32_IN_LENMIN 12
  1612. #define MC_CMD_CSR_WRITE32_IN_LENMAX 252
  1613. #define MC_CMD_CSR_WRITE32_IN_LEN(num) (8+4*(num))
  1614. /* Address */
  1615. #define MC_CMD_CSR_WRITE32_IN_ADDR_OFST 0
  1616. #define MC_CMD_CSR_WRITE32_IN_STEP_OFST 4
  1617. #define MC_CMD_CSR_WRITE32_IN_BUFFER_OFST 8
  1618. #define MC_CMD_CSR_WRITE32_IN_BUFFER_LEN 4
  1619. #define MC_CMD_CSR_WRITE32_IN_BUFFER_MINNUM 1
  1620. #define MC_CMD_CSR_WRITE32_IN_BUFFER_MAXNUM 61
  1621. /* MC_CMD_CSR_WRITE32_OUT msgresponse */
  1622. #define MC_CMD_CSR_WRITE32_OUT_LEN 4
  1623. #define MC_CMD_CSR_WRITE32_OUT_STATUS_OFST 0
  1624. /***********************************/
  1625. /* MC_CMD_HP
  1626. * These commands are used for HP related features. They are grouped under one
  1627. * MCDI command to avoid creating too many MCDI commands.
  1628. */
  1629. #define MC_CMD_HP 0x54
  1630. #define MC_CMD_0x54_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1631. /* MC_CMD_HP_IN msgrequest */
  1632. #define MC_CMD_HP_IN_LEN 16
  1633. /* HP OCSD sub-command. When address is not NULL, request activation of OCSD at
  1634. * the specified address with the specified interval.When address is NULL,
  1635. * INTERVAL is interpreted as a command: 0: stop OCSD / 1: Report OCSD current
  1636. * state / 2: (debug) Show temperature reported by one of the supported
  1637. * sensors.
  1638. */
  1639. #define MC_CMD_HP_IN_SUBCMD_OFST 0
  1640. /* enum: OCSD (Option Card Sensor Data) sub-command. */
  1641. #define MC_CMD_HP_IN_OCSD_SUBCMD 0x0
  1642. /* enum: Last known valid HP sub-command. */
  1643. #define MC_CMD_HP_IN_LAST_SUBCMD 0x0
  1644. /* The address to the array of sensor fields. (Or NULL to use a sub-command.)
  1645. */
  1646. #define MC_CMD_HP_IN_OCSD_ADDR_OFST 4
  1647. #define MC_CMD_HP_IN_OCSD_ADDR_LEN 8
  1648. #define MC_CMD_HP_IN_OCSD_ADDR_LO_OFST 4
  1649. #define MC_CMD_HP_IN_OCSD_ADDR_HI_OFST 8
  1650. /* The requested update interval, in seconds. (Or the sub-command if ADDR is
  1651. * NULL.)
  1652. */
  1653. #define MC_CMD_HP_IN_OCSD_INTERVAL_OFST 12
  1654. /* MC_CMD_HP_OUT msgresponse */
  1655. #define MC_CMD_HP_OUT_LEN 4
  1656. #define MC_CMD_HP_OUT_OCSD_STATUS_OFST 0
  1657. /* enum: OCSD stopped for this card. */
  1658. #define MC_CMD_HP_OUT_OCSD_STOPPED 0x1
  1659. /* enum: OCSD was successfully started with the address provided. */
  1660. #define MC_CMD_HP_OUT_OCSD_STARTED 0x2
  1661. /* enum: OCSD was already started for this card. */
  1662. #define MC_CMD_HP_OUT_OCSD_ALREADY_STARTED 0x3
  1663. /***********************************/
  1664. /* MC_CMD_STACKINFO
  1665. * Get stack information.
  1666. */
  1667. #define MC_CMD_STACKINFO 0xf
  1668. #define MC_CMD_0xf_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1669. /* MC_CMD_STACKINFO_IN msgrequest */
  1670. #define MC_CMD_STACKINFO_IN_LEN 0
  1671. /* MC_CMD_STACKINFO_OUT msgresponse */
  1672. #define MC_CMD_STACKINFO_OUT_LENMIN 12
  1673. #define MC_CMD_STACKINFO_OUT_LENMAX 252
  1674. #define MC_CMD_STACKINFO_OUT_LEN(num) (0+12*(num))
  1675. /* (thread ptr, stack size, free space) for each thread in system */
  1676. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_OFST 0
  1677. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_LEN 12
  1678. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_MINNUM 1
  1679. #define MC_CMD_STACKINFO_OUT_THREAD_INFO_MAXNUM 21
  1680. /***********************************/
  1681. /* MC_CMD_MDIO_READ
  1682. * MDIO register read.
  1683. */
  1684. #define MC_CMD_MDIO_READ 0x10
  1685. #define MC_CMD_0x10_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1686. /* MC_CMD_MDIO_READ_IN msgrequest */
  1687. #define MC_CMD_MDIO_READ_IN_LEN 16
  1688. /* Bus number; there are two MDIO buses: one for the internal PHY, and one for
  1689. * external devices.
  1690. */
  1691. #define MC_CMD_MDIO_READ_IN_BUS_OFST 0
  1692. /* enum: Internal. */
  1693. #define MC_CMD_MDIO_BUS_INTERNAL 0x0
  1694. /* enum: External. */
  1695. #define MC_CMD_MDIO_BUS_EXTERNAL 0x1
  1696. /* Port address */
  1697. #define MC_CMD_MDIO_READ_IN_PRTAD_OFST 4
  1698. /* Device Address or clause 22. */
  1699. #define MC_CMD_MDIO_READ_IN_DEVAD_OFST 8
  1700. /* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
  1701. * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
  1702. */
  1703. #define MC_CMD_MDIO_CLAUSE22 0x20
  1704. /* Address */
  1705. #define MC_CMD_MDIO_READ_IN_ADDR_OFST 12
  1706. /* MC_CMD_MDIO_READ_OUT msgresponse */
  1707. #define MC_CMD_MDIO_READ_OUT_LEN 8
  1708. /* Value */
  1709. #define MC_CMD_MDIO_READ_OUT_VALUE_OFST 0
  1710. /* Status the MDIO commands return the raw status bits from the MDIO block. A
  1711. * "good" transaction should have the DONE bit set and all other bits clear.
  1712. */
  1713. #define MC_CMD_MDIO_READ_OUT_STATUS_OFST 4
  1714. /* enum: Good. */
  1715. #define MC_CMD_MDIO_STATUS_GOOD 0x8
  1716. /***********************************/
  1717. /* MC_CMD_MDIO_WRITE
  1718. * MDIO register write.
  1719. */
  1720. #define MC_CMD_MDIO_WRITE 0x11
  1721. #define MC_CMD_0x11_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1722. /* MC_CMD_MDIO_WRITE_IN msgrequest */
  1723. #define MC_CMD_MDIO_WRITE_IN_LEN 20
  1724. /* Bus number; there are two MDIO buses: one for the internal PHY, and one for
  1725. * external devices.
  1726. */
  1727. #define MC_CMD_MDIO_WRITE_IN_BUS_OFST 0
  1728. /* enum: Internal. */
  1729. /* MC_CMD_MDIO_BUS_INTERNAL 0x0 */
  1730. /* enum: External. */
  1731. /* MC_CMD_MDIO_BUS_EXTERNAL 0x1 */
  1732. /* Port address */
  1733. #define MC_CMD_MDIO_WRITE_IN_PRTAD_OFST 4
  1734. /* Device Address or clause 22. */
  1735. #define MC_CMD_MDIO_WRITE_IN_DEVAD_OFST 8
  1736. /* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
  1737. * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
  1738. */
  1739. /* MC_CMD_MDIO_CLAUSE22 0x20 */
  1740. /* Address */
  1741. #define MC_CMD_MDIO_WRITE_IN_ADDR_OFST 12
  1742. /* Value */
  1743. #define MC_CMD_MDIO_WRITE_IN_VALUE_OFST 16
  1744. /* MC_CMD_MDIO_WRITE_OUT msgresponse */
  1745. #define MC_CMD_MDIO_WRITE_OUT_LEN 4
  1746. /* Status; the MDIO commands return the raw status bits from the MDIO block. A
  1747. * "good" transaction should have the DONE bit set and all other bits clear.
  1748. */
  1749. #define MC_CMD_MDIO_WRITE_OUT_STATUS_OFST 0
  1750. /* enum: Good. */
  1751. /* MC_CMD_MDIO_STATUS_GOOD 0x8 */
  1752. /***********************************/
  1753. /* MC_CMD_DBI_WRITE
  1754. * Write DBI register(s).
  1755. */
  1756. #define MC_CMD_DBI_WRITE 0x12
  1757. #define MC_CMD_0x12_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1758. /* MC_CMD_DBI_WRITE_IN msgrequest */
  1759. #define MC_CMD_DBI_WRITE_IN_LENMIN 12
  1760. #define MC_CMD_DBI_WRITE_IN_LENMAX 252
  1761. #define MC_CMD_DBI_WRITE_IN_LEN(num) (0+12*(num))
  1762. /* Each write op consists of an address (offset 0), byte enable/VF/CS2 (offset
  1763. * 32) and value (offset 64). See MC_CMD_DBIWROP_TYPEDEF.
  1764. */
  1765. #define MC_CMD_DBI_WRITE_IN_DBIWROP_OFST 0
  1766. #define MC_CMD_DBI_WRITE_IN_DBIWROP_LEN 12
  1767. #define MC_CMD_DBI_WRITE_IN_DBIWROP_MINNUM 1
  1768. #define MC_CMD_DBI_WRITE_IN_DBIWROP_MAXNUM 21
  1769. /* MC_CMD_DBI_WRITE_OUT msgresponse */
  1770. #define MC_CMD_DBI_WRITE_OUT_LEN 0
  1771. /* MC_CMD_DBIWROP_TYPEDEF structuredef */
  1772. #define MC_CMD_DBIWROP_TYPEDEF_LEN 12
  1773. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST 0
  1774. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_LBN 0
  1775. #define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_WIDTH 32
  1776. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_OFST 4
  1777. #define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_LBN 16
  1778. #define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_WIDTH 16
  1779. #define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_LBN 15
  1780. #define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_WIDTH 1
  1781. #define MC_CMD_DBIWROP_TYPEDEF_CS2_LBN 14
  1782. #define MC_CMD_DBIWROP_TYPEDEF_CS2_WIDTH 1
  1783. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_LBN 32
  1784. #define MC_CMD_DBIWROP_TYPEDEF_PARMS_WIDTH 32
  1785. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST 8
  1786. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_LBN 64
  1787. #define MC_CMD_DBIWROP_TYPEDEF_VALUE_WIDTH 32
  1788. /***********************************/
  1789. /* MC_CMD_PORT_READ32
  1790. * Read a 32-bit register from the indirect port register map. The port to
  1791. * access is implied by the Shared memory channel used.
  1792. */
  1793. #define MC_CMD_PORT_READ32 0x14
  1794. /* MC_CMD_PORT_READ32_IN msgrequest */
  1795. #define MC_CMD_PORT_READ32_IN_LEN 4
  1796. /* Address */
  1797. #define MC_CMD_PORT_READ32_IN_ADDR_OFST 0
  1798. /* MC_CMD_PORT_READ32_OUT msgresponse */
  1799. #define MC_CMD_PORT_READ32_OUT_LEN 8
  1800. /* Value */
  1801. #define MC_CMD_PORT_READ32_OUT_VALUE_OFST 0
  1802. /* Status */
  1803. #define MC_CMD_PORT_READ32_OUT_STATUS_OFST 4
  1804. /***********************************/
  1805. /* MC_CMD_PORT_WRITE32
  1806. * Write a 32-bit register to the indirect port register map. The port to
  1807. * access is implied by the Shared memory channel used.
  1808. */
  1809. #define MC_CMD_PORT_WRITE32 0x15
  1810. /* MC_CMD_PORT_WRITE32_IN msgrequest */
  1811. #define MC_CMD_PORT_WRITE32_IN_LEN 8
  1812. /* Address */
  1813. #define MC_CMD_PORT_WRITE32_IN_ADDR_OFST 0
  1814. /* Value */
  1815. #define MC_CMD_PORT_WRITE32_IN_VALUE_OFST 4
  1816. /* MC_CMD_PORT_WRITE32_OUT msgresponse */
  1817. #define MC_CMD_PORT_WRITE32_OUT_LEN 4
  1818. /* Status */
  1819. #define MC_CMD_PORT_WRITE32_OUT_STATUS_OFST 0
  1820. /***********************************/
  1821. /* MC_CMD_PORT_READ128
  1822. * Read a 128-bit register from the indirect port register map. The port to
  1823. * access is implied by the Shared memory channel used.
  1824. */
  1825. #define MC_CMD_PORT_READ128 0x16
  1826. /* MC_CMD_PORT_READ128_IN msgrequest */
  1827. #define MC_CMD_PORT_READ128_IN_LEN 4
  1828. /* Address */
  1829. #define MC_CMD_PORT_READ128_IN_ADDR_OFST 0
  1830. /* MC_CMD_PORT_READ128_OUT msgresponse */
  1831. #define MC_CMD_PORT_READ128_OUT_LEN 20
  1832. /* Value */
  1833. #define MC_CMD_PORT_READ128_OUT_VALUE_OFST 0
  1834. #define MC_CMD_PORT_READ128_OUT_VALUE_LEN 16
  1835. /* Status */
  1836. #define MC_CMD_PORT_READ128_OUT_STATUS_OFST 16
  1837. /***********************************/
  1838. /* MC_CMD_PORT_WRITE128
  1839. * Write a 128-bit register to the indirect port register map. The port to
  1840. * access is implied by the Shared memory channel used.
  1841. */
  1842. #define MC_CMD_PORT_WRITE128 0x17
  1843. /* MC_CMD_PORT_WRITE128_IN msgrequest */
  1844. #define MC_CMD_PORT_WRITE128_IN_LEN 20
  1845. /* Address */
  1846. #define MC_CMD_PORT_WRITE128_IN_ADDR_OFST 0
  1847. /* Value */
  1848. #define MC_CMD_PORT_WRITE128_IN_VALUE_OFST 4
  1849. #define MC_CMD_PORT_WRITE128_IN_VALUE_LEN 16
  1850. /* MC_CMD_PORT_WRITE128_OUT msgresponse */
  1851. #define MC_CMD_PORT_WRITE128_OUT_LEN 4
  1852. /* Status */
  1853. #define MC_CMD_PORT_WRITE128_OUT_STATUS_OFST 0
  1854. /* MC_CMD_CAPABILITIES structuredef */
  1855. #define MC_CMD_CAPABILITIES_LEN 4
  1856. /* Small buf table. */
  1857. #define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_LBN 0
  1858. #define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_WIDTH 1
  1859. /* Turbo mode (for Maranello). */
  1860. #define MC_CMD_CAPABILITIES_TURBO_LBN 1
  1861. #define MC_CMD_CAPABILITIES_TURBO_WIDTH 1
  1862. /* Turbo mode active (for Maranello). */
  1863. #define MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN 2
  1864. #define MC_CMD_CAPABILITIES_TURBO_ACTIVE_WIDTH 1
  1865. /* PTP offload. */
  1866. #define MC_CMD_CAPABILITIES_PTP_LBN 3
  1867. #define MC_CMD_CAPABILITIES_PTP_WIDTH 1
  1868. /* AOE mode. */
  1869. #define MC_CMD_CAPABILITIES_AOE_LBN 4
  1870. #define MC_CMD_CAPABILITIES_AOE_WIDTH 1
  1871. /* AOE mode active. */
  1872. #define MC_CMD_CAPABILITIES_AOE_ACTIVE_LBN 5
  1873. #define MC_CMD_CAPABILITIES_AOE_ACTIVE_WIDTH 1
  1874. /* AOE mode active. */
  1875. #define MC_CMD_CAPABILITIES_FC_ACTIVE_LBN 6
  1876. #define MC_CMD_CAPABILITIES_FC_ACTIVE_WIDTH 1
  1877. #define MC_CMD_CAPABILITIES_RESERVED_LBN 7
  1878. #define MC_CMD_CAPABILITIES_RESERVED_WIDTH 25
  1879. /***********************************/
  1880. /* MC_CMD_GET_BOARD_CFG
  1881. * Returns the MC firmware configuration structure.
  1882. */
  1883. #define MC_CMD_GET_BOARD_CFG 0x18
  1884. #define MC_CMD_0x18_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1885. /* MC_CMD_GET_BOARD_CFG_IN msgrequest */
  1886. #define MC_CMD_GET_BOARD_CFG_IN_LEN 0
  1887. /* MC_CMD_GET_BOARD_CFG_OUT msgresponse */
  1888. #define MC_CMD_GET_BOARD_CFG_OUT_LENMIN 96
  1889. #define MC_CMD_GET_BOARD_CFG_OUT_LENMAX 136
  1890. #define MC_CMD_GET_BOARD_CFG_OUT_LEN(num) (72+2*(num))
  1891. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_OFST 0
  1892. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4
  1893. #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32
  1894. /* See MC_CMD_CAPABILITIES */
  1895. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_OFST 36
  1896. /* See MC_CMD_CAPABILITIES */
  1897. #define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_OFST 40
  1898. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST 44
  1899. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_LEN 6
  1900. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_OFST 50
  1901. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_LEN 6
  1902. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT0_OFST 56
  1903. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_OFST 60
  1904. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_OFST 64
  1905. #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68
  1906. /* This field contains a 16-bit value for each of the types of NVRAM area. The
  1907. * values are defined in the firmware/mc/platform/.c file for a specific board
  1908. * type, but otherwise have no meaning to the MC; they are used by the driver
  1909. * to manage selection of appropriate firmware updates.
  1910. */
  1911. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72
  1912. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2
  1913. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM 12
  1914. #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MAXNUM 32
  1915. /***********************************/
  1916. /* MC_CMD_DBI_READX
  1917. * Read DBI register(s) -- extended functionality
  1918. */
  1919. #define MC_CMD_DBI_READX 0x19
  1920. #define MC_CMD_0x19_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1921. /* MC_CMD_DBI_READX_IN msgrequest */
  1922. #define MC_CMD_DBI_READX_IN_LENMIN 8
  1923. #define MC_CMD_DBI_READX_IN_LENMAX 248
  1924. #define MC_CMD_DBI_READX_IN_LEN(num) (0+8*(num))
  1925. /* Each Read op consists of an address (offset 0), VF/CS2) */
  1926. #define MC_CMD_DBI_READX_IN_DBIRDOP_OFST 0
  1927. #define MC_CMD_DBI_READX_IN_DBIRDOP_LEN 8
  1928. #define MC_CMD_DBI_READX_IN_DBIRDOP_LO_OFST 0
  1929. #define MC_CMD_DBI_READX_IN_DBIRDOP_HI_OFST 4
  1930. #define MC_CMD_DBI_READX_IN_DBIRDOP_MINNUM 1
  1931. #define MC_CMD_DBI_READX_IN_DBIRDOP_MAXNUM 31
  1932. /* MC_CMD_DBI_READX_OUT msgresponse */
  1933. #define MC_CMD_DBI_READX_OUT_LENMIN 4
  1934. #define MC_CMD_DBI_READX_OUT_LENMAX 252
  1935. #define MC_CMD_DBI_READX_OUT_LEN(num) (0+4*(num))
  1936. /* Value */
  1937. #define MC_CMD_DBI_READX_OUT_VALUE_OFST 0
  1938. #define MC_CMD_DBI_READX_OUT_VALUE_LEN 4
  1939. #define MC_CMD_DBI_READX_OUT_VALUE_MINNUM 1
  1940. #define MC_CMD_DBI_READX_OUT_VALUE_MAXNUM 63
  1941. /* MC_CMD_DBIRDOP_TYPEDEF structuredef */
  1942. #define MC_CMD_DBIRDOP_TYPEDEF_LEN 8
  1943. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_OFST 0
  1944. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_LBN 0
  1945. #define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_WIDTH 32
  1946. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_OFST 4
  1947. #define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_LBN 16
  1948. #define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_WIDTH 16
  1949. #define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_LBN 15
  1950. #define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_WIDTH 1
  1951. #define MC_CMD_DBIRDOP_TYPEDEF_CS2_LBN 14
  1952. #define MC_CMD_DBIRDOP_TYPEDEF_CS2_WIDTH 1
  1953. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_LBN 32
  1954. #define MC_CMD_DBIRDOP_TYPEDEF_PARMS_WIDTH 32
  1955. /***********************************/
  1956. /* MC_CMD_SET_RAND_SEED
  1957. * Set the 16byte seed for the MC pseudo-random generator.
  1958. */
  1959. #define MC_CMD_SET_RAND_SEED 0x1a
  1960. #define MC_CMD_0x1a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  1961. /* MC_CMD_SET_RAND_SEED_IN msgrequest */
  1962. #define MC_CMD_SET_RAND_SEED_IN_LEN 16
  1963. /* Seed value. */
  1964. #define MC_CMD_SET_RAND_SEED_IN_SEED_OFST 0
  1965. #define MC_CMD_SET_RAND_SEED_IN_SEED_LEN 16
  1966. /* MC_CMD_SET_RAND_SEED_OUT msgresponse */
  1967. #define MC_CMD_SET_RAND_SEED_OUT_LEN 0
  1968. /***********************************/
  1969. /* MC_CMD_LTSSM_HIST
  1970. * Retrieve the history of the LTSSM, if the build supports it.
  1971. */
  1972. #define MC_CMD_LTSSM_HIST 0x1b
  1973. /* MC_CMD_LTSSM_HIST_IN msgrequest */
  1974. #define MC_CMD_LTSSM_HIST_IN_LEN 0
  1975. /* MC_CMD_LTSSM_HIST_OUT msgresponse */
  1976. #define MC_CMD_LTSSM_HIST_OUT_LENMIN 0
  1977. #define MC_CMD_LTSSM_HIST_OUT_LENMAX 252
  1978. #define MC_CMD_LTSSM_HIST_OUT_LEN(num) (0+4*(num))
  1979. /* variable number of LTSSM values, as bytes. The history is read-to-clear. */
  1980. #define MC_CMD_LTSSM_HIST_OUT_DATA_OFST 0
  1981. #define MC_CMD_LTSSM_HIST_OUT_DATA_LEN 4
  1982. #define MC_CMD_LTSSM_HIST_OUT_DATA_MINNUM 0
  1983. #define MC_CMD_LTSSM_HIST_OUT_DATA_MAXNUM 63
  1984. /***********************************/
  1985. /* MC_CMD_DRV_ATTACH
  1986. * Inform MCPU that this port is managed on the host (i.e. driver active). For
  1987. * Huntington, also request the preferred datapath firmware to use if possible
  1988. * (it may not be possible for this request to be fulfilled; the driver must
  1989. * issue a subsequent MC_CMD_GET_CAPABILITIES command to determine which
  1990. * features are actually available). The FIRMWARE_ID field is ignored by older
  1991. * platforms.
  1992. */
  1993. #define MC_CMD_DRV_ATTACH 0x1c
  1994. #define MC_CMD_0x1c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  1995. /* MC_CMD_DRV_ATTACH_IN msgrequest */
  1996. #define MC_CMD_DRV_ATTACH_IN_LEN 12
  1997. /* new state to set if UPDATE=1 */
  1998. #define MC_CMD_DRV_ATTACH_IN_NEW_STATE_OFST 0
  1999. #define MC_CMD_DRV_ATTACH_LBN 0
  2000. #define MC_CMD_DRV_ATTACH_WIDTH 1
  2001. #define MC_CMD_DRV_PREBOOT_LBN 1
  2002. #define MC_CMD_DRV_PREBOOT_WIDTH 1
  2003. /* 1 to set new state, or 0 to just report the existing state */
  2004. #define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4
  2005. /* preferred datapath firmware (for Huntington; ignored for Siena) */
  2006. #define MC_CMD_DRV_ATTACH_IN_FIRMWARE_ID_OFST 8
  2007. /* enum: Prefer to use full featured firmware */
  2008. #define MC_CMD_FW_FULL_FEATURED 0x0
  2009. /* enum: Prefer to use firmware with fewer features but lower latency */
  2010. #define MC_CMD_FW_LOW_LATENCY 0x1
  2011. /* enum: Prefer to use firmware for SolarCapture packed stream mode */
  2012. #define MC_CMD_FW_PACKED_STREAM 0x2
  2013. /* enum: Prefer to use firmware with fewer features and simpler TX event
  2014. * batching but higher TX packet rate
  2015. */
  2016. #define MC_CMD_FW_HIGH_TX_RATE 0x3
  2017. /* enum: Reserved value */
  2018. #define MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 0x4
  2019. /* enum: Prefer to use firmware with additional "rules engine" filtering
  2020. * support
  2021. */
  2022. #define MC_CMD_FW_RULES_ENGINE 0x5
  2023. /* enum: Only this option is allowed for non-admin functions */
  2024. #define MC_CMD_FW_DONT_CARE 0xffffffff
  2025. /* MC_CMD_DRV_ATTACH_OUT msgresponse */
  2026. #define MC_CMD_DRV_ATTACH_OUT_LEN 4
  2027. /* previous or existing state, see the bitmask at NEW_STATE */
  2028. #define MC_CMD_DRV_ATTACH_OUT_OLD_STATE_OFST 0
  2029. /* MC_CMD_DRV_ATTACH_EXT_OUT msgresponse */
  2030. #define MC_CMD_DRV_ATTACH_EXT_OUT_LEN 8
  2031. /* previous or existing state, see the bitmask at NEW_STATE */
  2032. #define MC_CMD_DRV_ATTACH_EXT_OUT_OLD_STATE_OFST 0
  2033. /* Flags associated with this function */
  2034. #define MC_CMD_DRV_ATTACH_EXT_OUT_FUNC_FLAGS_OFST 4
  2035. /* enum: Labels the lowest-numbered function visible to the OS */
  2036. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY 0x0
  2037. /* enum: The function can control the link state of the physical port it is
  2038. * bound to.
  2039. */
  2040. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL 0x1
  2041. /* enum: The function can perform privileged operations */
  2042. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED 0x2
  2043. /* enum: The function does not have an active port associated with it. The port
  2044. * refers to the Sorrento external FPGA port.
  2045. */
  2046. #define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_NO_ACTIVE_PORT 0x3
  2047. /***********************************/
  2048. /* MC_CMD_SHMUART
  2049. * Route UART output to circular buffer in shared memory instead.
  2050. */
  2051. #define MC_CMD_SHMUART 0x1f
  2052. /* MC_CMD_SHMUART_IN msgrequest */
  2053. #define MC_CMD_SHMUART_IN_LEN 4
  2054. /* ??? */
  2055. #define MC_CMD_SHMUART_IN_FLAG_OFST 0
  2056. /* MC_CMD_SHMUART_OUT msgresponse */
  2057. #define MC_CMD_SHMUART_OUT_LEN 0
  2058. /***********************************/
  2059. /* MC_CMD_PORT_RESET
  2060. * Generic per-port reset. There is no equivalent for per-board reset. Locks
  2061. * required: None; Return code: 0, ETIME. NOTE: This command is deprecated -
  2062. * use MC_CMD_ENTITY_RESET instead.
  2063. */
  2064. #define MC_CMD_PORT_RESET 0x20
  2065. #define MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2066. /* MC_CMD_PORT_RESET_IN msgrequest */
  2067. #define MC_CMD_PORT_RESET_IN_LEN 0
  2068. /* MC_CMD_PORT_RESET_OUT msgresponse */
  2069. #define MC_CMD_PORT_RESET_OUT_LEN 0
  2070. /***********************************/
  2071. /* MC_CMD_ENTITY_RESET
  2072. * Generic per-resource reset. There is no equivalent for per-board reset.
  2073. * Locks required: None; Return code: 0, ETIME. NOTE: This command is an
  2074. * extended version of the deprecated MC_CMD_PORT_RESET with added fields.
  2075. */
  2076. #define MC_CMD_ENTITY_RESET 0x20
  2077. /* MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL */
  2078. /* MC_CMD_ENTITY_RESET_IN msgrequest */
  2079. #define MC_CMD_ENTITY_RESET_IN_LEN 4
  2080. /* Optional flags field. Omitting this will perform a "legacy" reset action
  2081. * (TBD).
  2082. */
  2083. #define MC_CMD_ENTITY_RESET_IN_FLAG_OFST 0
  2084. #define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_LBN 0
  2085. #define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_WIDTH 1
  2086. /* MC_CMD_ENTITY_RESET_OUT msgresponse */
  2087. #define MC_CMD_ENTITY_RESET_OUT_LEN 0
  2088. /***********************************/
  2089. /* MC_CMD_PCIE_CREDITS
  2090. * Read instantaneous and minimum flow control thresholds.
  2091. */
  2092. #define MC_CMD_PCIE_CREDITS 0x21
  2093. /* MC_CMD_PCIE_CREDITS_IN msgrequest */
  2094. #define MC_CMD_PCIE_CREDITS_IN_LEN 8
  2095. /* poll period. 0 is disabled */
  2096. #define MC_CMD_PCIE_CREDITS_IN_POLL_PERIOD_OFST 0
  2097. /* wipe statistics */
  2098. #define MC_CMD_PCIE_CREDITS_IN_WIPE_OFST 4
  2099. /* MC_CMD_PCIE_CREDITS_OUT msgresponse */
  2100. #define MC_CMD_PCIE_CREDITS_OUT_LEN 16
  2101. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_HDR_OFST 0
  2102. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_HDR_LEN 2
  2103. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_DATA_OFST 2
  2104. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_P_DATA_LEN 2
  2105. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_HDR_OFST 4
  2106. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_HDR_LEN 2
  2107. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_DATA_OFST 6
  2108. #define MC_CMD_PCIE_CREDITS_OUT_CURRENT_NP_DATA_LEN 2
  2109. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_HDR_OFST 8
  2110. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_HDR_LEN 2
  2111. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_DATA_OFST 10
  2112. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_P_DATA_LEN 2
  2113. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_HDR_OFST 12
  2114. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_HDR_LEN 2
  2115. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_DATA_OFST 14
  2116. #define MC_CMD_PCIE_CREDITS_OUT_MINIMUM_NP_DATA_LEN 2
  2117. /***********************************/
  2118. /* MC_CMD_RXD_MONITOR
  2119. * Get histogram of RX queue fill level.
  2120. */
  2121. #define MC_CMD_RXD_MONITOR 0x22
  2122. /* MC_CMD_RXD_MONITOR_IN msgrequest */
  2123. #define MC_CMD_RXD_MONITOR_IN_LEN 12
  2124. #define MC_CMD_RXD_MONITOR_IN_QID_OFST 0
  2125. #define MC_CMD_RXD_MONITOR_IN_POLL_PERIOD_OFST 4
  2126. #define MC_CMD_RXD_MONITOR_IN_WIPE_OFST 8
  2127. /* MC_CMD_RXD_MONITOR_OUT msgresponse */
  2128. #define MC_CMD_RXD_MONITOR_OUT_LEN 80
  2129. #define MC_CMD_RXD_MONITOR_OUT_QID_OFST 0
  2130. #define MC_CMD_RXD_MONITOR_OUT_RING_FILL_OFST 4
  2131. #define MC_CMD_RXD_MONITOR_OUT_CACHE_FILL_OFST 8
  2132. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_1_OFST 12
  2133. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_2_OFST 16
  2134. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_4_OFST 20
  2135. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_8_OFST 24
  2136. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_16_OFST 28
  2137. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_32_OFST 32
  2138. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_64_OFST 36
  2139. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_128_OFST 40
  2140. #define MC_CMD_RXD_MONITOR_OUT_RING_LT_256_OFST 44
  2141. #define MC_CMD_RXD_MONITOR_OUT_RING_GE_256_OFST 48
  2142. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_1_OFST 52
  2143. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_2_OFST 56
  2144. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_4_OFST 60
  2145. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_8_OFST 64
  2146. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_16_OFST 68
  2147. #define MC_CMD_RXD_MONITOR_OUT_CACHE_LT_32_OFST 72
  2148. #define MC_CMD_RXD_MONITOR_OUT_CACHE_GE_32_OFST 76
  2149. /***********************************/
  2150. /* MC_CMD_PUTS
  2151. * Copy the given ASCII string out onto UART and/or out of the network port.
  2152. */
  2153. #define MC_CMD_PUTS 0x23
  2154. #define MC_CMD_0x23_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2155. /* MC_CMD_PUTS_IN msgrequest */
  2156. #define MC_CMD_PUTS_IN_LENMIN 13
  2157. #define MC_CMD_PUTS_IN_LENMAX 252
  2158. #define MC_CMD_PUTS_IN_LEN(num) (12+1*(num))
  2159. #define MC_CMD_PUTS_IN_DEST_OFST 0
  2160. #define MC_CMD_PUTS_IN_UART_LBN 0
  2161. #define MC_CMD_PUTS_IN_UART_WIDTH 1
  2162. #define MC_CMD_PUTS_IN_PORT_LBN 1
  2163. #define MC_CMD_PUTS_IN_PORT_WIDTH 1
  2164. #define MC_CMD_PUTS_IN_DHOST_OFST 4
  2165. #define MC_CMD_PUTS_IN_DHOST_LEN 6
  2166. #define MC_CMD_PUTS_IN_STRING_OFST 12
  2167. #define MC_CMD_PUTS_IN_STRING_LEN 1
  2168. #define MC_CMD_PUTS_IN_STRING_MINNUM 1
  2169. #define MC_CMD_PUTS_IN_STRING_MAXNUM 240
  2170. /* MC_CMD_PUTS_OUT msgresponse */
  2171. #define MC_CMD_PUTS_OUT_LEN 0
  2172. /***********************************/
  2173. /* MC_CMD_GET_PHY_CFG
  2174. * Report PHY configuration. This guarantees to succeed even if the PHY is in a
  2175. * 'zombie' state. Locks required: None
  2176. */
  2177. #define MC_CMD_GET_PHY_CFG 0x24
  2178. #define MC_CMD_0x24_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2179. /* MC_CMD_GET_PHY_CFG_IN msgrequest */
  2180. #define MC_CMD_GET_PHY_CFG_IN_LEN 0
  2181. /* MC_CMD_GET_PHY_CFG_OUT msgresponse */
  2182. #define MC_CMD_GET_PHY_CFG_OUT_LEN 72
  2183. /* flags */
  2184. #define MC_CMD_GET_PHY_CFG_OUT_FLAGS_OFST 0
  2185. #define MC_CMD_GET_PHY_CFG_OUT_PRESENT_LBN 0
  2186. #define MC_CMD_GET_PHY_CFG_OUT_PRESENT_WIDTH 1
  2187. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_LBN 1
  2188. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_WIDTH 1
  2189. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_LBN 2
  2190. #define MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_WIDTH 1
  2191. #define MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_LBN 3
  2192. #define MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_WIDTH 1
  2193. #define MC_CMD_GET_PHY_CFG_OUT_POWEROFF_LBN 4
  2194. #define MC_CMD_GET_PHY_CFG_OUT_POWEROFF_WIDTH 1
  2195. #define MC_CMD_GET_PHY_CFG_OUT_TXDIS_LBN 5
  2196. #define MC_CMD_GET_PHY_CFG_OUT_TXDIS_WIDTH 1
  2197. #define MC_CMD_GET_PHY_CFG_OUT_BIST_LBN 6
  2198. #define MC_CMD_GET_PHY_CFG_OUT_BIST_WIDTH 1
  2199. /* ?? */
  2200. #define MC_CMD_GET_PHY_CFG_OUT_TYPE_OFST 4
  2201. /* Bitmask of supported capabilities */
  2202. #define MC_CMD_GET_PHY_CFG_OUT_SUPPORTED_CAP_OFST 8
  2203. #define MC_CMD_PHY_CAP_10HDX_LBN 1
  2204. #define MC_CMD_PHY_CAP_10HDX_WIDTH 1
  2205. #define MC_CMD_PHY_CAP_10FDX_LBN 2
  2206. #define MC_CMD_PHY_CAP_10FDX_WIDTH 1
  2207. #define MC_CMD_PHY_CAP_100HDX_LBN 3
  2208. #define MC_CMD_PHY_CAP_100HDX_WIDTH 1
  2209. #define MC_CMD_PHY_CAP_100FDX_LBN 4
  2210. #define MC_CMD_PHY_CAP_100FDX_WIDTH 1
  2211. #define MC_CMD_PHY_CAP_1000HDX_LBN 5
  2212. #define MC_CMD_PHY_CAP_1000HDX_WIDTH 1
  2213. #define MC_CMD_PHY_CAP_1000FDX_LBN 6
  2214. #define MC_CMD_PHY_CAP_1000FDX_WIDTH 1
  2215. #define MC_CMD_PHY_CAP_10000FDX_LBN 7
  2216. #define MC_CMD_PHY_CAP_10000FDX_WIDTH 1
  2217. #define MC_CMD_PHY_CAP_PAUSE_LBN 8
  2218. #define MC_CMD_PHY_CAP_PAUSE_WIDTH 1
  2219. #define MC_CMD_PHY_CAP_ASYM_LBN 9
  2220. #define MC_CMD_PHY_CAP_ASYM_WIDTH 1
  2221. #define MC_CMD_PHY_CAP_AN_LBN 10
  2222. #define MC_CMD_PHY_CAP_AN_WIDTH 1
  2223. #define MC_CMD_PHY_CAP_40000FDX_LBN 11
  2224. #define MC_CMD_PHY_CAP_40000FDX_WIDTH 1
  2225. #define MC_CMD_PHY_CAP_DDM_LBN 12
  2226. #define MC_CMD_PHY_CAP_DDM_WIDTH 1
  2227. /* ?? */
  2228. #define MC_CMD_GET_PHY_CFG_OUT_CHANNEL_OFST 12
  2229. /* ?? */
  2230. #define MC_CMD_GET_PHY_CFG_OUT_PRT_OFST 16
  2231. /* ?? */
  2232. #define MC_CMD_GET_PHY_CFG_OUT_STATS_MASK_OFST 20
  2233. /* ?? */
  2234. #define MC_CMD_GET_PHY_CFG_OUT_NAME_OFST 24
  2235. #define MC_CMD_GET_PHY_CFG_OUT_NAME_LEN 20
  2236. /* ?? */
  2237. #define MC_CMD_GET_PHY_CFG_OUT_MEDIA_TYPE_OFST 44
  2238. /* enum: Xaui. */
  2239. #define MC_CMD_MEDIA_XAUI 0x1
  2240. /* enum: CX4. */
  2241. #define MC_CMD_MEDIA_CX4 0x2
  2242. /* enum: KX4. */
  2243. #define MC_CMD_MEDIA_KX4 0x3
  2244. /* enum: XFP Far. */
  2245. #define MC_CMD_MEDIA_XFP 0x4
  2246. /* enum: SFP+. */
  2247. #define MC_CMD_MEDIA_SFP_PLUS 0x5
  2248. /* enum: 10GBaseT. */
  2249. #define MC_CMD_MEDIA_BASE_T 0x6
  2250. /* enum: QSFP+. */
  2251. #define MC_CMD_MEDIA_QSFP_PLUS 0x7
  2252. #define MC_CMD_GET_PHY_CFG_OUT_MMD_MASK_OFST 48
  2253. /* enum: Native clause 22 */
  2254. #define MC_CMD_MMD_CLAUSE22 0x0
  2255. #define MC_CMD_MMD_CLAUSE45_PMAPMD 0x1 /* enum */
  2256. #define MC_CMD_MMD_CLAUSE45_WIS 0x2 /* enum */
  2257. #define MC_CMD_MMD_CLAUSE45_PCS 0x3 /* enum */
  2258. #define MC_CMD_MMD_CLAUSE45_PHYXS 0x4 /* enum */
  2259. #define MC_CMD_MMD_CLAUSE45_DTEXS 0x5 /* enum */
  2260. #define MC_CMD_MMD_CLAUSE45_TC 0x6 /* enum */
  2261. #define MC_CMD_MMD_CLAUSE45_AN 0x7 /* enum */
  2262. /* enum: Clause22 proxied over clause45 by PHY. */
  2263. #define MC_CMD_MMD_CLAUSE45_C22EXT 0x1d
  2264. #define MC_CMD_MMD_CLAUSE45_VEND1 0x1e /* enum */
  2265. #define MC_CMD_MMD_CLAUSE45_VEND2 0x1f /* enum */
  2266. #define MC_CMD_GET_PHY_CFG_OUT_REVISION_OFST 52
  2267. #define MC_CMD_GET_PHY_CFG_OUT_REVISION_LEN 20
  2268. /***********************************/
  2269. /* MC_CMD_START_BIST
  2270. * Start a BIST test on the PHY. Locks required: PHY_LOCK if doing a PHY BIST
  2271. * Return code: 0, EINVAL, EACCES (if PHY_LOCK is not held)
  2272. */
  2273. #define MC_CMD_START_BIST 0x25
  2274. #define MC_CMD_0x25_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2275. /* MC_CMD_START_BIST_IN msgrequest */
  2276. #define MC_CMD_START_BIST_IN_LEN 4
  2277. /* Type of test. */
  2278. #define MC_CMD_START_BIST_IN_TYPE_OFST 0
  2279. /* enum: Run the PHY's short cable BIST. */
  2280. #define MC_CMD_PHY_BIST_CABLE_SHORT 0x1
  2281. /* enum: Run the PHY's long cable BIST. */
  2282. #define MC_CMD_PHY_BIST_CABLE_LONG 0x2
  2283. /* enum: Run BIST on the currently selected BPX Serdes (XAUI or XFI) . */
  2284. #define MC_CMD_BPX_SERDES_BIST 0x3
  2285. /* enum: Run the MC loopback tests. */
  2286. #define MC_CMD_MC_LOOPBACK_BIST 0x4
  2287. /* enum: Run the PHY's standard BIST. */
  2288. #define MC_CMD_PHY_BIST 0x5
  2289. /* enum: Run MC RAM test. */
  2290. #define MC_CMD_MC_MEM_BIST 0x6
  2291. /* enum: Run Port RAM test. */
  2292. #define MC_CMD_PORT_MEM_BIST 0x7
  2293. /* enum: Run register test. */
  2294. #define MC_CMD_REG_BIST 0x8
  2295. /* MC_CMD_START_BIST_OUT msgresponse */
  2296. #define MC_CMD_START_BIST_OUT_LEN 0
  2297. /***********************************/
  2298. /* MC_CMD_POLL_BIST
  2299. * Poll for BIST completion. Returns a single status code, and optionally some
  2300. * PHY specific bist output. The driver should only consume the BIST output
  2301. * after validating OUTLEN and MC_CMD_GET_PHY_CFG.TYPE. If a driver can't
  2302. * successfully parse the BIST output, it should still respect the pass/Fail in
  2303. * OUT.RESULT. Locks required: PHY_LOCK if doing a PHY BIST. Return code: 0,
  2304. * EACCES (if PHY_LOCK is not held).
  2305. */
  2306. #define MC_CMD_POLL_BIST 0x26
  2307. #define MC_CMD_0x26_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  2308. /* MC_CMD_POLL_BIST_IN msgrequest */
  2309. #define MC_CMD_POLL_BIST_IN_LEN 0
  2310. /* MC_CMD_POLL_BIST_OUT msgresponse */
  2311. #define MC_CMD_POLL_BIST_OUT_LEN 8
  2312. /* result */
  2313. #define MC_CMD_POLL_BIST_OUT_RESULT_OFST 0
  2314. /* enum: Running. */
  2315. #define MC_CMD_POLL_BIST_RUNNING 0x1
  2316. /* enum: Passed. */
  2317. #define MC_CMD_POLL_BIST_PASSED 0x2
  2318. /* enum: Failed. */
  2319. #define MC_CMD_POLL_BIST_FAILED 0x3
  2320. /* enum: Timed-out. */
  2321. #define MC_CMD_POLL_BIST_TIMEOUT 0x4
  2322. #define MC_CMD_POLL_BIST_OUT_PRIVATE_OFST 4
  2323. /* MC_CMD_POLL_BIST_OUT_SFT9001 msgresponse */
  2324. #define MC_CMD_POLL_BIST_OUT_SFT9001_LEN 36
  2325. /* result */
  2326. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2327. /* Enum values, see field(s): */
  2328. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2329. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_A_OFST 4
  2330. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_B_OFST 8
  2331. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_C_OFST 12
  2332. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_D_OFST 16
  2333. /* Status of each channel A */
  2334. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_A_OFST 20
  2335. /* enum: Ok. */
  2336. #define MC_CMD_POLL_BIST_SFT9001_PAIR_OK 0x1
  2337. /* enum: Open. */
  2338. #define MC_CMD_POLL_BIST_SFT9001_PAIR_OPEN 0x2
  2339. /* enum: Intra-pair short. */
  2340. #define MC_CMD_POLL_BIST_SFT9001_INTRA_PAIR_SHORT 0x3
  2341. /* enum: Inter-pair short. */
  2342. #define MC_CMD_POLL_BIST_SFT9001_INTER_PAIR_SHORT 0x4
  2343. /* enum: Busy. */
  2344. #define MC_CMD_POLL_BIST_SFT9001_PAIR_BUSY 0x9
  2345. /* Status of each channel B */
  2346. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_B_OFST 24
  2347. /* Enum values, see field(s): */
  2348. /* CABLE_STATUS_A */
  2349. /* Status of each channel C */
  2350. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_C_OFST 28
  2351. /* Enum values, see field(s): */
  2352. /* CABLE_STATUS_A */
  2353. /* Status of each channel D */
  2354. #define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_D_OFST 32
  2355. /* Enum values, see field(s): */
  2356. /* CABLE_STATUS_A */
  2357. /* MC_CMD_POLL_BIST_OUT_MRSFP msgresponse */
  2358. #define MC_CMD_POLL_BIST_OUT_MRSFP_LEN 8
  2359. /* result */
  2360. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2361. /* Enum values, see field(s): */
  2362. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2363. #define MC_CMD_POLL_BIST_OUT_MRSFP_TEST_OFST 4
  2364. /* enum: Complete. */
  2365. #define MC_CMD_POLL_BIST_MRSFP_TEST_COMPLETE 0x0
  2366. /* enum: Bus switch off I2C write. */
  2367. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_WRITE 0x1
  2368. /* enum: Bus switch off I2C no access IO exp. */
  2369. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_IO_EXP 0x2
  2370. /* enum: Bus switch off I2C no access module. */
  2371. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_MODULE 0x3
  2372. /* enum: IO exp I2C configure. */
  2373. #define MC_CMD_POLL_BIST_MRSFP_TEST_IO_EXP_I2C_CONFIGURE 0x4
  2374. /* enum: Bus switch I2C no cross talk. */
  2375. #define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_I2C_NO_CROSSTALK 0x5
  2376. /* enum: Module presence. */
  2377. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_PRESENCE 0x6
  2378. /* enum: Module ID I2C access. */
  2379. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_I2C_ACCESS 0x7
  2380. /* enum: Module ID sane value. */
  2381. #define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_SANE_VALUE 0x8
  2382. /* MC_CMD_POLL_BIST_OUT_MEM msgresponse */
  2383. #define MC_CMD_POLL_BIST_OUT_MEM_LEN 36
  2384. /* result */
  2385. /* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
  2386. /* Enum values, see field(s): */
  2387. /* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
  2388. #define MC_CMD_POLL_BIST_OUT_MEM_TEST_OFST 4
  2389. /* enum: Test has completed. */
  2390. #define MC_CMD_POLL_BIST_MEM_COMPLETE 0x0
  2391. /* enum: RAM test - walk ones. */
  2392. #define MC_CMD_POLL_BIST_MEM_MEM_WALK_ONES 0x1
  2393. /* enum: RAM test - walk zeros. */
  2394. #define MC_CMD_POLL_BIST_MEM_MEM_WALK_ZEROS 0x2
  2395. /* enum: RAM test - walking inversions zeros/ones. */
  2396. #define MC_CMD_POLL_BIST_MEM_MEM_INV_ZERO_ONE 0x3
  2397. /* enum: RAM test - walking inversions checkerboard. */
  2398. #define MC_CMD_POLL_BIST_MEM_MEM_INV_CHKBOARD 0x4
  2399. /* enum: Register test - set / clear individual bits. */
  2400. #define MC_CMD_POLL_BIST_MEM_REG 0x5
  2401. /* enum: ECC error detected. */
  2402. #define MC_CMD_POLL_BIST_MEM_ECC 0x6
  2403. /* Failure address, only valid if result is POLL_BIST_FAILED */
  2404. #define MC_CMD_POLL_BIST_OUT_MEM_ADDR_OFST 8
  2405. /* Bus or address space to which the failure address corresponds */
  2406. #define MC_CMD_POLL_BIST_OUT_MEM_BUS_OFST 12
  2407. /* enum: MC MIPS bus. */
  2408. #define MC_CMD_POLL_BIST_MEM_BUS_MC 0x0
  2409. /* enum: CSR IREG bus. */
  2410. #define MC_CMD_POLL_BIST_MEM_BUS_CSR 0x1
  2411. /* enum: RX0 DPCPU bus. */
  2412. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2
  2413. /* enum: TX0 DPCPU bus. */
  2414. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3
  2415. /* enum: TX1 DPCPU bus. */
  2416. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4
  2417. /* enum: RX0 DICPU bus. */
  2418. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5
  2419. /* enum: TX DICPU bus. */
  2420. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6
  2421. /* enum: RX1 DPCPU bus. */
  2422. #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX1 0x7
  2423. /* enum: RX1 DICPU bus. */
  2424. #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX1 0x8
  2425. /* Pattern written to RAM / register */
  2426. #define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16
  2427. /* Actual value read from RAM / register */
  2428. #define MC_CMD_POLL_BIST_OUT_MEM_ACTUAL_OFST 20
  2429. /* ECC error mask */
  2430. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_OFST 24
  2431. /* ECC parity error mask */
  2432. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_PARITY_OFST 28
  2433. /* ECC fatal error mask */
  2434. #define MC_CMD_POLL_BIST_OUT_MEM_ECC_FATAL_OFST 32
  2435. /***********************************/
  2436. /* MC_CMD_FLUSH_RX_QUEUES
  2437. * Flush receive queue(s). If SRIOV is enabled (via MC_CMD_SRIOV), then RXQ
  2438. * flushes should be initiated via this MCDI operation, rather than via
  2439. * directly writing FLUSH_CMD.
  2440. *
  2441. * The flush is completed (either done/fail) asynchronously (after this command
  2442. * returns). The driver must still wait for flush done/failure events as usual.
  2443. */
  2444. #define MC_CMD_FLUSH_RX_QUEUES 0x27
  2445. /* MC_CMD_FLUSH_RX_QUEUES_IN msgrequest */
  2446. #define MC_CMD_FLUSH_RX_QUEUES_IN_LENMIN 4
  2447. #define MC_CMD_FLUSH_RX_QUEUES_IN_LENMAX 252
  2448. #define MC_CMD_FLUSH_RX_QUEUES_IN_LEN(num) (0+4*(num))
  2449. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_OFST 0
  2450. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_LEN 4
  2451. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MINNUM 1
  2452. #define MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM 63
  2453. /* MC_CMD_FLUSH_RX_QUEUES_OUT msgresponse */
  2454. #define MC_CMD_FLUSH_RX_QUEUES_OUT_LEN 0
  2455. /***********************************/
  2456. /* MC_CMD_GET_LOOPBACK_MODES
  2457. * Returns a bitmask of loopback modes available at each speed.
  2458. */
  2459. #define MC_CMD_GET_LOOPBACK_MODES 0x28
  2460. #define MC_CMD_0x28_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2461. /* MC_CMD_GET_LOOPBACK_MODES_IN msgrequest */
  2462. #define MC_CMD_GET_LOOPBACK_MODES_IN_LEN 0
  2463. /* MC_CMD_GET_LOOPBACK_MODES_OUT msgresponse */
  2464. #define MC_CMD_GET_LOOPBACK_MODES_OUT_LEN 40
  2465. /* Supported loopbacks. */
  2466. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_OFST 0
  2467. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LEN 8
  2468. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LO_OFST 0
  2469. #define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_HI_OFST 4
  2470. /* enum: None. */
  2471. #define MC_CMD_LOOPBACK_NONE 0x0
  2472. /* enum: Data. */
  2473. #define MC_CMD_LOOPBACK_DATA 0x1
  2474. /* enum: GMAC. */
  2475. #define MC_CMD_LOOPBACK_GMAC 0x2
  2476. /* enum: XGMII. */
  2477. #define MC_CMD_LOOPBACK_XGMII 0x3
  2478. /* enum: XGXS. */
  2479. #define MC_CMD_LOOPBACK_XGXS 0x4
  2480. /* enum: XAUI. */
  2481. #define MC_CMD_LOOPBACK_XAUI 0x5
  2482. /* enum: GMII. */
  2483. #define MC_CMD_LOOPBACK_GMII 0x6
  2484. /* enum: SGMII. */
  2485. #define MC_CMD_LOOPBACK_SGMII 0x7
  2486. /* enum: XGBR. */
  2487. #define MC_CMD_LOOPBACK_XGBR 0x8
  2488. /* enum: XFI. */
  2489. #define MC_CMD_LOOPBACK_XFI 0x9
  2490. /* enum: XAUI Far. */
  2491. #define MC_CMD_LOOPBACK_XAUI_FAR 0xa
  2492. /* enum: GMII Far. */
  2493. #define MC_CMD_LOOPBACK_GMII_FAR 0xb
  2494. /* enum: SGMII Far. */
  2495. #define MC_CMD_LOOPBACK_SGMII_FAR 0xc
  2496. /* enum: XFI Far. */
  2497. #define MC_CMD_LOOPBACK_XFI_FAR 0xd
  2498. /* enum: GPhy. */
  2499. #define MC_CMD_LOOPBACK_GPHY 0xe
  2500. /* enum: PhyXS. */
  2501. #define MC_CMD_LOOPBACK_PHYXS 0xf
  2502. /* enum: PCS. */
  2503. #define MC_CMD_LOOPBACK_PCS 0x10
  2504. /* enum: PMA-PMD. */
  2505. #define MC_CMD_LOOPBACK_PMAPMD 0x11
  2506. /* enum: Cross-Port. */
  2507. #define MC_CMD_LOOPBACK_XPORT 0x12
  2508. /* enum: XGMII-Wireside. */
  2509. #define MC_CMD_LOOPBACK_XGMII_WS 0x13
  2510. /* enum: XAUI Wireside. */
  2511. #define MC_CMD_LOOPBACK_XAUI_WS 0x14
  2512. /* enum: XAUI Wireside Far. */
  2513. #define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15
  2514. /* enum: XAUI Wireside near. */
  2515. #define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16
  2516. /* enum: GMII Wireside. */
  2517. #define MC_CMD_LOOPBACK_GMII_WS 0x17
  2518. /* enum: XFI Wireside. */
  2519. #define MC_CMD_LOOPBACK_XFI_WS 0x18
  2520. /* enum: XFI Wireside Far. */
  2521. #define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19
  2522. /* enum: PhyXS Wireside. */
  2523. #define MC_CMD_LOOPBACK_PHYXS_WS 0x1a
  2524. /* enum: PMA lanes MAC-Serdes. */
  2525. #define MC_CMD_LOOPBACK_PMA_INT 0x1b
  2526. /* enum: KR Serdes Parallel (Encoder). */
  2527. #define MC_CMD_LOOPBACK_SD_NEAR 0x1c
  2528. /* enum: KR Serdes Serial. */
  2529. #define MC_CMD_LOOPBACK_SD_FAR 0x1d
  2530. /* enum: PMA lanes MAC-Serdes Wireside. */
  2531. #define MC_CMD_LOOPBACK_PMA_INT_WS 0x1e
  2532. /* enum: KR Serdes Parallel Wireside (Full PCS). */
  2533. #define MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f
  2534. /* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */
  2535. #define MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20
  2536. /* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */
  2537. #define MC_CMD_LOOPBACK_SD_FEP_WS 0x21
  2538. /* enum: KR Serdes Serial Wireside. */
  2539. #define MC_CMD_LOOPBACK_SD_FES_WS 0x22
  2540. /* enum: Near side of AOE Siena side port */
  2541. #define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23
  2542. /* enum: Medford Wireside datapath loopback */
  2543. #define MC_CMD_LOOPBACK_DATA_WS 0x24
  2544. /* enum: Force link up without setting up any physical loopback (snapper use
  2545. * only)
  2546. */
  2547. #define MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25
  2548. /* Supported loopbacks. */
  2549. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_OFST 8
  2550. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LEN 8
  2551. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LO_OFST 8
  2552. #define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_HI_OFST 12
  2553. /* Enum values, see field(s): */
  2554. /* 100M */
  2555. /* Supported loopbacks. */
  2556. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_OFST 16
  2557. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LEN 8
  2558. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LO_OFST 16
  2559. #define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_HI_OFST 20
  2560. /* Enum values, see field(s): */
  2561. /* 100M */
  2562. /* Supported loopbacks. */
  2563. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_OFST 24
  2564. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LEN 8
  2565. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LO_OFST 24
  2566. #define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_HI_OFST 28
  2567. /* Enum values, see field(s): */
  2568. /* 100M */
  2569. /* Supported loopbacks. */
  2570. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_OFST 32
  2571. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LEN 8
  2572. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LO_OFST 32
  2573. #define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_HI_OFST 36
  2574. /* Enum values, see field(s): */
  2575. /* 100M */
  2576. /***********************************/
  2577. /* MC_CMD_GET_LINK
  2578. * Read the unified MAC/PHY link state. Locks required: None Return code: 0,
  2579. * ETIME.
  2580. */
  2581. #define MC_CMD_GET_LINK 0x29
  2582. #define MC_CMD_0x29_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2583. /* MC_CMD_GET_LINK_IN msgrequest */
  2584. #define MC_CMD_GET_LINK_IN_LEN 0
  2585. /* MC_CMD_GET_LINK_OUT msgresponse */
  2586. #define MC_CMD_GET_LINK_OUT_LEN 28
  2587. /* near-side advertised capabilities */
  2588. #define MC_CMD_GET_LINK_OUT_CAP_OFST 0
  2589. /* link-partner advertised capabilities */
  2590. #define MC_CMD_GET_LINK_OUT_LP_CAP_OFST 4
  2591. /* Autonegotiated speed in mbit/s. The link may still be down even if this
  2592. * reads non-zero.
  2593. */
  2594. #define MC_CMD_GET_LINK_OUT_LINK_SPEED_OFST 8
  2595. /* Current loopback setting. */
  2596. #define MC_CMD_GET_LINK_OUT_LOOPBACK_MODE_OFST 12
  2597. /* Enum values, see field(s): */
  2598. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  2599. #define MC_CMD_GET_LINK_OUT_FLAGS_OFST 16
  2600. #define MC_CMD_GET_LINK_OUT_LINK_UP_LBN 0
  2601. #define MC_CMD_GET_LINK_OUT_LINK_UP_WIDTH 1
  2602. #define MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN 1
  2603. #define MC_CMD_GET_LINK_OUT_FULL_DUPLEX_WIDTH 1
  2604. #define MC_CMD_GET_LINK_OUT_BPX_LINK_LBN 2
  2605. #define MC_CMD_GET_LINK_OUT_BPX_LINK_WIDTH 1
  2606. #define MC_CMD_GET_LINK_OUT_PHY_LINK_LBN 3
  2607. #define MC_CMD_GET_LINK_OUT_PHY_LINK_WIDTH 1
  2608. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_LBN 6
  2609. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_WIDTH 1
  2610. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_LBN 7
  2611. #define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_WIDTH 1
  2612. /* This returns the negotiated flow control value. */
  2613. #define MC_CMD_GET_LINK_OUT_FCNTL_OFST 20
  2614. /* Enum values, see field(s): */
  2615. /* MC_CMD_SET_MAC/MC_CMD_SET_MAC_IN/FCNTL */
  2616. #define MC_CMD_GET_LINK_OUT_MAC_FAULT_OFST 24
  2617. #define MC_CMD_MAC_FAULT_XGMII_LOCAL_LBN 0
  2618. #define MC_CMD_MAC_FAULT_XGMII_LOCAL_WIDTH 1
  2619. #define MC_CMD_MAC_FAULT_XGMII_REMOTE_LBN 1
  2620. #define MC_CMD_MAC_FAULT_XGMII_REMOTE_WIDTH 1
  2621. #define MC_CMD_MAC_FAULT_SGMII_REMOTE_LBN 2
  2622. #define MC_CMD_MAC_FAULT_SGMII_REMOTE_WIDTH 1
  2623. #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_LBN 3
  2624. #define MC_CMD_MAC_FAULT_PENDING_RECONFIG_WIDTH 1
  2625. /***********************************/
  2626. /* MC_CMD_SET_LINK
  2627. * Write the unified MAC/PHY link configuration. Locks required: None. Return
  2628. * code: 0, EINVAL, ETIME
  2629. */
  2630. #define MC_CMD_SET_LINK 0x2a
  2631. #define MC_CMD_0x2a_PRIVILEGE_CTG SRIOV_CTG_LINK
  2632. /* MC_CMD_SET_LINK_IN msgrequest */
  2633. #define MC_CMD_SET_LINK_IN_LEN 16
  2634. /* ??? */
  2635. #define MC_CMD_SET_LINK_IN_CAP_OFST 0
  2636. /* Flags */
  2637. #define MC_CMD_SET_LINK_IN_FLAGS_OFST 4
  2638. #define MC_CMD_SET_LINK_IN_LOWPOWER_LBN 0
  2639. #define MC_CMD_SET_LINK_IN_LOWPOWER_WIDTH 1
  2640. #define MC_CMD_SET_LINK_IN_POWEROFF_LBN 1
  2641. #define MC_CMD_SET_LINK_IN_POWEROFF_WIDTH 1
  2642. #define MC_CMD_SET_LINK_IN_TXDIS_LBN 2
  2643. #define MC_CMD_SET_LINK_IN_TXDIS_WIDTH 1
  2644. /* Loopback mode. */
  2645. #define MC_CMD_SET_LINK_IN_LOOPBACK_MODE_OFST 8
  2646. /* Enum values, see field(s): */
  2647. /* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
  2648. /* A loopback speed of "0" is supported, and means (choose any available
  2649. * speed).
  2650. */
  2651. #define MC_CMD_SET_LINK_IN_LOOPBACK_SPEED_OFST 12
  2652. /* MC_CMD_SET_LINK_OUT msgresponse */
  2653. #define MC_CMD_SET_LINK_OUT_LEN 0
  2654. /***********************************/
  2655. /* MC_CMD_SET_ID_LED
  2656. * Set identification LED state. Locks required: None. Return code: 0, EINVAL
  2657. */
  2658. #define MC_CMD_SET_ID_LED 0x2b
  2659. #define MC_CMD_0x2b_PRIVILEGE_CTG SRIOV_CTG_LINK
  2660. /* MC_CMD_SET_ID_LED_IN msgrequest */
  2661. #define MC_CMD_SET_ID_LED_IN_LEN 4
  2662. /* Set LED state. */
  2663. #define MC_CMD_SET_ID_LED_IN_STATE_OFST 0
  2664. #define MC_CMD_LED_OFF 0x0 /* enum */
  2665. #define MC_CMD_LED_ON 0x1 /* enum */
  2666. #define MC_CMD_LED_DEFAULT 0x2 /* enum */
  2667. /* MC_CMD_SET_ID_LED_OUT msgresponse */
  2668. #define MC_CMD_SET_ID_LED_OUT_LEN 0
  2669. /***********************************/
  2670. /* MC_CMD_SET_MAC
  2671. * Set MAC configuration. Locks required: None. Return code: 0, EINVAL
  2672. */
  2673. #define MC_CMD_SET_MAC 0x2c
  2674. #define MC_CMD_0x2c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2675. /* MC_CMD_SET_MAC_IN msgrequest */
  2676. #define MC_CMD_SET_MAC_IN_LEN 28
  2677. /* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
  2678. * EtherII, VLAN, bug16011 padding).
  2679. */
  2680. #define MC_CMD_SET_MAC_IN_MTU_OFST 0
  2681. #define MC_CMD_SET_MAC_IN_DRAIN_OFST 4
  2682. #define MC_CMD_SET_MAC_IN_ADDR_OFST 8
  2683. #define MC_CMD_SET_MAC_IN_ADDR_LEN 8
  2684. #define MC_CMD_SET_MAC_IN_ADDR_LO_OFST 8
  2685. #define MC_CMD_SET_MAC_IN_ADDR_HI_OFST 12
  2686. #define MC_CMD_SET_MAC_IN_REJECT_OFST 16
  2687. #define MC_CMD_SET_MAC_IN_REJECT_UNCST_LBN 0
  2688. #define MC_CMD_SET_MAC_IN_REJECT_UNCST_WIDTH 1
  2689. #define MC_CMD_SET_MAC_IN_REJECT_BRDCST_LBN 1
  2690. #define MC_CMD_SET_MAC_IN_REJECT_BRDCST_WIDTH 1
  2691. #define MC_CMD_SET_MAC_IN_FCNTL_OFST 20
  2692. /* enum: Flow control is off. */
  2693. #define MC_CMD_FCNTL_OFF 0x0
  2694. /* enum: Respond to flow control. */
  2695. #define MC_CMD_FCNTL_RESPOND 0x1
  2696. /* enum: Respond to and Issue flow control. */
  2697. #define MC_CMD_FCNTL_BIDIR 0x2
  2698. /* enum: Auto neg flow control. */
  2699. #define MC_CMD_FCNTL_AUTO 0x3
  2700. /* enum: Priority flow control (eftest builds only). */
  2701. #define MC_CMD_FCNTL_QBB 0x4
  2702. /* enum: Issue flow control. */
  2703. #define MC_CMD_FCNTL_GENERATE 0x5
  2704. #define MC_CMD_SET_MAC_IN_FLAGS_OFST 24
  2705. #define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_LBN 0
  2706. #define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_WIDTH 1
  2707. /* MC_CMD_SET_MAC_EXT_IN msgrequest */
  2708. #define MC_CMD_SET_MAC_EXT_IN_LEN 32
  2709. /* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
  2710. * EtherII, VLAN, bug16011 padding).
  2711. */
  2712. #define MC_CMD_SET_MAC_EXT_IN_MTU_OFST 0
  2713. #define MC_CMD_SET_MAC_EXT_IN_DRAIN_OFST 4
  2714. #define MC_CMD_SET_MAC_EXT_IN_ADDR_OFST 8
  2715. #define MC_CMD_SET_MAC_EXT_IN_ADDR_LEN 8
  2716. #define MC_CMD_SET_MAC_EXT_IN_ADDR_LO_OFST 8
  2717. #define MC_CMD_SET_MAC_EXT_IN_ADDR_HI_OFST 12
  2718. #define MC_CMD_SET_MAC_EXT_IN_REJECT_OFST 16
  2719. #define MC_CMD_SET_MAC_EXT_IN_REJECT_UNCST_LBN 0
  2720. #define MC_CMD_SET_MAC_EXT_IN_REJECT_UNCST_WIDTH 1
  2721. #define MC_CMD_SET_MAC_EXT_IN_REJECT_BRDCST_LBN 1
  2722. #define MC_CMD_SET_MAC_EXT_IN_REJECT_BRDCST_WIDTH 1
  2723. #define MC_CMD_SET_MAC_EXT_IN_FCNTL_OFST 20
  2724. /* enum: Flow control is off. */
  2725. /* MC_CMD_FCNTL_OFF 0x0 */
  2726. /* enum: Respond to flow control. */
  2727. /* MC_CMD_FCNTL_RESPOND 0x1 */
  2728. /* enum: Respond to and Issue flow control. */
  2729. /* MC_CMD_FCNTL_BIDIR 0x2 */
  2730. /* enum: Auto neg flow control. */
  2731. /* MC_CMD_FCNTL_AUTO 0x3 */
  2732. /* enum: Priority flow control (eftest builds only). */
  2733. /* MC_CMD_FCNTL_QBB 0x4 */
  2734. /* enum: Issue flow control. */
  2735. /* MC_CMD_FCNTL_GENERATE 0x5 */
  2736. #define MC_CMD_SET_MAC_EXT_IN_FLAGS_OFST 24
  2737. #define MC_CMD_SET_MAC_EXT_IN_FLAG_INCLUDE_FCS_LBN 0
  2738. #define MC_CMD_SET_MAC_EXT_IN_FLAG_INCLUDE_FCS_WIDTH 1
  2739. /* Select which parameters to configure. A parameter will only be modified if
  2740. * the corresponding control flag is set. If SET_MAC_ENHANCED is not set in
  2741. * capabilities then this field is ignored (and all flags are assumed to be
  2742. * set).
  2743. */
  2744. #define MC_CMD_SET_MAC_EXT_IN_CONTROL_OFST 28
  2745. #define MC_CMD_SET_MAC_EXT_IN_CFG_MTU_LBN 0
  2746. #define MC_CMD_SET_MAC_EXT_IN_CFG_MTU_WIDTH 1
  2747. #define MC_CMD_SET_MAC_EXT_IN_CFG_DRAIN_LBN 1
  2748. #define MC_CMD_SET_MAC_EXT_IN_CFG_DRAIN_WIDTH 1
  2749. #define MC_CMD_SET_MAC_EXT_IN_CFG_REJECT_LBN 2
  2750. #define MC_CMD_SET_MAC_EXT_IN_CFG_REJECT_WIDTH 1
  2751. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCNTL_LBN 3
  2752. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCNTL_WIDTH 1
  2753. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCS_LBN 4
  2754. #define MC_CMD_SET_MAC_EXT_IN_CFG_FCS_WIDTH 1
  2755. /* MC_CMD_SET_MAC_OUT msgresponse */
  2756. #define MC_CMD_SET_MAC_OUT_LEN 0
  2757. /* MC_CMD_SET_MAC_V2_OUT msgresponse */
  2758. #define MC_CMD_SET_MAC_V2_OUT_LEN 4
  2759. /* MTU as configured after processing the request. See comment at
  2760. * MC_CMD_SET_MAC_IN/MTU. To query MTU without doing any changes, set CONTROL
  2761. * to 0.
  2762. */
  2763. #define MC_CMD_SET_MAC_V2_OUT_MTU_OFST 0
  2764. /***********************************/
  2765. /* MC_CMD_PHY_STATS
  2766. * Get generic PHY statistics. This call returns the statistics for a generic
  2767. * PHY in a sparse array (indexed by the enumerate). Each value is represented
  2768. * by a 32bit number. If the DMA_ADDR is 0, then no DMA is performed, and the
  2769. * statistics may be read from the message response. If DMA_ADDR != 0, then the
  2770. * statistics are dmad to that (page-aligned location). Locks required: None.
  2771. * Returns: 0, ETIME
  2772. */
  2773. #define MC_CMD_PHY_STATS 0x2d
  2774. #define MC_CMD_0x2d_PRIVILEGE_CTG SRIOV_CTG_LINK
  2775. /* MC_CMD_PHY_STATS_IN msgrequest */
  2776. #define MC_CMD_PHY_STATS_IN_LEN 8
  2777. /* ??? */
  2778. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_OFST 0
  2779. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_LEN 8
  2780. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_LO_OFST 0
  2781. #define MC_CMD_PHY_STATS_IN_DMA_ADDR_HI_OFST 4
  2782. /* MC_CMD_PHY_STATS_OUT_DMA msgresponse */
  2783. #define MC_CMD_PHY_STATS_OUT_DMA_LEN 0
  2784. /* MC_CMD_PHY_STATS_OUT_NO_DMA msgresponse */
  2785. #define MC_CMD_PHY_STATS_OUT_NO_DMA_LEN (((MC_CMD_PHY_NSTATS*32))>>3)
  2786. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_OFST 0
  2787. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_LEN 4
  2788. #define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_PHY_NSTATS
  2789. /* enum: OUI. */
  2790. #define MC_CMD_OUI 0x0
  2791. /* enum: PMA-PMD Link Up. */
  2792. #define MC_CMD_PMA_PMD_LINK_UP 0x1
  2793. /* enum: PMA-PMD RX Fault. */
  2794. #define MC_CMD_PMA_PMD_RX_FAULT 0x2
  2795. /* enum: PMA-PMD TX Fault. */
  2796. #define MC_CMD_PMA_PMD_TX_FAULT 0x3
  2797. /* enum: PMA-PMD Signal */
  2798. #define MC_CMD_PMA_PMD_SIGNAL 0x4
  2799. /* enum: PMA-PMD SNR A. */
  2800. #define MC_CMD_PMA_PMD_SNR_A 0x5
  2801. /* enum: PMA-PMD SNR B. */
  2802. #define MC_CMD_PMA_PMD_SNR_B 0x6
  2803. /* enum: PMA-PMD SNR C. */
  2804. #define MC_CMD_PMA_PMD_SNR_C 0x7
  2805. /* enum: PMA-PMD SNR D. */
  2806. #define MC_CMD_PMA_PMD_SNR_D 0x8
  2807. /* enum: PCS Link Up. */
  2808. #define MC_CMD_PCS_LINK_UP 0x9
  2809. /* enum: PCS RX Fault. */
  2810. #define MC_CMD_PCS_RX_FAULT 0xa
  2811. /* enum: PCS TX Fault. */
  2812. #define MC_CMD_PCS_TX_FAULT 0xb
  2813. /* enum: PCS BER. */
  2814. #define MC_CMD_PCS_BER 0xc
  2815. /* enum: PCS Block Errors. */
  2816. #define MC_CMD_PCS_BLOCK_ERRORS 0xd
  2817. /* enum: PhyXS Link Up. */
  2818. #define MC_CMD_PHYXS_LINK_UP 0xe
  2819. /* enum: PhyXS RX Fault. */
  2820. #define MC_CMD_PHYXS_RX_FAULT 0xf
  2821. /* enum: PhyXS TX Fault. */
  2822. #define MC_CMD_PHYXS_TX_FAULT 0x10
  2823. /* enum: PhyXS Align. */
  2824. #define MC_CMD_PHYXS_ALIGN 0x11
  2825. /* enum: PhyXS Sync. */
  2826. #define MC_CMD_PHYXS_SYNC 0x12
  2827. /* enum: AN link-up. */
  2828. #define MC_CMD_AN_LINK_UP 0x13
  2829. /* enum: AN Complete. */
  2830. #define MC_CMD_AN_COMPLETE 0x14
  2831. /* enum: AN 10GBaseT Status. */
  2832. #define MC_CMD_AN_10GBT_STATUS 0x15
  2833. /* enum: Clause 22 Link-Up. */
  2834. #define MC_CMD_CL22_LINK_UP 0x16
  2835. /* enum: (Last entry) */
  2836. #define MC_CMD_PHY_NSTATS 0x17
  2837. /***********************************/
  2838. /* MC_CMD_MAC_STATS
  2839. * Get generic MAC statistics. This call returns unified statistics maintained
  2840. * by the MC as it switches between the GMAC and XMAC. The MC will write out
  2841. * all supported stats. The driver should zero initialise the buffer to
  2842. * guarantee consistent results. If the DMA_ADDR is 0, then no DMA is
  2843. * performed, and the statistics may be read from the message response. If
  2844. * DMA_ADDR != 0, then the statistics are dmad to that (page-aligned location).
  2845. * Locks required: None. The PERIODIC_CLEAR option is not used and now has no
  2846. * effect. Returns: 0, ETIME
  2847. */
  2848. #define MC_CMD_MAC_STATS 0x2e
  2849. #define MC_CMD_0x2e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  2850. /* MC_CMD_MAC_STATS_IN msgrequest */
  2851. #define MC_CMD_MAC_STATS_IN_LEN 20
  2852. /* ??? */
  2853. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_OFST 0
  2854. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_LEN 8
  2855. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_LO_OFST 0
  2856. #define MC_CMD_MAC_STATS_IN_DMA_ADDR_HI_OFST 4
  2857. #define MC_CMD_MAC_STATS_IN_CMD_OFST 8
  2858. #define MC_CMD_MAC_STATS_IN_DMA_LBN 0
  2859. #define MC_CMD_MAC_STATS_IN_DMA_WIDTH 1
  2860. #define MC_CMD_MAC_STATS_IN_CLEAR_LBN 1
  2861. #define MC_CMD_MAC_STATS_IN_CLEAR_WIDTH 1
  2862. #define MC_CMD_MAC_STATS_IN_PERIODIC_CHANGE_LBN 2
  2863. #define MC_CMD_MAC_STATS_IN_PERIODIC_CHANGE_WIDTH 1
  2864. #define MC_CMD_MAC_STATS_IN_PERIODIC_ENABLE_LBN 3
  2865. #define MC_CMD_MAC_STATS_IN_PERIODIC_ENABLE_WIDTH 1
  2866. #define MC_CMD_MAC_STATS_IN_PERIODIC_CLEAR_LBN 4
  2867. #define MC_CMD_MAC_STATS_IN_PERIODIC_CLEAR_WIDTH 1
  2868. #define MC_CMD_MAC_STATS_IN_PERIODIC_NOEVENT_LBN 5
  2869. #define MC_CMD_MAC_STATS_IN_PERIODIC_NOEVENT_WIDTH 1
  2870. #define MC_CMD_MAC_STATS_IN_PERIOD_MS_LBN 16
  2871. #define MC_CMD_MAC_STATS_IN_PERIOD_MS_WIDTH 16
  2872. #define MC_CMD_MAC_STATS_IN_DMA_LEN_OFST 12
  2873. /* port id so vadapter stats can be provided */
  2874. #define MC_CMD_MAC_STATS_IN_PORT_ID_OFST 16
  2875. /* MC_CMD_MAC_STATS_OUT_DMA msgresponse */
  2876. #define MC_CMD_MAC_STATS_OUT_DMA_LEN 0
  2877. /* MC_CMD_MAC_STATS_OUT_NO_DMA msgresponse */
  2878. #define MC_CMD_MAC_STATS_OUT_NO_DMA_LEN (((MC_CMD_MAC_NSTATS*64))>>3)
  2879. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_OFST 0
  2880. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LEN 8
  2881. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_LO_OFST 0
  2882. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_HI_OFST 4
  2883. #define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS
  2884. #define MC_CMD_MAC_GENERATION_START 0x0 /* enum */
  2885. #define MC_CMD_MAC_DMABUF_START 0x1 /* enum */
  2886. #define MC_CMD_MAC_TX_PKTS 0x1 /* enum */
  2887. #define MC_CMD_MAC_TX_PAUSE_PKTS 0x2 /* enum */
  2888. #define MC_CMD_MAC_TX_CONTROL_PKTS 0x3 /* enum */
  2889. #define MC_CMD_MAC_TX_UNICAST_PKTS 0x4 /* enum */
  2890. #define MC_CMD_MAC_TX_MULTICAST_PKTS 0x5 /* enum */
  2891. #define MC_CMD_MAC_TX_BROADCAST_PKTS 0x6 /* enum */
  2892. #define MC_CMD_MAC_TX_BYTES 0x7 /* enum */
  2893. #define MC_CMD_MAC_TX_BAD_BYTES 0x8 /* enum */
  2894. #define MC_CMD_MAC_TX_LT64_PKTS 0x9 /* enum */
  2895. #define MC_CMD_MAC_TX_64_PKTS 0xa /* enum */
  2896. #define MC_CMD_MAC_TX_65_TO_127_PKTS 0xb /* enum */
  2897. #define MC_CMD_MAC_TX_128_TO_255_PKTS 0xc /* enum */
  2898. #define MC_CMD_MAC_TX_256_TO_511_PKTS 0xd /* enum */
  2899. #define MC_CMD_MAC_TX_512_TO_1023_PKTS 0xe /* enum */
  2900. #define MC_CMD_MAC_TX_1024_TO_15XX_PKTS 0xf /* enum */
  2901. #define MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS 0x10 /* enum */
  2902. #define MC_CMD_MAC_TX_GTJUMBO_PKTS 0x11 /* enum */
  2903. #define MC_CMD_MAC_TX_BAD_FCS_PKTS 0x12 /* enum */
  2904. #define MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS 0x13 /* enum */
  2905. #define MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS 0x14 /* enum */
  2906. #define MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS 0x15 /* enum */
  2907. #define MC_CMD_MAC_TX_LATE_COLLISION_PKTS 0x16 /* enum */
  2908. #define MC_CMD_MAC_TX_DEFERRED_PKTS 0x17 /* enum */
  2909. #define MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS 0x18 /* enum */
  2910. #define MC_CMD_MAC_TX_NON_TCPUDP_PKTS 0x19 /* enum */
  2911. #define MC_CMD_MAC_TX_MAC_SRC_ERR_PKTS 0x1a /* enum */
  2912. #define MC_CMD_MAC_TX_IP_SRC_ERR_PKTS 0x1b /* enum */
  2913. #define MC_CMD_MAC_RX_PKTS 0x1c /* enum */
  2914. #define MC_CMD_MAC_RX_PAUSE_PKTS 0x1d /* enum */
  2915. #define MC_CMD_MAC_RX_GOOD_PKTS 0x1e /* enum */
  2916. #define MC_CMD_MAC_RX_CONTROL_PKTS 0x1f /* enum */
  2917. #define MC_CMD_MAC_RX_UNICAST_PKTS 0x20 /* enum */
  2918. #define MC_CMD_MAC_RX_MULTICAST_PKTS 0x21 /* enum */
  2919. #define MC_CMD_MAC_RX_BROADCAST_PKTS 0x22 /* enum */
  2920. #define MC_CMD_MAC_RX_BYTES 0x23 /* enum */
  2921. #define MC_CMD_MAC_RX_BAD_BYTES 0x24 /* enum */
  2922. #define MC_CMD_MAC_RX_64_PKTS 0x25 /* enum */
  2923. #define MC_CMD_MAC_RX_65_TO_127_PKTS 0x26 /* enum */
  2924. #define MC_CMD_MAC_RX_128_TO_255_PKTS 0x27 /* enum */
  2925. #define MC_CMD_MAC_RX_256_TO_511_PKTS 0x28 /* enum */
  2926. #define MC_CMD_MAC_RX_512_TO_1023_PKTS 0x29 /* enum */
  2927. #define MC_CMD_MAC_RX_1024_TO_15XX_PKTS 0x2a /* enum */
  2928. #define MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS 0x2b /* enum */
  2929. #define MC_CMD_MAC_RX_GTJUMBO_PKTS 0x2c /* enum */
  2930. #define MC_CMD_MAC_RX_UNDERSIZE_PKTS 0x2d /* enum */
  2931. #define MC_CMD_MAC_RX_BAD_FCS_PKTS 0x2e /* enum */
  2932. #define MC_CMD_MAC_RX_OVERFLOW_PKTS 0x2f /* enum */
  2933. #define MC_CMD_MAC_RX_FALSE_CARRIER_PKTS 0x30 /* enum */
  2934. #define MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS 0x31 /* enum */
  2935. #define MC_CMD_MAC_RX_ALIGN_ERROR_PKTS 0x32 /* enum */
  2936. #define MC_CMD_MAC_RX_LENGTH_ERROR_PKTS 0x33 /* enum */
  2937. #define MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS 0x34 /* enum */
  2938. #define MC_CMD_MAC_RX_JABBER_PKTS 0x35 /* enum */
  2939. #define MC_CMD_MAC_RX_NODESC_DROPS 0x36 /* enum */
  2940. #define MC_CMD_MAC_RX_LANES01_CHAR_ERR 0x37 /* enum */
  2941. #define MC_CMD_MAC_RX_LANES23_CHAR_ERR 0x38 /* enum */
  2942. #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */
  2943. #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */
  2944. #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */
  2945. /* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2946. * capability only.
  2947. */
  2948. #define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c
  2949. /* enum: PM discard_bb_overflow counter. Valid for EF10 with
  2950. * PM_AND_RXDP_COUNTERS capability only.
  2951. */
  2952. #define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d
  2953. /* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2954. * capability only.
  2955. */
  2956. #define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e
  2957. /* enum: PM discard_vfifo_full counter. Valid for EF10 with
  2958. * PM_AND_RXDP_COUNTERS capability only.
  2959. */
  2960. #define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f
  2961. /* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2962. * capability only.
  2963. */
  2964. #define MC_CMD_MAC_PM_TRUNC_QBB 0x40
  2965. /* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2966. * capability only.
  2967. */
  2968. #define MC_CMD_MAC_PM_DISCARD_QBB 0x41
  2969. /* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
  2970. * capability only.
  2971. */
  2972. #define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42
  2973. /* enum: RXDP counter: Number of packets dropped due to the queue being
  2974. * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  2975. */
  2976. #define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43
  2977. /* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10
  2978. * with PM_AND_RXDP_COUNTERS capability only.
  2979. */
  2980. #define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45
  2981. /* enum: RXDP counter: Number of non-host packets. Valid for EF10 with
  2982. * PM_AND_RXDP_COUNTERS capability only.
  2983. */
  2984. #define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46
  2985. /* enum: RXDP counter: Number of times an hlb descriptor fetch was performed.
  2986. * Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  2987. */
  2988. #define MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS 0x47
  2989. /* enum: RXDP counter: Number of times the DPCPU waited for an existing
  2990. * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
  2991. */
  2992. #define MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS 0x48
  2993. #define MC_CMD_MAC_VADAPTER_RX_DMABUF_START 0x4c /* enum */
  2994. #define MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS 0x4c /* enum */
  2995. #define MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES 0x4d /* enum */
  2996. #define MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS 0x4e /* enum */
  2997. #define MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES 0x4f /* enum */
  2998. #define MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS 0x50 /* enum */
  2999. #define MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES 0x51 /* enum */
  3000. #define MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS 0x52 /* enum */
  3001. #define MC_CMD_MAC_VADAPTER_RX_BAD_BYTES 0x53 /* enum */
  3002. #define MC_CMD_MAC_VADAPTER_RX_OVERFLOW 0x54 /* enum */
  3003. #define MC_CMD_MAC_VADAPTER_TX_DMABUF_START 0x57 /* enum */
  3004. #define MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS 0x57 /* enum */
  3005. #define MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES 0x58 /* enum */
  3006. #define MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS 0x59 /* enum */
  3007. #define MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES 0x5a /* enum */
  3008. #define MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS 0x5b /* enum */
  3009. #define MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES 0x5c /* enum */
  3010. #define MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS 0x5d /* enum */
  3011. #define MC_CMD_MAC_VADAPTER_TX_BAD_BYTES 0x5e /* enum */
  3012. #define MC_CMD_MAC_VADAPTER_TX_OVERFLOW 0x5f /* enum */
  3013. /* enum: Start of GMAC stats buffer space, for Siena only. */
  3014. #define MC_CMD_GMAC_DMABUF_START 0x40
  3015. /* enum: End of GMAC stats buffer space, for Siena only. */
  3016. #define MC_CMD_GMAC_DMABUF_END 0x5f
  3017. #define MC_CMD_MAC_GENERATION_END 0x60 /* enum */
  3018. #define MC_CMD_MAC_NSTATS 0x61 /* enum */
  3019. /***********************************/
  3020. /* MC_CMD_SRIOV
  3021. * to be documented
  3022. */
  3023. #define MC_CMD_SRIOV 0x30
  3024. /* MC_CMD_SRIOV_IN msgrequest */
  3025. #define MC_CMD_SRIOV_IN_LEN 12
  3026. #define MC_CMD_SRIOV_IN_ENABLE_OFST 0
  3027. #define MC_CMD_SRIOV_IN_VI_BASE_OFST 4
  3028. #define MC_CMD_SRIOV_IN_VF_COUNT_OFST 8
  3029. /* MC_CMD_SRIOV_OUT msgresponse */
  3030. #define MC_CMD_SRIOV_OUT_LEN 8
  3031. #define MC_CMD_SRIOV_OUT_VI_SCALE_OFST 0
  3032. #define MC_CMD_SRIOV_OUT_VF_TOTAL_OFST 4
  3033. /* MC_CMD_MEMCPY_RECORD_TYPEDEF structuredef */
  3034. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LEN 32
  3035. /* this is only used for the first record */
  3036. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_OFST 0
  3037. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_LBN 0
  3038. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_WIDTH 32
  3039. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_OFST 4
  3040. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_LBN 32
  3041. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_RID_WIDTH 32
  3042. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_OFST 8
  3043. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LEN 8
  3044. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LO_OFST 8
  3045. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_HI_OFST 12
  3046. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_LBN 64
  3047. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_TO_ADDR_WIDTH 64
  3048. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_OFST 16
  3049. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_RID_INLINE 0x100 /* enum */
  3050. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_LBN 128
  3051. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_RID_WIDTH 32
  3052. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_OFST 20
  3053. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LEN 8
  3054. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LO_OFST 20
  3055. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_HI_OFST 24
  3056. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_LBN 160
  3057. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_FROM_ADDR_WIDTH 64
  3058. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_OFST 28
  3059. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_LBN 224
  3060. #define MC_CMD_MEMCPY_RECORD_TYPEDEF_LENGTH_WIDTH 32
  3061. /***********************************/
  3062. /* MC_CMD_MEMCPY
  3063. * DMA write data into (Rid,Addr), either by dma reading (Rid,Addr), or by data
  3064. * embedded directly in the command.
  3065. *
  3066. * A common pattern is for a client to use generation counts to signal a dma
  3067. * update of a datastructure. To facilitate this, this MCDI operation can
  3068. * contain multiple requests which are executed in strict order. Requests take
  3069. * the form of duplicating the entire MCDI request continuously (including the
  3070. * requests record, which is ignored in all but the first structure)
  3071. *
  3072. * The source data can either come from a DMA from the host, or it can be
  3073. * embedded within the request directly, thereby eliminating a DMA read. To
  3074. * indicate this, the client sets FROM_RID=%RID_INLINE, ADDR_HI=0, and
  3075. * ADDR_LO=offset, and inserts the data at %offset from the start of the
  3076. * payload. It's the callers responsibility to ensure that the embedded data
  3077. * doesn't overlap the records.
  3078. *
  3079. * Returns: 0, EINVAL (invalid RID)
  3080. */
  3081. #define MC_CMD_MEMCPY 0x31
  3082. /* MC_CMD_MEMCPY_IN msgrequest */
  3083. #define MC_CMD_MEMCPY_IN_LENMIN 32
  3084. #define MC_CMD_MEMCPY_IN_LENMAX 224
  3085. #define MC_CMD_MEMCPY_IN_LEN(num) (0+32*(num))
  3086. /* see MC_CMD_MEMCPY_RECORD_TYPEDEF */
  3087. #define MC_CMD_MEMCPY_IN_RECORD_OFST 0
  3088. #define MC_CMD_MEMCPY_IN_RECORD_LEN 32
  3089. #define MC_CMD_MEMCPY_IN_RECORD_MINNUM 1
  3090. #define MC_CMD_MEMCPY_IN_RECORD_MAXNUM 7
  3091. /* MC_CMD_MEMCPY_OUT msgresponse */
  3092. #define MC_CMD_MEMCPY_OUT_LEN 0
  3093. /***********************************/
  3094. /* MC_CMD_WOL_FILTER_SET
  3095. * Set a WoL filter.
  3096. */
  3097. #define MC_CMD_WOL_FILTER_SET 0x32
  3098. #define MC_CMD_0x32_PRIVILEGE_CTG SRIOV_CTG_LINK
  3099. /* MC_CMD_WOL_FILTER_SET_IN msgrequest */
  3100. #define MC_CMD_WOL_FILTER_SET_IN_LEN 192
  3101. #define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0
  3102. #define MC_CMD_FILTER_MODE_SIMPLE 0x0 /* enum */
  3103. #define MC_CMD_FILTER_MODE_STRUCTURED 0xffffffff /* enum */
  3104. /* A type value of 1 is unused. */
  3105. #define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4
  3106. /* enum: Magic */
  3107. #define MC_CMD_WOL_TYPE_MAGIC 0x0
  3108. /* enum: MS Windows Magic */
  3109. #define MC_CMD_WOL_TYPE_WIN_MAGIC 0x2
  3110. /* enum: IPv4 Syn */
  3111. #define MC_CMD_WOL_TYPE_IPV4_SYN 0x3
  3112. /* enum: IPv6 Syn */
  3113. #define MC_CMD_WOL_TYPE_IPV6_SYN 0x4
  3114. /* enum: Bitmap */
  3115. #define MC_CMD_WOL_TYPE_BITMAP 0x5
  3116. /* enum: Link */
  3117. #define MC_CMD_WOL_TYPE_LINK 0x6
  3118. /* enum: (Above this for future use) */
  3119. #define MC_CMD_WOL_TYPE_MAX 0x7
  3120. #define MC_CMD_WOL_FILTER_SET_IN_DATA_OFST 8
  3121. #define MC_CMD_WOL_FILTER_SET_IN_DATA_LEN 4
  3122. #define MC_CMD_WOL_FILTER_SET_IN_DATA_NUM 46
  3123. /* MC_CMD_WOL_FILTER_SET_IN_MAGIC msgrequest */
  3124. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_LEN 16
  3125. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  3126. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  3127. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_OFST 8
  3128. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_LEN 8
  3129. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_LO_OFST 8
  3130. #define MC_CMD_WOL_FILTER_SET_IN_MAGIC_MAC_HI_OFST 12
  3131. /* MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN msgrequest */
  3132. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_LEN 20
  3133. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  3134. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  3135. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_IP_OFST 8
  3136. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_IP_OFST 12
  3137. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_PORT_OFST 16
  3138. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_SRC_PORT_LEN 2
  3139. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_PORT_OFST 18
  3140. #define MC_CMD_WOL_FILTER_SET_IN_IPV4_SYN_DST_PORT_LEN 2
  3141. /* MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN msgrequest */
  3142. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_LEN 44
  3143. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  3144. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  3145. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_IP_OFST 8
  3146. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_IP_LEN 16
  3147. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_IP_OFST 24
  3148. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_IP_LEN 16
  3149. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_PORT_OFST 40
  3150. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_SRC_PORT_LEN 2
  3151. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_PORT_OFST 42
  3152. #define MC_CMD_WOL_FILTER_SET_IN_IPV6_SYN_DST_PORT_LEN 2
  3153. /* MC_CMD_WOL_FILTER_SET_IN_BITMAP msgrequest */
  3154. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN 187
  3155. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  3156. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  3157. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_MASK_OFST 8
  3158. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_MASK_LEN 48
  3159. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_BITMAP_OFST 56
  3160. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_BITMAP_LEN 128
  3161. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN_OFST 184
  3162. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LEN_LEN 1
  3163. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER3_OFST 185
  3164. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER3_LEN 1
  3165. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER4_OFST 186
  3166. #define MC_CMD_WOL_FILTER_SET_IN_BITMAP_LAYER4_LEN 1
  3167. /* MC_CMD_WOL_FILTER_SET_IN_LINK msgrequest */
  3168. #define MC_CMD_WOL_FILTER_SET_IN_LINK_LEN 12
  3169. /* MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0 */
  3170. /* MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4 */
  3171. #define MC_CMD_WOL_FILTER_SET_IN_LINK_MASK_OFST 8
  3172. #define MC_CMD_WOL_FILTER_SET_IN_LINK_UP_LBN 0
  3173. #define MC_CMD_WOL_FILTER_SET_IN_LINK_UP_WIDTH 1
  3174. #define MC_CMD_WOL_FILTER_SET_IN_LINK_DOWN_LBN 1
  3175. #define MC_CMD_WOL_FILTER_SET_IN_LINK_DOWN_WIDTH 1
  3176. /* MC_CMD_WOL_FILTER_SET_OUT msgresponse */
  3177. #define MC_CMD_WOL_FILTER_SET_OUT_LEN 4
  3178. #define MC_CMD_WOL_FILTER_SET_OUT_FILTER_ID_OFST 0
  3179. /***********************************/
  3180. /* MC_CMD_WOL_FILTER_REMOVE
  3181. * Remove a WoL filter. Locks required: None. Returns: 0, EINVAL, ENOSYS
  3182. */
  3183. #define MC_CMD_WOL_FILTER_REMOVE 0x33
  3184. #define MC_CMD_0x33_PRIVILEGE_CTG SRIOV_CTG_LINK
  3185. /* MC_CMD_WOL_FILTER_REMOVE_IN msgrequest */
  3186. #define MC_CMD_WOL_FILTER_REMOVE_IN_LEN 4
  3187. #define MC_CMD_WOL_FILTER_REMOVE_IN_FILTER_ID_OFST 0
  3188. /* MC_CMD_WOL_FILTER_REMOVE_OUT msgresponse */
  3189. #define MC_CMD_WOL_FILTER_REMOVE_OUT_LEN 0
  3190. /***********************************/
  3191. /* MC_CMD_WOL_FILTER_RESET
  3192. * Reset (i.e. remove all) WoL filters. Locks required: None. Returns: 0,
  3193. * ENOSYS
  3194. */
  3195. #define MC_CMD_WOL_FILTER_RESET 0x34
  3196. #define MC_CMD_0x34_PRIVILEGE_CTG SRIOV_CTG_LINK
  3197. /* MC_CMD_WOL_FILTER_RESET_IN msgrequest */
  3198. #define MC_CMD_WOL_FILTER_RESET_IN_LEN 4
  3199. #define MC_CMD_WOL_FILTER_RESET_IN_MASK_OFST 0
  3200. #define MC_CMD_WOL_FILTER_RESET_IN_WAKE_FILTERS 0x1 /* enum */
  3201. #define MC_CMD_WOL_FILTER_RESET_IN_LIGHTSOUT_OFFLOADS 0x2 /* enum */
  3202. /* MC_CMD_WOL_FILTER_RESET_OUT msgresponse */
  3203. #define MC_CMD_WOL_FILTER_RESET_OUT_LEN 0
  3204. /***********************************/
  3205. /* MC_CMD_SET_MCAST_HASH
  3206. * Set the MCAST hash value without otherwise reconfiguring the MAC
  3207. */
  3208. #define MC_CMD_SET_MCAST_HASH 0x35
  3209. /* MC_CMD_SET_MCAST_HASH_IN msgrequest */
  3210. #define MC_CMD_SET_MCAST_HASH_IN_LEN 32
  3211. #define MC_CMD_SET_MCAST_HASH_IN_HASH0_OFST 0
  3212. #define MC_CMD_SET_MCAST_HASH_IN_HASH0_LEN 16
  3213. #define MC_CMD_SET_MCAST_HASH_IN_HASH1_OFST 16
  3214. #define MC_CMD_SET_MCAST_HASH_IN_HASH1_LEN 16
  3215. /* MC_CMD_SET_MCAST_HASH_OUT msgresponse */
  3216. #define MC_CMD_SET_MCAST_HASH_OUT_LEN 0
  3217. /***********************************/
  3218. /* MC_CMD_NVRAM_TYPES
  3219. * Return bitfield indicating available types of virtual NVRAM partitions.
  3220. * Locks required: none. Returns: 0
  3221. */
  3222. #define MC_CMD_NVRAM_TYPES 0x36
  3223. #define MC_CMD_0x36_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3224. /* MC_CMD_NVRAM_TYPES_IN msgrequest */
  3225. #define MC_CMD_NVRAM_TYPES_IN_LEN 0
  3226. /* MC_CMD_NVRAM_TYPES_OUT msgresponse */
  3227. #define MC_CMD_NVRAM_TYPES_OUT_LEN 4
  3228. /* Bit mask of supported types. */
  3229. #define MC_CMD_NVRAM_TYPES_OUT_TYPES_OFST 0
  3230. /* enum: Disabled callisto. */
  3231. #define MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO 0x0
  3232. /* enum: MC firmware. */
  3233. #define MC_CMD_NVRAM_TYPE_MC_FW 0x1
  3234. /* enum: MC backup firmware. */
  3235. #define MC_CMD_NVRAM_TYPE_MC_FW_BACKUP 0x2
  3236. /* enum: Static configuration Port0. */
  3237. #define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0 0x3
  3238. /* enum: Static configuration Port1. */
  3239. #define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1 0x4
  3240. /* enum: Dynamic configuration Port0. */
  3241. #define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 0x5
  3242. /* enum: Dynamic configuration Port1. */
  3243. #define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1 0x6
  3244. /* enum: Expansion Rom. */
  3245. #define MC_CMD_NVRAM_TYPE_EXP_ROM 0x7
  3246. /* enum: Expansion Rom Configuration Port0. */
  3247. #define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT0 0x8
  3248. /* enum: Expansion Rom Configuration Port1. */
  3249. #define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1 0x9
  3250. /* enum: Phy Configuration Port0. */
  3251. #define MC_CMD_NVRAM_TYPE_PHY_PORT0 0xa
  3252. /* enum: Phy Configuration Port1. */
  3253. #define MC_CMD_NVRAM_TYPE_PHY_PORT1 0xb
  3254. /* enum: Log. */
  3255. #define MC_CMD_NVRAM_TYPE_LOG 0xc
  3256. /* enum: FPGA image. */
  3257. #define MC_CMD_NVRAM_TYPE_FPGA 0xd
  3258. /* enum: FPGA backup image */
  3259. #define MC_CMD_NVRAM_TYPE_FPGA_BACKUP 0xe
  3260. /* enum: FC firmware. */
  3261. #define MC_CMD_NVRAM_TYPE_FC_FW 0xf
  3262. /* enum: FC backup firmware. */
  3263. #define MC_CMD_NVRAM_TYPE_FC_FW_BACKUP 0x10
  3264. /* enum: CPLD image. */
  3265. #define MC_CMD_NVRAM_TYPE_CPLD 0x11
  3266. /* enum: Licensing information. */
  3267. #define MC_CMD_NVRAM_TYPE_LICENSE 0x12
  3268. /* enum: FC Log. */
  3269. #define MC_CMD_NVRAM_TYPE_FC_LOG 0x13
  3270. /* enum: Additional flash on FPGA. */
  3271. #define MC_CMD_NVRAM_TYPE_FC_EXTRA 0x14
  3272. /***********************************/
  3273. /* MC_CMD_NVRAM_INFO
  3274. * Read info about a virtual NVRAM partition. Locks required: none. Returns: 0,
  3275. * EINVAL (bad type).
  3276. */
  3277. #define MC_CMD_NVRAM_INFO 0x37
  3278. #define MC_CMD_0x37_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3279. /* MC_CMD_NVRAM_INFO_IN msgrequest */
  3280. #define MC_CMD_NVRAM_INFO_IN_LEN 4
  3281. #define MC_CMD_NVRAM_INFO_IN_TYPE_OFST 0
  3282. /* Enum values, see field(s): */
  3283. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3284. /* MC_CMD_NVRAM_INFO_OUT msgresponse */
  3285. #define MC_CMD_NVRAM_INFO_OUT_LEN 24
  3286. #define MC_CMD_NVRAM_INFO_OUT_TYPE_OFST 0
  3287. /* Enum values, see field(s): */
  3288. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3289. #define MC_CMD_NVRAM_INFO_OUT_SIZE_OFST 4
  3290. #define MC_CMD_NVRAM_INFO_OUT_ERASESIZE_OFST 8
  3291. #define MC_CMD_NVRAM_INFO_OUT_FLAGS_OFST 12
  3292. #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_LBN 0
  3293. #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1
  3294. #define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1
  3295. #define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1
  3296. #define MC_CMD_NVRAM_INFO_OUT_CMAC_LBN 6
  3297. #define MC_CMD_NVRAM_INFO_OUT_CMAC_WIDTH 1
  3298. #define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7
  3299. #define MC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1
  3300. #define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16
  3301. #define MC_CMD_NVRAM_INFO_OUT_PHYSADDR_OFST 20
  3302. /* MC_CMD_NVRAM_INFO_V2_OUT msgresponse */
  3303. #define MC_CMD_NVRAM_INFO_V2_OUT_LEN 28
  3304. #define MC_CMD_NVRAM_INFO_V2_OUT_TYPE_OFST 0
  3305. /* Enum values, see field(s): */
  3306. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3307. #define MC_CMD_NVRAM_INFO_V2_OUT_SIZE_OFST 4
  3308. #define MC_CMD_NVRAM_INFO_V2_OUT_ERASESIZE_OFST 8
  3309. #define MC_CMD_NVRAM_INFO_V2_OUT_FLAGS_OFST 12
  3310. #define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_LBN 0
  3311. #define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_WIDTH 1
  3312. #define MC_CMD_NVRAM_INFO_V2_OUT_TLV_LBN 1
  3313. #define MC_CMD_NVRAM_INFO_V2_OUT_TLV_WIDTH 1
  3314. #define MC_CMD_NVRAM_INFO_V2_OUT_A_B_LBN 7
  3315. #define MC_CMD_NVRAM_INFO_V2_OUT_A_B_WIDTH 1
  3316. #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSDEV_OFST 16
  3317. #define MC_CMD_NVRAM_INFO_V2_OUT_PHYSADDR_OFST 20
  3318. /* Writes must be multiples of this size. Added to support the MUM on Sorrento.
  3319. */
  3320. #define MC_CMD_NVRAM_INFO_V2_OUT_WRITESIZE_OFST 24
  3321. /***********************************/
  3322. /* MC_CMD_NVRAM_UPDATE_START
  3323. * Start a group of update operations on a virtual NVRAM partition. Locks
  3324. * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad type), EACCES (if
  3325. * PHY_LOCK required and not held).
  3326. */
  3327. #define MC_CMD_NVRAM_UPDATE_START 0x38
  3328. #define MC_CMD_0x38_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3329. /* MC_CMD_NVRAM_UPDATE_START_IN msgrequest: Legacy NVRAM_UPDATE_START request.
  3330. * Use NVRAM_UPDATE_START_V2_IN in new code
  3331. */
  3332. #define MC_CMD_NVRAM_UPDATE_START_IN_LEN 4
  3333. #define MC_CMD_NVRAM_UPDATE_START_IN_TYPE_OFST 0
  3334. /* Enum values, see field(s): */
  3335. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3336. /* MC_CMD_NVRAM_UPDATE_START_V2_IN msgrequest: Extended NVRAM_UPDATE_START
  3337. * request with additional flags indicating version of command in use. See
  3338. * MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT for details of extended functionality. Use
  3339. * paired up with NVRAM_UPDATE_FINISH_V2_IN.
  3340. */
  3341. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_LEN 8
  3342. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_TYPE_OFST 0
  3343. /* Enum values, see field(s): */
  3344. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3345. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAGS_OFST 4
  3346. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT_LBN 0
  3347. #define MC_CMD_NVRAM_UPDATE_START_V2_IN_FLAG_REPORT_VERIFY_RESULT_WIDTH 1
  3348. /* MC_CMD_NVRAM_UPDATE_START_OUT msgresponse */
  3349. #define MC_CMD_NVRAM_UPDATE_START_OUT_LEN 0
  3350. /***********************************/
  3351. /* MC_CMD_NVRAM_READ
  3352. * Read data from a virtual NVRAM partition. Locks required: PHY_LOCK if
  3353. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  3354. * PHY_LOCK required and not held)
  3355. */
  3356. #define MC_CMD_NVRAM_READ 0x39
  3357. #define MC_CMD_0x39_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3358. /* MC_CMD_NVRAM_READ_IN msgrequest */
  3359. #define MC_CMD_NVRAM_READ_IN_LEN 12
  3360. #define MC_CMD_NVRAM_READ_IN_TYPE_OFST 0
  3361. /* Enum values, see field(s): */
  3362. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3363. #define MC_CMD_NVRAM_READ_IN_OFFSET_OFST 4
  3364. /* amount to read in bytes */
  3365. #define MC_CMD_NVRAM_READ_IN_LENGTH_OFST 8
  3366. /* MC_CMD_NVRAM_READ_IN_V2 msgrequest */
  3367. #define MC_CMD_NVRAM_READ_IN_V2_LEN 16
  3368. #define MC_CMD_NVRAM_READ_IN_V2_TYPE_OFST 0
  3369. /* Enum values, see field(s): */
  3370. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3371. #define MC_CMD_NVRAM_READ_IN_V2_OFFSET_OFST 4
  3372. /* amount to read in bytes */
  3373. #define MC_CMD_NVRAM_READ_IN_V2_LENGTH_OFST 8
  3374. /* Optional control info. If a partition is stored with an A/B versioning
  3375. * scheme (i.e. in more than one physical partition in NVRAM) the host can set
  3376. * this to control which underlying physical partition is used to read data
  3377. * from. This allows it to perform a read-modify-write-verify with the write
  3378. * lock continuously held by calling NVRAM_UPDATE_START, reading the old
  3379. * contents using MODE=TARGET_CURRENT, overwriting the old partition and then
  3380. * verifying by reading with MODE=TARGET_BACKUP.
  3381. */
  3382. #define MC_CMD_NVRAM_READ_IN_V2_MODE_OFST 12
  3383. /* enum: Same as omitting MODE: caller sees data in current partition unless it
  3384. * holds the write lock in which case it sees data in the partition it is
  3385. * updating.
  3386. */
  3387. #define MC_CMD_NVRAM_READ_IN_V2_DEFAULT 0x0
  3388. /* enum: Read from the current partition of an A/B pair, even if holding the
  3389. * write lock.
  3390. */
  3391. #define MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT 0x1
  3392. /* enum: Read from the non-current (i.e. to be updated) partition of an A/B
  3393. * pair
  3394. */
  3395. #define MC_CMD_NVRAM_READ_IN_V2_TARGET_BACKUP 0x2
  3396. /* MC_CMD_NVRAM_READ_OUT msgresponse */
  3397. #define MC_CMD_NVRAM_READ_OUT_LENMIN 1
  3398. #define MC_CMD_NVRAM_READ_OUT_LENMAX 252
  3399. #define MC_CMD_NVRAM_READ_OUT_LEN(num) (0+1*(num))
  3400. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_OFST 0
  3401. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_LEN 1
  3402. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_MINNUM 1
  3403. #define MC_CMD_NVRAM_READ_OUT_READ_BUFFER_MAXNUM 252
  3404. /***********************************/
  3405. /* MC_CMD_NVRAM_WRITE
  3406. * Write data to a virtual NVRAM partition. Locks required: PHY_LOCK if
  3407. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  3408. * PHY_LOCK required and not held)
  3409. */
  3410. #define MC_CMD_NVRAM_WRITE 0x3a
  3411. #define MC_CMD_0x3a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3412. /* MC_CMD_NVRAM_WRITE_IN msgrequest */
  3413. #define MC_CMD_NVRAM_WRITE_IN_LENMIN 13
  3414. #define MC_CMD_NVRAM_WRITE_IN_LENMAX 252
  3415. #define MC_CMD_NVRAM_WRITE_IN_LEN(num) (12+1*(num))
  3416. #define MC_CMD_NVRAM_WRITE_IN_TYPE_OFST 0
  3417. /* Enum values, see field(s): */
  3418. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3419. #define MC_CMD_NVRAM_WRITE_IN_OFFSET_OFST 4
  3420. #define MC_CMD_NVRAM_WRITE_IN_LENGTH_OFST 8
  3421. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_OFST 12
  3422. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_LEN 1
  3423. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_MINNUM 1
  3424. #define MC_CMD_NVRAM_WRITE_IN_WRITE_BUFFER_MAXNUM 240
  3425. /* MC_CMD_NVRAM_WRITE_OUT msgresponse */
  3426. #define MC_CMD_NVRAM_WRITE_OUT_LEN 0
  3427. /***********************************/
  3428. /* MC_CMD_NVRAM_ERASE
  3429. * Erase sector(s) from a virtual NVRAM partition. Locks required: PHY_LOCK if
  3430. * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
  3431. * PHY_LOCK required and not held)
  3432. */
  3433. #define MC_CMD_NVRAM_ERASE 0x3b
  3434. #define MC_CMD_0x3b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3435. /* MC_CMD_NVRAM_ERASE_IN msgrequest */
  3436. #define MC_CMD_NVRAM_ERASE_IN_LEN 12
  3437. #define MC_CMD_NVRAM_ERASE_IN_TYPE_OFST 0
  3438. /* Enum values, see field(s): */
  3439. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3440. #define MC_CMD_NVRAM_ERASE_IN_OFFSET_OFST 4
  3441. #define MC_CMD_NVRAM_ERASE_IN_LENGTH_OFST 8
  3442. /* MC_CMD_NVRAM_ERASE_OUT msgresponse */
  3443. #define MC_CMD_NVRAM_ERASE_OUT_LEN 0
  3444. /***********************************/
  3445. /* MC_CMD_NVRAM_UPDATE_FINISH
  3446. * Finish a group of update operations on a virtual NVRAM partition. Locks
  3447. * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad
  3448. * type/offset/length), EACCES (if PHY_LOCK required and not held)
  3449. */
  3450. #define MC_CMD_NVRAM_UPDATE_FINISH 0x3c
  3451. #define MC_CMD_0x3c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3452. /* MC_CMD_NVRAM_UPDATE_FINISH_IN msgrequest: Legacy NVRAM_UPDATE_FINISH
  3453. * request. Use NVRAM_UPDATE_FINISH_V2_IN in new code
  3454. */
  3455. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN 8
  3456. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_TYPE_OFST 0
  3457. /* Enum values, see field(s): */
  3458. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3459. #define MC_CMD_NVRAM_UPDATE_FINISH_IN_REBOOT_OFST 4
  3460. /* MC_CMD_NVRAM_UPDATE_FINISH_V2_IN msgrequest: Extended NVRAM_UPDATE_FINISH
  3461. * request with additional flags indicating version of NVRAM_UPDATE commands in
  3462. * use. See MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT for details of extended
  3463. * functionality. Use paired up with NVRAM_UPDATE_START_V2_IN.
  3464. */
  3465. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN 12
  3466. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_TYPE_OFST 0
  3467. /* Enum values, see field(s): */
  3468. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  3469. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_REBOOT_OFST 4
  3470. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAGS_OFST 8
  3471. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT_LBN 0
  3472. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_FLAG_REPORT_VERIFY_RESULT_WIDTH 1
  3473. /* MC_CMD_NVRAM_UPDATE_FINISH_OUT msgresponse: Legacy NVRAM_UPDATE_FINISH
  3474. * response. Use NVRAM_UPDATE_FINISH_V2_OUT in new code
  3475. */
  3476. #define MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN 0
  3477. /* MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT msgresponse:
  3478. *
  3479. * Extended NVRAM_UPDATE_FINISH response that communicates the result of secure
  3480. * firmware validation where applicable back to the host.
  3481. *
  3482. * Medford only: For signed firmware images, such as those for medford, the MC
  3483. * firmware verifies the signature before marking the firmware image as valid.
  3484. * This process takes a few seconds to complete. So is likely to take more than
  3485. * the MCDI timeout. Hence signature verification is initiated when
  3486. * MC_CMD_NVRAM_UPDATE_FINISH_V2_IN is received by the firmware, however, the
  3487. * MCDI command returns immediately with error code EAGAIN. Subsequent
  3488. * NVRAM_UPDATE_FINISH_V2_IN requests also return EAGAIN if the verification is
  3489. * in progress. Once the verification has completed, this response payload
  3490. * includes the results of the signature verification. Note that the nvram lock
  3491. * in firmware is only released after the verification has completed and the
  3492. * host has read back the result code from firmware.
  3493. */
  3494. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN 4
  3495. /* Result of nvram update completion processing */
  3496. #define MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE_OFST 0
  3497. /* enum: Verify succeeded without any errors. */
  3498. #define MC_CMD_NVRAM_VERIFY_RC_SUCCESS 0x1
  3499. /* enum: CMS format verification failed due to an internal error. */
  3500. #define MC_CMD_NVRAM_VERIFY_RC_CMS_CHECK_FAILED 0x2
  3501. /* enum: Invalid CMS format in image metadata. */
  3502. #define MC_CMD_NVRAM_VERIFY_RC_INVALID_CMS_FORMAT 0x3
  3503. /* enum: Message digest verification failed due to an internal error. */
  3504. #define MC_CMD_NVRAM_VERIFY_RC_MESSAGE_DIGEST_CHECK_FAILED 0x4
  3505. /* enum: Error in message digest calculated over the reflash-header, payload
  3506. * and reflash-trailer.
  3507. */
  3508. #define MC_CMD_NVRAM_VERIFY_RC_BAD_MESSAGE_DIGEST 0x5
  3509. /* enum: Signature verification failed due to an internal error. */
  3510. #define MC_CMD_NVRAM_VERIFY_RC_SIGNATURE_CHECK_FAILED 0x6
  3511. /* enum: There are no valid signatures in the image. */
  3512. #define MC_CMD_NVRAM_VERIFY_RC_NO_VALID_SIGNATURES 0x7
  3513. /* enum: Trusted approvers verification failed due to an internal error. */
  3514. #define MC_CMD_NVRAM_VERIFY_RC_TRUSTED_APPROVERS_CHECK_FAILED 0x8
  3515. /* enum: The Trusted approver's list is empty. */
  3516. #define MC_CMD_NVRAM_VERIFY_RC_NO_TRUSTED_APPROVERS 0x9
  3517. /* enum: Signature chain verification failed due to an internal error. */
  3518. #define MC_CMD_NVRAM_VERIFY_RC_SIGNATURE_CHAIN_CHECK_FAILED 0xa
  3519. /* enum: The signers of the signatures in the image are not listed in the
  3520. * Trusted approver's list.
  3521. */
  3522. #define MC_CMD_NVRAM_VERIFY_RC_NO_SIGNATURE_MATCH 0xb
  3523. /***********************************/
  3524. /* MC_CMD_REBOOT
  3525. * Reboot the MC.
  3526. *
  3527. * The AFTER_ASSERTION flag is intended to be used when the driver notices an
  3528. * assertion failure (at which point it is expected to perform a complete tear
  3529. * down and reinitialise), to allow both ports to reset the MC once in an
  3530. * atomic fashion.
  3531. *
  3532. * Production mc firmwares are generally compiled with REBOOT_ON_ASSERT=1,
  3533. * which means that they will automatically reboot out of the assertion
  3534. * handler, so this is in practise an optional operation. It is still
  3535. * recommended that drivers execute this to support custom firmwares with
  3536. * REBOOT_ON_ASSERT=0.
  3537. *
  3538. * Locks required: NONE Returns: Nothing. You get back a response with ERR=1,
  3539. * DATALEN=0
  3540. */
  3541. #define MC_CMD_REBOOT 0x3d
  3542. #define MC_CMD_0x3d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3543. /* MC_CMD_REBOOT_IN msgrequest */
  3544. #define MC_CMD_REBOOT_IN_LEN 4
  3545. #define MC_CMD_REBOOT_IN_FLAGS_OFST 0
  3546. #define MC_CMD_REBOOT_FLAGS_AFTER_ASSERTION 0x1 /* enum */
  3547. /* MC_CMD_REBOOT_OUT msgresponse */
  3548. #define MC_CMD_REBOOT_OUT_LEN 0
  3549. /***********************************/
  3550. /* MC_CMD_SCHEDINFO
  3551. * Request scheduler info. Locks required: NONE. Returns: An array of
  3552. * (timeslice,maximum overrun), one for each thread, in ascending order of
  3553. * thread address.
  3554. */
  3555. #define MC_CMD_SCHEDINFO 0x3e
  3556. #define MC_CMD_0x3e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3557. /* MC_CMD_SCHEDINFO_IN msgrequest */
  3558. #define MC_CMD_SCHEDINFO_IN_LEN 0
  3559. /* MC_CMD_SCHEDINFO_OUT msgresponse */
  3560. #define MC_CMD_SCHEDINFO_OUT_LENMIN 4
  3561. #define MC_CMD_SCHEDINFO_OUT_LENMAX 252
  3562. #define MC_CMD_SCHEDINFO_OUT_LEN(num) (0+4*(num))
  3563. #define MC_CMD_SCHEDINFO_OUT_DATA_OFST 0
  3564. #define MC_CMD_SCHEDINFO_OUT_DATA_LEN 4
  3565. #define MC_CMD_SCHEDINFO_OUT_DATA_MINNUM 1
  3566. #define MC_CMD_SCHEDINFO_OUT_DATA_MAXNUM 63
  3567. /***********************************/
  3568. /* MC_CMD_REBOOT_MODE
  3569. * Set the mode for the next MC reboot. Locks required: NONE. Sets the reboot
  3570. * mode to the specified value. Returns the old mode.
  3571. */
  3572. #define MC_CMD_REBOOT_MODE 0x3f
  3573. #define MC_CMD_0x3f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3574. /* MC_CMD_REBOOT_MODE_IN msgrequest */
  3575. #define MC_CMD_REBOOT_MODE_IN_LEN 4
  3576. #define MC_CMD_REBOOT_MODE_IN_VALUE_OFST 0
  3577. /* enum: Normal. */
  3578. #define MC_CMD_REBOOT_MODE_NORMAL 0x0
  3579. /* enum: Power-on Reset. */
  3580. #define MC_CMD_REBOOT_MODE_POR 0x2
  3581. /* enum: Snapper. */
  3582. #define MC_CMD_REBOOT_MODE_SNAPPER 0x3
  3583. /* enum: snapper fake POR */
  3584. #define MC_CMD_REBOOT_MODE_SNAPPER_POR 0x4
  3585. #define MC_CMD_REBOOT_MODE_IN_FAKE_LBN 7
  3586. #define MC_CMD_REBOOT_MODE_IN_FAKE_WIDTH 1
  3587. /* MC_CMD_REBOOT_MODE_OUT msgresponse */
  3588. #define MC_CMD_REBOOT_MODE_OUT_LEN 4
  3589. #define MC_CMD_REBOOT_MODE_OUT_VALUE_OFST 0
  3590. /***********************************/
  3591. /* MC_CMD_SENSOR_INFO
  3592. * Returns information about every available sensor.
  3593. *
  3594. * Each sensor has a single (16bit) value, and a corresponding state. The
  3595. * mapping between value and state is nominally determined by the MC, but may
  3596. * be implemented using up to 2 ranges per sensor.
  3597. *
  3598. * This call returns a mask (32bit) of the sensors that are supported by this
  3599. * platform, then an array of sensor information structures, in order of sensor
  3600. * type (but without gaps for unimplemented sensors). Each structure defines
  3601. * the ranges for the corresponding sensor. An unused range is indicated by
  3602. * equal limit values. If one range is used, a value outside that range results
  3603. * in STATE_FATAL. If two ranges are used, a value outside the second range
  3604. * results in STATE_FATAL while a value outside the first and inside the second
  3605. * range results in STATE_WARNING.
  3606. *
  3607. * Sensor masks and sensor information arrays are organised into pages. For
  3608. * backward compatibility, older host software can only use sensors in page 0.
  3609. * Bit 32 in the sensor mask was previously unused, and is no reserved for use
  3610. * as the next page flag.
  3611. *
  3612. * If the request does not contain a PAGE value then firmware will only return
  3613. * page 0 of sensor information, with bit 31 in the sensor mask cleared.
  3614. *
  3615. * If the request contains a PAGE value then firmware responds with the sensor
  3616. * mask and sensor information array for that page of sensors. In this case bit
  3617. * 31 in the mask is set if another page exists.
  3618. *
  3619. * Locks required: None Returns: 0
  3620. */
  3621. #define MC_CMD_SENSOR_INFO 0x41
  3622. #define MC_CMD_0x41_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3623. /* MC_CMD_SENSOR_INFO_IN msgrequest */
  3624. #define MC_CMD_SENSOR_INFO_IN_LEN 0
  3625. /* MC_CMD_SENSOR_INFO_EXT_IN msgrequest */
  3626. #define MC_CMD_SENSOR_INFO_EXT_IN_LEN 4
  3627. /* Which page of sensors to report.
  3628. *
  3629. * Page 0 contains sensors 0 to 30 (sensor 31 is the next page bit).
  3630. *
  3631. * Page 1 contains sensors 32 to 62 (sensor 63 is the next page bit). etc.
  3632. */
  3633. #define MC_CMD_SENSOR_INFO_EXT_IN_PAGE_OFST 0
  3634. /* MC_CMD_SENSOR_INFO_OUT msgresponse */
  3635. #define MC_CMD_SENSOR_INFO_OUT_LENMIN 4
  3636. #define MC_CMD_SENSOR_INFO_OUT_LENMAX 252
  3637. #define MC_CMD_SENSOR_INFO_OUT_LEN(num) (4+8*(num))
  3638. #define MC_CMD_SENSOR_INFO_OUT_MASK_OFST 0
  3639. /* enum: Controller temperature: degC */
  3640. #define MC_CMD_SENSOR_CONTROLLER_TEMP 0x0
  3641. /* enum: Phy common temperature: degC */
  3642. #define MC_CMD_SENSOR_PHY_COMMON_TEMP 0x1
  3643. /* enum: Controller cooling: bool */
  3644. #define MC_CMD_SENSOR_CONTROLLER_COOLING 0x2
  3645. /* enum: Phy 0 temperature: degC */
  3646. #define MC_CMD_SENSOR_PHY0_TEMP 0x3
  3647. /* enum: Phy 0 cooling: bool */
  3648. #define MC_CMD_SENSOR_PHY0_COOLING 0x4
  3649. /* enum: Phy 1 temperature: degC */
  3650. #define MC_CMD_SENSOR_PHY1_TEMP 0x5
  3651. /* enum: Phy 1 cooling: bool */
  3652. #define MC_CMD_SENSOR_PHY1_COOLING 0x6
  3653. /* enum: 1.0v power: mV */
  3654. #define MC_CMD_SENSOR_IN_1V0 0x7
  3655. /* enum: 1.2v power: mV */
  3656. #define MC_CMD_SENSOR_IN_1V2 0x8
  3657. /* enum: 1.8v power: mV */
  3658. #define MC_CMD_SENSOR_IN_1V8 0x9
  3659. /* enum: 2.5v power: mV */
  3660. #define MC_CMD_SENSOR_IN_2V5 0xa
  3661. /* enum: 3.3v power: mV */
  3662. #define MC_CMD_SENSOR_IN_3V3 0xb
  3663. /* enum: 12v power: mV */
  3664. #define MC_CMD_SENSOR_IN_12V0 0xc
  3665. /* enum: 1.2v analogue power: mV */
  3666. #define MC_CMD_SENSOR_IN_1V2A 0xd
  3667. /* enum: reference voltage: mV */
  3668. #define MC_CMD_SENSOR_IN_VREF 0xe
  3669. /* enum: AOE FPGA power: mV */
  3670. #define MC_CMD_SENSOR_OUT_VAOE 0xf
  3671. /* enum: AOE FPGA temperature: degC */
  3672. #define MC_CMD_SENSOR_AOE_TEMP 0x10
  3673. /* enum: AOE FPGA PSU temperature: degC */
  3674. #define MC_CMD_SENSOR_PSU_AOE_TEMP 0x11
  3675. /* enum: AOE PSU temperature: degC */
  3676. #define MC_CMD_SENSOR_PSU_TEMP 0x12
  3677. /* enum: Fan 0 speed: RPM */
  3678. #define MC_CMD_SENSOR_FAN_0 0x13
  3679. /* enum: Fan 1 speed: RPM */
  3680. #define MC_CMD_SENSOR_FAN_1 0x14
  3681. /* enum: Fan 2 speed: RPM */
  3682. #define MC_CMD_SENSOR_FAN_2 0x15
  3683. /* enum: Fan 3 speed: RPM */
  3684. #define MC_CMD_SENSOR_FAN_3 0x16
  3685. /* enum: Fan 4 speed: RPM */
  3686. #define MC_CMD_SENSOR_FAN_4 0x17
  3687. /* enum: AOE FPGA input power: mV */
  3688. #define MC_CMD_SENSOR_IN_VAOE 0x18
  3689. /* enum: AOE FPGA current: mA */
  3690. #define MC_CMD_SENSOR_OUT_IAOE 0x19
  3691. /* enum: AOE FPGA input current: mA */
  3692. #define MC_CMD_SENSOR_IN_IAOE 0x1a
  3693. /* enum: NIC power consumption: W */
  3694. #define MC_CMD_SENSOR_NIC_POWER 0x1b
  3695. /* enum: 0.9v power voltage: mV */
  3696. #define MC_CMD_SENSOR_IN_0V9 0x1c
  3697. /* enum: 0.9v power current: mA */
  3698. #define MC_CMD_SENSOR_IN_I0V9 0x1d
  3699. /* enum: 1.2v power current: mA */
  3700. #define MC_CMD_SENSOR_IN_I1V2 0x1e
  3701. /* enum: Not a sensor: reserved for the next page flag */
  3702. #define MC_CMD_SENSOR_PAGE0_NEXT 0x1f
  3703. /* enum: 0.9v power voltage (at ADC): mV */
  3704. #define MC_CMD_SENSOR_IN_0V9_ADC 0x20
  3705. /* enum: Controller temperature 2: degC */
  3706. #define MC_CMD_SENSOR_CONTROLLER_2_TEMP 0x21
  3707. /* enum: Voltage regulator internal temperature: degC */
  3708. #define MC_CMD_SENSOR_VREG_INTERNAL_TEMP 0x22
  3709. /* enum: 0.9V voltage regulator temperature: degC */
  3710. #define MC_CMD_SENSOR_VREG_0V9_TEMP 0x23
  3711. /* enum: 1.2V voltage regulator temperature: degC */
  3712. #define MC_CMD_SENSOR_VREG_1V2_TEMP 0x24
  3713. /* enum: controller internal temperature sensor voltage (internal ADC): mV */
  3714. #define MC_CMD_SENSOR_CONTROLLER_VPTAT 0x25
  3715. /* enum: controller internal temperature (internal ADC): degC */
  3716. #define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP 0x26
  3717. /* enum: controller internal temperature sensor voltage (external ADC): mV */
  3718. #define MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC 0x27
  3719. /* enum: controller internal temperature (external ADC): degC */
  3720. #define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC 0x28
  3721. /* enum: ambient temperature: degC */
  3722. #define MC_CMD_SENSOR_AMBIENT_TEMP 0x29
  3723. /* enum: air flow: bool */
  3724. #define MC_CMD_SENSOR_AIRFLOW 0x2a
  3725. /* enum: voltage between VSS08D and VSS08D at CSR: mV */
  3726. #define MC_CMD_SENSOR_VDD08D_VSS08D_CSR 0x2b
  3727. /* enum: voltage between VSS08D and VSS08D at CSR (external ADC): mV */
  3728. #define MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC 0x2c
  3729. /* enum: Hotpoint temperature: degC */
  3730. #define MC_CMD_SENSOR_HOTPOINT_TEMP 0x2d
  3731. /* enum: Port 0 PHY power switch over-current: bool */
  3732. #define MC_CMD_SENSOR_PHY_POWER_PORT0 0x2e
  3733. /* enum: Port 1 PHY power switch over-current: bool */
  3734. #define MC_CMD_SENSOR_PHY_POWER_PORT1 0x2f
  3735. /* enum: Mop-up microcontroller reference voltage (millivolts) */
  3736. #define MC_CMD_SENSOR_MUM_VCC 0x30
  3737. /* enum: 0.9v power phase A voltage: mV */
  3738. #define MC_CMD_SENSOR_IN_0V9_A 0x31
  3739. /* enum: 0.9v power phase A current: mA */
  3740. #define MC_CMD_SENSOR_IN_I0V9_A 0x32
  3741. /* enum: 0.9V voltage regulator phase A temperature: degC */
  3742. #define MC_CMD_SENSOR_VREG_0V9_A_TEMP 0x33
  3743. /* enum: 0.9v power phase B voltage: mV */
  3744. #define MC_CMD_SENSOR_IN_0V9_B 0x34
  3745. /* enum: 0.9v power phase B current: mA */
  3746. #define MC_CMD_SENSOR_IN_I0V9_B 0x35
  3747. /* enum: 0.9V voltage regulator phase B temperature: degC */
  3748. #define MC_CMD_SENSOR_VREG_0V9_B_TEMP 0x36
  3749. /* enum: CCOM AVREG 1v2 supply (interval ADC): mV */
  3750. #define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY 0x37
  3751. /* enum: CCOM AVREG 1v2 supply (external ADC): mV */
  3752. #define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC 0x38
  3753. /* enum: CCOM AVREG 1v8 supply (interval ADC): mV */
  3754. #define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY 0x39
  3755. /* enum: CCOM AVREG 1v8 supply (external ADC): mV */
  3756. #define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC 0x3a
  3757. /* enum: CCOM RTS temperature: degC */
  3758. #define MC_CMD_SENSOR_CONTROLLER_RTS 0x3b
  3759. /* enum: Not a sensor: reserved for the next page flag */
  3760. #define MC_CMD_SENSOR_PAGE1_NEXT 0x3f
  3761. /* enum: controller internal temperature sensor voltage on master core
  3762. * (internal ADC): mV
  3763. */
  3764. #define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT 0x40
  3765. /* enum: controller internal temperature on master core (internal ADC): degC */
  3766. #define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP 0x41
  3767. /* enum: controller internal temperature sensor voltage on master core
  3768. * (external ADC): mV
  3769. */
  3770. #define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC 0x42
  3771. /* enum: controller internal temperature on master core (external ADC): degC */
  3772. #define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC 0x43
  3773. /* enum: controller internal temperature on slave core sensor voltage (internal
  3774. * ADC): mV
  3775. */
  3776. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT 0x44
  3777. /* enum: controller internal temperature on slave core (internal ADC): degC */
  3778. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP 0x45
  3779. /* enum: controller internal temperature on slave core sensor voltage (external
  3780. * ADC): mV
  3781. */
  3782. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC 0x46
  3783. /* enum: controller internal temperature on slave core (external ADC): degC */
  3784. #define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC 0x47
  3785. /* enum: Voltage supplied to the SODIMMs from their power supply: mV */
  3786. #define MC_CMD_SENSOR_SODIMM_VOUT 0x49
  3787. /* enum: Temperature of SODIMM 0 (if installed): degC */
  3788. #define MC_CMD_SENSOR_SODIMM_0_TEMP 0x4a
  3789. /* enum: Temperature of SODIMM 1 (if installed): degC */
  3790. #define MC_CMD_SENSOR_SODIMM_1_TEMP 0x4b
  3791. /* enum: Voltage supplied to the QSFP #0 from their power supply: mV */
  3792. #define MC_CMD_SENSOR_PHY0_VCC 0x4c
  3793. /* enum: Voltage supplied to the QSFP #1 from their power supply: mV */
  3794. #define MC_CMD_SENSOR_PHY1_VCC 0x4d
  3795. /* enum: Controller die temperature (TDIODE): degC */
  3796. #define MC_CMD_SENSOR_CONTROLLER_TDIODE_TEMP 0x4e
  3797. /* enum: Board temperature (front): degC */
  3798. #define MC_CMD_SENSOR_BOARD_FRONT_TEMP 0x4f
  3799. /* enum: Board temperature (back): degC */
  3800. #define MC_CMD_SENSOR_BOARD_BACK_TEMP 0x50
  3801. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
  3802. #define MC_CMD_SENSOR_ENTRY_OFST 4
  3803. #define MC_CMD_SENSOR_ENTRY_LEN 8
  3804. #define MC_CMD_SENSOR_ENTRY_LO_OFST 4
  3805. #define MC_CMD_SENSOR_ENTRY_HI_OFST 8
  3806. #define MC_CMD_SENSOR_ENTRY_MINNUM 0
  3807. #define MC_CMD_SENSOR_ENTRY_MAXNUM 31
  3808. /* MC_CMD_SENSOR_INFO_EXT_OUT msgresponse */
  3809. #define MC_CMD_SENSOR_INFO_EXT_OUT_LENMIN 4
  3810. #define MC_CMD_SENSOR_INFO_EXT_OUT_LENMAX 252
  3811. #define MC_CMD_SENSOR_INFO_EXT_OUT_LEN(num) (4+8*(num))
  3812. #define MC_CMD_SENSOR_INFO_EXT_OUT_MASK_OFST 0
  3813. /* Enum values, see field(s): */
  3814. /* MC_CMD_SENSOR_INFO_OUT */
  3815. #define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_LBN 31
  3816. #define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_WIDTH 1
  3817. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
  3818. /* MC_CMD_SENSOR_ENTRY_OFST 4 */
  3819. /* MC_CMD_SENSOR_ENTRY_LEN 8 */
  3820. /* MC_CMD_SENSOR_ENTRY_LO_OFST 4 */
  3821. /* MC_CMD_SENSOR_ENTRY_HI_OFST 8 */
  3822. /* MC_CMD_SENSOR_ENTRY_MINNUM 0 */
  3823. /* MC_CMD_SENSOR_ENTRY_MAXNUM 31 */
  3824. /* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF structuredef */
  3825. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_LEN 8
  3826. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_OFST 0
  3827. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_LEN 2
  3828. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_LBN 0
  3829. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_WIDTH 16
  3830. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_OFST 2
  3831. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_LEN 2
  3832. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_LBN 16
  3833. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1_WIDTH 16
  3834. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_OFST 4
  3835. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_LEN 2
  3836. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_LBN 32
  3837. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2_WIDTH 16
  3838. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_OFST 6
  3839. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_LEN 2
  3840. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_LBN 48
  3841. #define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2_WIDTH 16
  3842. /***********************************/
  3843. /* MC_CMD_READ_SENSORS
  3844. * Returns the current reading from each sensor. DMAs an array of sensor
  3845. * readings, in order of sensor type (but without gaps for unimplemented
  3846. * sensors), into host memory. Each array element is a
  3847. * MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF dword.
  3848. *
  3849. * If the request does not contain the LENGTH field then only sensors 0 to 30
  3850. * are reported, to avoid DMA buffer overflow in older host software. If the
  3851. * sensor reading require more space than the LENGTH allows, then return
  3852. * EINVAL.
  3853. *
  3854. * The MC will send a SENSOREVT event every time any sensor changes state. The
  3855. * driver is responsible for ensuring that it doesn't miss any events. The
  3856. * board will function normally if all sensors are in STATE_OK or
  3857. * STATE_WARNING. Otherwise the board should not be expected to function.
  3858. */
  3859. #define MC_CMD_READ_SENSORS 0x42
  3860. #define MC_CMD_0x42_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  3861. /* MC_CMD_READ_SENSORS_IN msgrequest */
  3862. #define MC_CMD_READ_SENSORS_IN_LEN 8
  3863. /* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */
  3864. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_OFST 0
  3865. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LEN 8
  3866. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LO_OFST 0
  3867. #define MC_CMD_READ_SENSORS_IN_DMA_ADDR_HI_OFST 4
  3868. /* MC_CMD_READ_SENSORS_EXT_IN msgrequest */
  3869. #define MC_CMD_READ_SENSORS_EXT_IN_LEN 12
  3870. /* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */
  3871. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_OFST 0
  3872. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LEN 8
  3873. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LO_OFST 0
  3874. #define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_HI_OFST 4
  3875. /* Size in bytes of host buffer. */
  3876. #define MC_CMD_READ_SENSORS_EXT_IN_LENGTH_OFST 8
  3877. /* MC_CMD_READ_SENSORS_OUT msgresponse */
  3878. #define MC_CMD_READ_SENSORS_OUT_LEN 0
  3879. /* MC_CMD_READ_SENSORS_EXT_OUT msgresponse */
  3880. #define MC_CMD_READ_SENSORS_EXT_OUT_LEN 0
  3881. /* MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF structuredef */
  3882. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_LEN 4
  3883. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_OFST 0
  3884. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LEN 2
  3885. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LBN 0
  3886. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_WIDTH 16
  3887. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_OFST 2
  3888. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LEN 1
  3889. /* enum: Ok. */
  3890. #define MC_CMD_SENSOR_STATE_OK 0x0
  3891. /* enum: Breached warning threshold. */
  3892. #define MC_CMD_SENSOR_STATE_WARNING 0x1
  3893. /* enum: Breached fatal threshold. */
  3894. #define MC_CMD_SENSOR_STATE_FATAL 0x2
  3895. /* enum: Fault with sensor. */
  3896. #define MC_CMD_SENSOR_STATE_BROKEN 0x3
  3897. /* enum: Sensor is working but does not currently have a reading. */
  3898. #define MC_CMD_SENSOR_STATE_NO_READING 0x4
  3899. /* enum: Sensor initialisation failed. */
  3900. #define MC_CMD_SENSOR_STATE_INIT_FAILED 0x5
  3901. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LBN 16
  3902. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_WIDTH 8
  3903. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_OFST 3
  3904. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LEN 1
  3905. /* Enum values, see field(s): */
  3906. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  3907. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LBN 24
  3908. #define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_WIDTH 8
  3909. /***********************************/
  3910. /* MC_CMD_GET_PHY_STATE
  3911. * Report current state of PHY. A 'zombie' PHY is a PHY that has failed to boot
  3912. * (e.g. due to missing or corrupted firmware). Locks required: None. Return
  3913. * code: 0
  3914. */
  3915. #define MC_CMD_GET_PHY_STATE 0x43
  3916. #define MC_CMD_0x43_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  3917. /* MC_CMD_GET_PHY_STATE_IN msgrequest */
  3918. #define MC_CMD_GET_PHY_STATE_IN_LEN 0
  3919. /* MC_CMD_GET_PHY_STATE_OUT msgresponse */
  3920. #define MC_CMD_GET_PHY_STATE_OUT_LEN 4
  3921. #define MC_CMD_GET_PHY_STATE_OUT_STATE_OFST 0
  3922. /* enum: Ok. */
  3923. #define MC_CMD_PHY_STATE_OK 0x1
  3924. /* enum: Faulty. */
  3925. #define MC_CMD_PHY_STATE_ZOMBIE 0x2
  3926. /***********************************/
  3927. /* MC_CMD_SETUP_8021QBB
  3928. * 802.1Qbb control. 8 Tx queues that map to priorities 0 - 7. Use all 1s to
  3929. * disable 802.Qbb for a given priority.
  3930. */
  3931. #define MC_CMD_SETUP_8021QBB 0x44
  3932. /* MC_CMD_SETUP_8021QBB_IN msgrequest */
  3933. #define MC_CMD_SETUP_8021QBB_IN_LEN 32
  3934. #define MC_CMD_SETUP_8021QBB_IN_TXQS_OFST 0
  3935. #define MC_CMD_SETUP_8021QBB_IN_TXQS_LEN 32
  3936. /* MC_CMD_SETUP_8021QBB_OUT msgresponse */
  3937. #define MC_CMD_SETUP_8021QBB_OUT_LEN 0
  3938. /***********************************/
  3939. /* MC_CMD_WOL_FILTER_GET
  3940. * Retrieve ID of any WoL filters. Locks required: None. Returns: 0, ENOSYS
  3941. */
  3942. #define MC_CMD_WOL_FILTER_GET 0x45
  3943. #define MC_CMD_0x45_PRIVILEGE_CTG SRIOV_CTG_LINK
  3944. /* MC_CMD_WOL_FILTER_GET_IN msgrequest */
  3945. #define MC_CMD_WOL_FILTER_GET_IN_LEN 0
  3946. /* MC_CMD_WOL_FILTER_GET_OUT msgresponse */
  3947. #define MC_CMD_WOL_FILTER_GET_OUT_LEN 4
  3948. #define MC_CMD_WOL_FILTER_GET_OUT_FILTER_ID_OFST 0
  3949. /***********************************/
  3950. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD
  3951. * Add a protocol offload to NIC for lights-out state. Locks required: None.
  3952. * Returns: 0, ENOSYS
  3953. */
  3954. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD 0x46
  3955. #define MC_CMD_0x46_PRIVILEGE_CTG SRIOV_CTG_LINK
  3956. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN msgrequest */
  3957. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMIN 8
  3958. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMAX 252
  3959. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LEN(num) (4+4*(num))
  3960. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0
  3961. #define MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_ARP 0x1 /* enum */
  3962. #define MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_NS 0x2 /* enum */
  3963. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_OFST 4
  3964. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_LEN 4
  3965. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_MINNUM 1
  3966. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_DATA_MAXNUM 62
  3967. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP msgrequest */
  3968. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_LEN 14
  3969. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0 */
  3970. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_MAC_OFST 4
  3971. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_MAC_LEN 6
  3972. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_IP_OFST 10
  3973. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS msgrequest */
  3974. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_LEN 42
  3975. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0 */
  3976. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_MAC_OFST 4
  3977. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_MAC_LEN 6
  3978. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_SNIPV6_OFST 10
  3979. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_SNIPV6_LEN 16
  3980. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_IPV6_OFST 26
  3981. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_IPV6_LEN 16
  3982. /* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT msgresponse */
  3983. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_LEN 4
  3984. #define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_FILTER_ID_OFST 0
  3985. /***********************************/
  3986. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD
  3987. * Remove a protocol offload from NIC for lights-out state. Locks required:
  3988. * None. Returns: 0, ENOSYS
  3989. */
  3990. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD 0x47
  3991. #define MC_CMD_0x47_PRIVILEGE_CTG SRIOV_CTG_LINK
  3992. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN msgrequest */
  3993. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN 8
  3994. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_PROTOCOL_OFST 0
  3995. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_FILTER_ID_OFST 4
  3996. /* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT msgresponse */
  3997. #define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN 0
  3998. /***********************************/
  3999. /* MC_CMD_MAC_RESET_RESTORE
  4000. * Restore MAC after block reset. Locks required: None. Returns: 0.
  4001. */
  4002. #define MC_CMD_MAC_RESET_RESTORE 0x48
  4003. /* MC_CMD_MAC_RESET_RESTORE_IN msgrequest */
  4004. #define MC_CMD_MAC_RESET_RESTORE_IN_LEN 0
  4005. /* MC_CMD_MAC_RESET_RESTORE_OUT msgresponse */
  4006. #define MC_CMD_MAC_RESET_RESTORE_OUT_LEN 0
  4007. /***********************************/
  4008. /* MC_CMD_TESTASSERT
  4009. * Deliberately trigger an assert-detonation in the firmware for testing
  4010. * purposes (i.e. to allow tests that the driver copes gracefully). Locks
  4011. * required: None Returns: 0
  4012. */
  4013. #define MC_CMD_TESTASSERT 0x49
  4014. #define MC_CMD_0x49_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4015. /* MC_CMD_TESTASSERT_IN msgrequest */
  4016. #define MC_CMD_TESTASSERT_IN_LEN 0
  4017. /* MC_CMD_TESTASSERT_OUT msgresponse */
  4018. #define MC_CMD_TESTASSERT_OUT_LEN 0
  4019. /* MC_CMD_TESTASSERT_V2_IN msgrequest */
  4020. #define MC_CMD_TESTASSERT_V2_IN_LEN 4
  4021. /* How to provoke the assertion */
  4022. #define MC_CMD_TESTASSERT_V2_IN_TYPE_OFST 0
  4023. /* enum: Assert using the FAIL_ASSERTION_WITH_USEFUL_VALUES macro. Unless
  4024. * you're testing firmware, this is what you want.
  4025. */
  4026. #define MC_CMD_TESTASSERT_V2_IN_FAIL_ASSERTION_WITH_USEFUL_VALUES 0x0
  4027. /* enum: Assert using assert(0); */
  4028. #define MC_CMD_TESTASSERT_V2_IN_ASSERT_FALSE 0x1
  4029. /* enum: Deliberately trigger a watchdog */
  4030. #define MC_CMD_TESTASSERT_V2_IN_WATCHDOG 0x2
  4031. /* enum: Deliberately trigger a trap by loading from an invalid address */
  4032. #define MC_CMD_TESTASSERT_V2_IN_LOAD_TRAP 0x3
  4033. /* enum: Deliberately trigger a trap by storing to an invalid address */
  4034. #define MC_CMD_TESTASSERT_V2_IN_STORE_TRAP 0x4
  4035. /* enum: Jump to an invalid address */
  4036. #define MC_CMD_TESTASSERT_V2_IN_JUMP_TRAP 0x5
  4037. /* MC_CMD_TESTASSERT_V2_OUT msgresponse */
  4038. #define MC_CMD_TESTASSERT_V2_OUT_LEN 0
  4039. /***********************************/
  4040. /* MC_CMD_WORKAROUND
  4041. * Enable/Disable a given workaround. The mcfw will return EINVAL if it doesn't
  4042. * understand the given workaround number - which should not be treated as a
  4043. * hard error by client code. This op does not imply any semantics about each
  4044. * workaround, that's between the driver and the mcfw on a per-workaround
  4045. * basis. Locks required: None. Returns: 0, EINVAL .
  4046. */
  4047. #define MC_CMD_WORKAROUND 0x4a
  4048. #define MC_CMD_0x4a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4049. /* MC_CMD_WORKAROUND_IN msgrequest */
  4050. #define MC_CMD_WORKAROUND_IN_LEN 8
  4051. /* The enums here must correspond with those in MC_CMD_GET_WORKAROUND. */
  4052. #define MC_CMD_WORKAROUND_IN_TYPE_OFST 0
  4053. /* enum: Bug 17230 work around. */
  4054. #define MC_CMD_WORKAROUND_BUG17230 0x1
  4055. /* enum: Bug 35388 work around (unsafe EVQ writes). */
  4056. #define MC_CMD_WORKAROUND_BUG35388 0x2
  4057. /* enum: Bug35017 workaround (A64 tables must be identity map) */
  4058. #define MC_CMD_WORKAROUND_BUG35017 0x3
  4059. /* enum: Bug 41750 present (MC_CMD_TRIGGER_INTERRUPT won't work) */
  4060. #define MC_CMD_WORKAROUND_BUG41750 0x4
  4061. /* enum: Bug 42008 present (Interrupts can overtake associated events). Caution
  4062. * - before adding code that queries this workaround, remember that there's
  4063. * released Monza firmware that doesn't understand MC_CMD_WORKAROUND_BUG42008,
  4064. * and will hence (incorrectly) report that the bug doesn't exist.
  4065. */
  4066. #define MC_CMD_WORKAROUND_BUG42008 0x5
  4067. /* enum: Bug 26807 features present in firmware (multicast filter chaining)
  4068. * This feature cannot be turned on/off while there are any filters already
  4069. * present. The behaviour in such case depends on the acting client's privilege
  4070. * level. If the client has the admin privilege, then all functions that have
  4071. * filters installed will be FLRed and the FLR_DONE flag will be set. Otherwise
  4072. * the command will fail with MC_CMD_ERR_FILTERS_PRESENT.
  4073. */
  4074. #define MC_CMD_WORKAROUND_BUG26807 0x6
  4075. /* enum: Bug 61265 work around (broken EVQ TMR writes). */
  4076. #define MC_CMD_WORKAROUND_BUG61265 0x7
  4077. /* 0 = disable the workaround indicated by TYPE; any non-zero value = enable
  4078. * the workaround
  4079. */
  4080. #define MC_CMD_WORKAROUND_IN_ENABLED_OFST 4
  4081. /* MC_CMD_WORKAROUND_OUT msgresponse */
  4082. #define MC_CMD_WORKAROUND_OUT_LEN 0
  4083. /* MC_CMD_WORKAROUND_EXT_OUT msgresponse: This response format will be used
  4084. * when (TYPE == MC_CMD_WORKAROUND_BUG26807)
  4085. */
  4086. #define MC_CMD_WORKAROUND_EXT_OUT_LEN 4
  4087. #define MC_CMD_WORKAROUND_EXT_OUT_FLAGS_OFST 0
  4088. #define MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_LBN 0
  4089. #define MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_WIDTH 1
  4090. /***********************************/
  4091. /* MC_CMD_GET_PHY_MEDIA_INFO
  4092. * Read media-specific data from PHY (e.g. SFP/SFP+ module ID information for
  4093. * SFP+ PHYs). The 'media type' can be found via GET_PHY_CFG
  4094. * (GET_PHY_CFG_OUT_MEDIA_TYPE); the valid 'page number' input values, and the
  4095. * output data, are interpreted on a per-type basis. For SFP+: PAGE=0 or 1
  4096. * returns a 128-byte block read from module I2C address 0xA0 offset 0 or 0x80.
  4097. * Anything else: currently undefined. Locks required: None. Return code: 0.
  4098. */
  4099. #define MC_CMD_GET_PHY_MEDIA_INFO 0x4b
  4100. #define MC_CMD_0x4b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4101. /* MC_CMD_GET_PHY_MEDIA_INFO_IN msgrequest */
  4102. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN 4
  4103. #define MC_CMD_GET_PHY_MEDIA_INFO_IN_PAGE_OFST 0
  4104. /* MC_CMD_GET_PHY_MEDIA_INFO_OUT msgresponse */
  4105. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMIN 5
  4106. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMAX 252
  4107. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(num) (4+1*(num))
  4108. /* in bytes */
  4109. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATALEN_OFST 0
  4110. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_OFST 4
  4111. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_LEN 1
  4112. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_MINNUM 1
  4113. #define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_MAXNUM 248
  4114. /***********************************/
  4115. /* MC_CMD_NVRAM_TEST
  4116. * Test a particular NVRAM partition for valid contents (where "valid" depends
  4117. * on the type of partition).
  4118. */
  4119. #define MC_CMD_NVRAM_TEST 0x4c
  4120. #define MC_CMD_0x4c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4121. /* MC_CMD_NVRAM_TEST_IN msgrequest */
  4122. #define MC_CMD_NVRAM_TEST_IN_LEN 4
  4123. #define MC_CMD_NVRAM_TEST_IN_TYPE_OFST 0
  4124. /* Enum values, see field(s): */
  4125. /* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
  4126. /* MC_CMD_NVRAM_TEST_OUT msgresponse */
  4127. #define MC_CMD_NVRAM_TEST_OUT_LEN 4
  4128. #define MC_CMD_NVRAM_TEST_OUT_RESULT_OFST 0
  4129. /* enum: Passed. */
  4130. #define MC_CMD_NVRAM_TEST_PASS 0x0
  4131. /* enum: Failed. */
  4132. #define MC_CMD_NVRAM_TEST_FAIL 0x1
  4133. /* enum: Not supported. */
  4134. #define MC_CMD_NVRAM_TEST_NOTSUPP 0x2
  4135. /***********************************/
  4136. /* MC_CMD_MRSFP_TWEAK
  4137. * Read status and/or set parameters for the 'mrsfp' driver in mr_rusty builds.
  4138. * I2C I/O expander bits are always read; if equaliser parameters are supplied,
  4139. * they are configured first. Locks required: None. Return code: 0, EINVAL.
  4140. */
  4141. #define MC_CMD_MRSFP_TWEAK 0x4d
  4142. /* MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG msgrequest */
  4143. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_LEN 16
  4144. /* 0-6 low->high de-emph. */
  4145. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_LEVEL_OFST 0
  4146. /* 0-8 low->high ref.V */
  4147. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_DT_CFG_OFST 4
  4148. /* 0-8 0-8 low->high boost */
  4149. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_BOOST_OFST 8
  4150. /* 0-8 low->high ref.V */
  4151. #define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_DT_CFG_OFST 12
  4152. /* MC_CMD_MRSFP_TWEAK_IN_READ_ONLY msgrequest */
  4153. #define MC_CMD_MRSFP_TWEAK_IN_READ_ONLY_LEN 0
  4154. /* MC_CMD_MRSFP_TWEAK_OUT msgresponse */
  4155. #define MC_CMD_MRSFP_TWEAK_OUT_LEN 12
  4156. /* input bits */
  4157. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_INPUTS_OFST 0
  4158. /* output bits */
  4159. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_OUTPUTS_OFST 4
  4160. /* direction */
  4161. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OFST 8
  4162. /* enum: Out. */
  4163. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OUT 0x0
  4164. /* enum: In. */
  4165. #define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_IN 0x1
  4166. /***********************************/
  4167. /* MC_CMD_SENSOR_SET_LIMS
  4168. * Adjusts the sensor limits. This is a warranty-voiding operation. Returns:
  4169. * ENOENT if the sensor specified does not exist, EINVAL if the limits are out
  4170. * of range.
  4171. */
  4172. #define MC_CMD_SENSOR_SET_LIMS 0x4e
  4173. #define MC_CMD_0x4e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4174. /* MC_CMD_SENSOR_SET_LIMS_IN msgrequest */
  4175. #define MC_CMD_SENSOR_SET_LIMS_IN_LEN 20
  4176. #define MC_CMD_SENSOR_SET_LIMS_IN_SENSOR_OFST 0
  4177. /* Enum values, see field(s): */
  4178. /* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
  4179. /* interpretation is is sensor-specific. */
  4180. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW0_OFST 4
  4181. /* interpretation is is sensor-specific. */
  4182. #define MC_CMD_SENSOR_SET_LIMS_IN_HI0_OFST 8
  4183. /* interpretation is is sensor-specific. */
  4184. #define MC_CMD_SENSOR_SET_LIMS_IN_LOW1_OFST 12
  4185. /* interpretation is is sensor-specific. */
  4186. #define MC_CMD_SENSOR_SET_LIMS_IN_HI1_OFST 16
  4187. /* MC_CMD_SENSOR_SET_LIMS_OUT msgresponse */
  4188. #define MC_CMD_SENSOR_SET_LIMS_OUT_LEN 0
  4189. /***********************************/
  4190. /* MC_CMD_GET_RESOURCE_LIMITS
  4191. */
  4192. #define MC_CMD_GET_RESOURCE_LIMITS 0x4f
  4193. /* MC_CMD_GET_RESOURCE_LIMITS_IN msgrequest */
  4194. #define MC_CMD_GET_RESOURCE_LIMITS_IN_LEN 0
  4195. /* MC_CMD_GET_RESOURCE_LIMITS_OUT msgresponse */
  4196. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN 16
  4197. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_BUFTBL_OFST 0
  4198. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_EVQ_OFST 4
  4199. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_RXQ_OFST 8
  4200. #define MC_CMD_GET_RESOURCE_LIMITS_OUT_TXQ_OFST 12
  4201. /***********************************/
  4202. /* MC_CMD_NVRAM_PARTITIONS
  4203. * Reads the list of available virtual NVRAM partition types. Locks required:
  4204. * none. Returns: 0, EINVAL (bad type).
  4205. */
  4206. #define MC_CMD_NVRAM_PARTITIONS 0x51
  4207. #define MC_CMD_0x51_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4208. /* MC_CMD_NVRAM_PARTITIONS_IN msgrequest */
  4209. #define MC_CMD_NVRAM_PARTITIONS_IN_LEN 0
  4210. /* MC_CMD_NVRAM_PARTITIONS_OUT msgresponse */
  4211. #define MC_CMD_NVRAM_PARTITIONS_OUT_LENMIN 4
  4212. #define MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX 252
  4213. #define MC_CMD_NVRAM_PARTITIONS_OUT_LEN(num) (4+4*(num))
  4214. /* total number of partitions */
  4215. #define MC_CMD_NVRAM_PARTITIONS_OUT_NUM_PARTITIONS_OFST 0
  4216. /* type ID code for each of NUM_PARTITIONS partitions */
  4217. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_OFST 4
  4218. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_LEN 4
  4219. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MINNUM 0
  4220. #define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM 62
  4221. /***********************************/
  4222. /* MC_CMD_NVRAM_METADATA
  4223. * Reads soft metadata for a virtual NVRAM partition type. Locks required:
  4224. * none. Returns: 0, EINVAL (bad type).
  4225. */
  4226. #define MC_CMD_NVRAM_METADATA 0x52
  4227. #define MC_CMD_0x52_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4228. /* MC_CMD_NVRAM_METADATA_IN msgrequest */
  4229. #define MC_CMD_NVRAM_METADATA_IN_LEN 4
  4230. /* Partition type ID code */
  4231. #define MC_CMD_NVRAM_METADATA_IN_TYPE_OFST 0
  4232. /* MC_CMD_NVRAM_METADATA_OUT msgresponse */
  4233. #define MC_CMD_NVRAM_METADATA_OUT_LENMIN 20
  4234. #define MC_CMD_NVRAM_METADATA_OUT_LENMAX 252
  4235. #define MC_CMD_NVRAM_METADATA_OUT_LEN(num) (20+1*(num))
  4236. /* Partition type ID code */
  4237. #define MC_CMD_NVRAM_METADATA_OUT_TYPE_OFST 0
  4238. #define MC_CMD_NVRAM_METADATA_OUT_FLAGS_OFST 4
  4239. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_LBN 0
  4240. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_WIDTH 1
  4241. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_LBN 1
  4242. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_WIDTH 1
  4243. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_LBN 2
  4244. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_WIDTH 1
  4245. /* Subtype ID code for content of this partition */
  4246. #define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_OFST 8
  4247. /* 1st component of W.X.Y.Z version number for content of this partition */
  4248. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_OFST 12
  4249. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_LEN 2
  4250. /* 2nd component of W.X.Y.Z version number for content of this partition */
  4251. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_OFST 14
  4252. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_LEN 2
  4253. /* 3rd component of W.X.Y.Z version number for content of this partition */
  4254. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_OFST 16
  4255. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_LEN 2
  4256. /* 4th component of W.X.Y.Z version number for content of this partition */
  4257. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_OFST 18
  4258. #define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_LEN 2
  4259. /* Zero-terminated string describing the content of this partition */
  4260. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_OFST 20
  4261. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_LEN 1
  4262. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MINNUM 0
  4263. #define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MAXNUM 232
  4264. /***********************************/
  4265. /* MC_CMD_GET_MAC_ADDRESSES
  4266. * Returns the base MAC, count and stride for the requesting function
  4267. */
  4268. #define MC_CMD_GET_MAC_ADDRESSES 0x55
  4269. #define MC_CMD_0x55_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  4270. /* MC_CMD_GET_MAC_ADDRESSES_IN msgrequest */
  4271. #define MC_CMD_GET_MAC_ADDRESSES_IN_LEN 0
  4272. /* MC_CMD_GET_MAC_ADDRESSES_OUT msgresponse */
  4273. #define MC_CMD_GET_MAC_ADDRESSES_OUT_LEN 16
  4274. /* Base MAC address */
  4275. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_OFST 0
  4276. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_LEN 6
  4277. /* Padding */
  4278. #define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_OFST 6
  4279. #define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_LEN 2
  4280. /* Number of allocated MAC addresses */
  4281. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_COUNT_OFST 8
  4282. /* Spacing of allocated MAC addresses */
  4283. #define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_STRIDE_OFST 12
  4284. /***********************************/
  4285. /* MC_CMD_CLP
  4286. * Perform a CLP related operation
  4287. */
  4288. #define MC_CMD_CLP 0x56
  4289. #define MC_CMD_0x56_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4290. /* MC_CMD_CLP_IN msgrequest */
  4291. #define MC_CMD_CLP_IN_LEN 4
  4292. /* Sub operation */
  4293. #define MC_CMD_CLP_IN_OP_OFST 0
  4294. /* enum: Return to factory default settings */
  4295. #define MC_CMD_CLP_OP_DEFAULT 0x1
  4296. /* enum: Set MAC address */
  4297. #define MC_CMD_CLP_OP_SET_MAC 0x2
  4298. /* enum: Get MAC address */
  4299. #define MC_CMD_CLP_OP_GET_MAC 0x3
  4300. /* enum: Set UEFI/GPXE boot mode */
  4301. #define MC_CMD_CLP_OP_SET_BOOT 0x4
  4302. /* enum: Get UEFI/GPXE boot mode */
  4303. #define MC_CMD_CLP_OP_GET_BOOT 0x5
  4304. /* MC_CMD_CLP_OUT msgresponse */
  4305. #define MC_CMD_CLP_OUT_LEN 0
  4306. /* MC_CMD_CLP_IN_DEFAULT msgrequest */
  4307. #define MC_CMD_CLP_IN_DEFAULT_LEN 4
  4308. /* MC_CMD_CLP_IN_OP_OFST 0 */
  4309. /* MC_CMD_CLP_OUT_DEFAULT msgresponse */
  4310. #define MC_CMD_CLP_OUT_DEFAULT_LEN 0
  4311. /* MC_CMD_CLP_IN_SET_MAC msgrequest */
  4312. #define MC_CMD_CLP_IN_SET_MAC_LEN 12
  4313. /* MC_CMD_CLP_IN_OP_OFST 0 */
  4314. /* MAC address assigned to port */
  4315. #define MC_CMD_CLP_IN_SET_MAC_ADDR_OFST 4
  4316. #define MC_CMD_CLP_IN_SET_MAC_ADDR_LEN 6
  4317. /* Padding */
  4318. #define MC_CMD_CLP_IN_SET_MAC_RESERVED_OFST 10
  4319. #define MC_CMD_CLP_IN_SET_MAC_RESERVED_LEN 2
  4320. /* MC_CMD_CLP_OUT_SET_MAC msgresponse */
  4321. #define MC_CMD_CLP_OUT_SET_MAC_LEN 0
  4322. /* MC_CMD_CLP_IN_GET_MAC msgrequest */
  4323. #define MC_CMD_CLP_IN_GET_MAC_LEN 4
  4324. /* MC_CMD_CLP_IN_OP_OFST 0 */
  4325. /* MC_CMD_CLP_OUT_GET_MAC msgresponse */
  4326. #define MC_CMD_CLP_OUT_GET_MAC_LEN 8
  4327. /* MAC address assigned to port */
  4328. #define MC_CMD_CLP_OUT_GET_MAC_ADDR_OFST 0
  4329. #define MC_CMD_CLP_OUT_GET_MAC_ADDR_LEN 6
  4330. /* Padding */
  4331. #define MC_CMD_CLP_OUT_GET_MAC_RESERVED_OFST 6
  4332. #define MC_CMD_CLP_OUT_GET_MAC_RESERVED_LEN 2
  4333. /* MC_CMD_CLP_IN_SET_BOOT msgrequest */
  4334. #define MC_CMD_CLP_IN_SET_BOOT_LEN 5
  4335. /* MC_CMD_CLP_IN_OP_OFST 0 */
  4336. /* Boot flag */
  4337. #define MC_CMD_CLP_IN_SET_BOOT_FLAG_OFST 4
  4338. #define MC_CMD_CLP_IN_SET_BOOT_FLAG_LEN 1
  4339. /* MC_CMD_CLP_OUT_SET_BOOT msgresponse */
  4340. #define MC_CMD_CLP_OUT_SET_BOOT_LEN 0
  4341. /* MC_CMD_CLP_IN_GET_BOOT msgrequest */
  4342. #define MC_CMD_CLP_IN_GET_BOOT_LEN 4
  4343. /* MC_CMD_CLP_IN_OP_OFST 0 */
  4344. /* MC_CMD_CLP_OUT_GET_BOOT msgresponse */
  4345. #define MC_CMD_CLP_OUT_GET_BOOT_LEN 4
  4346. /* Boot flag */
  4347. #define MC_CMD_CLP_OUT_GET_BOOT_FLAG_OFST 0
  4348. #define MC_CMD_CLP_OUT_GET_BOOT_FLAG_LEN 1
  4349. /* Padding */
  4350. #define MC_CMD_CLP_OUT_GET_BOOT_RESERVED_OFST 1
  4351. #define MC_CMD_CLP_OUT_GET_BOOT_RESERVED_LEN 3
  4352. /***********************************/
  4353. /* MC_CMD_MUM
  4354. * Perform a MUM operation
  4355. */
  4356. #define MC_CMD_MUM 0x57
  4357. #define MC_CMD_0x57_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  4358. /* MC_CMD_MUM_IN msgrequest */
  4359. #define MC_CMD_MUM_IN_LEN 4
  4360. #define MC_CMD_MUM_IN_OP_HDR_OFST 0
  4361. #define MC_CMD_MUM_IN_OP_LBN 0
  4362. #define MC_CMD_MUM_IN_OP_WIDTH 8
  4363. /* enum: NULL MCDI command to MUM */
  4364. #define MC_CMD_MUM_OP_NULL 0x1
  4365. /* enum: Get MUM version */
  4366. #define MC_CMD_MUM_OP_GET_VERSION 0x2
  4367. /* enum: Issue raw I2C command to MUM */
  4368. #define MC_CMD_MUM_OP_RAW_CMD 0x3
  4369. /* enum: Read from registers on devices connected to MUM. */
  4370. #define MC_CMD_MUM_OP_READ 0x4
  4371. /* enum: Write to registers on devices connected to MUM. */
  4372. #define MC_CMD_MUM_OP_WRITE 0x5
  4373. /* enum: Control UART logging. */
  4374. #define MC_CMD_MUM_OP_LOG 0x6
  4375. /* enum: Operations on MUM GPIO lines */
  4376. #define MC_CMD_MUM_OP_GPIO 0x7
  4377. /* enum: Get sensor readings from MUM */
  4378. #define MC_CMD_MUM_OP_READ_SENSORS 0x8
  4379. /* enum: Initiate clock programming on the MUM */
  4380. #define MC_CMD_MUM_OP_PROGRAM_CLOCKS 0x9
  4381. /* enum: Initiate FPGA load from flash on the MUM */
  4382. #define MC_CMD_MUM_OP_FPGA_LOAD 0xa
  4383. /* enum: Request sensor reading from MUM ADC resulting from earlier request via
  4384. * MUM ATB
  4385. */
  4386. #define MC_CMD_MUM_OP_READ_ATB_SENSOR 0xb
  4387. /* enum: Send commands relating to the QSFP ports via the MUM for PHY
  4388. * operations
  4389. */
  4390. #define MC_CMD_MUM_OP_QSFP 0xc
  4391. /* enum: Request discrete and SODIMM DDR info (type, size, speed grade, voltage
  4392. * level) from MUM
  4393. */
  4394. #define MC_CMD_MUM_OP_READ_DDR_INFO 0xd
  4395. /* MC_CMD_MUM_IN_NULL msgrequest */
  4396. #define MC_CMD_MUM_IN_NULL_LEN 4
  4397. /* MUM cmd header */
  4398. #define MC_CMD_MUM_IN_CMD_OFST 0
  4399. /* MC_CMD_MUM_IN_GET_VERSION msgrequest */
  4400. #define MC_CMD_MUM_IN_GET_VERSION_LEN 4
  4401. /* MUM cmd header */
  4402. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4403. /* MC_CMD_MUM_IN_READ msgrequest */
  4404. #define MC_CMD_MUM_IN_READ_LEN 16
  4405. /* MUM cmd header */
  4406. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4407. /* ID of (device connected to MUM) to read from registers of */
  4408. #define MC_CMD_MUM_IN_READ_DEVICE_OFST 4
  4409. /* enum: Hittite HMC1035 clock generator on Sorrento board */
  4410. #define MC_CMD_MUM_DEV_HITTITE 0x1
  4411. /* enum: Hittite HMC1035 clock generator for NIC-side on Sorrento board */
  4412. #define MC_CMD_MUM_DEV_HITTITE_NIC 0x2
  4413. /* 32-bit address to read from */
  4414. #define MC_CMD_MUM_IN_READ_ADDR_OFST 8
  4415. /* Number of words to read. */
  4416. #define MC_CMD_MUM_IN_READ_NUMWORDS_OFST 12
  4417. /* MC_CMD_MUM_IN_WRITE msgrequest */
  4418. #define MC_CMD_MUM_IN_WRITE_LENMIN 16
  4419. #define MC_CMD_MUM_IN_WRITE_LENMAX 252
  4420. #define MC_CMD_MUM_IN_WRITE_LEN(num) (12+4*(num))
  4421. /* MUM cmd header */
  4422. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4423. /* ID of (device connected to MUM) to write to registers of */
  4424. #define MC_CMD_MUM_IN_WRITE_DEVICE_OFST 4
  4425. /* enum: Hittite HMC1035 clock generator on Sorrento board */
  4426. /* MC_CMD_MUM_DEV_HITTITE 0x1 */
  4427. /* 32-bit address to write to */
  4428. #define MC_CMD_MUM_IN_WRITE_ADDR_OFST 8
  4429. /* Words to write */
  4430. #define MC_CMD_MUM_IN_WRITE_BUFFER_OFST 12
  4431. #define MC_CMD_MUM_IN_WRITE_BUFFER_LEN 4
  4432. #define MC_CMD_MUM_IN_WRITE_BUFFER_MINNUM 1
  4433. #define MC_CMD_MUM_IN_WRITE_BUFFER_MAXNUM 60
  4434. /* MC_CMD_MUM_IN_RAW_CMD msgrequest */
  4435. #define MC_CMD_MUM_IN_RAW_CMD_LENMIN 17
  4436. #define MC_CMD_MUM_IN_RAW_CMD_LENMAX 252
  4437. #define MC_CMD_MUM_IN_RAW_CMD_LEN(num) (16+1*(num))
  4438. /* MUM cmd header */
  4439. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4440. /* MUM I2C cmd code */
  4441. #define MC_CMD_MUM_IN_RAW_CMD_CMD_CODE_OFST 4
  4442. /* Number of bytes to write */
  4443. #define MC_CMD_MUM_IN_RAW_CMD_NUM_WRITE_OFST 8
  4444. /* Number of bytes to read */
  4445. #define MC_CMD_MUM_IN_RAW_CMD_NUM_READ_OFST 12
  4446. /* Bytes to write */
  4447. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_OFST 16
  4448. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_LEN 1
  4449. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_MINNUM 1
  4450. #define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_MAXNUM 236
  4451. /* MC_CMD_MUM_IN_LOG msgrequest */
  4452. #define MC_CMD_MUM_IN_LOG_LEN 8
  4453. /* MUM cmd header */
  4454. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4455. #define MC_CMD_MUM_IN_LOG_OP_OFST 4
  4456. #define MC_CMD_MUM_IN_LOG_OP_UART 0x1 /* enum */
  4457. /* MC_CMD_MUM_IN_LOG_OP_UART msgrequest */
  4458. #define MC_CMD_MUM_IN_LOG_OP_UART_LEN 12
  4459. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4460. /* MC_CMD_MUM_IN_LOG_OP_OFST 4 */
  4461. /* Enable/disable debug output to UART */
  4462. #define MC_CMD_MUM_IN_LOG_OP_UART_ENABLE_OFST 8
  4463. /* MC_CMD_MUM_IN_GPIO msgrequest */
  4464. #define MC_CMD_MUM_IN_GPIO_LEN 8
  4465. /* MUM cmd header */
  4466. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4467. #define MC_CMD_MUM_IN_GPIO_HDR_OFST 4
  4468. #define MC_CMD_MUM_IN_GPIO_OPCODE_LBN 0
  4469. #define MC_CMD_MUM_IN_GPIO_OPCODE_WIDTH 8
  4470. #define MC_CMD_MUM_IN_GPIO_IN_READ 0x0 /* enum */
  4471. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE 0x1 /* enum */
  4472. #define MC_CMD_MUM_IN_GPIO_OUT_READ 0x2 /* enum */
  4473. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE 0x3 /* enum */
  4474. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ 0x4 /* enum */
  4475. #define MC_CMD_MUM_IN_GPIO_OP 0x5 /* enum */
  4476. /* MC_CMD_MUM_IN_GPIO_IN_READ msgrequest */
  4477. #define MC_CMD_MUM_IN_GPIO_IN_READ_LEN 8
  4478. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4479. #define MC_CMD_MUM_IN_GPIO_IN_READ_HDR_OFST 4
  4480. /* MC_CMD_MUM_IN_GPIO_OUT_WRITE msgrequest */
  4481. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_LEN 16
  4482. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4483. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_HDR_OFST 4
  4484. /* The first 32-bit word to be written to the GPIO OUT register. */
  4485. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK1_OFST 8
  4486. /* The second 32-bit word to be written to the GPIO OUT register. */
  4487. #define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK2_OFST 12
  4488. /* MC_CMD_MUM_IN_GPIO_OUT_READ msgrequest */
  4489. #define MC_CMD_MUM_IN_GPIO_OUT_READ_LEN 8
  4490. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4491. #define MC_CMD_MUM_IN_GPIO_OUT_READ_HDR_OFST 4
  4492. /* MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE msgrequest */
  4493. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_LEN 16
  4494. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4495. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_HDR_OFST 4
  4496. /* The first 32-bit word to be written to the GPIO OUT ENABLE register. */
  4497. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK1_OFST 8
  4498. /* The second 32-bit word to be written to the GPIO OUT ENABLE register. */
  4499. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK2_OFST 12
  4500. /* MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ msgrequest */
  4501. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_LEN 8
  4502. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4503. #define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_HDR_OFST 4
  4504. /* MC_CMD_MUM_IN_GPIO_OP msgrequest */
  4505. #define MC_CMD_MUM_IN_GPIO_OP_LEN 8
  4506. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4507. #define MC_CMD_MUM_IN_GPIO_OP_HDR_OFST 4
  4508. #define MC_CMD_MUM_IN_GPIO_OP_BITWISE_OP_LBN 8
  4509. #define MC_CMD_MUM_IN_GPIO_OP_BITWISE_OP_WIDTH 8
  4510. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ 0x0 /* enum */
  4511. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE 0x1 /* enum */
  4512. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG 0x2 /* enum */
  4513. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE 0x3 /* enum */
  4514. #define MC_CMD_MUM_IN_GPIO_OP_GPIO_NUMBER_LBN 16
  4515. #define MC_CMD_MUM_IN_GPIO_OP_GPIO_NUMBER_WIDTH 8
  4516. /* MC_CMD_MUM_IN_GPIO_OP_OUT_READ msgrequest */
  4517. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_LEN 8
  4518. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4519. #define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_HDR_OFST 4
  4520. /* MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE msgrequest */
  4521. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_LEN 8
  4522. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4523. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_HDR_OFST 4
  4524. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_WRITEBIT_LBN 24
  4525. #define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_WRITEBIT_WIDTH 8
  4526. /* MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG msgrequest */
  4527. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_LEN 8
  4528. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4529. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_HDR_OFST 4
  4530. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_CFG_LBN 24
  4531. #define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_CFG_WIDTH 8
  4532. /* MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE msgrequest */
  4533. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_LEN 8
  4534. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4535. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_HDR_OFST 4
  4536. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_ENABLEBIT_LBN 24
  4537. #define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_ENABLEBIT_WIDTH 8
  4538. /* MC_CMD_MUM_IN_READ_SENSORS msgrequest */
  4539. #define MC_CMD_MUM_IN_READ_SENSORS_LEN 8
  4540. /* MUM cmd header */
  4541. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4542. #define MC_CMD_MUM_IN_READ_SENSORS_PARAMS_OFST 4
  4543. #define MC_CMD_MUM_IN_READ_SENSORS_SENSOR_ID_LBN 0
  4544. #define MC_CMD_MUM_IN_READ_SENSORS_SENSOR_ID_WIDTH 8
  4545. #define MC_CMD_MUM_IN_READ_SENSORS_NUM_SENSORS_LBN 8
  4546. #define MC_CMD_MUM_IN_READ_SENSORS_NUM_SENSORS_WIDTH 8
  4547. /* MC_CMD_MUM_IN_PROGRAM_CLOCKS msgrequest */
  4548. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_LEN 12
  4549. /* MUM cmd header */
  4550. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4551. /* Bit-mask of clocks to be programmed */
  4552. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_MASK_OFST 4
  4553. #define MC_CMD_MUM_CLOCK_ID_FPGA 0x0 /* enum */
  4554. #define MC_CMD_MUM_CLOCK_ID_DDR 0x1 /* enum */
  4555. #define MC_CMD_MUM_CLOCK_ID_NIC 0x2 /* enum */
  4556. /* Control flags for clock programming */
  4557. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_FLAGS_OFST 8
  4558. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_LBN 0
  4559. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_WIDTH 1
  4560. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_NIC_FROM_FPGA_LBN 1
  4561. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_NIC_FROM_FPGA_WIDTH 1
  4562. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_REF_FROM_XO_LBN 2
  4563. #define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_REF_FROM_XO_WIDTH 1
  4564. /* MC_CMD_MUM_IN_FPGA_LOAD msgrequest */
  4565. #define MC_CMD_MUM_IN_FPGA_LOAD_LEN 8
  4566. /* MUM cmd header */
  4567. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4568. /* Enable/Disable FPGA config from flash */
  4569. #define MC_CMD_MUM_IN_FPGA_LOAD_ENABLE_OFST 4
  4570. /* MC_CMD_MUM_IN_READ_ATB_SENSOR msgrequest */
  4571. #define MC_CMD_MUM_IN_READ_ATB_SENSOR_LEN 4
  4572. /* MUM cmd header */
  4573. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4574. /* MC_CMD_MUM_IN_QSFP msgrequest */
  4575. #define MC_CMD_MUM_IN_QSFP_LEN 12
  4576. /* MUM cmd header */
  4577. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4578. #define MC_CMD_MUM_IN_QSFP_HDR_OFST 4
  4579. #define MC_CMD_MUM_IN_QSFP_OPCODE_LBN 0
  4580. #define MC_CMD_MUM_IN_QSFP_OPCODE_WIDTH 4
  4581. #define MC_CMD_MUM_IN_QSFP_INIT 0x0 /* enum */
  4582. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE 0x1 /* enum */
  4583. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP 0x2 /* enum */
  4584. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO 0x3 /* enum */
  4585. #define MC_CMD_MUM_IN_QSFP_FILL_STATS 0x4 /* enum */
  4586. #define MC_CMD_MUM_IN_QSFP_POLL_BIST 0x5 /* enum */
  4587. #define MC_CMD_MUM_IN_QSFP_IDX_OFST 8
  4588. /* MC_CMD_MUM_IN_QSFP_INIT msgrequest */
  4589. #define MC_CMD_MUM_IN_QSFP_INIT_LEN 16
  4590. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4591. #define MC_CMD_MUM_IN_QSFP_INIT_HDR_OFST 4
  4592. #define MC_CMD_MUM_IN_QSFP_INIT_IDX_OFST 8
  4593. #define MC_CMD_MUM_IN_QSFP_INIT_CAGE_OFST 12
  4594. /* MC_CMD_MUM_IN_QSFP_RECONFIGURE msgrequest */
  4595. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_LEN 24
  4596. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4597. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_HDR_OFST 4
  4598. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_IDX_OFST 8
  4599. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_TX_DISABLE_OFST 12
  4600. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LANES_OFST 16
  4601. #define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LINK_SPEED_OFST 20
  4602. /* MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP msgrequest */
  4603. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_LEN 12
  4604. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4605. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_HDR_OFST 4
  4606. #define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_IDX_OFST 8
  4607. /* MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO msgrequest */
  4608. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_LEN 16
  4609. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4610. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_HDR_OFST 4
  4611. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_IDX_OFST 8
  4612. #define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_PAGE_OFST 12
  4613. /* MC_CMD_MUM_IN_QSFP_FILL_STATS msgrequest */
  4614. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_LEN 12
  4615. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4616. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_HDR_OFST 4
  4617. #define MC_CMD_MUM_IN_QSFP_FILL_STATS_IDX_OFST 8
  4618. /* MC_CMD_MUM_IN_QSFP_POLL_BIST msgrequest */
  4619. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_LEN 12
  4620. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4621. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_HDR_OFST 4
  4622. #define MC_CMD_MUM_IN_QSFP_POLL_BIST_IDX_OFST 8
  4623. /* MC_CMD_MUM_IN_READ_DDR_INFO msgrequest */
  4624. #define MC_CMD_MUM_IN_READ_DDR_INFO_LEN 4
  4625. /* MUM cmd header */
  4626. /* MC_CMD_MUM_IN_CMD_OFST 0 */
  4627. /* MC_CMD_MUM_OUT msgresponse */
  4628. #define MC_CMD_MUM_OUT_LEN 0
  4629. /* MC_CMD_MUM_OUT_NULL msgresponse */
  4630. #define MC_CMD_MUM_OUT_NULL_LEN 0
  4631. /* MC_CMD_MUM_OUT_GET_VERSION msgresponse */
  4632. #define MC_CMD_MUM_OUT_GET_VERSION_LEN 12
  4633. #define MC_CMD_MUM_OUT_GET_VERSION_FIRMWARE_OFST 0
  4634. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_OFST 4
  4635. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_LEN 8
  4636. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_LO_OFST 4
  4637. #define MC_CMD_MUM_OUT_GET_VERSION_VERSION_HI_OFST 8
  4638. /* MC_CMD_MUM_OUT_RAW_CMD msgresponse */
  4639. #define MC_CMD_MUM_OUT_RAW_CMD_LENMIN 1
  4640. #define MC_CMD_MUM_OUT_RAW_CMD_LENMAX 252
  4641. #define MC_CMD_MUM_OUT_RAW_CMD_LEN(num) (0+1*(num))
  4642. /* returned data */
  4643. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_OFST 0
  4644. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_LEN 1
  4645. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_MINNUM 1
  4646. #define MC_CMD_MUM_OUT_RAW_CMD_DATA_MAXNUM 252
  4647. /* MC_CMD_MUM_OUT_READ msgresponse */
  4648. #define MC_CMD_MUM_OUT_READ_LENMIN 4
  4649. #define MC_CMD_MUM_OUT_READ_LENMAX 252
  4650. #define MC_CMD_MUM_OUT_READ_LEN(num) (0+4*(num))
  4651. #define MC_CMD_MUM_OUT_READ_BUFFER_OFST 0
  4652. #define MC_CMD_MUM_OUT_READ_BUFFER_LEN 4
  4653. #define MC_CMD_MUM_OUT_READ_BUFFER_MINNUM 1
  4654. #define MC_CMD_MUM_OUT_READ_BUFFER_MAXNUM 63
  4655. /* MC_CMD_MUM_OUT_WRITE msgresponse */
  4656. #define MC_CMD_MUM_OUT_WRITE_LEN 0
  4657. /* MC_CMD_MUM_OUT_LOG msgresponse */
  4658. #define MC_CMD_MUM_OUT_LOG_LEN 0
  4659. /* MC_CMD_MUM_OUT_LOG_OP_UART msgresponse */
  4660. #define MC_CMD_MUM_OUT_LOG_OP_UART_LEN 0
  4661. /* MC_CMD_MUM_OUT_GPIO_IN_READ msgresponse */
  4662. #define MC_CMD_MUM_OUT_GPIO_IN_READ_LEN 8
  4663. /* The first 32-bit word read from the GPIO IN register. */
  4664. #define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK1_OFST 0
  4665. /* The second 32-bit word read from the GPIO IN register. */
  4666. #define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK2_OFST 4
  4667. /* MC_CMD_MUM_OUT_GPIO_OUT_WRITE msgresponse */
  4668. #define MC_CMD_MUM_OUT_GPIO_OUT_WRITE_LEN 0
  4669. /* MC_CMD_MUM_OUT_GPIO_OUT_READ msgresponse */
  4670. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_LEN 8
  4671. /* The first 32-bit word read from the GPIO OUT register. */
  4672. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK1_OFST 0
  4673. /* The second 32-bit word read from the GPIO OUT register. */
  4674. #define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK2_OFST 4
  4675. /* MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_WRITE msgresponse */
  4676. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_WRITE_LEN 0
  4677. /* MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ msgresponse */
  4678. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_LEN 8
  4679. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK1_OFST 0
  4680. #define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK2_OFST 4
  4681. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_READ msgresponse */
  4682. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_LEN 4
  4683. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_BIT_READ_OFST 0
  4684. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_WRITE msgresponse */
  4685. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_WRITE_LEN 0
  4686. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_CONFIG msgresponse */
  4687. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_CONFIG_LEN 0
  4688. /* MC_CMD_MUM_OUT_GPIO_OP_OUT_ENABLE msgresponse */
  4689. #define MC_CMD_MUM_OUT_GPIO_OP_OUT_ENABLE_LEN 0
  4690. /* MC_CMD_MUM_OUT_READ_SENSORS msgresponse */
  4691. #define MC_CMD_MUM_OUT_READ_SENSORS_LENMIN 4
  4692. #define MC_CMD_MUM_OUT_READ_SENSORS_LENMAX 252
  4693. #define MC_CMD_MUM_OUT_READ_SENSORS_LEN(num) (0+4*(num))
  4694. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_OFST 0
  4695. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_LEN 4
  4696. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_MINNUM 1
  4697. #define MC_CMD_MUM_OUT_READ_SENSORS_DATA_MAXNUM 63
  4698. #define MC_CMD_MUM_OUT_READ_SENSORS_READING_LBN 0
  4699. #define MC_CMD_MUM_OUT_READ_SENSORS_READING_WIDTH 16
  4700. #define MC_CMD_MUM_OUT_READ_SENSORS_STATE_LBN 16
  4701. #define MC_CMD_MUM_OUT_READ_SENSORS_STATE_WIDTH 8
  4702. #define MC_CMD_MUM_OUT_READ_SENSORS_TYPE_LBN 24
  4703. #define MC_CMD_MUM_OUT_READ_SENSORS_TYPE_WIDTH 8
  4704. /* MC_CMD_MUM_OUT_PROGRAM_CLOCKS msgresponse */
  4705. #define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_LEN 4
  4706. #define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_OK_MASK_OFST 0
  4707. /* MC_CMD_MUM_OUT_FPGA_LOAD msgresponse */
  4708. #define MC_CMD_MUM_OUT_FPGA_LOAD_LEN 0
  4709. /* MC_CMD_MUM_OUT_READ_ATB_SENSOR msgresponse */
  4710. #define MC_CMD_MUM_OUT_READ_ATB_SENSOR_LEN 4
  4711. #define MC_CMD_MUM_OUT_READ_ATB_SENSOR_RESULT_OFST 0
  4712. /* MC_CMD_MUM_OUT_QSFP_INIT msgresponse */
  4713. #define MC_CMD_MUM_OUT_QSFP_INIT_LEN 0
  4714. /* MC_CMD_MUM_OUT_QSFP_RECONFIGURE msgresponse */
  4715. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_LEN 8
  4716. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LP_CAP_OFST 0
  4717. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_FLAGS_OFST 4
  4718. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_READY_LBN 0
  4719. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_READY_WIDTH 1
  4720. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LINK_UP_LBN 1
  4721. #define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LINK_UP_WIDTH 1
  4722. /* MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP msgresponse */
  4723. #define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_LEN 4
  4724. #define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_PORT_PHY_LP_CAP_OFST 0
  4725. /* MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO msgresponse */
  4726. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LENMIN 5
  4727. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LENMAX 252
  4728. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LEN(num) (4+1*(num))
  4729. /* in bytes */
  4730. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATALEN_OFST 0
  4731. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_OFST 4
  4732. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_LEN 1
  4733. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_MINNUM 1
  4734. #define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_MAXNUM 248
  4735. /* MC_CMD_MUM_OUT_QSFP_FILL_STATS msgresponse */
  4736. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_LEN 8
  4737. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PMA_PMD_LINK_UP_OFST 0
  4738. #define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PCS_LINK_UP_OFST 4
  4739. /* MC_CMD_MUM_OUT_QSFP_POLL_BIST msgresponse */
  4740. #define MC_CMD_MUM_OUT_QSFP_POLL_BIST_LEN 4
  4741. #define MC_CMD_MUM_OUT_QSFP_POLL_BIST_TEST_OFST 0
  4742. /* MC_CMD_MUM_OUT_READ_DDR_INFO msgresponse */
  4743. #define MC_CMD_MUM_OUT_READ_DDR_INFO_LENMIN 24
  4744. #define MC_CMD_MUM_OUT_READ_DDR_INFO_LENMAX 248
  4745. #define MC_CMD_MUM_OUT_READ_DDR_INFO_LEN(num) (8+8*(num))
  4746. /* Discrete (soldered) DDR resistor strap info */
  4747. #define MC_CMD_MUM_OUT_READ_DDR_INFO_DISCRETE_DDR_INFO_OFST 0
  4748. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VRATIO_LBN 0
  4749. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VRATIO_WIDTH 16
  4750. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED1_LBN 16
  4751. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED1_WIDTH 16
  4752. /* Number of SODIMM info records */
  4753. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_RECORDS_OFST 4
  4754. /* Array of SODIMM info records */
  4755. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_OFST 8
  4756. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_LEN 8
  4757. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_LO_OFST 8
  4758. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_HI_OFST 12
  4759. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_MINNUM 2
  4760. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_MAXNUM 30
  4761. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK_ID_LBN 0
  4762. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK_ID_WIDTH 8
  4763. /* enum: SODIMM bank 1 (Top SODIMM for Sorrento) */
  4764. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK1 0x0
  4765. /* enum: SODIMM bank 2 (Bottom SODDIMM for Sorrento) */
  4766. #define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK2 0x1
  4767. /* enum: Total number of SODIMM banks */
  4768. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_BANKS 0x2
  4769. #define MC_CMD_MUM_OUT_READ_DDR_INFO_TYPE_LBN 8
  4770. #define MC_CMD_MUM_OUT_READ_DDR_INFO_TYPE_WIDTH 8
  4771. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RANK_LBN 16
  4772. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RANK_WIDTH 4
  4773. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VOLTAGE_LBN 20
  4774. #define MC_CMD_MUM_OUT_READ_DDR_INFO_VOLTAGE_WIDTH 4
  4775. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NOT_POWERED 0x0 /* enum */
  4776. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V25 0x1 /* enum */
  4777. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V35 0x2 /* enum */
  4778. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V5 0x3 /* enum */
  4779. /* enum: Values 5-15 are reserved for future usage */
  4780. #define MC_CMD_MUM_OUT_READ_DDR_INFO_1V8 0x4
  4781. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SIZE_LBN 24
  4782. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SIZE_WIDTH 8
  4783. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SPEED_LBN 32
  4784. #define MC_CMD_MUM_OUT_READ_DDR_INFO_SPEED_WIDTH 16
  4785. #define MC_CMD_MUM_OUT_READ_DDR_INFO_STATE_LBN 48
  4786. #define MC_CMD_MUM_OUT_READ_DDR_INFO_STATE_WIDTH 4
  4787. /* enum: No module present */
  4788. #define MC_CMD_MUM_OUT_READ_DDR_INFO_ABSENT 0x0
  4789. /* enum: Module present supported and powered on */
  4790. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_POWERED 0x1
  4791. /* enum: Module present but bad type */
  4792. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_TYPE 0x2
  4793. /* enum: Module present but incompatible voltage */
  4794. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_VOLTAGE 0x3
  4795. /* enum: Module present but unknown SPD */
  4796. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_SPD 0x4
  4797. /* enum: Module present but slot cannot support it */
  4798. #define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_SLOT 0x5
  4799. /* enum: Modules may or may not be present, but cannot establish contact by I2C
  4800. */
  4801. #define MC_CMD_MUM_OUT_READ_DDR_INFO_NOT_REACHABLE 0x6
  4802. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED2_LBN 52
  4803. #define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED2_WIDTH 12
  4804. /* MC_CMD_RESOURCE_SPECIFIER enum */
  4805. /* enum: Any */
  4806. #define MC_CMD_RESOURCE_INSTANCE_ANY 0xffffffff
  4807. /* enum: None */
  4808. #define MC_CMD_RESOURCE_INSTANCE_NONE 0xfffffffe
  4809. /* EVB_PORT_ID structuredef */
  4810. #define EVB_PORT_ID_LEN 4
  4811. #define EVB_PORT_ID_PORT_ID_OFST 0
  4812. /* enum: An invalid port handle. */
  4813. #define EVB_PORT_ID_NULL 0x0
  4814. /* enum: The port assigned to this function.. */
  4815. #define EVB_PORT_ID_ASSIGNED 0x1000000
  4816. /* enum: External network port 0 */
  4817. #define EVB_PORT_ID_MAC0 0x2000000
  4818. /* enum: External network port 1 */
  4819. #define EVB_PORT_ID_MAC1 0x2000001
  4820. /* enum: External network port 2 */
  4821. #define EVB_PORT_ID_MAC2 0x2000002
  4822. /* enum: External network port 3 */
  4823. #define EVB_PORT_ID_MAC3 0x2000003
  4824. #define EVB_PORT_ID_PORT_ID_LBN 0
  4825. #define EVB_PORT_ID_PORT_ID_WIDTH 32
  4826. /* EVB_VLAN_TAG structuredef */
  4827. #define EVB_VLAN_TAG_LEN 2
  4828. /* The VLAN tag value */
  4829. #define EVB_VLAN_TAG_VLAN_ID_LBN 0
  4830. #define EVB_VLAN_TAG_VLAN_ID_WIDTH 12
  4831. #define EVB_VLAN_TAG_MODE_LBN 12
  4832. #define EVB_VLAN_TAG_MODE_WIDTH 4
  4833. /* enum: Insert the VLAN. */
  4834. #define EVB_VLAN_TAG_INSERT 0x0
  4835. /* enum: Replace the VLAN if already present. */
  4836. #define EVB_VLAN_TAG_REPLACE 0x1
  4837. /* BUFTBL_ENTRY structuredef */
  4838. #define BUFTBL_ENTRY_LEN 12
  4839. /* the owner ID */
  4840. #define BUFTBL_ENTRY_OID_OFST 0
  4841. #define BUFTBL_ENTRY_OID_LEN 2
  4842. #define BUFTBL_ENTRY_OID_LBN 0
  4843. #define BUFTBL_ENTRY_OID_WIDTH 16
  4844. /* the page parameter as one of ESE_DZ_SMC_PAGE_SIZE_ */
  4845. #define BUFTBL_ENTRY_PGSZ_OFST 2
  4846. #define BUFTBL_ENTRY_PGSZ_LEN 2
  4847. #define BUFTBL_ENTRY_PGSZ_LBN 16
  4848. #define BUFTBL_ENTRY_PGSZ_WIDTH 16
  4849. /* the raw 64-bit address field from the SMC, not adjusted for page size */
  4850. #define BUFTBL_ENTRY_RAWADDR_OFST 4
  4851. #define BUFTBL_ENTRY_RAWADDR_LEN 8
  4852. #define BUFTBL_ENTRY_RAWADDR_LO_OFST 4
  4853. #define BUFTBL_ENTRY_RAWADDR_HI_OFST 8
  4854. #define BUFTBL_ENTRY_RAWADDR_LBN 32
  4855. #define BUFTBL_ENTRY_RAWADDR_WIDTH 64
  4856. /* NVRAM_PARTITION_TYPE structuredef */
  4857. #define NVRAM_PARTITION_TYPE_LEN 2
  4858. #define NVRAM_PARTITION_TYPE_ID_OFST 0
  4859. #define NVRAM_PARTITION_TYPE_ID_LEN 2
  4860. /* enum: Primary MC firmware partition */
  4861. #define NVRAM_PARTITION_TYPE_MC_FIRMWARE 0x100
  4862. /* enum: Secondary MC firmware partition */
  4863. #define NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP 0x200
  4864. /* enum: Expansion ROM partition */
  4865. #define NVRAM_PARTITION_TYPE_EXPANSION_ROM 0x300
  4866. /* enum: Static configuration TLV partition */
  4867. #define NVRAM_PARTITION_TYPE_STATIC_CONFIG 0x400
  4868. /* enum: Dynamic configuration TLV partition */
  4869. #define NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG 0x500
  4870. /* enum: Expansion ROM configuration data for port 0 */
  4871. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0 0x600
  4872. /* enum: Synonym for EXPROM_CONFIG_PORT0 as used in pmap files */
  4873. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG 0x600
  4874. /* enum: Expansion ROM configuration data for port 1 */
  4875. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1 0x601
  4876. /* enum: Expansion ROM configuration data for port 2 */
  4877. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2 0x602
  4878. /* enum: Expansion ROM configuration data for port 3 */
  4879. #define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3 0x603
  4880. /* enum: Non-volatile log output partition */
  4881. #define NVRAM_PARTITION_TYPE_LOG 0x700
  4882. /* enum: Non-volatile log output of second core on dual-core device */
  4883. #define NVRAM_PARTITION_TYPE_LOG_SLAVE 0x701
  4884. /* enum: Device state dump output partition */
  4885. #define NVRAM_PARTITION_TYPE_DUMP 0x800
  4886. /* enum: Application license key storage partition */
  4887. #define NVRAM_PARTITION_TYPE_LICENSE 0x900
  4888. /* enum: Start of range used for PHY partitions (low 8 bits are the PHY ID) */
  4889. #define NVRAM_PARTITION_TYPE_PHY_MIN 0xa00
  4890. /* enum: End of range used for PHY partitions (low 8 bits are the PHY ID) */
  4891. #define NVRAM_PARTITION_TYPE_PHY_MAX 0xaff
  4892. /* enum: Primary FPGA partition */
  4893. #define NVRAM_PARTITION_TYPE_FPGA 0xb00
  4894. /* enum: Secondary FPGA partition */
  4895. #define NVRAM_PARTITION_TYPE_FPGA_BACKUP 0xb01
  4896. /* enum: FC firmware partition */
  4897. #define NVRAM_PARTITION_TYPE_FC_FIRMWARE 0xb02
  4898. /* enum: FC License partition */
  4899. #define NVRAM_PARTITION_TYPE_FC_LICENSE 0xb03
  4900. /* enum: Non-volatile log output partition for FC */
  4901. #define NVRAM_PARTITION_TYPE_FC_LOG 0xb04
  4902. /* enum: MUM firmware partition */
  4903. #define NVRAM_PARTITION_TYPE_MUM_FIRMWARE 0xc00
  4904. /* enum: MUM Non-volatile log output partition. */
  4905. #define NVRAM_PARTITION_TYPE_MUM_LOG 0xc01
  4906. /* enum: MUM Application table partition. */
  4907. #define NVRAM_PARTITION_TYPE_MUM_APPTABLE 0xc02
  4908. /* enum: MUM boot rom partition. */
  4909. #define NVRAM_PARTITION_TYPE_MUM_BOOT_ROM 0xc03
  4910. /* enum: MUM production signatures & calibration rom partition. */
  4911. #define NVRAM_PARTITION_TYPE_MUM_PROD_ROM 0xc04
  4912. /* enum: MUM user signatures & calibration rom partition. */
  4913. #define NVRAM_PARTITION_TYPE_MUM_USER_ROM 0xc05
  4914. /* enum: MUM fuses and lockbits partition. */
  4915. #define NVRAM_PARTITION_TYPE_MUM_FUSELOCK 0xc06
  4916. /* enum: UEFI expansion ROM if separate from PXE */
  4917. #define NVRAM_PARTITION_TYPE_EXPANSION_UEFI 0xd00
  4918. /* enum: Spare partition 0 */
  4919. #define NVRAM_PARTITION_TYPE_SPARE_0 0x1000
  4920. /* enum: Used for XIP code of shmbooted images */
  4921. #define NVRAM_PARTITION_TYPE_XIP_SCRATCH 0x1100
  4922. /* enum: Spare partition 2 */
  4923. #define NVRAM_PARTITION_TYPE_SPARE_2 0x1200
  4924. /* enum: Manufacturing partition. Used during manufacture to pass information
  4925. * between XJTAG and Manftest.
  4926. */
  4927. #define NVRAM_PARTITION_TYPE_MANUFACTURING 0x1300
  4928. /* enum: Spare partition 4 */
  4929. #define NVRAM_PARTITION_TYPE_SPARE_4 0x1400
  4930. /* enum: Spare partition 5 */
  4931. #define NVRAM_PARTITION_TYPE_SPARE_5 0x1500
  4932. /* enum: Start of reserved value range (firmware may use for any purpose) */
  4933. #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MIN 0xff00
  4934. /* enum: End of reserved value range (firmware may use for any purpose) */
  4935. #define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MAX 0xfffd
  4936. /* enum: Recovery partition map (provided if real map is missing or corrupt) */
  4937. #define NVRAM_PARTITION_TYPE_RECOVERY_MAP 0xfffe
  4938. /* enum: Partition map (real map as stored in flash) */
  4939. #define NVRAM_PARTITION_TYPE_PARTITION_MAP 0xffff
  4940. #define NVRAM_PARTITION_TYPE_ID_LBN 0
  4941. #define NVRAM_PARTITION_TYPE_ID_WIDTH 16
  4942. /* LICENSED_APP_ID structuredef */
  4943. #define LICENSED_APP_ID_LEN 4
  4944. #define LICENSED_APP_ID_ID_OFST 0
  4945. /* enum: OpenOnload */
  4946. #define LICENSED_APP_ID_ONLOAD 0x1
  4947. /* enum: PTP timestamping */
  4948. #define LICENSED_APP_ID_PTP 0x2
  4949. /* enum: SolarCapture Pro */
  4950. #define LICENSED_APP_ID_SOLARCAPTURE_PRO 0x4
  4951. /* enum: SolarSecure filter engine */
  4952. #define LICENSED_APP_ID_SOLARSECURE 0x8
  4953. /* enum: Performance monitor */
  4954. #define LICENSED_APP_ID_PERF_MONITOR 0x10
  4955. /* enum: SolarCapture Live */
  4956. #define LICENSED_APP_ID_SOLARCAPTURE_LIVE 0x20
  4957. /* enum: Capture SolarSystem */
  4958. #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM 0x40
  4959. /* enum: Network Access Control */
  4960. #define LICENSED_APP_ID_NETWORK_ACCESS_CONTROL 0x80
  4961. /* enum: TCP Direct */
  4962. #define LICENSED_APP_ID_TCP_DIRECT 0x100
  4963. /* enum: Low Latency */
  4964. #define LICENSED_APP_ID_LOW_LATENCY 0x200
  4965. /* enum: SolarCapture Tap */
  4966. #define LICENSED_APP_ID_SOLARCAPTURE_TAP 0x400
  4967. /* enum: Capture SolarSystem 40G */
  4968. #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM_40G 0x800
  4969. #define LICENSED_APP_ID_ID_LBN 0
  4970. #define LICENSED_APP_ID_ID_WIDTH 32
  4971. /* LICENSED_FEATURES structuredef */
  4972. #define LICENSED_FEATURES_LEN 8
  4973. /* Bitmask of licensed firmware features */
  4974. #define LICENSED_FEATURES_MASK_OFST 0
  4975. #define LICENSED_FEATURES_MASK_LEN 8
  4976. #define LICENSED_FEATURES_MASK_LO_OFST 0
  4977. #define LICENSED_FEATURES_MASK_HI_OFST 4
  4978. #define LICENSED_FEATURES_RX_CUT_THROUGH_LBN 0
  4979. #define LICENSED_FEATURES_RX_CUT_THROUGH_WIDTH 1
  4980. #define LICENSED_FEATURES_PIO_LBN 1
  4981. #define LICENSED_FEATURES_PIO_WIDTH 1
  4982. #define LICENSED_FEATURES_EVQ_TIMER_LBN 2
  4983. #define LICENSED_FEATURES_EVQ_TIMER_WIDTH 1
  4984. #define LICENSED_FEATURES_CLOCK_LBN 3
  4985. #define LICENSED_FEATURES_CLOCK_WIDTH 1
  4986. #define LICENSED_FEATURES_RX_TIMESTAMPS_LBN 4
  4987. #define LICENSED_FEATURES_RX_TIMESTAMPS_WIDTH 1
  4988. #define LICENSED_FEATURES_TX_TIMESTAMPS_LBN 5
  4989. #define LICENSED_FEATURES_TX_TIMESTAMPS_WIDTH 1
  4990. #define LICENSED_FEATURES_RX_SNIFF_LBN 6
  4991. #define LICENSED_FEATURES_RX_SNIFF_WIDTH 1
  4992. #define LICENSED_FEATURES_TX_SNIFF_LBN 7
  4993. #define LICENSED_FEATURES_TX_SNIFF_WIDTH 1
  4994. #define LICENSED_FEATURES_PROXY_FILTER_OPS_LBN 8
  4995. #define LICENSED_FEATURES_PROXY_FILTER_OPS_WIDTH 1
  4996. #define LICENSED_FEATURES_EVENT_CUT_THROUGH_LBN 9
  4997. #define LICENSED_FEATURES_EVENT_CUT_THROUGH_WIDTH 1
  4998. #define LICENSED_FEATURES_MASK_LBN 0
  4999. #define LICENSED_FEATURES_MASK_WIDTH 64
  5000. /* LICENSED_V3_APPS structuredef */
  5001. #define LICENSED_V3_APPS_LEN 8
  5002. /* Bitmask of licensed applications */
  5003. #define LICENSED_V3_APPS_MASK_OFST 0
  5004. #define LICENSED_V3_APPS_MASK_LEN 8
  5005. #define LICENSED_V3_APPS_MASK_LO_OFST 0
  5006. #define LICENSED_V3_APPS_MASK_HI_OFST 4
  5007. #define LICENSED_V3_APPS_ONLOAD_LBN 0
  5008. #define LICENSED_V3_APPS_ONLOAD_WIDTH 1
  5009. #define LICENSED_V3_APPS_PTP_LBN 1
  5010. #define LICENSED_V3_APPS_PTP_WIDTH 1
  5011. #define LICENSED_V3_APPS_SOLARCAPTURE_PRO_LBN 2
  5012. #define LICENSED_V3_APPS_SOLARCAPTURE_PRO_WIDTH 1
  5013. #define LICENSED_V3_APPS_SOLARSECURE_LBN 3
  5014. #define LICENSED_V3_APPS_SOLARSECURE_WIDTH 1
  5015. #define LICENSED_V3_APPS_PERF_MONITOR_LBN 4
  5016. #define LICENSED_V3_APPS_PERF_MONITOR_WIDTH 1
  5017. #define LICENSED_V3_APPS_SOLARCAPTURE_LIVE_LBN 5
  5018. #define LICENSED_V3_APPS_SOLARCAPTURE_LIVE_WIDTH 1
  5019. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_LBN 6
  5020. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_WIDTH 1
  5021. #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_LBN 7
  5022. #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_WIDTH 1
  5023. #define LICENSED_V3_APPS_TCP_DIRECT_LBN 8
  5024. #define LICENSED_V3_APPS_TCP_DIRECT_WIDTH 1
  5025. #define LICENSED_V3_APPS_LOW_LATENCY_LBN 9
  5026. #define LICENSED_V3_APPS_LOW_LATENCY_WIDTH 1
  5027. #define LICENSED_V3_APPS_SOLARCAPTURE_TAP_LBN 10
  5028. #define LICENSED_V3_APPS_SOLARCAPTURE_TAP_WIDTH 1
  5029. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_LBN 11
  5030. #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_40G_WIDTH 1
  5031. #define LICENSED_V3_APPS_MASK_LBN 0
  5032. #define LICENSED_V3_APPS_MASK_WIDTH 64
  5033. /* LICENSED_V3_FEATURES structuredef */
  5034. #define LICENSED_V3_FEATURES_LEN 8
  5035. /* Bitmask of licensed firmware features */
  5036. #define LICENSED_V3_FEATURES_MASK_OFST 0
  5037. #define LICENSED_V3_FEATURES_MASK_LEN 8
  5038. #define LICENSED_V3_FEATURES_MASK_LO_OFST 0
  5039. #define LICENSED_V3_FEATURES_MASK_HI_OFST 4
  5040. #define LICENSED_V3_FEATURES_RX_CUT_THROUGH_LBN 0
  5041. #define LICENSED_V3_FEATURES_RX_CUT_THROUGH_WIDTH 1
  5042. #define LICENSED_V3_FEATURES_PIO_LBN 1
  5043. #define LICENSED_V3_FEATURES_PIO_WIDTH 1
  5044. #define LICENSED_V3_FEATURES_EVQ_TIMER_LBN 2
  5045. #define LICENSED_V3_FEATURES_EVQ_TIMER_WIDTH 1
  5046. #define LICENSED_V3_FEATURES_CLOCK_LBN 3
  5047. #define LICENSED_V3_FEATURES_CLOCK_WIDTH 1
  5048. #define LICENSED_V3_FEATURES_RX_TIMESTAMPS_LBN 4
  5049. #define LICENSED_V3_FEATURES_RX_TIMESTAMPS_WIDTH 1
  5050. #define LICENSED_V3_FEATURES_TX_TIMESTAMPS_LBN 5
  5051. #define LICENSED_V3_FEATURES_TX_TIMESTAMPS_WIDTH 1
  5052. #define LICENSED_V3_FEATURES_RX_SNIFF_LBN 6
  5053. #define LICENSED_V3_FEATURES_RX_SNIFF_WIDTH 1
  5054. #define LICENSED_V3_FEATURES_TX_SNIFF_LBN 7
  5055. #define LICENSED_V3_FEATURES_TX_SNIFF_WIDTH 1
  5056. #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_LBN 8
  5057. #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_WIDTH 1
  5058. #define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_LBN 9
  5059. #define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_WIDTH 1
  5060. #define LICENSED_V3_FEATURES_MASK_LBN 0
  5061. #define LICENSED_V3_FEATURES_MASK_WIDTH 64
  5062. /* TX_TIMESTAMP_EVENT structuredef */
  5063. #define TX_TIMESTAMP_EVENT_LEN 6
  5064. /* lower 16 bits of timestamp data */
  5065. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_OFST 0
  5066. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_LEN 2
  5067. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_LBN 0
  5068. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_WIDTH 16
  5069. /* Type of TX event, ordinary TX completion, low or high part of TX timestamp
  5070. */
  5071. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_OFST 3
  5072. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LEN 1
  5073. /* enum: This is a TX completion event, not a timestamp */
  5074. #define TX_TIMESTAMP_EVENT_TX_EV_COMPLETION 0x0
  5075. /* enum: This is the low part of a TX timestamp event */
  5076. #define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_LO 0x51
  5077. /* enum: This is the high part of a TX timestamp event */
  5078. #define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_HI 0x52
  5079. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LBN 24
  5080. #define TX_TIMESTAMP_EVENT_TX_EV_TYPE_WIDTH 8
  5081. /* upper 16 bits of timestamp data */
  5082. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_OFST 4
  5083. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_LEN 2
  5084. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_LBN 32
  5085. #define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_WIDTH 16
  5086. /* RSS_MODE structuredef */
  5087. #define RSS_MODE_LEN 1
  5088. /* The RSS mode for a particular packet type is a value from 0 - 15 which can
  5089. * be considered as 4 bits selecting which fields are included in the hash. (A
  5090. * value 0 effectively disables RSS spreading for the packet type.) The YAML
  5091. * generation tools require this structure to be a whole number of bytes wide,
  5092. * but only 4 bits are relevant.
  5093. */
  5094. #define RSS_MODE_HASH_SELECTOR_OFST 0
  5095. #define RSS_MODE_HASH_SELECTOR_LEN 1
  5096. #define RSS_MODE_HASH_SRC_ADDR_LBN 0
  5097. #define RSS_MODE_HASH_SRC_ADDR_WIDTH 1
  5098. #define RSS_MODE_HASH_DST_ADDR_LBN 1
  5099. #define RSS_MODE_HASH_DST_ADDR_WIDTH 1
  5100. #define RSS_MODE_HASH_SRC_PORT_LBN 2
  5101. #define RSS_MODE_HASH_SRC_PORT_WIDTH 1
  5102. #define RSS_MODE_HASH_DST_PORT_LBN 3
  5103. #define RSS_MODE_HASH_DST_PORT_WIDTH 1
  5104. #define RSS_MODE_HASH_SELECTOR_LBN 0
  5105. #define RSS_MODE_HASH_SELECTOR_WIDTH 8
  5106. /***********************************/
  5107. /* MC_CMD_READ_REGS
  5108. * Get a dump of the MCPU registers
  5109. */
  5110. #define MC_CMD_READ_REGS 0x50
  5111. #define MC_CMD_0x50_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5112. /* MC_CMD_READ_REGS_IN msgrequest */
  5113. #define MC_CMD_READ_REGS_IN_LEN 0
  5114. /* MC_CMD_READ_REGS_OUT msgresponse */
  5115. #define MC_CMD_READ_REGS_OUT_LEN 308
  5116. /* Whether the corresponding register entry contains a valid value */
  5117. #define MC_CMD_READ_REGS_OUT_MASK_OFST 0
  5118. #define MC_CMD_READ_REGS_OUT_MASK_LEN 16
  5119. /* Same order as MIPS GDB (r0-r31, sr, lo, hi, bad, cause, 32 x float, fsr,
  5120. * fir, fp)
  5121. */
  5122. #define MC_CMD_READ_REGS_OUT_REGS_OFST 16
  5123. #define MC_CMD_READ_REGS_OUT_REGS_LEN 4
  5124. #define MC_CMD_READ_REGS_OUT_REGS_NUM 73
  5125. /***********************************/
  5126. /* MC_CMD_INIT_EVQ
  5127. * Set up an event queue according to the supplied parameters. The IN arguments
  5128. * end with an address for each 4k of host memory required to back the EVQ.
  5129. */
  5130. #define MC_CMD_INIT_EVQ 0x80
  5131. #define MC_CMD_0x80_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5132. /* MC_CMD_INIT_EVQ_IN msgrequest */
  5133. #define MC_CMD_INIT_EVQ_IN_LENMIN 44
  5134. #define MC_CMD_INIT_EVQ_IN_LENMAX 548
  5135. #define MC_CMD_INIT_EVQ_IN_LEN(num) (36+8*(num))
  5136. /* Size, in entries */
  5137. #define MC_CMD_INIT_EVQ_IN_SIZE_OFST 0
  5138. /* Desired instance. Must be set to a specific instance, which is a function
  5139. * local queue index.
  5140. */
  5141. #define MC_CMD_INIT_EVQ_IN_INSTANCE_OFST 4
  5142. /* The initial timer value. The load value is ignored if the timer mode is DIS.
  5143. */
  5144. #define MC_CMD_INIT_EVQ_IN_TMR_LOAD_OFST 8
  5145. /* The reload value is ignored in one-shot modes */
  5146. #define MC_CMD_INIT_EVQ_IN_TMR_RELOAD_OFST 12
  5147. /* tbd */
  5148. #define MC_CMD_INIT_EVQ_IN_FLAGS_OFST 16
  5149. #define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_LBN 0
  5150. #define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_WIDTH 1
  5151. #define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_LBN 1
  5152. #define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_WIDTH 1
  5153. #define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_LBN 2
  5154. #define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_WIDTH 1
  5155. #define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_LBN 3
  5156. #define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_WIDTH 1
  5157. #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_LBN 4
  5158. #define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_WIDTH 1
  5159. #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_LBN 5
  5160. #define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_WIDTH 1
  5161. #define MC_CMD_INIT_EVQ_IN_FLAG_USE_TIMER_LBN 6
  5162. #define MC_CMD_INIT_EVQ_IN_FLAG_USE_TIMER_WIDTH 1
  5163. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_OFST 20
  5164. /* enum: Disabled */
  5165. #define MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS 0x0
  5166. /* enum: Immediate */
  5167. #define MC_CMD_INIT_EVQ_IN_TMR_IMMED_START 0x1
  5168. /* enum: Triggered */
  5169. #define MC_CMD_INIT_EVQ_IN_TMR_TRIG_START 0x2
  5170. /* enum: Hold-off */
  5171. #define MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF 0x3
  5172. /* Target EVQ for wakeups if in wakeup mode. */
  5173. #define MC_CMD_INIT_EVQ_IN_TARGET_EVQ_OFST 24
  5174. /* Target interrupt if in interrupting mode (note union with target EVQ). Use
  5175. * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test
  5176. * purposes.
  5177. */
  5178. #define MC_CMD_INIT_EVQ_IN_IRQ_NUM_OFST 24
  5179. /* Event Counter Mode. */
  5180. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_OFST 28
  5181. /* enum: Disabled */
  5182. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS 0x0
  5183. /* enum: Disabled */
  5184. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RX 0x1
  5185. /* enum: Disabled */
  5186. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_TX 0x2
  5187. /* enum: Disabled */
  5188. #define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RXTX 0x3
  5189. /* Event queue packet count threshold. */
  5190. #define MC_CMD_INIT_EVQ_IN_COUNT_THRSHLD_OFST 32
  5191. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  5192. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_OFST 36
  5193. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LEN 8
  5194. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LO_OFST 36
  5195. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_HI_OFST 40
  5196. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MINNUM 1
  5197. #define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MAXNUM 64
  5198. /* MC_CMD_INIT_EVQ_OUT msgresponse */
  5199. #define MC_CMD_INIT_EVQ_OUT_LEN 4
  5200. /* Only valid if INTRFLAG was true */
  5201. #define MC_CMD_INIT_EVQ_OUT_IRQ_OFST 0
  5202. /* MC_CMD_INIT_EVQ_V2_IN msgrequest */
  5203. #define MC_CMD_INIT_EVQ_V2_IN_LENMIN 44
  5204. #define MC_CMD_INIT_EVQ_V2_IN_LENMAX 548
  5205. #define MC_CMD_INIT_EVQ_V2_IN_LEN(num) (36+8*(num))
  5206. /* Size, in entries */
  5207. #define MC_CMD_INIT_EVQ_V2_IN_SIZE_OFST 0
  5208. /* Desired instance. Must be set to a specific instance, which is a function
  5209. * local queue index.
  5210. */
  5211. #define MC_CMD_INIT_EVQ_V2_IN_INSTANCE_OFST 4
  5212. /* The initial timer value. The load value is ignored if the timer mode is DIS.
  5213. */
  5214. #define MC_CMD_INIT_EVQ_V2_IN_TMR_LOAD_OFST 8
  5215. /* The reload value is ignored in one-shot modes */
  5216. #define MC_CMD_INIT_EVQ_V2_IN_TMR_RELOAD_OFST 12
  5217. /* tbd */
  5218. #define MC_CMD_INIT_EVQ_V2_IN_FLAGS_OFST 16
  5219. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_LBN 0
  5220. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_WIDTH 1
  5221. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_LBN 1
  5222. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_WIDTH 1
  5223. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_LBN 2
  5224. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_WIDTH 1
  5225. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_LBN 3
  5226. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_WIDTH 1
  5227. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_LBN 4
  5228. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_WIDTH 1
  5229. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_LBN 5
  5230. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_WIDTH 1
  5231. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_LBN 6
  5232. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_WIDTH 1
  5233. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LBN 7
  5234. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_WIDTH 4
  5235. /* enum: All initialisation flags specified by host. */
  5236. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_MANUAL 0x0
  5237. /* enum: MEDFORD only. Certain initialisation flags specified by host may be
  5238. * over-ridden by firmware based on licenses and firmware variant in order to
  5239. * provide the lowest latency achievable. See
  5240. * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags.
  5241. */
  5242. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY 0x1
  5243. /* enum: MEDFORD only. Certain initialisation flags specified by host may be
  5244. * over-ridden by firmware based on licenses and firmware variant in order to
  5245. * provide the best throughput achievable. See
  5246. * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags.
  5247. */
  5248. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT 0x2
  5249. /* enum: MEDFORD only. Certain initialisation flags may be over-ridden by
  5250. * firmware based on licenses and firmware variant. See
  5251. * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags.
  5252. */
  5253. #define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO 0x3
  5254. #define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_OFST 20
  5255. /* enum: Disabled */
  5256. #define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_DIS 0x0
  5257. /* enum: Immediate */
  5258. #define MC_CMD_INIT_EVQ_V2_IN_TMR_IMMED_START 0x1
  5259. /* enum: Triggered */
  5260. #define MC_CMD_INIT_EVQ_V2_IN_TMR_TRIG_START 0x2
  5261. /* enum: Hold-off */
  5262. #define MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF 0x3
  5263. /* Target EVQ for wakeups if in wakeup mode. */
  5264. #define MC_CMD_INIT_EVQ_V2_IN_TARGET_EVQ_OFST 24
  5265. /* Target interrupt if in interrupting mode (note union with target EVQ). Use
  5266. * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test
  5267. * purposes.
  5268. */
  5269. #define MC_CMD_INIT_EVQ_V2_IN_IRQ_NUM_OFST 24
  5270. /* Event Counter Mode. */
  5271. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_OFST 28
  5272. /* enum: Disabled */
  5273. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_DIS 0x0
  5274. /* enum: Disabled */
  5275. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RX 0x1
  5276. /* enum: Disabled */
  5277. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_TX 0x2
  5278. /* enum: Disabled */
  5279. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RXTX 0x3
  5280. /* Event queue packet count threshold. */
  5281. #define MC_CMD_INIT_EVQ_V2_IN_COUNT_THRSHLD_OFST 32
  5282. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  5283. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_OFST 36
  5284. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LEN 8
  5285. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LO_OFST 36
  5286. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_HI_OFST 40
  5287. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MINNUM 1
  5288. #define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MAXNUM 64
  5289. /* MC_CMD_INIT_EVQ_V2_OUT msgresponse */
  5290. #define MC_CMD_INIT_EVQ_V2_OUT_LEN 8
  5291. /* Only valid if INTRFLAG was true */
  5292. #define MC_CMD_INIT_EVQ_V2_OUT_IRQ_OFST 0
  5293. /* Actual configuration applied on the card */
  5294. #define MC_CMD_INIT_EVQ_V2_OUT_FLAGS_OFST 4
  5295. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_LBN 0
  5296. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_WIDTH 1
  5297. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_LBN 1
  5298. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_WIDTH 1
  5299. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_LBN 2
  5300. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_WIDTH 1
  5301. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_LBN 3
  5302. #define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_WIDTH 1
  5303. /* QUEUE_CRC_MODE structuredef */
  5304. #define QUEUE_CRC_MODE_LEN 1
  5305. #define QUEUE_CRC_MODE_MODE_LBN 0
  5306. #define QUEUE_CRC_MODE_MODE_WIDTH 4
  5307. /* enum: No CRC. */
  5308. #define QUEUE_CRC_MODE_NONE 0x0
  5309. /* enum: CRC Fiber channel over ethernet. */
  5310. #define QUEUE_CRC_MODE_FCOE 0x1
  5311. /* enum: CRC (digest) iSCSI header only. */
  5312. #define QUEUE_CRC_MODE_ISCSI_HDR 0x2
  5313. /* enum: CRC (digest) iSCSI header and payload. */
  5314. #define QUEUE_CRC_MODE_ISCSI 0x3
  5315. /* enum: CRC Fiber channel over IP over ethernet. */
  5316. #define QUEUE_CRC_MODE_FCOIPOE 0x4
  5317. /* enum: CRC MPA. */
  5318. #define QUEUE_CRC_MODE_MPA 0x5
  5319. #define QUEUE_CRC_MODE_SPARE_LBN 4
  5320. #define QUEUE_CRC_MODE_SPARE_WIDTH 4
  5321. /***********************************/
  5322. /* MC_CMD_INIT_RXQ
  5323. * set up a receive queue according to the supplied parameters. The IN
  5324. * arguments end with an address for each 4k of host memory required to back
  5325. * the RXQ.
  5326. */
  5327. #define MC_CMD_INIT_RXQ 0x81
  5328. #define MC_CMD_0x81_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5329. /* MC_CMD_INIT_RXQ_IN msgrequest: Legacy RXQ_INIT request. Use extended version
  5330. * in new code.
  5331. */
  5332. #define MC_CMD_INIT_RXQ_IN_LENMIN 36
  5333. #define MC_CMD_INIT_RXQ_IN_LENMAX 252
  5334. #define MC_CMD_INIT_RXQ_IN_LEN(num) (28+8*(num))
  5335. /* Size, in entries */
  5336. #define MC_CMD_INIT_RXQ_IN_SIZE_OFST 0
  5337. /* The EVQ to send events to. This is an index originally specified to INIT_EVQ
  5338. */
  5339. #define MC_CMD_INIT_RXQ_IN_TARGET_EVQ_OFST 4
  5340. /* The value to put in the event data. Check hardware spec. for valid range. */
  5341. #define MC_CMD_INIT_RXQ_IN_LABEL_OFST 8
  5342. /* Desired instance. Must be set to a specific instance, which is a function
  5343. * local queue index.
  5344. */
  5345. #define MC_CMD_INIT_RXQ_IN_INSTANCE_OFST 12
  5346. /* There will be more flags here. */
  5347. #define MC_CMD_INIT_RXQ_IN_FLAGS_OFST 16
  5348. #define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_LBN 0
  5349. #define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_WIDTH 1
  5350. #define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_LBN 1
  5351. #define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_WIDTH 1
  5352. #define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_LBN 2
  5353. #define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_WIDTH 1
  5354. #define MC_CMD_INIT_RXQ_IN_CRC_MODE_LBN 3
  5355. #define MC_CMD_INIT_RXQ_IN_CRC_MODE_WIDTH 4
  5356. #define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_LBN 7
  5357. #define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_WIDTH 1
  5358. #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_LBN 8
  5359. #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1
  5360. #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9
  5361. #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1
  5362. #define MC_CMD_INIT_RXQ_IN_UNUSED_LBN 10
  5363. #define MC_CMD_INIT_RXQ_IN_UNUSED_WIDTH 1
  5364. /* Owner ID to use if in buffer mode (zero if physical) */
  5365. #define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20
  5366. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  5367. #define MC_CMD_INIT_RXQ_IN_PORT_ID_OFST 24
  5368. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  5369. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_OFST 28
  5370. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LEN 8
  5371. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LO_OFST 28
  5372. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_HI_OFST 32
  5373. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MINNUM 1
  5374. #define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MAXNUM 28
  5375. /* MC_CMD_INIT_RXQ_EXT_IN msgrequest: Extended RXQ_INIT with additional mode
  5376. * flags
  5377. */
  5378. #define MC_CMD_INIT_RXQ_EXT_IN_LEN 544
  5379. /* Size, in entries */
  5380. #define MC_CMD_INIT_RXQ_EXT_IN_SIZE_OFST 0
  5381. /* The EVQ to send events to. This is an index originally specified to INIT_EVQ
  5382. */
  5383. #define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_OFST 4
  5384. /* The value to put in the event data. Check hardware spec. for valid range. */
  5385. #define MC_CMD_INIT_RXQ_EXT_IN_LABEL_OFST 8
  5386. /* Desired instance. Must be set to a specific instance, which is a function
  5387. * local queue index.
  5388. */
  5389. #define MC_CMD_INIT_RXQ_EXT_IN_INSTANCE_OFST 12
  5390. /* There will be more flags here. */
  5391. #define MC_CMD_INIT_RXQ_EXT_IN_FLAGS_OFST 16
  5392. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_BUFF_MODE_LBN 0
  5393. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_BUFF_MODE_WIDTH 1
  5394. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT_LBN 1
  5395. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT_WIDTH 1
  5396. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_TIMESTAMP_LBN 2
  5397. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_TIMESTAMP_WIDTH 1
  5398. #define MC_CMD_INIT_RXQ_EXT_IN_CRC_MODE_LBN 3
  5399. #define MC_CMD_INIT_RXQ_EXT_IN_CRC_MODE_WIDTH 4
  5400. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_CHAIN_LBN 7
  5401. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_CHAIN_WIDTH 1
  5402. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_PREFIX_LBN 8
  5403. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_PREFIX_WIDTH 1
  5404. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER_LBN 9
  5405. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER_WIDTH 1
  5406. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_MODE_LBN 10
  5407. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_MODE_WIDTH 4
  5408. /* enum: One packet per descriptor (for normal networking) */
  5409. #define MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET 0x0
  5410. /* enum: Pack multiple packets into large descriptors (for SolarCapture) */
  5411. #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM 0x1
  5412. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_LBN 14
  5413. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_WIDTH 1
  5414. #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_LBN 15
  5415. #define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_WIDTH 3
  5416. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M 0x0 /* enum */
  5417. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K 0x1 /* enum */
  5418. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K 0x2 /* enum */
  5419. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K 0x3 /* enum */
  5420. #define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K 0x4 /* enum */
  5421. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_LBN 18
  5422. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_WIDTH 1
  5423. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_FORCE_EV_MERGING_LBN 19
  5424. #define MC_CMD_INIT_RXQ_EXT_IN_FLAG_FORCE_EV_MERGING_WIDTH 1
  5425. /* Owner ID to use if in buffer mode (zero if physical) */
  5426. #define MC_CMD_INIT_RXQ_EXT_IN_OWNER_ID_OFST 20
  5427. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  5428. #define MC_CMD_INIT_RXQ_EXT_IN_PORT_ID_OFST 24
  5429. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  5430. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_OFST 28
  5431. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_LEN 8
  5432. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_LO_OFST 28
  5433. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_HI_OFST 32
  5434. #define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_NUM 64
  5435. /* Maximum length of packet to receive, if SNAPSHOT_MODE flag is set */
  5436. #define MC_CMD_INIT_RXQ_EXT_IN_SNAPSHOT_LENGTH_OFST 540
  5437. /* MC_CMD_INIT_RXQ_OUT msgresponse */
  5438. #define MC_CMD_INIT_RXQ_OUT_LEN 0
  5439. /* MC_CMD_INIT_RXQ_EXT_OUT msgresponse */
  5440. #define MC_CMD_INIT_RXQ_EXT_OUT_LEN 0
  5441. /***********************************/
  5442. /* MC_CMD_INIT_TXQ
  5443. */
  5444. #define MC_CMD_INIT_TXQ 0x82
  5445. #define MC_CMD_0x82_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5446. /* MC_CMD_INIT_TXQ_IN msgrequest: Legacy INIT_TXQ request. Use extended version
  5447. * in new code.
  5448. */
  5449. #define MC_CMD_INIT_TXQ_IN_LENMIN 36
  5450. #define MC_CMD_INIT_TXQ_IN_LENMAX 252
  5451. #define MC_CMD_INIT_TXQ_IN_LEN(num) (28+8*(num))
  5452. /* Size, in entries */
  5453. #define MC_CMD_INIT_TXQ_IN_SIZE_OFST 0
  5454. /* The EVQ to send events to. This is an index originally specified to
  5455. * INIT_EVQ.
  5456. */
  5457. #define MC_CMD_INIT_TXQ_IN_TARGET_EVQ_OFST 4
  5458. /* The value to put in the event data. Check hardware spec. for valid range. */
  5459. #define MC_CMD_INIT_TXQ_IN_LABEL_OFST 8
  5460. /* Desired instance. Must be set to a specific instance, which is a function
  5461. * local queue index.
  5462. */
  5463. #define MC_CMD_INIT_TXQ_IN_INSTANCE_OFST 12
  5464. /* There will be more flags here. */
  5465. #define MC_CMD_INIT_TXQ_IN_FLAGS_OFST 16
  5466. #define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_LBN 0
  5467. #define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_WIDTH 1
  5468. #define MC_CMD_INIT_TXQ_IN_FLAG_IP_CSUM_DIS_LBN 1
  5469. #define MC_CMD_INIT_TXQ_IN_FLAG_IP_CSUM_DIS_WIDTH 1
  5470. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_CSUM_DIS_LBN 2
  5471. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_CSUM_DIS_WIDTH 1
  5472. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_LBN 3
  5473. #define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
  5474. #define MC_CMD_INIT_TXQ_IN_CRC_MODE_LBN 4
  5475. #define MC_CMD_INIT_TXQ_IN_CRC_MODE_WIDTH 4
  5476. #define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_LBN 8
  5477. #define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_WIDTH 1
  5478. #define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_LBN 9
  5479. #define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_WIDTH 1
  5480. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_IP_CSUM_EN_LBN 10
  5481. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1
  5482. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11
  5483. #define MC_CMD_INIT_TXQ_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1
  5484. /* Owner ID to use if in buffer mode (zero if physical) */
  5485. #define MC_CMD_INIT_TXQ_IN_OWNER_ID_OFST 20
  5486. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  5487. #define MC_CMD_INIT_TXQ_IN_PORT_ID_OFST 24
  5488. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  5489. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_OFST 28
  5490. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LEN 8
  5491. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LO_OFST 28
  5492. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_HI_OFST 32
  5493. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MINNUM 1
  5494. #define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM 28
  5495. /* MC_CMD_INIT_TXQ_EXT_IN msgrequest: Extended INIT_TXQ with additional mode
  5496. * flags
  5497. */
  5498. #define MC_CMD_INIT_TXQ_EXT_IN_LEN 544
  5499. /* Size, in entries */
  5500. #define MC_CMD_INIT_TXQ_EXT_IN_SIZE_OFST 0
  5501. /* The EVQ to send events to. This is an index originally specified to
  5502. * INIT_EVQ.
  5503. */
  5504. #define MC_CMD_INIT_TXQ_EXT_IN_TARGET_EVQ_OFST 4
  5505. /* The value to put in the event data. Check hardware spec. for valid range. */
  5506. #define MC_CMD_INIT_TXQ_EXT_IN_LABEL_OFST 8
  5507. /* Desired instance. Must be set to a specific instance, which is a function
  5508. * local queue index.
  5509. */
  5510. #define MC_CMD_INIT_TXQ_EXT_IN_INSTANCE_OFST 12
  5511. /* There will be more flags here. */
  5512. #define MC_CMD_INIT_TXQ_EXT_IN_FLAGS_OFST 16
  5513. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_BUFF_MODE_LBN 0
  5514. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_BUFF_MODE_WIDTH 1
  5515. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_IP_CSUM_DIS_LBN 1
  5516. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_IP_CSUM_DIS_WIDTH 1
  5517. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_CSUM_DIS_LBN 2
  5518. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_CSUM_DIS_WIDTH 1
  5519. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_UDP_ONLY_LBN 3
  5520. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
  5521. #define MC_CMD_INIT_TXQ_EXT_IN_CRC_MODE_LBN 4
  5522. #define MC_CMD_INIT_TXQ_EXT_IN_CRC_MODE_WIDTH 4
  5523. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TIMESTAMP_LBN 8
  5524. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TIMESTAMP_WIDTH 1
  5525. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_PACER_BYPASS_LBN 9
  5526. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_PACER_BYPASS_WIDTH 1
  5527. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_LBN 10
  5528. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1
  5529. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11
  5530. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1
  5531. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_LBN 12
  5532. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TSOV2_EN_WIDTH 1
  5533. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_LBN 13
  5534. #define MC_CMD_INIT_TXQ_EXT_IN_FLAG_CTPIO_WIDTH 1
  5535. /* Owner ID to use if in buffer mode (zero if physical) */
  5536. #define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_OFST 20
  5537. /* The port ID associated with the v-adaptor which should contain this DMAQ. */
  5538. #define MC_CMD_INIT_TXQ_EXT_IN_PORT_ID_OFST 24
  5539. /* 64-bit address of 4k of 4k-aligned host memory buffer */
  5540. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_OFST 28
  5541. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_LEN 8
  5542. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_LO_OFST 28
  5543. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_HI_OFST 32
  5544. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_MINNUM 1
  5545. #define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_MAXNUM 64
  5546. /* Flags related to Qbb flow control mode. */
  5547. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_FLAGS_OFST 540
  5548. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_ENABLE_LBN 0
  5549. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_ENABLE_WIDTH 1
  5550. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_PRIORITY_LBN 1
  5551. #define MC_CMD_INIT_TXQ_EXT_IN_QBB_PRIORITY_WIDTH 3
  5552. /* MC_CMD_INIT_TXQ_OUT msgresponse */
  5553. #define MC_CMD_INIT_TXQ_OUT_LEN 0
  5554. /***********************************/
  5555. /* MC_CMD_FINI_EVQ
  5556. * Teardown an EVQ.
  5557. *
  5558. * All DMAQs or EVQs that point to the EVQ to tear down must be torn down first
  5559. * or the operation will fail with EBUSY
  5560. */
  5561. #define MC_CMD_FINI_EVQ 0x83
  5562. #define MC_CMD_0x83_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5563. /* MC_CMD_FINI_EVQ_IN msgrequest */
  5564. #define MC_CMD_FINI_EVQ_IN_LEN 4
  5565. /* Instance of EVQ to destroy. Should be the same instance as that previously
  5566. * passed to INIT_EVQ
  5567. */
  5568. #define MC_CMD_FINI_EVQ_IN_INSTANCE_OFST 0
  5569. /* MC_CMD_FINI_EVQ_OUT msgresponse */
  5570. #define MC_CMD_FINI_EVQ_OUT_LEN 0
  5571. /***********************************/
  5572. /* MC_CMD_FINI_RXQ
  5573. * Teardown a RXQ.
  5574. */
  5575. #define MC_CMD_FINI_RXQ 0x84
  5576. #define MC_CMD_0x84_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5577. /* MC_CMD_FINI_RXQ_IN msgrequest */
  5578. #define MC_CMD_FINI_RXQ_IN_LEN 4
  5579. /* Instance of RXQ to destroy */
  5580. #define MC_CMD_FINI_RXQ_IN_INSTANCE_OFST 0
  5581. /* MC_CMD_FINI_RXQ_OUT msgresponse */
  5582. #define MC_CMD_FINI_RXQ_OUT_LEN 0
  5583. /***********************************/
  5584. /* MC_CMD_FINI_TXQ
  5585. * Teardown a TXQ.
  5586. */
  5587. #define MC_CMD_FINI_TXQ 0x85
  5588. #define MC_CMD_0x85_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5589. /* MC_CMD_FINI_TXQ_IN msgrequest */
  5590. #define MC_CMD_FINI_TXQ_IN_LEN 4
  5591. /* Instance of TXQ to destroy */
  5592. #define MC_CMD_FINI_TXQ_IN_INSTANCE_OFST 0
  5593. /* MC_CMD_FINI_TXQ_OUT msgresponse */
  5594. #define MC_CMD_FINI_TXQ_OUT_LEN 0
  5595. /***********************************/
  5596. /* MC_CMD_DRIVER_EVENT
  5597. * Generate an event on an EVQ belonging to the function issuing the command.
  5598. */
  5599. #define MC_CMD_DRIVER_EVENT 0x86
  5600. #define MC_CMD_0x86_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5601. /* MC_CMD_DRIVER_EVENT_IN msgrequest */
  5602. #define MC_CMD_DRIVER_EVENT_IN_LEN 12
  5603. /* Handle of target EVQ */
  5604. #define MC_CMD_DRIVER_EVENT_IN_EVQ_OFST 0
  5605. /* Bits 0 - 63 of event */
  5606. #define MC_CMD_DRIVER_EVENT_IN_DATA_OFST 4
  5607. #define MC_CMD_DRIVER_EVENT_IN_DATA_LEN 8
  5608. #define MC_CMD_DRIVER_EVENT_IN_DATA_LO_OFST 4
  5609. #define MC_CMD_DRIVER_EVENT_IN_DATA_HI_OFST 8
  5610. /* MC_CMD_DRIVER_EVENT_OUT msgresponse */
  5611. #define MC_CMD_DRIVER_EVENT_OUT_LEN 0
  5612. /***********************************/
  5613. /* MC_CMD_PROXY_CMD
  5614. * Execute an arbitrary MCDI command on behalf of a different function, subject
  5615. * to security restrictions. The command to be proxied follows immediately
  5616. * afterward in the host buffer (or on the UART). This command supercedes
  5617. * MC_CMD_SET_FUNC, which remains available for Siena but now deprecated.
  5618. */
  5619. #define MC_CMD_PROXY_CMD 0x5b
  5620. #define MC_CMD_0x5b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5621. /* MC_CMD_PROXY_CMD_IN msgrequest */
  5622. #define MC_CMD_PROXY_CMD_IN_LEN 4
  5623. /* The handle of the target function. */
  5624. #define MC_CMD_PROXY_CMD_IN_TARGET_OFST 0
  5625. #define MC_CMD_PROXY_CMD_IN_TARGET_PF_LBN 0
  5626. #define MC_CMD_PROXY_CMD_IN_TARGET_PF_WIDTH 16
  5627. #define MC_CMD_PROXY_CMD_IN_TARGET_VF_LBN 16
  5628. #define MC_CMD_PROXY_CMD_IN_TARGET_VF_WIDTH 16
  5629. #define MC_CMD_PROXY_CMD_IN_VF_NULL 0xffff /* enum */
  5630. /* MC_CMD_PROXY_CMD_OUT msgresponse */
  5631. #define MC_CMD_PROXY_CMD_OUT_LEN 0
  5632. /* MC_PROXY_STATUS_BUFFER structuredef: Host memory status buffer used to
  5633. * manage proxied requests
  5634. */
  5635. #define MC_PROXY_STATUS_BUFFER_LEN 16
  5636. /* Handle allocated by the firmware for this proxy transaction */
  5637. #define MC_PROXY_STATUS_BUFFER_HANDLE_OFST 0
  5638. /* enum: An invalid handle. */
  5639. #define MC_PROXY_STATUS_BUFFER_HANDLE_INVALID 0x0
  5640. #define MC_PROXY_STATUS_BUFFER_HANDLE_LBN 0
  5641. #define MC_PROXY_STATUS_BUFFER_HANDLE_WIDTH 32
  5642. /* The requesting physical function number */
  5643. #define MC_PROXY_STATUS_BUFFER_PF_OFST 4
  5644. #define MC_PROXY_STATUS_BUFFER_PF_LEN 2
  5645. #define MC_PROXY_STATUS_BUFFER_PF_LBN 32
  5646. #define MC_PROXY_STATUS_BUFFER_PF_WIDTH 16
  5647. /* The requesting virtual function number. Set to VF_NULL if the target is a
  5648. * PF.
  5649. */
  5650. #define MC_PROXY_STATUS_BUFFER_VF_OFST 6
  5651. #define MC_PROXY_STATUS_BUFFER_VF_LEN 2
  5652. #define MC_PROXY_STATUS_BUFFER_VF_LBN 48
  5653. #define MC_PROXY_STATUS_BUFFER_VF_WIDTH 16
  5654. /* The target function RID. */
  5655. #define MC_PROXY_STATUS_BUFFER_RID_OFST 8
  5656. #define MC_PROXY_STATUS_BUFFER_RID_LEN 2
  5657. #define MC_PROXY_STATUS_BUFFER_RID_LBN 64
  5658. #define MC_PROXY_STATUS_BUFFER_RID_WIDTH 16
  5659. /* The status of the proxy as described in MC_CMD_PROXY_COMPLETE. */
  5660. #define MC_PROXY_STATUS_BUFFER_STATUS_OFST 10
  5661. #define MC_PROXY_STATUS_BUFFER_STATUS_LEN 2
  5662. #define MC_PROXY_STATUS_BUFFER_STATUS_LBN 80
  5663. #define MC_PROXY_STATUS_BUFFER_STATUS_WIDTH 16
  5664. /* If a request is authorized rather than carried out by the host, this is the
  5665. * elevated privilege mask granted to the requesting function.
  5666. */
  5667. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_OFST 12
  5668. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_LBN 96
  5669. #define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_WIDTH 32
  5670. /***********************************/
  5671. /* MC_CMD_PROXY_CONFIGURE
  5672. * Enable/disable authorization of MCDI requests from unprivileged functions by
  5673. * a designated admin function
  5674. */
  5675. #define MC_CMD_PROXY_CONFIGURE 0x58
  5676. #define MC_CMD_0x58_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5677. /* MC_CMD_PROXY_CONFIGURE_IN msgrequest */
  5678. #define MC_CMD_PROXY_CONFIGURE_IN_LEN 108
  5679. #define MC_CMD_PROXY_CONFIGURE_IN_FLAGS_OFST 0
  5680. #define MC_CMD_PROXY_CONFIGURE_IN_ENABLE_LBN 0
  5681. #define MC_CMD_PROXY_CONFIGURE_IN_ENABLE_WIDTH 1
  5682. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  5683. * of blocks, each of the size REQUEST_BLOCK_SIZE.
  5684. */
  5685. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_OFST 4
  5686. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_LEN 8
  5687. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_LO_OFST 4
  5688. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_HI_OFST 8
  5689. /* Must be a power of 2 */
  5690. #define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BLOCK_SIZE_OFST 12
  5691. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  5692. * of blocks, each of the size REPLY_BLOCK_SIZE.
  5693. */
  5694. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_OFST 16
  5695. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_LEN 8
  5696. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_LO_OFST 16
  5697. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_HI_OFST 20
  5698. /* Must be a power of 2 */
  5699. #define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BLOCK_SIZE_OFST 24
  5700. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  5701. * of blocks, each of the size STATUS_BLOCK_SIZE. This buffer is only needed if
  5702. * host intends to complete proxied operations by using MC_CMD_PROXY_CMD.
  5703. */
  5704. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_OFST 28
  5705. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_LEN 8
  5706. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_LO_OFST 28
  5707. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_HI_OFST 32
  5708. /* Must be a power of 2, or zero if this buffer is not provided */
  5709. #define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BLOCK_SIZE_OFST 36
  5710. /* Applies to all three buffers */
  5711. #define MC_CMD_PROXY_CONFIGURE_IN_NUM_BLOCKS_OFST 40
  5712. /* A bit mask defining which MCDI operations may be proxied */
  5713. #define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_OFST 44
  5714. #define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_LEN 64
  5715. /* MC_CMD_PROXY_CONFIGURE_EXT_IN msgrequest */
  5716. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_LEN 112
  5717. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_FLAGS_OFST 0
  5718. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ENABLE_LBN 0
  5719. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ENABLE_WIDTH 1
  5720. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  5721. * of blocks, each of the size REQUEST_BLOCK_SIZE.
  5722. */
  5723. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_OFST 4
  5724. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_LEN 8
  5725. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_LO_OFST 4
  5726. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_HI_OFST 8
  5727. /* Must be a power of 2 */
  5728. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BLOCK_SIZE_OFST 12
  5729. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  5730. * of blocks, each of the size REPLY_BLOCK_SIZE.
  5731. */
  5732. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_OFST 16
  5733. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_LEN 8
  5734. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_LO_OFST 16
  5735. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_HI_OFST 20
  5736. /* Must be a power of 2 */
  5737. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BLOCK_SIZE_OFST 24
  5738. /* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
  5739. * of blocks, each of the size STATUS_BLOCK_SIZE. This buffer is only needed if
  5740. * host intends to complete proxied operations by using MC_CMD_PROXY_CMD.
  5741. */
  5742. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_OFST 28
  5743. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_LEN 8
  5744. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_LO_OFST 28
  5745. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_HI_OFST 32
  5746. /* Must be a power of 2, or zero if this buffer is not provided */
  5747. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BLOCK_SIZE_OFST 36
  5748. /* Applies to all three buffers */
  5749. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_NUM_BLOCKS_OFST 40
  5750. /* A bit mask defining which MCDI operations may be proxied */
  5751. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ALLOWED_MCDI_MASK_OFST 44
  5752. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_ALLOWED_MCDI_MASK_LEN 64
  5753. #define MC_CMD_PROXY_CONFIGURE_EXT_IN_RESERVED_OFST 108
  5754. /* MC_CMD_PROXY_CONFIGURE_OUT msgresponse */
  5755. #define MC_CMD_PROXY_CONFIGURE_OUT_LEN 0
  5756. /***********************************/
  5757. /* MC_CMD_PROXY_COMPLETE
  5758. * Tells FW that a requested proxy operation has either been completed (by
  5759. * using MC_CMD_PROXY_CMD) or authorized/declined. May only be sent by the
  5760. * function that enabled proxying/authorization (by using
  5761. * MC_CMD_PROXY_CONFIGURE).
  5762. */
  5763. #define MC_CMD_PROXY_COMPLETE 0x5f
  5764. #define MC_CMD_0x5f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  5765. /* MC_CMD_PROXY_COMPLETE_IN msgrequest */
  5766. #define MC_CMD_PROXY_COMPLETE_IN_LEN 12
  5767. #define MC_CMD_PROXY_COMPLETE_IN_BLOCK_INDEX_OFST 0
  5768. #define MC_CMD_PROXY_COMPLETE_IN_STATUS_OFST 4
  5769. /* enum: The operation has been completed by using MC_CMD_PROXY_CMD, the reply
  5770. * is stored in the REPLY_BUFF.
  5771. */
  5772. #define MC_CMD_PROXY_COMPLETE_IN_COMPLETE 0x0
  5773. /* enum: The operation has been authorized. The originating function may now
  5774. * try again.
  5775. */
  5776. #define MC_CMD_PROXY_COMPLETE_IN_AUTHORIZED 0x1
  5777. /* enum: The operation has been declined. */
  5778. #define MC_CMD_PROXY_COMPLETE_IN_DECLINED 0x2
  5779. /* enum: The authorization failed because the relevant application did not
  5780. * respond in time.
  5781. */
  5782. #define MC_CMD_PROXY_COMPLETE_IN_TIMEDOUT 0x3
  5783. #define MC_CMD_PROXY_COMPLETE_IN_HANDLE_OFST 8
  5784. /* MC_CMD_PROXY_COMPLETE_OUT msgresponse */
  5785. #define MC_CMD_PROXY_COMPLETE_OUT_LEN 0
  5786. /***********************************/
  5787. /* MC_CMD_ALLOC_BUFTBL_CHUNK
  5788. * Allocate a set of buffer table entries using the specified owner ID. This
  5789. * operation allocates the required buffer table entries (and fails if it
  5790. * cannot do so). The buffer table entries will initially be zeroed.
  5791. */
  5792. #define MC_CMD_ALLOC_BUFTBL_CHUNK 0x87
  5793. #define MC_CMD_0x87_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5794. /* MC_CMD_ALLOC_BUFTBL_CHUNK_IN msgrequest */
  5795. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_LEN 8
  5796. /* Owner ID to use */
  5797. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_OWNER_OFST 0
  5798. /* Size of buffer table pages to use, in bytes (note that only a few values are
  5799. * legal on any specific hardware).
  5800. */
  5801. #define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_PAGE_SIZE_OFST 4
  5802. /* MC_CMD_ALLOC_BUFTBL_CHUNK_OUT msgresponse */
  5803. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_LEN 12
  5804. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_HANDLE_OFST 0
  5805. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_NUMENTRIES_OFST 4
  5806. /* Buffer table IDs for use in DMA descriptors. */
  5807. #define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_ID_OFST 8
  5808. /***********************************/
  5809. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES
  5810. * Reprogram a set of buffer table entries in the specified chunk.
  5811. */
  5812. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES 0x88
  5813. #define MC_CMD_0x88_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5814. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN msgrequest */
  5815. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMIN 20
  5816. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMAX 268
  5817. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LEN(num) (12+8*(num))
  5818. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_HANDLE_OFST 0
  5819. /* ID */
  5820. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_FIRSTID_OFST 4
  5821. /* Num entries */
  5822. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 8
  5823. /* Buffer table entry address */
  5824. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_OFST 12
  5825. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LEN 8
  5826. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LO_OFST 12
  5827. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_HI_OFST 16
  5828. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MINNUM 1
  5829. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MAXNUM 32
  5830. /* MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT msgresponse */
  5831. #define MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT_LEN 0
  5832. /***********************************/
  5833. /* MC_CMD_FREE_BUFTBL_CHUNK
  5834. */
  5835. #define MC_CMD_FREE_BUFTBL_CHUNK 0x89
  5836. #define MC_CMD_0x89_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  5837. /* MC_CMD_FREE_BUFTBL_CHUNK_IN msgrequest */
  5838. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_LEN 4
  5839. #define MC_CMD_FREE_BUFTBL_CHUNK_IN_HANDLE_OFST 0
  5840. /* MC_CMD_FREE_BUFTBL_CHUNK_OUT msgresponse */
  5841. #define MC_CMD_FREE_BUFTBL_CHUNK_OUT_LEN 0
  5842. /* PORT_CONFIG_ENTRY structuredef */
  5843. #define PORT_CONFIG_ENTRY_LEN 16
  5844. /* External port number (label) */
  5845. #define PORT_CONFIG_ENTRY_EXT_NUMBER_OFST 0
  5846. #define PORT_CONFIG_ENTRY_EXT_NUMBER_LEN 1
  5847. #define PORT_CONFIG_ENTRY_EXT_NUMBER_LBN 0
  5848. #define PORT_CONFIG_ENTRY_EXT_NUMBER_WIDTH 8
  5849. /* Port core location */
  5850. #define PORT_CONFIG_ENTRY_CORE_OFST 1
  5851. #define PORT_CONFIG_ENTRY_CORE_LEN 1
  5852. #define PORT_CONFIG_ENTRY_STANDALONE 0x0 /* enum */
  5853. #define PORT_CONFIG_ENTRY_MASTER 0x1 /* enum */
  5854. #define PORT_CONFIG_ENTRY_SLAVE 0x2 /* enum */
  5855. #define PORT_CONFIG_ENTRY_CORE_LBN 8
  5856. #define PORT_CONFIG_ENTRY_CORE_WIDTH 8
  5857. /* Internal number (HW resource) relative to the core */
  5858. #define PORT_CONFIG_ENTRY_INT_NUMBER_OFST 2
  5859. #define PORT_CONFIG_ENTRY_INT_NUMBER_LEN 1
  5860. #define PORT_CONFIG_ENTRY_INT_NUMBER_LBN 16
  5861. #define PORT_CONFIG_ENTRY_INT_NUMBER_WIDTH 8
  5862. /* Reserved */
  5863. #define PORT_CONFIG_ENTRY_RSVD_OFST 3
  5864. #define PORT_CONFIG_ENTRY_RSVD_LEN 1
  5865. #define PORT_CONFIG_ENTRY_RSVD_LBN 24
  5866. #define PORT_CONFIG_ENTRY_RSVD_WIDTH 8
  5867. /* Bitmask of KR lanes used by the port */
  5868. #define PORT_CONFIG_ENTRY_LANES_OFST 4
  5869. #define PORT_CONFIG_ENTRY_LANES_LBN 32
  5870. #define PORT_CONFIG_ENTRY_LANES_WIDTH 32
  5871. /* Port capabilities (MC_CMD_PHY_CAP_*) */
  5872. #define PORT_CONFIG_ENTRY_SUPPORTED_CAPS_OFST 8
  5873. #define PORT_CONFIG_ENTRY_SUPPORTED_CAPS_LBN 64
  5874. #define PORT_CONFIG_ENTRY_SUPPORTED_CAPS_WIDTH 32
  5875. /* Reserved (align to 16 bytes) */
  5876. #define PORT_CONFIG_ENTRY_RSVD2_OFST 12
  5877. #define PORT_CONFIG_ENTRY_RSVD2_LBN 96
  5878. #define PORT_CONFIG_ENTRY_RSVD2_WIDTH 32
  5879. /***********************************/
  5880. /* MC_CMD_FILTER_OP
  5881. * Multiplexed MCDI call for filter operations
  5882. */
  5883. #define MC_CMD_FILTER_OP 0x8a
  5884. #define MC_CMD_0x8a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  5885. /* MC_CMD_FILTER_OP_IN msgrequest */
  5886. #define MC_CMD_FILTER_OP_IN_LEN 108
  5887. /* identifies the type of operation requested */
  5888. #define MC_CMD_FILTER_OP_IN_OP_OFST 0
  5889. /* enum: single-recipient filter insert */
  5890. #define MC_CMD_FILTER_OP_IN_OP_INSERT 0x0
  5891. /* enum: single-recipient filter remove */
  5892. #define MC_CMD_FILTER_OP_IN_OP_REMOVE 0x1
  5893. /* enum: multi-recipient filter subscribe */
  5894. #define MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE 0x2
  5895. /* enum: multi-recipient filter unsubscribe */
  5896. #define MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE 0x3
  5897. /* enum: replace one recipient with another (warning - the filter handle may
  5898. * change)
  5899. */
  5900. #define MC_CMD_FILTER_OP_IN_OP_REPLACE 0x4
  5901. /* filter handle (for remove / unsubscribe operations) */
  5902. #define MC_CMD_FILTER_OP_IN_HANDLE_OFST 4
  5903. #define MC_CMD_FILTER_OP_IN_HANDLE_LEN 8
  5904. #define MC_CMD_FILTER_OP_IN_HANDLE_LO_OFST 4
  5905. #define MC_CMD_FILTER_OP_IN_HANDLE_HI_OFST 8
  5906. /* The port ID associated with the v-adaptor which should contain this filter.
  5907. */
  5908. #define MC_CMD_FILTER_OP_IN_PORT_ID_OFST 12
  5909. /* fields to include in match criteria */
  5910. #define MC_CMD_FILTER_OP_IN_MATCH_FIELDS_OFST 16
  5911. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_LBN 0
  5912. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_WIDTH 1
  5913. #define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_LBN 1
  5914. #define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_WIDTH 1
  5915. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC_LBN 2
  5916. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC_WIDTH 1
  5917. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT_LBN 3
  5918. #define MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT_WIDTH 1
  5919. #define MC_CMD_FILTER_OP_IN_MATCH_DST_MAC_LBN 4
  5920. #define MC_CMD_FILTER_OP_IN_MATCH_DST_MAC_WIDTH 1
  5921. #define MC_CMD_FILTER_OP_IN_MATCH_DST_PORT_LBN 5
  5922. #define MC_CMD_FILTER_OP_IN_MATCH_DST_PORT_WIDTH 1
  5923. #define MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE_LBN 6
  5924. #define MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE_WIDTH 1
  5925. #define MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN_LBN 7
  5926. #define MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN_WIDTH 1
  5927. #define MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN_LBN 8
  5928. #define MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN_WIDTH 1
  5929. #define MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO_LBN 9
  5930. #define MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO_WIDTH 1
  5931. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_LBN 10
  5932. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_WIDTH 1
  5933. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_LBN 11
  5934. #define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_WIDTH 1
  5935. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
  5936. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
  5937. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
  5938. #define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
  5939. /* receive destination */
  5940. #define MC_CMD_FILTER_OP_IN_RX_DEST_OFST 20
  5941. /* enum: drop packets */
  5942. #define MC_CMD_FILTER_OP_IN_RX_DEST_DROP 0x0
  5943. /* enum: receive to host */
  5944. #define MC_CMD_FILTER_OP_IN_RX_DEST_HOST 0x1
  5945. /* enum: receive to MC */
  5946. #define MC_CMD_FILTER_OP_IN_RX_DEST_MC 0x2
  5947. /* enum: loop back to TXDP 0 */
  5948. #define MC_CMD_FILTER_OP_IN_RX_DEST_TX0 0x3
  5949. /* enum: loop back to TXDP 1 */
  5950. #define MC_CMD_FILTER_OP_IN_RX_DEST_TX1 0x4
  5951. /* receive queue handle (for multiple queue modes, this is the base queue) */
  5952. #define MC_CMD_FILTER_OP_IN_RX_QUEUE_OFST 24
  5953. /* receive mode */
  5954. #define MC_CMD_FILTER_OP_IN_RX_MODE_OFST 28
  5955. /* enum: receive to just the specified queue */
  5956. #define MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE 0x0
  5957. /* enum: receive to multiple queues using RSS context */
  5958. #define MC_CMD_FILTER_OP_IN_RX_MODE_RSS 0x1
  5959. /* enum: receive to multiple queues using .1p mapping */
  5960. #define MC_CMD_FILTER_OP_IN_RX_MODE_DOT1P_MAPPING 0x2
  5961. /* enum: install a filter entry that will never match; for test purposes only
  5962. */
  5963. #define MC_CMD_FILTER_OP_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
  5964. /* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
  5965. * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
  5966. * MC_CMD_DOT1P_MAPPING_ALLOC.
  5967. */
  5968. #define MC_CMD_FILTER_OP_IN_RX_CONTEXT_OFST 32
  5969. /* transmit domain (reserved; set to 0) */
  5970. #define MC_CMD_FILTER_OP_IN_TX_DOMAIN_OFST 36
  5971. /* transmit destination (either set the MAC and/or PM bits for explicit
  5972. * control, or set this field to TX_DEST_DEFAULT for sensible default
  5973. * behaviour)
  5974. */
  5975. #define MC_CMD_FILTER_OP_IN_TX_DEST_OFST 40
  5976. /* enum: request default behaviour (based on filter type) */
  5977. #define MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT 0xffffffff
  5978. #define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_LBN 0
  5979. #define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_WIDTH 1
  5980. #define MC_CMD_FILTER_OP_IN_TX_DEST_PM_LBN 1
  5981. #define MC_CMD_FILTER_OP_IN_TX_DEST_PM_WIDTH 1
  5982. /* source MAC address to match (as bytes in network order) */
  5983. #define MC_CMD_FILTER_OP_IN_SRC_MAC_OFST 44
  5984. #define MC_CMD_FILTER_OP_IN_SRC_MAC_LEN 6
  5985. /* source port to match (as bytes in network order) */
  5986. #define MC_CMD_FILTER_OP_IN_SRC_PORT_OFST 50
  5987. #define MC_CMD_FILTER_OP_IN_SRC_PORT_LEN 2
  5988. /* destination MAC address to match (as bytes in network order) */
  5989. #define MC_CMD_FILTER_OP_IN_DST_MAC_OFST 52
  5990. #define MC_CMD_FILTER_OP_IN_DST_MAC_LEN 6
  5991. /* destination port to match (as bytes in network order) */
  5992. #define MC_CMD_FILTER_OP_IN_DST_PORT_OFST 58
  5993. #define MC_CMD_FILTER_OP_IN_DST_PORT_LEN 2
  5994. /* Ethernet type to match (as bytes in network order) */
  5995. #define MC_CMD_FILTER_OP_IN_ETHER_TYPE_OFST 60
  5996. #define MC_CMD_FILTER_OP_IN_ETHER_TYPE_LEN 2
  5997. /* Inner VLAN tag to match (as bytes in network order) */
  5998. #define MC_CMD_FILTER_OP_IN_INNER_VLAN_OFST 62
  5999. #define MC_CMD_FILTER_OP_IN_INNER_VLAN_LEN 2
  6000. /* Outer VLAN tag to match (as bytes in network order) */
  6001. #define MC_CMD_FILTER_OP_IN_OUTER_VLAN_OFST 64
  6002. #define MC_CMD_FILTER_OP_IN_OUTER_VLAN_LEN 2
  6003. /* IP protocol to match (in low byte; set high byte to 0) */
  6004. #define MC_CMD_FILTER_OP_IN_IP_PROTO_OFST 66
  6005. #define MC_CMD_FILTER_OP_IN_IP_PROTO_LEN 2
  6006. /* Firmware defined register 0 to match (reserved; set to 0) */
  6007. #define MC_CMD_FILTER_OP_IN_FWDEF0_OFST 68
  6008. /* Firmware defined register 1 to match (reserved; set to 0) */
  6009. #define MC_CMD_FILTER_OP_IN_FWDEF1_OFST 72
  6010. /* source IP address to match (as bytes in network order; set last 12 bytes to
  6011. * 0 for IPv4 address)
  6012. */
  6013. #define MC_CMD_FILTER_OP_IN_SRC_IP_OFST 76
  6014. #define MC_CMD_FILTER_OP_IN_SRC_IP_LEN 16
  6015. /* destination IP address to match (as bytes in network order; set last 12
  6016. * bytes to 0 for IPv4 address)
  6017. */
  6018. #define MC_CMD_FILTER_OP_IN_DST_IP_OFST 92
  6019. #define MC_CMD_FILTER_OP_IN_DST_IP_LEN 16
  6020. /* MC_CMD_FILTER_OP_EXT_IN msgrequest: Extension to MC_CMD_FILTER_OP_IN to
  6021. * include handling of VXLAN/NVGRE encapsulated frame filtering (which is
  6022. * supported on Medford only).
  6023. */
  6024. #define MC_CMD_FILTER_OP_EXT_IN_LEN 172
  6025. /* identifies the type of operation requested */
  6026. #define MC_CMD_FILTER_OP_EXT_IN_OP_OFST 0
  6027. /* Enum values, see field(s): */
  6028. /* MC_CMD_FILTER_OP_IN/OP */
  6029. /* filter handle (for remove / unsubscribe operations) */
  6030. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_OFST 4
  6031. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_LEN 8
  6032. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_LO_OFST 4
  6033. #define MC_CMD_FILTER_OP_EXT_IN_HANDLE_HI_OFST 8
  6034. /* The port ID associated with the v-adaptor which should contain this filter.
  6035. */
  6036. #define MC_CMD_FILTER_OP_EXT_IN_PORT_ID_OFST 12
  6037. /* fields to include in match criteria */
  6038. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FIELDS_OFST 16
  6039. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP_LBN 0
  6040. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP_WIDTH 1
  6041. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP_LBN 1
  6042. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP_WIDTH 1
  6043. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC_LBN 2
  6044. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC_WIDTH 1
  6045. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT_LBN 3
  6046. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT_WIDTH 1
  6047. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC_LBN 4
  6048. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC_WIDTH 1
  6049. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT_LBN 5
  6050. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT_WIDTH 1
  6051. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE_LBN 6
  6052. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE_WIDTH 1
  6053. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN_LBN 7
  6054. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN_WIDTH 1
  6055. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN_LBN 8
  6056. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN_WIDTH 1
  6057. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO_LBN 9
  6058. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO_WIDTH 1
  6059. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FWDEF0_LBN 10
  6060. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_FWDEF0_WIDTH 1
  6061. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID_LBN 11
  6062. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID_WIDTH 1
  6063. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_IP_LBN 12
  6064. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_IP_WIDTH 1
  6065. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_IP_LBN 13
  6066. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_IP_WIDTH 1
  6067. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_MAC_LBN 14
  6068. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_MAC_WIDTH 1
  6069. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_PORT_LBN 15
  6070. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_PORT_WIDTH 1
  6071. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC_LBN 16
  6072. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC_WIDTH 1
  6073. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_PORT_LBN 17
  6074. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_PORT_WIDTH 1
  6075. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_ETHER_TYPE_LBN 18
  6076. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_ETHER_TYPE_WIDTH 1
  6077. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_INNER_VLAN_LBN 19
  6078. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_INNER_VLAN_WIDTH 1
  6079. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_OUTER_VLAN_LBN 20
  6080. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_OUTER_VLAN_WIDTH 1
  6081. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_IP_PROTO_LBN 21
  6082. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_IP_PROTO_WIDTH 1
  6083. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF0_LBN 22
  6084. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF0_WIDTH 1
  6085. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF1_LBN 23
  6086. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF1_WIDTH 1
  6087. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_LBN 24
  6088. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_WIDTH 1
  6089. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_LBN 25
  6090. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_WIDTH 1
  6091. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
  6092. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
  6093. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
  6094. #define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
  6095. /* receive destination */
  6096. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_OFST 20
  6097. /* enum: drop packets */
  6098. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_DROP 0x0
  6099. /* enum: receive to host */
  6100. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST 0x1
  6101. /* enum: receive to MC */
  6102. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_MC 0x2
  6103. /* enum: loop back to TXDP 0 */
  6104. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_TX0 0x3
  6105. /* enum: loop back to TXDP 1 */
  6106. #define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_TX1 0x4
  6107. /* receive queue handle (for multiple queue modes, this is the base queue) */
  6108. #define MC_CMD_FILTER_OP_EXT_IN_RX_QUEUE_OFST 24
  6109. /* receive mode */
  6110. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_OFST 28
  6111. /* enum: receive to just the specified queue */
  6112. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_SIMPLE 0x0
  6113. /* enum: receive to multiple queues using RSS context */
  6114. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS 0x1
  6115. /* enum: receive to multiple queues using .1p mapping */
  6116. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_DOT1P_MAPPING 0x2
  6117. /* enum: install a filter entry that will never match; for test purposes only
  6118. */
  6119. #define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
  6120. /* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
  6121. * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
  6122. * MC_CMD_DOT1P_MAPPING_ALLOC.
  6123. */
  6124. #define MC_CMD_FILTER_OP_EXT_IN_RX_CONTEXT_OFST 32
  6125. /* transmit domain (reserved; set to 0) */
  6126. #define MC_CMD_FILTER_OP_EXT_IN_TX_DOMAIN_OFST 36
  6127. /* transmit destination (either set the MAC and/or PM bits for explicit
  6128. * control, or set this field to TX_DEST_DEFAULT for sensible default
  6129. * behaviour)
  6130. */
  6131. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_OFST 40
  6132. /* enum: request default behaviour (based on filter type) */
  6133. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_DEFAULT 0xffffffff
  6134. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_MAC_LBN 0
  6135. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_MAC_WIDTH 1
  6136. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_PM_LBN 1
  6137. #define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_PM_WIDTH 1
  6138. /* source MAC address to match (as bytes in network order) */
  6139. #define MC_CMD_FILTER_OP_EXT_IN_SRC_MAC_OFST 44
  6140. #define MC_CMD_FILTER_OP_EXT_IN_SRC_MAC_LEN 6
  6141. /* source port to match (as bytes in network order) */
  6142. #define MC_CMD_FILTER_OP_EXT_IN_SRC_PORT_OFST 50
  6143. #define MC_CMD_FILTER_OP_EXT_IN_SRC_PORT_LEN 2
  6144. /* destination MAC address to match (as bytes in network order) */
  6145. #define MC_CMD_FILTER_OP_EXT_IN_DST_MAC_OFST 52
  6146. #define MC_CMD_FILTER_OP_EXT_IN_DST_MAC_LEN 6
  6147. /* destination port to match (as bytes in network order) */
  6148. #define MC_CMD_FILTER_OP_EXT_IN_DST_PORT_OFST 58
  6149. #define MC_CMD_FILTER_OP_EXT_IN_DST_PORT_LEN 2
  6150. /* Ethernet type to match (as bytes in network order) */
  6151. #define MC_CMD_FILTER_OP_EXT_IN_ETHER_TYPE_OFST 60
  6152. #define MC_CMD_FILTER_OP_EXT_IN_ETHER_TYPE_LEN 2
  6153. /* Inner VLAN tag to match (as bytes in network order) */
  6154. #define MC_CMD_FILTER_OP_EXT_IN_INNER_VLAN_OFST 62
  6155. #define MC_CMD_FILTER_OP_EXT_IN_INNER_VLAN_LEN 2
  6156. /* Outer VLAN tag to match (as bytes in network order) */
  6157. #define MC_CMD_FILTER_OP_EXT_IN_OUTER_VLAN_OFST 64
  6158. #define MC_CMD_FILTER_OP_EXT_IN_OUTER_VLAN_LEN 2
  6159. /* IP protocol to match (in low byte; set high byte to 0) */
  6160. #define MC_CMD_FILTER_OP_EXT_IN_IP_PROTO_OFST 66
  6161. #define MC_CMD_FILTER_OP_EXT_IN_IP_PROTO_LEN 2
  6162. /* Firmware defined register 0 to match (reserved; set to 0) */
  6163. #define MC_CMD_FILTER_OP_EXT_IN_FWDEF0_OFST 68
  6164. /* VNI (for VXLAN/Geneve, when IP protocol is UDP) or VSID (for NVGRE, when IP
  6165. * protocol is GRE) to match (as bytes in network order; set last byte to 0 for
  6166. * VXLAN/NVGRE, or 1 for Geneve)
  6167. */
  6168. #define MC_CMD_FILTER_OP_EXT_IN_VNI_OR_VSID_OFST 72
  6169. #define MC_CMD_FILTER_OP_EXT_IN_VNI_VALUE_LBN 0
  6170. #define MC_CMD_FILTER_OP_EXT_IN_VNI_VALUE_WIDTH 24
  6171. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_LBN 24
  6172. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_WIDTH 8
  6173. /* enum: Match VXLAN traffic with this VNI */
  6174. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN 0x0
  6175. /* enum: Match Geneve traffic with this VNI */
  6176. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE 0x1
  6177. /* enum: Reserved for experimental development use */
  6178. #define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_EXPERIMENTAL 0xfe
  6179. #define MC_CMD_FILTER_OP_EXT_IN_VSID_VALUE_LBN 0
  6180. #define MC_CMD_FILTER_OP_EXT_IN_VSID_VALUE_WIDTH 24
  6181. #define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_LBN 24
  6182. #define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_WIDTH 8
  6183. /* enum: Match NVGRE traffic with this VSID */
  6184. #define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE 0x0
  6185. /* source IP address to match (as bytes in network order; set last 12 bytes to
  6186. * 0 for IPv4 address)
  6187. */
  6188. #define MC_CMD_FILTER_OP_EXT_IN_SRC_IP_OFST 76
  6189. #define MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN 16
  6190. /* destination IP address to match (as bytes in network order; set last 12
  6191. * bytes to 0 for IPv4 address)
  6192. */
  6193. #define MC_CMD_FILTER_OP_EXT_IN_DST_IP_OFST 92
  6194. #define MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN 16
  6195. /* VXLAN/NVGRE inner frame source MAC address to match (as bytes in network
  6196. * order)
  6197. */
  6198. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_MAC_OFST 108
  6199. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_MAC_LEN 6
  6200. /* VXLAN/NVGRE inner frame source port to match (as bytes in network order) */
  6201. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_PORT_OFST 114
  6202. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_PORT_LEN 2
  6203. /* VXLAN/NVGRE inner frame destination MAC address to match (as bytes in
  6204. * network order)
  6205. */
  6206. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_MAC_OFST 116
  6207. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_MAC_LEN 6
  6208. /* VXLAN/NVGRE inner frame destination port to match (as bytes in network
  6209. * order)
  6210. */
  6211. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_PORT_OFST 122
  6212. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_PORT_LEN 2
  6213. /* VXLAN/NVGRE inner frame Ethernet type to match (as bytes in network order)
  6214. */
  6215. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_ETHER_TYPE_OFST 124
  6216. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_ETHER_TYPE_LEN 2
  6217. /* VXLAN/NVGRE inner frame Inner VLAN tag to match (as bytes in network order)
  6218. */
  6219. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_INNER_VLAN_OFST 126
  6220. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_INNER_VLAN_LEN 2
  6221. /* VXLAN/NVGRE inner frame Outer VLAN tag to match (as bytes in network order)
  6222. */
  6223. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_OUTER_VLAN_OFST 128
  6224. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_OUTER_VLAN_LEN 2
  6225. /* VXLAN/NVGRE inner frame IP protocol to match (in low byte; set high byte to
  6226. * 0)
  6227. */
  6228. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_IP_PROTO_OFST 130
  6229. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_IP_PROTO_LEN 2
  6230. /* VXLAN/NVGRE inner frame Firmware defined register 0 to match (reserved; set
  6231. * to 0)
  6232. */
  6233. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF0_OFST 132
  6234. /* VXLAN/NVGRE inner frame Firmware defined register 1 to match (reserved; set
  6235. * to 0)
  6236. */
  6237. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF1_OFST 136
  6238. /* VXLAN/NVGRE inner frame source IP address to match (as bytes in network
  6239. * order; set last 12 bytes to 0 for IPv4 address)
  6240. */
  6241. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_IP_OFST 140
  6242. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_IP_LEN 16
  6243. /* VXLAN/NVGRE inner frame destination IP address to match (as bytes in network
  6244. * order; set last 12 bytes to 0 for IPv4 address)
  6245. */
  6246. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_OFST 156
  6247. #define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_LEN 16
  6248. /* MC_CMD_FILTER_OP_OUT msgresponse */
  6249. #define MC_CMD_FILTER_OP_OUT_LEN 12
  6250. /* identifies the type of operation requested */
  6251. #define MC_CMD_FILTER_OP_OUT_OP_OFST 0
  6252. /* Enum values, see field(s): */
  6253. /* MC_CMD_FILTER_OP_IN/OP */
  6254. /* Returned filter handle (for insert / subscribe operations). Note that these
  6255. * handles should be considered opaque to the host, although a value of
  6256. * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
  6257. */
  6258. #define MC_CMD_FILTER_OP_OUT_HANDLE_OFST 4
  6259. #define MC_CMD_FILTER_OP_OUT_HANDLE_LEN 8
  6260. #define MC_CMD_FILTER_OP_OUT_HANDLE_LO_OFST 4
  6261. #define MC_CMD_FILTER_OP_OUT_HANDLE_HI_OFST 8
  6262. /* enum: guaranteed invalid filter handle (low 32 bits) */
  6263. #define MC_CMD_FILTER_OP_OUT_HANDLE_LO_INVALID 0xffffffff
  6264. /* enum: guaranteed invalid filter handle (high 32 bits) */
  6265. #define MC_CMD_FILTER_OP_OUT_HANDLE_HI_INVALID 0xffffffff
  6266. /* MC_CMD_FILTER_OP_EXT_OUT msgresponse */
  6267. #define MC_CMD_FILTER_OP_EXT_OUT_LEN 12
  6268. /* identifies the type of operation requested */
  6269. #define MC_CMD_FILTER_OP_EXT_OUT_OP_OFST 0
  6270. /* Enum values, see field(s): */
  6271. /* MC_CMD_FILTER_OP_EXT_IN/OP */
  6272. /* Returned filter handle (for insert / subscribe operations). Note that these
  6273. * handles should be considered opaque to the host, although a value of
  6274. * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
  6275. */
  6276. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_OFST 4
  6277. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_LEN 8
  6278. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_LO_OFST 4
  6279. #define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_HI_OFST 8
  6280. /* Enum values, see field(s): */
  6281. /* MC_CMD_FILTER_OP_OUT/HANDLE */
  6282. /***********************************/
  6283. /* MC_CMD_GET_PARSER_DISP_INFO
  6284. * Get information related to the parser-dispatcher subsystem
  6285. */
  6286. #define MC_CMD_GET_PARSER_DISP_INFO 0xe4
  6287. #define MC_CMD_0xe4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6288. /* MC_CMD_GET_PARSER_DISP_INFO_IN msgrequest */
  6289. #define MC_CMD_GET_PARSER_DISP_INFO_IN_LEN 4
  6290. /* identifies the type of operation requested */
  6291. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_OFST 0
  6292. /* enum: read the list of supported RX filter matches */
  6293. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_RX_MATCHES 0x1
  6294. /* enum: read flags indicating restrictions on filter insertion for the calling
  6295. * client
  6296. */
  6297. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_RESTRICTIONS 0x2
  6298. /* enum: read properties relating to security rules (Medford-only; for use by
  6299. * SolarSecure apps, not directly by drivers. See SF-114946-SW.)
  6300. */
  6301. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SECURITY_RULE_INFO 0x3
  6302. /* enum: read the list of supported RX filter matches for VXLAN/NVGRE
  6303. * encapsulated frames, which follow a different match sequence to normal
  6304. * frames (Medford only)
  6305. */
  6306. #define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_ENCAP_RX_MATCHES 0x4
  6307. /* MC_CMD_GET_PARSER_DISP_INFO_OUT msgresponse */
  6308. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMIN 8
  6309. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX 252
  6310. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(num) (8+4*(num))
  6311. /* identifies the type of operation requested */
  6312. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_OP_OFST 0
  6313. /* Enum values, see field(s): */
  6314. /* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
  6315. /* number of supported match types */
  6316. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES_OFST 4
  6317. /* array of supported match types (valid MATCH_FIELDS values for
  6318. * MC_CMD_FILTER_OP) sorted in decreasing priority order
  6319. */
  6320. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_OFST 8
  6321. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN 4
  6322. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MINNUM 0
  6323. #define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MAXNUM 61
  6324. /* MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT msgresponse */
  6325. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_LEN 8
  6326. /* identifies the type of operation requested */
  6327. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_OP_OFST 0
  6328. /* Enum values, see field(s): */
  6329. /* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
  6330. /* bitfield of filter insertion restrictions */
  6331. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_RESTRICTION_FLAGS_OFST 4
  6332. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_LBN 0
  6333. #define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_WIDTH 1
  6334. /***********************************/
  6335. /* MC_CMD_PARSER_DISP_RW
  6336. * Direct read/write of parser-dispatcher state (DICPUs and LUE) for debugging.
  6337. * Please note that this interface is only of use to debug tools which have
  6338. * knowledge of firmware and hardware data structures; nothing here is intended
  6339. * for use by normal driver code.
  6340. */
  6341. #define MC_CMD_PARSER_DISP_RW 0xe5
  6342. #define MC_CMD_0xe5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6343. /* MC_CMD_PARSER_DISP_RW_IN msgrequest */
  6344. #define MC_CMD_PARSER_DISP_RW_IN_LEN 32
  6345. /* identifies the target of the operation */
  6346. #define MC_CMD_PARSER_DISP_RW_IN_TARGET_OFST 0
  6347. /* enum: RX dispatcher CPU */
  6348. #define MC_CMD_PARSER_DISP_RW_IN_RX_DICPU 0x0
  6349. /* enum: TX dispatcher CPU */
  6350. #define MC_CMD_PARSER_DISP_RW_IN_TX_DICPU 0x1
  6351. /* enum: Lookup engine (with original metadata format) */
  6352. #define MC_CMD_PARSER_DISP_RW_IN_LUE 0x2
  6353. /* enum: Lookup engine (with requested metadata format) */
  6354. #define MC_CMD_PARSER_DISP_RW_IN_LUE_VERSIONED_METADATA 0x3
  6355. /* enum: RX0 dispatcher CPU (alias for RX_DICPU; Medford has 2 RX DICPUs) */
  6356. #define MC_CMD_PARSER_DISP_RW_IN_RX0_DICPU 0x0
  6357. /* enum: RX1 dispatcher CPU (only valid for Medford) */
  6358. #define MC_CMD_PARSER_DISP_RW_IN_RX1_DICPU 0x4
  6359. /* enum: Miscellaneous other state (only valid for Medford) */
  6360. #define MC_CMD_PARSER_DISP_RW_IN_MISC_STATE 0x5
  6361. /* identifies the type of operation requested */
  6362. #define MC_CMD_PARSER_DISP_RW_IN_OP_OFST 4
  6363. /* enum: read a word of DICPU DMEM or a LUE entry */
  6364. #define MC_CMD_PARSER_DISP_RW_IN_READ 0x0
  6365. /* enum: write a word of DICPU DMEM or a LUE entry */
  6366. #define MC_CMD_PARSER_DISP_RW_IN_WRITE 0x1
  6367. /* enum: read-modify-write a word of DICPU DMEM (not valid for LUE) */
  6368. #define MC_CMD_PARSER_DISP_RW_IN_RMW 0x2
  6369. /* data memory address (DICPU targets) or LUE index (LUE targets) */
  6370. #define MC_CMD_PARSER_DISP_RW_IN_ADDRESS_OFST 8
  6371. /* selector (for MISC_STATE target) */
  6372. #define MC_CMD_PARSER_DISP_RW_IN_SELECTOR_OFST 8
  6373. /* enum: Port to datapath mapping */
  6374. #define MC_CMD_PARSER_DISP_RW_IN_PORT_DP_MAPPING 0x1
  6375. /* value to write (for DMEM writes) */
  6376. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_WRITE_VALUE_OFST 12
  6377. /* XOR value (for DMEM read-modify-writes: new = (old & mask) ^ value) */
  6378. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_XOR_VALUE_OFST 12
  6379. /* AND mask (for DMEM read-modify-writes: new = (old & mask) ^ value) */
  6380. #define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_AND_MASK_OFST 16
  6381. /* metadata format (for LUE reads using LUE_VERSIONED_METADATA) */
  6382. #define MC_CMD_PARSER_DISP_RW_IN_LUE_READ_METADATA_VERSION_OFST 12
  6383. /* value to write (for LUE writes) */
  6384. #define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_OFST 12
  6385. #define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_LEN 20
  6386. /* MC_CMD_PARSER_DISP_RW_OUT msgresponse */
  6387. #define MC_CMD_PARSER_DISP_RW_OUT_LEN 52
  6388. /* value read (for DMEM reads) */
  6389. #define MC_CMD_PARSER_DISP_RW_OUT_DMEM_READ_VALUE_OFST 0
  6390. /* value read (for LUE reads) */
  6391. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_OFST 0
  6392. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_LEN 20
  6393. /* up to 8 32-bit words of additional soft state from the LUE manager (the
  6394. * exact content is firmware-dependent and intended only for debug use)
  6395. */
  6396. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_OFST 20
  6397. #define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_LEN 32
  6398. /* datapath(s) used for each port (for MISC_STATE PORT_DP_MAPPING selector) */
  6399. #define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_OFST 0
  6400. #define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_LEN 4
  6401. #define MC_CMD_PARSER_DISP_RW_OUT_PORT_DP_MAPPING_NUM 4
  6402. #define MC_CMD_PARSER_DISP_RW_OUT_DP0 0x1 /* enum */
  6403. #define MC_CMD_PARSER_DISP_RW_OUT_DP1 0x2 /* enum */
  6404. /***********************************/
  6405. /* MC_CMD_GET_PF_COUNT
  6406. * Get number of PFs on the device.
  6407. */
  6408. #define MC_CMD_GET_PF_COUNT 0xb6
  6409. #define MC_CMD_0xb6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6410. /* MC_CMD_GET_PF_COUNT_IN msgrequest */
  6411. #define MC_CMD_GET_PF_COUNT_IN_LEN 0
  6412. /* MC_CMD_GET_PF_COUNT_OUT msgresponse */
  6413. #define MC_CMD_GET_PF_COUNT_OUT_LEN 1
  6414. /* Identifies the number of PFs on the device. */
  6415. #define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST 0
  6416. #define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_LEN 1
  6417. /***********************************/
  6418. /* MC_CMD_SET_PF_COUNT
  6419. * Set number of PFs on the device.
  6420. */
  6421. #define MC_CMD_SET_PF_COUNT 0xb7
  6422. /* MC_CMD_SET_PF_COUNT_IN msgrequest */
  6423. #define MC_CMD_SET_PF_COUNT_IN_LEN 4
  6424. /* New number of PFs on the device. */
  6425. #define MC_CMD_SET_PF_COUNT_IN_PF_COUNT_OFST 0
  6426. /* MC_CMD_SET_PF_COUNT_OUT msgresponse */
  6427. #define MC_CMD_SET_PF_COUNT_OUT_LEN 0
  6428. /***********************************/
  6429. /* MC_CMD_GET_PORT_ASSIGNMENT
  6430. * Get port assignment for current PCI function.
  6431. */
  6432. #define MC_CMD_GET_PORT_ASSIGNMENT 0xb8
  6433. #define MC_CMD_0xb8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6434. /* MC_CMD_GET_PORT_ASSIGNMENT_IN msgrequest */
  6435. #define MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN 0
  6436. /* MC_CMD_GET_PORT_ASSIGNMENT_OUT msgresponse */
  6437. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN 4
  6438. /* Identifies the port assignment for this function. */
  6439. #define MC_CMD_GET_PORT_ASSIGNMENT_OUT_PORT_OFST 0
  6440. /***********************************/
  6441. /* MC_CMD_SET_PORT_ASSIGNMENT
  6442. * Set port assignment for current PCI function.
  6443. */
  6444. #define MC_CMD_SET_PORT_ASSIGNMENT 0xb9
  6445. #define MC_CMD_0xb9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6446. /* MC_CMD_SET_PORT_ASSIGNMENT_IN msgrequest */
  6447. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_LEN 4
  6448. /* Identifies the port assignment for this function. */
  6449. #define MC_CMD_SET_PORT_ASSIGNMENT_IN_PORT_OFST 0
  6450. /* MC_CMD_SET_PORT_ASSIGNMENT_OUT msgresponse */
  6451. #define MC_CMD_SET_PORT_ASSIGNMENT_OUT_LEN 0
  6452. /***********************************/
  6453. /* MC_CMD_ALLOC_VIS
  6454. * Allocate VIs for current PCI function.
  6455. */
  6456. #define MC_CMD_ALLOC_VIS 0x8b
  6457. #define MC_CMD_0x8b_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6458. /* MC_CMD_ALLOC_VIS_IN msgrequest */
  6459. #define MC_CMD_ALLOC_VIS_IN_LEN 8
  6460. /* The minimum number of VIs that is acceptable */
  6461. #define MC_CMD_ALLOC_VIS_IN_MIN_VI_COUNT_OFST 0
  6462. /* The maximum number of VIs that would be useful */
  6463. #define MC_CMD_ALLOC_VIS_IN_MAX_VI_COUNT_OFST 4
  6464. /* MC_CMD_ALLOC_VIS_OUT msgresponse: Huntington-compatible VI_ALLOC request.
  6465. * Use extended version in new code.
  6466. */
  6467. #define MC_CMD_ALLOC_VIS_OUT_LEN 8
  6468. /* The number of VIs allocated on this function */
  6469. #define MC_CMD_ALLOC_VIS_OUT_VI_COUNT_OFST 0
  6470. /* The base absolute VI number allocated to this function. Required to
  6471. * correctly interpret wakeup events.
  6472. */
  6473. #define MC_CMD_ALLOC_VIS_OUT_VI_BASE_OFST 4
  6474. /* MC_CMD_ALLOC_VIS_EXT_OUT msgresponse */
  6475. #define MC_CMD_ALLOC_VIS_EXT_OUT_LEN 12
  6476. /* The number of VIs allocated on this function */
  6477. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_COUNT_OFST 0
  6478. /* The base absolute VI number allocated to this function. Required to
  6479. * correctly interpret wakeup events.
  6480. */
  6481. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_BASE_OFST 4
  6482. /* Function's port vi_shift value (always 0 on Huntington) */
  6483. #define MC_CMD_ALLOC_VIS_EXT_OUT_VI_SHIFT_OFST 8
  6484. /***********************************/
  6485. /* MC_CMD_FREE_VIS
  6486. * Free VIs for current PCI function. Any linked PIO buffers will be unlinked,
  6487. * but not freed.
  6488. */
  6489. #define MC_CMD_FREE_VIS 0x8c
  6490. #define MC_CMD_0x8c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6491. /* MC_CMD_FREE_VIS_IN msgrequest */
  6492. #define MC_CMD_FREE_VIS_IN_LEN 0
  6493. /* MC_CMD_FREE_VIS_OUT msgresponse */
  6494. #define MC_CMD_FREE_VIS_OUT_LEN 0
  6495. /***********************************/
  6496. /* MC_CMD_GET_SRIOV_CFG
  6497. * Get SRIOV config for this PF.
  6498. */
  6499. #define MC_CMD_GET_SRIOV_CFG 0xba
  6500. #define MC_CMD_0xba_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6501. /* MC_CMD_GET_SRIOV_CFG_IN msgrequest */
  6502. #define MC_CMD_GET_SRIOV_CFG_IN_LEN 0
  6503. /* MC_CMD_GET_SRIOV_CFG_OUT msgresponse */
  6504. #define MC_CMD_GET_SRIOV_CFG_OUT_LEN 20
  6505. /* Number of VFs currently enabled. */
  6506. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_CURRENT_OFST 0
  6507. /* Max number of VFs before sriov stride and offset may need to be changed. */
  6508. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_MAX_OFST 4
  6509. #define MC_CMD_GET_SRIOV_CFG_OUT_FLAGS_OFST 8
  6510. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_LBN 0
  6511. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_WIDTH 1
  6512. /* RID offset of first VF from PF. */
  6513. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_OFFSET_OFST 12
  6514. /* RID offset of each subsequent VF from the previous. */
  6515. #define MC_CMD_GET_SRIOV_CFG_OUT_VF_STRIDE_OFST 16
  6516. /***********************************/
  6517. /* MC_CMD_SET_SRIOV_CFG
  6518. * Set SRIOV config for this PF.
  6519. */
  6520. #define MC_CMD_SET_SRIOV_CFG 0xbb
  6521. #define MC_CMD_0xbb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6522. /* MC_CMD_SET_SRIOV_CFG_IN msgrequest */
  6523. #define MC_CMD_SET_SRIOV_CFG_IN_LEN 20
  6524. /* Number of VFs currently enabled. */
  6525. #define MC_CMD_SET_SRIOV_CFG_IN_VF_CURRENT_OFST 0
  6526. /* Max number of VFs before sriov stride and offset may need to be changed. */
  6527. #define MC_CMD_SET_SRIOV_CFG_IN_VF_MAX_OFST 4
  6528. #define MC_CMD_SET_SRIOV_CFG_IN_FLAGS_OFST 8
  6529. #define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_LBN 0
  6530. #define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_WIDTH 1
  6531. /* RID offset of first VF from PF, or 0 for no change, or
  6532. * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate an offset.
  6533. */
  6534. #define MC_CMD_SET_SRIOV_CFG_IN_VF_OFFSET_OFST 12
  6535. /* RID offset of each subsequent VF from the previous, 0 for no change, or
  6536. * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate a stride.
  6537. */
  6538. #define MC_CMD_SET_SRIOV_CFG_IN_VF_STRIDE_OFST 16
  6539. /* MC_CMD_SET_SRIOV_CFG_OUT msgresponse */
  6540. #define MC_CMD_SET_SRIOV_CFG_OUT_LEN 0
  6541. /***********************************/
  6542. /* MC_CMD_GET_VI_ALLOC_INFO
  6543. * Get information about number of VI's and base VI number allocated to this
  6544. * function.
  6545. */
  6546. #define MC_CMD_GET_VI_ALLOC_INFO 0x8d
  6547. #define MC_CMD_0x8d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6548. /* MC_CMD_GET_VI_ALLOC_INFO_IN msgrequest */
  6549. #define MC_CMD_GET_VI_ALLOC_INFO_IN_LEN 0
  6550. /* MC_CMD_GET_VI_ALLOC_INFO_OUT msgresponse */
  6551. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_LEN 12
  6552. /* The number of VIs allocated on this function */
  6553. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_COUNT_OFST 0
  6554. /* The base absolute VI number allocated to this function. Required to
  6555. * correctly interpret wakeup events.
  6556. */
  6557. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_BASE_OFST 4
  6558. /* Function's port vi_shift value (always 0 on Huntington) */
  6559. #define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_SHIFT_OFST 8
  6560. /***********************************/
  6561. /* MC_CMD_DUMP_VI_STATE
  6562. * For CmdClient use. Dump pertinent information on a specific absolute VI.
  6563. */
  6564. #define MC_CMD_DUMP_VI_STATE 0x8e
  6565. #define MC_CMD_0x8e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6566. /* MC_CMD_DUMP_VI_STATE_IN msgrequest */
  6567. #define MC_CMD_DUMP_VI_STATE_IN_LEN 4
  6568. /* The VI number to query. */
  6569. #define MC_CMD_DUMP_VI_STATE_IN_VI_NUMBER_OFST 0
  6570. /* MC_CMD_DUMP_VI_STATE_OUT msgresponse */
  6571. #define MC_CMD_DUMP_VI_STATE_OUT_LEN 96
  6572. /* The PF part of the function owning this VI. */
  6573. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_OFST 0
  6574. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_LEN 2
  6575. /* The VF part of the function owning this VI. */
  6576. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_OFST 2
  6577. #define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_LEN 2
  6578. /* Base of VIs allocated to this function. */
  6579. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_OFST 4
  6580. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_LEN 2
  6581. /* Count of VIs allocated to the owner function. */
  6582. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_OFST 6
  6583. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_LEN 2
  6584. /* Base interrupt vector allocated to this function. */
  6585. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_OFST 8
  6586. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_LEN 2
  6587. /* Number of interrupt vectors allocated to this function. */
  6588. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_OFST 10
  6589. #define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_LEN 2
  6590. /* Raw evq ptr table data. */
  6591. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_OFST 12
  6592. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LEN 8
  6593. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LO_OFST 12
  6594. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_HI_OFST 16
  6595. /* Raw evq timer table data. */
  6596. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_OFST 20
  6597. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LEN 8
  6598. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LO_OFST 20
  6599. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_HI_OFST 24
  6600. /* Combined metadata field. */
  6601. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_OFST 28
  6602. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_LBN 0
  6603. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_WIDTH 16
  6604. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_LBN 16
  6605. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_WIDTH 8
  6606. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_LBN 24
  6607. #define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_WIDTH 8
  6608. /* TXDPCPU raw table data for queue. */
  6609. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_OFST 32
  6610. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LEN 8
  6611. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LO_OFST 32
  6612. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_HI_OFST 36
  6613. /* TXDPCPU raw table data for queue. */
  6614. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_OFST 40
  6615. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LEN 8
  6616. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LO_OFST 40
  6617. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_HI_OFST 44
  6618. /* TXDPCPU raw table data for queue. */
  6619. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_OFST 48
  6620. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LEN 8
  6621. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LO_OFST 48
  6622. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_HI_OFST 52
  6623. /* Combined metadata field. */
  6624. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_OFST 56
  6625. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LEN 8
  6626. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LO_OFST 56
  6627. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_HI_OFST 60
  6628. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_LBN 0
  6629. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_WIDTH 16
  6630. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_LBN 16
  6631. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_WIDTH 8
  6632. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_LBN 24
  6633. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_WIDTH 8
  6634. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_LBN 32
  6635. #define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_WIDTH 8
  6636. #define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_LBN 40
  6637. #define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_WIDTH 24
  6638. /* RXDPCPU raw table data for queue. */
  6639. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_OFST 64
  6640. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LEN 8
  6641. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LO_OFST 64
  6642. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_HI_OFST 68
  6643. /* RXDPCPU raw table data for queue. */
  6644. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_OFST 72
  6645. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LEN 8
  6646. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LO_OFST 72
  6647. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_HI_OFST 76
  6648. /* Reserved, currently 0. */
  6649. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_OFST 80
  6650. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LEN 8
  6651. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LO_OFST 80
  6652. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_HI_OFST 84
  6653. /* Combined metadata field. */
  6654. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_OFST 88
  6655. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LEN 8
  6656. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LO_OFST 88
  6657. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_HI_OFST 92
  6658. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_LBN 0
  6659. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_WIDTH 16
  6660. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_LBN 16
  6661. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_WIDTH 8
  6662. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_LBN 24
  6663. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_WIDTH 8
  6664. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_LBN 32
  6665. #define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_WIDTH 8
  6666. /***********************************/
  6667. /* MC_CMD_ALLOC_PIOBUF
  6668. * Allocate a push I/O buffer for later use with a tx queue.
  6669. */
  6670. #define MC_CMD_ALLOC_PIOBUF 0x8f
  6671. #define MC_CMD_0x8f_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  6672. /* MC_CMD_ALLOC_PIOBUF_IN msgrequest */
  6673. #define MC_CMD_ALLOC_PIOBUF_IN_LEN 0
  6674. /* MC_CMD_ALLOC_PIOBUF_OUT msgresponse */
  6675. #define MC_CMD_ALLOC_PIOBUF_OUT_LEN 4
  6676. /* Handle for allocated push I/O buffer. */
  6677. #define MC_CMD_ALLOC_PIOBUF_OUT_PIOBUF_HANDLE_OFST 0
  6678. /***********************************/
  6679. /* MC_CMD_FREE_PIOBUF
  6680. * Free a push I/O buffer.
  6681. */
  6682. #define MC_CMD_FREE_PIOBUF 0x90
  6683. #define MC_CMD_0x90_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  6684. /* MC_CMD_FREE_PIOBUF_IN msgrequest */
  6685. #define MC_CMD_FREE_PIOBUF_IN_LEN 4
  6686. /* Handle for allocated push I/O buffer. */
  6687. #define MC_CMD_FREE_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
  6688. /* MC_CMD_FREE_PIOBUF_OUT msgresponse */
  6689. #define MC_CMD_FREE_PIOBUF_OUT_LEN 0
  6690. /***********************************/
  6691. /* MC_CMD_GET_VI_TLP_PROCESSING
  6692. * Get TLP steering and ordering information for a VI.
  6693. */
  6694. #define MC_CMD_GET_VI_TLP_PROCESSING 0xb0
  6695. #define MC_CMD_0xb0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6696. /* MC_CMD_GET_VI_TLP_PROCESSING_IN msgrequest */
  6697. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_LEN 4
  6698. /* VI number to get information for. */
  6699. #define MC_CMD_GET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
  6700. /* MC_CMD_GET_VI_TLP_PROCESSING_OUT msgresponse */
  6701. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_LEN 4
  6702. /* Transaction processing steering hint 1 for use with the Rx Queue. */
  6703. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_OFST 0
  6704. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_LEN 1
  6705. /* Transaction processing steering hint 2 for use with the Ev Queue. */
  6706. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_OFST 1
  6707. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_LEN 1
  6708. /* Use Relaxed ordering model for TLPs on this VI. */
  6709. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_LBN 16
  6710. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_WIDTH 1
  6711. /* Use ID based ordering for TLPs on this VI. */
  6712. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_LBN 17
  6713. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_WIDTH 1
  6714. /* Set no snoop bit for TLPs on this VI. */
  6715. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_LBN 18
  6716. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_WIDTH 1
  6717. /* Enable TPH for TLPs on this VI. */
  6718. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_LBN 19
  6719. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_WIDTH 1
  6720. #define MC_CMD_GET_VI_TLP_PROCESSING_OUT_DATA_OFST 0
  6721. /***********************************/
  6722. /* MC_CMD_SET_VI_TLP_PROCESSING
  6723. * Set TLP steering and ordering information for a VI.
  6724. */
  6725. #define MC_CMD_SET_VI_TLP_PROCESSING 0xb1
  6726. #define MC_CMD_0xb1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6727. /* MC_CMD_SET_VI_TLP_PROCESSING_IN msgrequest */
  6728. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_LEN 8
  6729. /* VI number to set information for. */
  6730. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
  6731. /* Transaction processing steering hint 1 for use with the Rx Queue. */
  6732. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_OFST 4
  6733. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_LEN 1
  6734. /* Transaction processing steering hint 2 for use with the Ev Queue. */
  6735. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_OFST 5
  6736. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_LEN 1
  6737. /* Use Relaxed ordering model for TLPs on this VI. */
  6738. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_LBN 48
  6739. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_WIDTH 1
  6740. /* Use ID based ordering for TLPs on this VI. */
  6741. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_LBN 49
  6742. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_WIDTH 1
  6743. /* Set the no snoop bit for TLPs on this VI. */
  6744. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_LBN 50
  6745. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_WIDTH 1
  6746. /* Enable TPH for TLPs on this VI. */
  6747. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_LBN 51
  6748. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_WIDTH 1
  6749. #define MC_CMD_SET_VI_TLP_PROCESSING_IN_DATA_OFST 4
  6750. /* MC_CMD_SET_VI_TLP_PROCESSING_OUT msgresponse */
  6751. #define MC_CMD_SET_VI_TLP_PROCESSING_OUT_LEN 0
  6752. /***********************************/
  6753. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS
  6754. * Get global PCIe steering and transaction processing configuration.
  6755. */
  6756. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS 0xbc
  6757. #define MC_CMD_0xbc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6758. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN msgrequest */
  6759. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_LEN 4
  6760. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
  6761. /* enum: MISC. */
  6762. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_MISC 0x0
  6763. /* enum: IDO. */
  6764. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_IDO 0x1
  6765. /* enum: RO. */
  6766. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_RO 0x2
  6767. /* enum: TPH Type. */
  6768. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_TPH_TYPE 0x3
  6769. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
  6770. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_LEN 8
  6771. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_GLOBAL_CATEGORY_OFST 0
  6772. /* Enum values, see field(s): */
  6773. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
  6774. /* Amalgamated TLP info word. */
  6775. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_WORD_OFST 4
  6776. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_LBN 0
  6777. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_WIDTH 1
  6778. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_LBN 1
  6779. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_WIDTH 31
  6780. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_LBN 0
  6781. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_WIDTH 1
  6782. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_LBN 1
  6783. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_WIDTH 1
  6784. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_LBN 2
  6785. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_WIDTH 1
  6786. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_LBN 3
  6787. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_WIDTH 1
  6788. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_LBN 4
  6789. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_WIDTH 28
  6790. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_LBN 0
  6791. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_WIDTH 1
  6792. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_LBN 1
  6793. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_WIDTH 1
  6794. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_LBN 2
  6795. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_WIDTH 1
  6796. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_LBN 3
  6797. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_WIDTH 29
  6798. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_LBN 0
  6799. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
  6800. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_LBN 2
  6801. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_WIDTH 2
  6802. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_LBN 4
  6803. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_WIDTH 2
  6804. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_LBN 6
  6805. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_WIDTH 2
  6806. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_LBN 8
  6807. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_WIDTH 2
  6808. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_LBN 9
  6809. #define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_WIDTH 23
  6810. /***********************************/
  6811. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS
  6812. * Set global PCIe steering and transaction processing configuration.
  6813. */
  6814. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS 0xbd
  6815. #define MC_CMD_0xbd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6816. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN msgrequest */
  6817. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_LEN 8
  6818. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
  6819. /* Enum values, see field(s): */
  6820. /* MC_CMD_GET_TLP_PROCESSING_GLOBALS/MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
  6821. /* Amalgamated TLP info word. */
  6822. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_WORD_OFST 4
  6823. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_LBN 0
  6824. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_WIDTH 1
  6825. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_LBN 0
  6826. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_WIDTH 1
  6827. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_LBN 1
  6828. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_WIDTH 1
  6829. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_LBN 2
  6830. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_WIDTH 1
  6831. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_LBN 3
  6832. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_WIDTH 1
  6833. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_LBN 0
  6834. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_WIDTH 1
  6835. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_LBN 1
  6836. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_WIDTH 1
  6837. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_LBN 2
  6838. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_WIDTH 1
  6839. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_LBN 0
  6840. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
  6841. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_LBN 2
  6842. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_WIDTH 2
  6843. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_LBN 4
  6844. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_WIDTH 2
  6845. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_LBN 6
  6846. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_WIDTH 2
  6847. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_LBN 8
  6848. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_WIDTH 2
  6849. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_LBN 10
  6850. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_WIDTH 22
  6851. /* MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
  6852. #define MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT_LEN 0
  6853. /***********************************/
  6854. /* MC_CMD_SATELLITE_DOWNLOAD
  6855. * Download a new set of images to the satellite CPUs from the host.
  6856. */
  6857. #define MC_CMD_SATELLITE_DOWNLOAD 0x91
  6858. #define MC_CMD_0x91_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  6859. /* MC_CMD_SATELLITE_DOWNLOAD_IN msgrequest: The reset requirements for the CPUs
  6860. * are subtle, and so downloads must proceed in a number of phases.
  6861. *
  6862. * 1) PHASE_RESET with a target of TARGET_ALL and chunk ID/length of 0.
  6863. *
  6864. * 2) PHASE_IMEMS for each of the IMEM targets (target IDs 0-11). Each download
  6865. * may consist of multiple chunks. The final chunk (with CHUNK_ID_LAST) should
  6866. * be a checksum (a simple 32-bit sum) of the transferred data. An individual
  6867. * download may be aborted using CHUNK_ID_ABORT.
  6868. *
  6869. * 3) PHASE_VECTORS for each of the vector table targets (target IDs 12-15),
  6870. * similar to PHASE_IMEMS.
  6871. *
  6872. * 4) PHASE_READY with a target of TARGET_ALL and chunk ID/length of 0.
  6873. *
  6874. * After any error (a requested abort is not considered to be an error) the
  6875. * sequence must be restarted from PHASE_RESET.
  6876. */
  6877. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMIN 20
  6878. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMAX 252
  6879. #define MC_CMD_SATELLITE_DOWNLOAD_IN_LEN(num) (16+4*(num))
  6880. /* Download phase. (Note: the IDLE phase is used internally and is never valid
  6881. * in a command from the host.)
  6882. */
  6883. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_OFST 0
  6884. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IDLE 0x0 /* enum */
  6885. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_RESET 0x1 /* enum */
  6886. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IMEMS 0x2 /* enum */
  6887. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_VECTORS 0x3 /* enum */
  6888. #define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_READY 0x4 /* enum */
  6889. /* Target for download. (These match the blob numbers defined in
  6890. * mc_flash_layout.h.)
  6891. */
  6892. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_OFST 4
  6893. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6894. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_TEXT 0x0
  6895. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6896. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_TEXT 0x1
  6897. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6898. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDP_TEXT 0x2
  6899. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6900. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDP_TEXT 0x3
  6901. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6902. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT 0x4
  6903. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6904. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT_CFG 0x5
  6905. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6906. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT 0x6
  6907. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6908. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT_CFG 0x7
  6909. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6910. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_PGM 0x8
  6911. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6912. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_SL_PGM 0x9
  6913. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6914. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_PGM 0xa
  6915. /* enum: Valid in phase 2 (PHASE_IMEMS) only */
  6916. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_SL_PGM 0xb
  6917. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  6918. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL0 0xc
  6919. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  6920. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL0 0xd
  6921. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  6922. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL1 0xe
  6923. /* enum: Valid in phase 3 (PHASE_VECTORS) only */
  6924. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL1 0xf
  6925. /* enum: Valid in phases 1 (PHASE_RESET) and 4 (PHASE_READY) only */
  6926. #define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_ALL 0xffffffff
  6927. /* Chunk ID, or CHUNK_ID_LAST or CHUNK_ID_ABORT */
  6928. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_OFST 8
  6929. /* enum: Last chunk, containing checksum rather than data */
  6930. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_LAST 0xffffffff
  6931. /* enum: Abort download of this item */
  6932. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_ABORT 0xfffffffe
  6933. /* Length of this chunk in bytes */
  6934. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_LEN_OFST 12
  6935. /* Data for this chunk */
  6936. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_OFST 16
  6937. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_LEN 4
  6938. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MINNUM 1
  6939. #define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MAXNUM 59
  6940. /* MC_CMD_SATELLITE_DOWNLOAD_OUT msgresponse */
  6941. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_LEN 8
  6942. /* Same as MC_CMD_ERR field, but included as 0 in success cases */
  6943. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_RESULT_OFST 0
  6944. /* Extra status information */
  6945. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_INFO_OFST 4
  6946. /* enum: Code download OK, completed. */
  6947. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_COMPLETE 0x0
  6948. /* enum: Code download aborted as requested. */
  6949. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_ABORTED 0x1
  6950. /* enum: Code download OK so far, send next chunk. */
  6951. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_NEXT_CHUNK 0x2
  6952. /* enum: Download phases out of sequence */
  6953. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_PHASE 0x100
  6954. /* enum: Bad target for this phase */
  6955. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_TARGET 0x101
  6956. /* enum: Chunk ID out of sequence */
  6957. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_ID 0x200
  6958. /* enum: Chunk length zero or too large */
  6959. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_LEN 0x201
  6960. /* enum: Checksum was incorrect */
  6961. #define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHECKSUM 0x300
  6962. /***********************************/
  6963. /* MC_CMD_GET_CAPABILITIES
  6964. * Get device capabilities.
  6965. *
  6966. * This is supplementary to the MC_CMD_GET_BOARD_CFG command, and intended to
  6967. * reference inherent device capabilities as opposed to current NVRAM config.
  6968. */
  6969. #define MC_CMD_GET_CAPABILITIES 0xbe
  6970. #define MC_CMD_0xbe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  6971. /* MC_CMD_GET_CAPABILITIES_IN msgrequest */
  6972. #define MC_CMD_GET_CAPABILITIES_IN_LEN 0
  6973. /* MC_CMD_GET_CAPABILITIES_OUT msgresponse */
  6974. #define MC_CMD_GET_CAPABILITIES_OUT_LEN 20
  6975. /* First word of flags. */
  6976. #define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_OFST 0
  6977. #define MC_CMD_GET_CAPABILITIES_OUT_VPORT_RECONFIGURE_LBN 3
  6978. #define MC_CMD_GET_CAPABILITIES_OUT_VPORT_RECONFIGURE_WIDTH 1
  6979. #define MC_CMD_GET_CAPABILITIES_OUT_TX_STRIPING_LBN 4
  6980. #define MC_CMD_GET_CAPABILITIES_OUT_TX_STRIPING_WIDTH 1
  6981. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_QUERY_LBN 5
  6982. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_QUERY_WIDTH 1
  6983. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  6984. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  6985. #define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_LBN 7
  6986. #define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  6987. #define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  6988. #define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  6989. #define MC_CMD_GET_CAPABILITIES_OUT_SET_MAC_ENHANCED_LBN 9
  6990. #define MC_CMD_GET_CAPABILITIES_OUT_SET_MAC_ENHANCED_WIDTH 1
  6991. #define MC_CMD_GET_CAPABILITIES_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  6992. #define MC_CMD_GET_CAPABILITIES_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  6993. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  6994. #define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  6995. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  6996. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  6997. #define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_LBN 13
  6998. #define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  6999. #define MC_CMD_GET_CAPABILITIES_OUT_QBB_LBN 14
  7000. #define MC_CMD_GET_CAPABILITIES_OUT_QBB_WIDTH 1
  7001. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  7002. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  7003. #define MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_LBN 16
  7004. #define MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_WIDTH 1
  7005. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_LBN 17
  7006. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_WIDTH 1
  7007. #define MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS_LBN 18
  7008. #define MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS_WIDTH 1
  7009. #define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_LBN 19
  7010. #define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_WIDTH 1
  7011. #define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_LBN 20
  7012. #define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_WIDTH 1
  7013. #define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN 21
  7014. #define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_WIDTH 1
  7015. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_LBN 22
  7016. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_WIDTH 1
  7017. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN 23
  7018. #define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_WIDTH 1
  7019. #define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_LBN 24
  7020. #define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_WIDTH 1
  7021. #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_LBN 25
  7022. #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1
  7023. #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26
  7024. #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  7025. #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  7026. #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  7027. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER_LBN 28
  7028. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER_WIDTH 1
  7029. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  7030. #define MC_CMD_GET_CAPABILITIES_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  7031. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN 30
  7032. #define MC_CMD_GET_CAPABILITIES_OUT_EVB_WIDTH 1
  7033. #define MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_LBN 31
  7034. #define MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_WIDTH 1
  7035. /* RxDPCPU firmware id. */
  7036. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4
  7037. #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2
  7038. /* enum: Standard RXDP firmware */
  7039. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP 0x0
  7040. /* enum: Low latency RXDP firmware */
  7041. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_LOW_LATENCY 0x1
  7042. /* enum: Packed stream RXDP firmware */
  7043. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_PACKED_STREAM 0x2
  7044. /* enum: BIST RXDP firmware */
  7045. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_BIST 0x10a
  7046. /* enum: RXDP Test firmware image 1 */
  7047. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  7048. /* enum: RXDP Test firmware image 2 */
  7049. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  7050. /* enum: RXDP Test firmware image 3 */
  7051. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  7052. /* enum: RXDP Test firmware image 4 */
  7053. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  7054. /* enum: RXDP Test firmware image 5 */
  7055. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_BACKPRESSURE 0x105
  7056. /* enum: RXDP Test firmware image 6 */
  7057. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  7058. /* enum: RXDP Test firmware image 7 */
  7059. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  7060. /* enum: RXDP Test firmware image 8 */
  7061. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  7062. /* enum: RXDP Test firmware image 9 */
  7063. #define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  7064. /* TxDPCPU firmware id. */
  7065. #define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_OFST 6
  7066. #define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_LEN 2
  7067. /* enum: Standard TXDP firmware */
  7068. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP 0x0
  7069. /* enum: Low latency TXDP firmware */
  7070. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_LOW_LATENCY 0x1
  7071. /* enum: High packet rate TXDP firmware */
  7072. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_HIGH_PACKET_RATE 0x3
  7073. /* enum: BIST TXDP firmware */
  7074. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_BIST 0x12d
  7075. /* enum: TXDP Test firmware image 1 */
  7076. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  7077. /* enum: TXDP Test firmware image 2 */
  7078. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  7079. /* enum: TXDP CSR bus test firmware */
  7080. #define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_CSR 0x103
  7081. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_OFST 8
  7082. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_LEN 2
  7083. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_LBN 0
  7084. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  7085. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  7086. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  7087. /* enum: reserved value - do not use (may indicate alternative interpretation
  7088. * of REV field in future)
  7089. */
  7090. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RESERVED 0x0
  7091. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  7092. * development only)
  7093. */
  7094. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  7095. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  7096. * (Huntington development only)
  7097. */
  7098. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  7099. /* enum: Virtual switching (full feature) RX PD production firmware */
  7100. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  7101. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  7102. * (Huntington development only)
  7103. */
  7104. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  7105. /* enum: Low latency RX PD production firmware */
  7106. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  7107. /* enum: Packed stream RX PD production firmware */
  7108. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  7109. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  7110. * tests (Medford development only)
  7111. */
  7112. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  7113. /* enum: Rules engine RX PD production firmware */
  7114. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  7115. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  7116. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  7117. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  7118. * encapsulations (Medford development only)
  7119. */
  7120. #define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  7121. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_OFST 10
  7122. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_LEN 2
  7123. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_LBN 0
  7124. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  7125. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  7126. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  7127. /* enum: reserved value - do not use (may indicate alternative interpretation
  7128. * of REV field in future)
  7129. */
  7130. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RESERVED 0x0
  7131. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  7132. * development only)
  7133. */
  7134. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  7135. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  7136. * (Huntington development only)
  7137. */
  7138. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  7139. /* enum: Virtual switching (full feature) TX PD production firmware */
  7140. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  7141. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  7142. * (Huntington development only)
  7143. */
  7144. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  7145. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  7146. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  7147. * tests (Medford development only)
  7148. */
  7149. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  7150. /* enum: Rules engine TX PD production firmware */
  7151. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  7152. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  7153. #define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  7154. /* Hardware capabilities of NIC */
  7155. #define MC_CMD_GET_CAPABILITIES_OUT_HW_CAPABILITIES_OFST 12
  7156. /* Licensed capabilities */
  7157. #define MC_CMD_GET_CAPABILITIES_OUT_LICENSE_CAPABILITIES_OFST 16
  7158. /* MC_CMD_GET_CAPABILITIES_V2_IN msgrequest */
  7159. #define MC_CMD_GET_CAPABILITIES_V2_IN_LEN 0
  7160. /* MC_CMD_GET_CAPABILITIES_V2_OUT msgresponse */
  7161. #define MC_CMD_GET_CAPABILITIES_V2_OUT_LEN 72
  7162. /* First word of flags. */
  7163. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS1_OFST 0
  7164. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_LBN 3
  7165. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VPORT_RECONFIGURE_WIDTH 1
  7166. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_STRIPING_LBN 4
  7167. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_STRIPING_WIDTH 1
  7168. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_QUERY_LBN 5
  7169. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_QUERY_WIDTH 1
  7170. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  7171. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  7172. #define MC_CMD_GET_CAPABILITIES_V2_OUT_DRV_ATTACH_PREBOOT_LBN 7
  7173. #define MC_CMD_GET_CAPABILITIES_V2_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  7174. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  7175. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  7176. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SET_MAC_ENHANCED_LBN 9
  7177. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SET_MAC_ENHANCED_WIDTH 1
  7178. #define MC_CMD_GET_CAPABILITIES_V2_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  7179. #define MC_CMD_GET_CAPABILITIES_V2_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  7180. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  7181. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  7182. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  7183. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  7184. #define MC_CMD_GET_CAPABILITIES_V2_OUT_ADDITIONAL_RSS_MODES_LBN 13
  7185. #define MC_CMD_GET_CAPABILITIES_V2_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  7186. #define MC_CMD_GET_CAPABILITIES_V2_OUT_QBB_LBN 14
  7187. #define MC_CMD_GET_CAPABILITIES_V2_OUT_QBB_WIDTH 1
  7188. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  7189. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  7190. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_RSS_LIMITED_LBN 16
  7191. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_RSS_LIMITED_WIDTH 1
  7192. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_LBN 17
  7193. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PACKED_STREAM_WIDTH 1
  7194. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_INCLUDE_FCS_LBN 18
  7195. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_INCLUDE_FCS_WIDTH 1
  7196. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VLAN_INSERTION_LBN 19
  7197. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VLAN_INSERTION_WIDTH 1
  7198. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_VLAN_STRIPPING_LBN 20
  7199. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_VLAN_STRIPPING_WIDTH 1
  7200. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_LBN 21
  7201. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_WIDTH 1
  7202. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_0_LBN 22
  7203. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_0_WIDTH 1
  7204. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_14_LBN 23
  7205. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_PREFIX_LEN_14_WIDTH 1
  7206. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_TIMESTAMP_LBN 24
  7207. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_TIMESTAMP_WIDTH 1
  7208. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_BATCHING_LBN 25
  7209. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_BATCHING_WIDTH 1
  7210. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCAST_FILTER_CHAINING_LBN 26
  7211. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  7212. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  7213. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  7214. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DISABLE_SCATTER_LBN 28
  7215. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DISABLE_SCATTER_WIDTH 1
  7216. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  7217. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  7218. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_LBN 30
  7219. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVB_WIDTH 1
  7220. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VXLAN_NVGRE_LBN 31
  7221. #define MC_CMD_GET_CAPABILITIES_V2_OUT_VXLAN_NVGRE_WIDTH 1
  7222. /* RxDPCPU firmware id. */
  7223. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DPCPU_FW_ID_OFST 4
  7224. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DPCPU_FW_ID_LEN 2
  7225. /* enum: Standard RXDP firmware */
  7226. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP 0x0
  7227. /* enum: Low latency RXDP firmware */
  7228. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_LOW_LATENCY 0x1
  7229. /* enum: Packed stream RXDP firmware */
  7230. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_PACKED_STREAM 0x2
  7231. /* enum: BIST RXDP firmware */
  7232. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_BIST 0x10a
  7233. /* enum: RXDP Test firmware image 1 */
  7234. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  7235. /* enum: RXDP Test firmware image 2 */
  7236. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  7237. /* enum: RXDP Test firmware image 3 */
  7238. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  7239. /* enum: RXDP Test firmware image 4 */
  7240. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  7241. /* enum: RXDP Test firmware image 5 */
  7242. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_BACKPRESSURE 0x105
  7243. /* enum: RXDP Test firmware image 6 */
  7244. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  7245. /* enum: RXDP Test firmware image 7 */
  7246. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  7247. /* enum: RXDP Test firmware image 8 */
  7248. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  7249. /* enum: RXDP Test firmware image 9 */
  7250. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  7251. /* TxDPCPU firmware id. */
  7252. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DPCPU_FW_ID_OFST 6
  7253. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DPCPU_FW_ID_LEN 2
  7254. /* enum: Standard TXDP firmware */
  7255. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP 0x0
  7256. /* enum: Low latency TXDP firmware */
  7257. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_LOW_LATENCY 0x1
  7258. /* enum: High packet rate TXDP firmware */
  7259. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_HIGH_PACKET_RATE 0x3
  7260. /* enum: BIST TXDP firmware */
  7261. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_BIST 0x12d
  7262. /* enum: TXDP Test firmware image 1 */
  7263. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  7264. /* enum: TXDP Test firmware image 2 */
  7265. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  7266. /* enum: TXDP CSR bus test firmware */
  7267. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXDP_TEST_FW_CSR 0x103
  7268. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_OFST 8
  7269. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_LEN 2
  7270. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_LBN 0
  7271. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  7272. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  7273. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  7274. /* enum: reserved value - do not use (may indicate alternative interpretation
  7275. * of REV field in future)
  7276. */
  7277. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RESERVED 0x0
  7278. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  7279. * development only)
  7280. */
  7281. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  7282. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  7283. * (Huntington development only)
  7284. */
  7285. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  7286. /* enum: Virtual switching (full feature) RX PD production firmware */
  7287. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  7288. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  7289. * (Huntington development only)
  7290. */
  7291. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  7292. /* enum: Low latency RX PD production firmware */
  7293. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  7294. /* enum: Packed stream RX PD production firmware */
  7295. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  7296. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  7297. * tests (Medford development only)
  7298. */
  7299. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  7300. /* enum: Rules engine RX PD production firmware */
  7301. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  7302. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  7303. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  7304. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  7305. * encapsulations (Medford development only)
  7306. */
  7307. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  7308. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_OFST 10
  7309. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_LEN 2
  7310. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_REV_LBN 0
  7311. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  7312. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  7313. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  7314. /* enum: reserved value - do not use (may indicate alternative interpretation
  7315. * of REV field in future)
  7316. */
  7317. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RESERVED 0x0
  7318. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  7319. * development only)
  7320. */
  7321. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  7322. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  7323. * (Huntington development only)
  7324. */
  7325. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  7326. /* enum: Virtual switching (full feature) TX PD production firmware */
  7327. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  7328. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  7329. * (Huntington development only)
  7330. */
  7331. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  7332. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  7333. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  7334. * tests (Medford development only)
  7335. */
  7336. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  7337. /* enum: Rules engine TX PD production firmware */
  7338. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  7339. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  7340. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  7341. /* Hardware capabilities of NIC */
  7342. #define MC_CMD_GET_CAPABILITIES_V2_OUT_HW_CAPABILITIES_OFST 12
  7343. /* Licensed capabilities */
  7344. #define MC_CMD_GET_CAPABILITIES_V2_OUT_LICENSE_CAPABILITIES_OFST 16
  7345. /* Second word of flags. Not present on older firmware (check the length). */
  7346. #define MC_CMD_GET_CAPABILITIES_V2_OUT_FLAGS2_OFST 20
  7347. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_LBN 0
  7348. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_WIDTH 1
  7349. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_LBN 1
  7350. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_ENCAP_WIDTH 1
  7351. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVQ_TIMER_CTRL_LBN 2
  7352. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVQ_TIMER_CTRL_WIDTH 1
  7353. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_LBN 3
  7354. #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_WIDTH 1
  7355. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_LBN 4
  7356. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_WIDTH 1
  7357. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_LBN 5
  7358. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_WIDTH 1
  7359. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6
  7360. #define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1
  7361. #define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_LBN 7
  7362. #define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_WIDTH 1
  7363. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_LBN 8
  7364. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_MAC_TIMESTAMPING_WIDTH 1
  7365. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TIMESTAMP_LBN 9
  7366. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TIMESTAMP_WIDTH 1
  7367. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_SNIFF_LBN 10
  7368. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_SNIFF_WIDTH 1
  7369. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_SNIFF_LBN 11
  7370. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_SNIFF_WIDTH 1
  7371. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12
  7372. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1
  7373. /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present
  7374. * on older firmware (check the length).
  7375. */
  7376. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24
  7377. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2
  7378. /* One byte per PF containing the number of the external port assigned to this
  7379. * PF, indexed by PF number. Special values indicate that a PF is either not
  7380. * present or not assigned.
  7381. */
  7382. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26
  7383. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1
  7384. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16
  7385. /* enum: The caller is not permitted to access information on this PF. */
  7386. #define MC_CMD_GET_CAPABILITIES_V2_OUT_ACCESS_NOT_PERMITTED 0xff
  7387. /* enum: PF does not exist. */
  7388. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_PRESENT 0xfe
  7389. /* enum: PF does exist but is not assigned to any external port. */
  7390. #define MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_ASSIGNED 0xfd
  7391. /* enum: This value indicates that PF is assigned, but it cannot be expressed
  7392. * in this field. It is intended for a possible future situation where a more
  7393. * complex scheme of PFs to ports mapping is being used. The future driver
  7394. * should look for a new field supporting the new scheme. The current/old
  7395. * driver should treat this value as PF_NOT_ASSIGNED.
  7396. */
  7397. #define MC_CMD_GET_CAPABILITIES_V2_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc
  7398. /* One byte per PF containing the number of its VFs, indexed by PF number. A
  7399. * special value indicates that a PF is not present.
  7400. */
  7401. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_OFST 42
  7402. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_LEN 1
  7403. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VFS_PER_PF_NUM 16
  7404. /* enum: The caller is not permitted to access information on this PF. */
  7405. /* MC_CMD_GET_CAPABILITIES_V2_OUT_ACCESS_NOT_PERMITTED 0xff */
  7406. /* enum: PF does not exist. */
  7407. /* MC_CMD_GET_CAPABILITIES_V2_OUT_PF_NOT_PRESENT 0xfe */
  7408. /* Number of VIs available for each external port */
  7409. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_OFST 58
  7410. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_LEN 2
  7411. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_VIS_PER_PORT_NUM 4
  7412. /* Size of RX descriptor cache expressed as binary logarithm The actual size
  7413. * equals (2 ^ RX_DESC_CACHE_SIZE)
  7414. */
  7415. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DESC_CACHE_SIZE_OFST 66
  7416. #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_DESC_CACHE_SIZE_LEN 1
  7417. /* Size of TX descriptor cache expressed as binary logarithm The actual size
  7418. * equals (2 ^ TX_DESC_CACHE_SIZE)
  7419. */
  7420. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DESC_CACHE_SIZE_OFST 67
  7421. #define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_DESC_CACHE_SIZE_LEN 1
  7422. /* Total number of available PIO buffers */
  7423. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_PIO_BUFFS_OFST 68
  7424. #define MC_CMD_GET_CAPABILITIES_V2_OUT_NUM_PIO_BUFFS_LEN 2
  7425. /* Size of a single PIO buffer */
  7426. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_OFST 70
  7427. #define MC_CMD_GET_CAPABILITIES_V2_OUT_SIZE_PIO_BUFF_LEN 2
  7428. /* MC_CMD_GET_CAPABILITIES_V3_OUT msgresponse */
  7429. #define MC_CMD_GET_CAPABILITIES_V3_OUT_LEN 73
  7430. /* First word of flags. */
  7431. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS1_OFST 0
  7432. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VPORT_RECONFIGURE_LBN 3
  7433. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VPORT_RECONFIGURE_WIDTH 1
  7434. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_STRIPING_LBN 4
  7435. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_STRIPING_WIDTH 1
  7436. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_QUERY_LBN 5
  7437. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_QUERY_WIDTH 1
  7438. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_PORT_VLAN_RESTRICT_LBN 6
  7439. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_PORT_VLAN_RESTRICT_WIDTH 1
  7440. #define MC_CMD_GET_CAPABILITIES_V3_OUT_DRV_ATTACH_PREBOOT_LBN 7
  7441. #define MC_CMD_GET_CAPABILITIES_V3_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
  7442. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_FORCE_EVENT_MERGING_LBN 8
  7443. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
  7444. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SET_MAC_ENHANCED_LBN 9
  7445. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SET_MAC_ENHANCED_WIDTH 1
  7446. #define MC_CMD_GET_CAPABILITIES_V3_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
  7447. #define MC_CMD_GET_CAPABILITIES_V3_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
  7448. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
  7449. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  7450. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
  7451. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
  7452. #define MC_CMD_GET_CAPABILITIES_V3_OUT_ADDITIONAL_RSS_MODES_LBN 13
  7453. #define MC_CMD_GET_CAPABILITIES_V3_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
  7454. #define MC_CMD_GET_CAPABILITIES_V3_OUT_QBB_LBN 14
  7455. #define MC_CMD_GET_CAPABILITIES_V3_OUT_QBB_WIDTH 1
  7456. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
  7457. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
  7458. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_RSS_LIMITED_LBN 16
  7459. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_RSS_LIMITED_WIDTH 1
  7460. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_LBN 17
  7461. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PACKED_STREAM_WIDTH 1
  7462. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_INCLUDE_FCS_LBN 18
  7463. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_INCLUDE_FCS_WIDTH 1
  7464. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VLAN_INSERTION_LBN 19
  7465. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VLAN_INSERTION_WIDTH 1
  7466. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_VLAN_STRIPPING_LBN 20
  7467. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_VLAN_STRIPPING_WIDTH 1
  7468. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_LBN 21
  7469. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_WIDTH 1
  7470. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_0_LBN 22
  7471. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_0_WIDTH 1
  7472. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_14_LBN 23
  7473. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_PREFIX_LEN_14_WIDTH 1
  7474. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_TIMESTAMP_LBN 24
  7475. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_TIMESTAMP_WIDTH 1
  7476. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_BATCHING_LBN 25
  7477. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_BATCHING_WIDTH 1
  7478. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCAST_FILTER_CHAINING_LBN 26
  7479. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MCAST_FILTER_CHAINING_WIDTH 1
  7480. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PM_AND_RXDP_COUNTERS_LBN 27
  7481. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
  7482. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DISABLE_SCATTER_LBN 28
  7483. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DISABLE_SCATTER_WIDTH 1
  7484. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
  7485. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
  7486. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_LBN 30
  7487. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVB_WIDTH 1
  7488. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VXLAN_NVGRE_LBN 31
  7489. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VXLAN_NVGRE_WIDTH 1
  7490. /* RxDPCPU firmware id. */
  7491. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DPCPU_FW_ID_OFST 4
  7492. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DPCPU_FW_ID_LEN 2
  7493. /* enum: Standard RXDP firmware */
  7494. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP 0x0
  7495. /* enum: Low latency RXDP firmware */
  7496. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_LOW_LATENCY 0x1
  7497. /* enum: Packed stream RXDP firmware */
  7498. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_PACKED_STREAM 0x2
  7499. /* enum: BIST RXDP firmware */
  7500. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_BIST 0x10a
  7501. /* enum: RXDP Test firmware image 1 */
  7502. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
  7503. /* enum: RXDP Test firmware image 2 */
  7504. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
  7505. /* enum: RXDP Test firmware image 3 */
  7506. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
  7507. /* enum: RXDP Test firmware image 4 */
  7508. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
  7509. /* enum: RXDP Test firmware image 5 */
  7510. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_BACKPRESSURE 0x105
  7511. /* enum: RXDP Test firmware image 6 */
  7512. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
  7513. /* enum: RXDP Test firmware image 7 */
  7514. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
  7515. /* enum: RXDP Test firmware image 8 */
  7516. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
  7517. /* enum: RXDP Test firmware image 9 */
  7518. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
  7519. /* TxDPCPU firmware id. */
  7520. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DPCPU_FW_ID_OFST 6
  7521. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DPCPU_FW_ID_LEN 2
  7522. /* enum: Standard TXDP firmware */
  7523. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP 0x0
  7524. /* enum: Low latency TXDP firmware */
  7525. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_LOW_LATENCY 0x1
  7526. /* enum: High packet rate TXDP firmware */
  7527. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_HIGH_PACKET_RATE 0x3
  7528. /* enum: BIST TXDP firmware */
  7529. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_BIST 0x12d
  7530. /* enum: TXDP Test firmware image 1 */
  7531. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
  7532. /* enum: TXDP Test firmware image 2 */
  7533. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
  7534. /* enum: TXDP CSR bus test firmware */
  7535. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXDP_TEST_FW_CSR 0x103
  7536. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_OFST 8
  7537. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_LEN 2
  7538. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_REV_LBN 0
  7539. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_REV_WIDTH 12
  7540. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_TYPE_LBN 12
  7541. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
  7542. /* enum: reserved value - do not use (may indicate alternative interpretation
  7543. * of REV field in future)
  7544. */
  7545. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RESERVED 0x0
  7546. /* enum: Trivial RX PD firmware for early Huntington development (Huntington
  7547. * development only)
  7548. */
  7549. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
  7550. /* enum: RX PD firmware with approximately Siena-compatible behaviour
  7551. * (Huntington development only)
  7552. */
  7553. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
  7554. /* enum: Virtual switching (full feature) RX PD production firmware */
  7555. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_VSWITCH 0x3
  7556. /* enum: siena_compat variant RX PD firmware using PM rather than MAC
  7557. * (Huntington development only)
  7558. */
  7559. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  7560. /* enum: Low latency RX PD production firmware */
  7561. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
  7562. /* enum: Packed stream RX PD production firmware */
  7563. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
  7564. /* enum: RX PD firmware handling layer 2 only for high packet rate performance
  7565. * tests (Medford development only)
  7566. */
  7567. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
  7568. /* enum: Rules engine RX PD production firmware */
  7569. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_RULES_ENGINE 0x8
  7570. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  7571. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  7572. /* enum: RX PD firmware parsing but not filtering network overlay tunnel
  7573. * encapsulations (Medford development only)
  7574. */
  7575. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
  7576. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_OFST 10
  7577. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_LEN 2
  7578. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_REV_LBN 0
  7579. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_REV_WIDTH 12
  7580. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_TYPE_LBN 12
  7581. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
  7582. /* enum: reserved value - do not use (may indicate alternative interpretation
  7583. * of REV field in future)
  7584. */
  7585. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RESERVED 0x0
  7586. /* enum: Trivial TX PD firmware for early Huntington development (Huntington
  7587. * development only)
  7588. */
  7589. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
  7590. /* enum: TX PD firmware with approximately Siena-compatible behaviour
  7591. * (Huntington development only)
  7592. */
  7593. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
  7594. /* enum: Virtual switching (full feature) TX PD production firmware */
  7595. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_VSWITCH 0x3
  7596. /* enum: siena_compat variant TX PD firmware using PM rather than MAC
  7597. * (Huntington development only)
  7598. */
  7599. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
  7600. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
  7601. /* enum: TX PD firmware handling layer 2 only for high packet rate performance
  7602. * tests (Medford development only)
  7603. */
  7604. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
  7605. /* enum: Rules engine TX PD production firmware */
  7606. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_RULES_ENGINE 0x8
  7607. /* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
  7608. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
  7609. /* Hardware capabilities of NIC */
  7610. #define MC_CMD_GET_CAPABILITIES_V3_OUT_HW_CAPABILITIES_OFST 12
  7611. /* Licensed capabilities */
  7612. #define MC_CMD_GET_CAPABILITIES_V3_OUT_LICENSE_CAPABILITIES_OFST 16
  7613. /* Second word of flags. Not present on older firmware (check the length). */
  7614. #define MC_CMD_GET_CAPABILITIES_V3_OUT_FLAGS2_OFST 20
  7615. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_LBN 0
  7616. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_WIDTH 1
  7617. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_ENCAP_LBN 1
  7618. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_ENCAP_WIDTH 1
  7619. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVQ_TIMER_CTRL_LBN 2
  7620. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVQ_TIMER_CTRL_WIDTH 1
  7621. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVENT_CUT_THROUGH_LBN 3
  7622. #define MC_CMD_GET_CAPABILITIES_V3_OUT_EVENT_CUT_THROUGH_WIDTH 1
  7623. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_CUT_THROUGH_LBN 4
  7624. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_CUT_THROUGH_WIDTH 1
  7625. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VFIFO_ULL_MODE_LBN 5
  7626. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_VFIFO_ULL_MODE_WIDTH 1
  7627. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6
  7628. #define MC_CMD_GET_CAPABILITIES_V3_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1
  7629. #define MC_CMD_GET_CAPABILITIES_V3_OUT_INIT_EVQ_V2_LBN 7
  7630. #define MC_CMD_GET_CAPABILITIES_V3_OUT_INIT_EVQ_V2_WIDTH 1
  7631. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_TIMESTAMPING_LBN 8
  7632. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_MAC_TIMESTAMPING_WIDTH 1
  7633. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TIMESTAMP_LBN 9
  7634. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TIMESTAMP_WIDTH 1
  7635. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_SNIFF_LBN 10
  7636. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_SNIFF_WIDTH 1
  7637. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_SNIFF_LBN 11
  7638. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_SNIFF_WIDTH 1
  7639. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_LBN 12
  7640. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NVRAM_UPDATE_REPORT_VERIFY_RESULT_WIDTH 1
  7641. /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present
  7642. * on older firmware (check the length).
  7643. */
  7644. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_N_CONTEXTS_OFST 24
  7645. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_TSO_V2_N_CONTEXTS_LEN 2
  7646. /* One byte per PF containing the number of the external port assigned to this
  7647. * PF, indexed by PF number. Special values indicate that a PF is either not
  7648. * present or not assigned.
  7649. */
  7650. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_OFST 26
  7651. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_LEN 1
  7652. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PFS_TO_PORTS_ASSIGNMENT_NUM 16
  7653. /* enum: The caller is not permitted to access information on this PF. */
  7654. #define MC_CMD_GET_CAPABILITIES_V3_OUT_ACCESS_NOT_PERMITTED 0xff
  7655. /* enum: PF does not exist. */
  7656. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_PRESENT 0xfe
  7657. /* enum: PF does exist but is not assigned to any external port. */
  7658. #define MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_ASSIGNED 0xfd
  7659. /* enum: This value indicates that PF is assigned, but it cannot be expressed
  7660. * in this field. It is intended for a possible future situation where a more
  7661. * complex scheme of PFs to ports mapping is being used. The future driver
  7662. * should look for a new field supporting the new scheme. The current/old
  7663. * driver should treat this value as PF_NOT_ASSIGNED.
  7664. */
  7665. #define MC_CMD_GET_CAPABILITIES_V3_OUT_INCOMPATIBLE_ASSIGNMENT 0xfc
  7666. /* One byte per PF containing the number of its VFs, indexed by PF number. A
  7667. * special value indicates that a PF is not present.
  7668. */
  7669. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_OFST 42
  7670. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_LEN 1
  7671. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VFS_PER_PF_NUM 16
  7672. /* enum: The caller is not permitted to access information on this PF. */
  7673. /* MC_CMD_GET_CAPABILITIES_V3_OUT_ACCESS_NOT_PERMITTED 0xff */
  7674. /* enum: PF does not exist. */
  7675. /* MC_CMD_GET_CAPABILITIES_V3_OUT_PF_NOT_PRESENT 0xfe */
  7676. /* Number of VIs available for each external port */
  7677. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_OFST 58
  7678. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_LEN 2
  7679. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_VIS_PER_PORT_NUM 4
  7680. /* Size of RX descriptor cache expressed as binary logarithm The actual size
  7681. * equals (2 ^ RX_DESC_CACHE_SIZE)
  7682. */
  7683. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DESC_CACHE_SIZE_OFST 66
  7684. #define MC_CMD_GET_CAPABILITIES_V3_OUT_RX_DESC_CACHE_SIZE_LEN 1
  7685. /* Size of TX descriptor cache expressed as binary logarithm The actual size
  7686. * equals (2 ^ TX_DESC_CACHE_SIZE)
  7687. */
  7688. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DESC_CACHE_SIZE_OFST 67
  7689. #define MC_CMD_GET_CAPABILITIES_V3_OUT_TX_DESC_CACHE_SIZE_LEN 1
  7690. /* Total number of available PIO buffers */
  7691. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_PIO_BUFFS_OFST 68
  7692. #define MC_CMD_GET_CAPABILITIES_V3_OUT_NUM_PIO_BUFFS_LEN 2
  7693. /* Size of a single PIO buffer */
  7694. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SIZE_PIO_BUFF_OFST 70
  7695. #define MC_CMD_GET_CAPABILITIES_V3_OUT_SIZE_PIO_BUFF_LEN 2
  7696. /* On chips later than Medford the amount of address space assigned to each VI
  7697. * is configurable. This is a global setting that the driver must query to
  7698. * discover the VI to address mapping. Cut-through PIO (CTPIO) is not available
  7699. * with 8k VI windows.
  7700. */
  7701. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_OFST 72
  7702. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_LEN 1
  7703. /* enum: Each VI occupies 8k as on Huntington and Medford. PIO is at offset 4k.
  7704. * CTPIO is not mapped.
  7705. */
  7706. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_8K 0x0
  7707. /* enum: Each VI occupies 16k. PIO is at offset 4k. CTPIO is at offset 12k. */
  7708. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_16K 0x1
  7709. /* enum: Each VI occupies 64k. PIO is at offset 4k. CTPIO is at offset 12k. */
  7710. #define MC_CMD_GET_CAPABILITIES_V3_OUT_VI_WINDOW_MODE_64K 0x2
  7711. /***********************************/
  7712. /* MC_CMD_V2_EXTN
  7713. * Encapsulation for a v2 extended command
  7714. */
  7715. #define MC_CMD_V2_EXTN 0x7f
  7716. /* MC_CMD_V2_EXTN_IN msgrequest */
  7717. #define MC_CMD_V2_EXTN_IN_LEN 4
  7718. /* the extended command number */
  7719. #define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_LBN 0
  7720. #define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_WIDTH 15
  7721. #define MC_CMD_V2_EXTN_IN_UNUSED_LBN 15
  7722. #define MC_CMD_V2_EXTN_IN_UNUSED_WIDTH 1
  7723. /* the actual length of the encapsulated command (which is not in the v1
  7724. * header)
  7725. */
  7726. #define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_LBN 16
  7727. #define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_WIDTH 10
  7728. #define MC_CMD_V2_EXTN_IN_UNUSED2_LBN 26
  7729. #define MC_CMD_V2_EXTN_IN_UNUSED2_WIDTH 6
  7730. /***********************************/
  7731. /* MC_CMD_TCM_BUCKET_ALLOC
  7732. * Allocate a pacer bucket (for qau rp or a snapper test)
  7733. */
  7734. #define MC_CMD_TCM_BUCKET_ALLOC 0xb2
  7735. #define MC_CMD_0xb2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7736. /* MC_CMD_TCM_BUCKET_ALLOC_IN msgrequest */
  7737. #define MC_CMD_TCM_BUCKET_ALLOC_IN_LEN 0
  7738. /* MC_CMD_TCM_BUCKET_ALLOC_OUT msgresponse */
  7739. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_LEN 4
  7740. /* the bucket id */
  7741. #define MC_CMD_TCM_BUCKET_ALLOC_OUT_BUCKET_OFST 0
  7742. /***********************************/
  7743. /* MC_CMD_TCM_BUCKET_FREE
  7744. * Free a pacer bucket
  7745. */
  7746. #define MC_CMD_TCM_BUCKET_FREE 0xb3
  7747. #define MC_CMD_0xb3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7748. /* MC_CMD_TCM_BUCKET_FREE_IN msgrequest */
  7749. #define MC_CMD_TCM_BUCKET_FREE_IN_LEN 4
  7750. /* the bucket id */
  7751. #define MC_CMD_TCM_BUCKET_FREE_IN_BUCKET_OFST 0
  7752. /* MC_CMD_TCM_BUCKET_FREE_OUT msgresponse */
  7753. #define MC_CMD_TCM_BUCKET_FREE_OUT_LEN 0
  7754. /***********************************/
  7755. /* MC_CMD_TCM_BUCKET_INIT
  7756. * Initialise pacer bucket with a given rate
  7757. */
  7758. #define MC_CMD_TCM_BUCKET_INIT 0xb4
  7759. #define MC_CMD_0xb4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7760. /* MC_CMD_TCM_BUCKET_INIT_IN msgrequest */
  7761. #define MC_CMD_TCM_BUCKET_INIT_IN_LEN 8
  7762. /* the bucket id */
  7763. #define MC_CMD_TCM_BUCKET_INIT_IN_BUCKET_OFST 0
  7764. /* the rate in mbps */
  7765. #define MC_CMD_TCM_BUCKET_INIT_IN_RATE_OFST 4
  7766. /* MC_CMD_TCM_BUCKET_INIT_EXT_IN msgrequest */
  7767. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_LEN 12
  7768. /* the bucket id */
  7769. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_BUCKET_OFST 0
  7770. /* the rate in mbps */
  7771. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_RATE_OFST 4
  7772. /* the desired maximum fill level */
  7773. #define MC_CMD_TCM_BUCKET_INIT_EXT_IN_MAX_FILL_OFST 8
  7774. /* MC_CMD_TCM_BUCKET_INIT_OUT msgresponse */
  7775. #define MC_CMD_TCM_BUCKET_INIT_OUT_LEN 0
  7776. /***********************************/
  7777. /* MC_CMD_TCM_TXQ_INIT
  7778. * Initialise txq in pacer with given options or set options
  7779. */
  7780. #define MC_CMD_TCM_TXQ_INIT 0xb5
  7781. #define MC_CMD_0xb5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7782. /* MC_CMD_TCM_TXQ_INIT_IN msgrequest */
  7783. #define MC_CMD_TCM_TXQ_INIT_IN_LEN 28
  7784. /* the txq id */
  7785. #define MC_CMD_TCM_TXQ_INIT_IN_QID_OFST 0
  7786. /* the static priority associated with the txq */
  7787. #define MC_CMD_TCM_TXQ_INIT_IN_LABEL_OFST 4
  7788. /* bitmask of the priority queues this txq is inserted into when inserted. */
  7789. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAGS_OFST 8
  7790. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_GUARANTEED_LBN 0
  7791. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_GUARANTEED_WIDTH 1
  7792. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_NORMAL_LBN 1
  7793. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_NORMAL_WIDTH 1
  7794. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_LOW_LBN 2
  7795. #define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_LOW_WIDTH 1
  7796. /* the reaction point (RP) bucket */
  7797. #define MC_CMD_TCM_TXQ_INIT_IN_RP_BKT_OFST 12
  7798. /* an already reserved bucket (typically set to bucket associated with outer
  7799. * vswitch)
  7800. */
  7801. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT1_OFST 16
  7802. /* an already reserved bucket (typically set to bucket associated with inner
  7803. * vswitch)
  7804. */
  7805. #define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT2_OFST 20
  7806. /* the min bucket (typically for ETS/minimum bandwidth) */
  7807. #define MC_CMD_TCM_TXQ_INIT_IN_MIN_BKT_OFST 24
  7808. /* MC_CMD_TCM_TXQ_INIT_EXT_IN msgrequest */
  7809. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LEN 32
  7810. /* the txq id */
  7811. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_QID_OFST 0
  7812. /* the static priority associated with the txq */
  7813. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_NORMAL_OFST 4
  7814. /* bitmask of the priority queues this txq is inserted into when inserted. */
  7815. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAGS_OFST 8
  7816. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_GUARANTEED_LBN 0
  7817. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_GUARANTEED_WIDTH 1
  7818. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_NORMAL_LBN 1
  7819. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_NORMAL_WIDTH 1
  7820. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_LOW_LBN 2
  7821. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_LOW_WIDTH 1
  7822. /* the reaction point (RP) bucket */
  7823. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_RP_BKT_OFST 12
  7824. /* an already reserved bucket (typically set to bucket associated with outer
  7825. * vswitch)
  7826. */
  7827. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT1_OFST 16
  7828. /* an already reserved bucket (typically set to bucket associated with inner
  7829. * vswitch)
  7830. */
  7831. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT2_OFST 20
  7832. /* the min bucket (typically for ETS/minimum bandwidth) */
  7833. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_MIN_BKT_OFST 24
  7834. /* the static priority associated with the txq */
  7835. #define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_GUARANTEED_OFST 28
  7836. /* MC_CMD_TCM_TXQ_INIT_OUT msgresponse */
  7837. #define MC_CMD_TCM_TXQ_INIT_OUT_LEN 0
  7838. /***********************************/
  7839. /* MC_CMD_LINK_PIOBUF
  7840. * Link a push I/O buffer to a TxQ
  7841. */
  7842. #define MC_CMD_LINK_PIOBUF 0x92
  7843. #define MC_CMD_0x92_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  7844. /* MC_CMD_LINK_PIOBUF_IN msgrequest */
  7845. #define MC_CMD_LINK_PIOBUF_IN_LEN 8
  7846. /* Handle for allocated push I/O buffer. */
  7847. #define MC_CMD_LINK_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
  7848. /* Function Local Instance (VI) number. */
  7849. #define MC_CMD_LINK_PIOBUF_IN_TXQ_INSTANCE_OFST 4
  7850. /* MC_CMD_LINK_PIOBUF_OUT msgresponse */
  7851. #define MC_CMD_LINK_PIOBUF_OUT_LEN 0
  7852. /***********************************/
  7853. /* MC_CMD_UNLINK_PIOBUF
  7854. * Unlink a push I/O buffer from a TxQ
  7855. */
  7856. #define MC_CMD_UNLINK_PIOBUF 0x93
  7857. #define MC_CMD_0x93_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  7858. /* MC_CMD_UNLINK_PIOBUF_IN msgrequest */
  7859. #define MC_CMD_UNLINK_PIOBUF_IN_LEN 4
  7860. /* Function Local Instance (VI) number. */
  7861. #define MC_CMD_UNLINK_PIOBUF_IN_TXQ_INSTANCE_OFST 0
  7862. /* MC_CMD_UNLINK_PIOBUF_OUT msgresponse */
  7863. #define MC_CMD_UNLINK_PIOBUF_OUT_LEN 0
  7864. /***********************************/
  7865. /* MC_CMD_VSWITCH_ALLOC
  7866. * allocate and initialise a v-switch.
  7867. */
  7868. #define MC_CMD_VSWITCH_ALLOC 0x94
  7869. #define MC_CMD_0x94_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7870. /* MC_CMD_VSWITCH_ALLOC_IN msgrequest */
  7871. #define MC_CMD_VSWITCH_ALLOC_IN_LEN 16
  7872. /* The port to connect to the v-switch's upstream port. */
  7873. #define MC_CMD_VSWITCH_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  7874. /* The type of v-switch to create. */
  7875. #define MC_CMD_VSWITCH_ALLOC_IN_TYPE_OFST 4
  7876. /* enum: VLAN */
  7877. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VLAN 0x1
  7878. /* enum: VEB */
  7879. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEB 0x2
  7880. /* enum: VEPA (obsolete) */
  7881. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEPA 0x3
  7882. /* enum: MUX */
  7883. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_MUX 0x4
  7884. /* enum: Snapper specific; semantics TBD */
  7885. #define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_TEST 0x5
  7886. /* Flags controlling v-port creation */
  7887. #define MC_CMD_VSWITCH_ALLOC_IN_FLAGS_OFST 8
  7888. #define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
  7889. #define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
  7890. /* The number of VLAN tags to allow for attached v-ports. For VLAN aggregators,
  7891. * this must be one or greated, and the attached v-ports must have exactly this
  7892. * number of tags. For other v-switch types, this must be zero of greater, and
  7893. * is an upper limit on the number of VLAN tags for attached v-ports. An error
  7894. * will be returned if existing configuration means we can't support attached
  7895. * v-ports with this number of tags.
  7896. */
  7897. #define MC_CMD_VSWITCH_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
  7898. /* MC_CMD_VSWITCH_ALLOC_OUT msgresponse */
  7899. #define MC_CMD_VSWITCH_ALLOC_OUT_LEN 0
  7900. /***********************************/
  7901. /* MC_CMD_VSWITCH_FREE
  7902. * de-allocate a v-switch.
  7903. */
  7904. #define MC_CMD_VSWITCH_FREE 0x95
  7905. #define MC_CMD_0x95_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7906. /* MC_CMD_VSWITCH_FREE_IN msgrequest */
  7907. #define MC_CMD_VSWITCH_FREE_IN_LEN 4
  7908. /* The port to which the v-switch is connected. */
  7909. #define MC_CMD_VSWITCH_FREE_IN_UPSTREAM_PORT_ID_OFST 0
  7910. /* MC_CMD_VSWITCH_FREE_OUT msgresponse */
  7911. #define MC_CMD_VSWITCH_FREE_OUT_LEN 0
  7912. /***********************************/
  7913. /* MC_CMD_VSWITCH_QUERY
  7914. * read some config of v-switch. For now this command is an empty placeholder.
  7915. * It may be used to check if a v-switch is connected to a given EVB port (if
  7916. * not, then the command returns ENOENT).
  7917. */
  7918. #define MC_CMD_VSWITCH_QUERY 0x63
  7919. #define MC_CMD_0x63_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7920. /* MC_CMD_VSWITCH_QUERY_IN msgrequest */
  7921. #define MC_CMD_VSWITCH_QUERY_IN_LEN 4
  7922. /* The port to which the v-switch is connected. */
  7923. #define MC_CMD_VSWITCH_QUERY_IN_UPSTREAM_PORT_ID_OFST 0
  7924. /* MC_CMD_VSWITCH_QUERY_OUT msgresponse */
  7925. #define MC_CMD_VSWITCH_QUERY_OUT_LEN 0
  7926. /***********************************/
  7927. /* MC_CMD_VPORT_ALLOC
  7928. * allocate a v-port.
  7929. */
  7930. #define MC_CMD_VPORT_ALLOC 0x96
  7931. #define MC_CMD_0x96_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7932. /* MC_CMD_VPORT_ALLOC_IN msgrequest */
  7933. #define MC_CMD_VPORT_ALLOC_IN_LEN 20
  7934. /* The port to which the v-switch is connected. */
  7935. #define MC_CMD_VPORT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  7936. /* The type of the new v-port. */
  7937. #define MC_CMD_VPORT_ALLOC_IN_TYPE_OFST 4
  7938. /* enum: VLAN (obsolete) */
  7939. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VLAN 0x1
  7940. /* enum: VEB (obsolete) */
  7941. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEB 0x2
  7942. /* enum: VEPA (obsolete) */
  7943. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEPA 0x3
  7944. /* enum: A normal v-port receives packets which match a specified MAC and/or
  7945. * VLAN.
  7946. */
  7947. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_NORMAL 0x4
  7948. /* enum: An expansion v-port packets traffic which don't match any other
  7949. * v-port.
  7950. */
  7951. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_EXPANSION 0x5
  7952. /* enum: An test v-port receives packets which match any filters installed by
  7953. * its downstream components.
  7954. */
  7955. #define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_TEST 0x6
  7956. /* Flags controlling v-port creation */
  7957. #define MC_CMD_VPORT_ALLOC_IN_FLAGS_OFST 8
  7958. #define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
  7959. #define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
  7960. #define MC_CMD_VPORT_ALLOC_IN_FLAG_VLAN_RESTRICT_LBN 1
  7961. #define MC_CMD_VPORT_ALLOC_IN_FLAG_VLAN_RESTRICT_WIDTH 1
  7962. /* The number of VLAN tags to insert/remove. An error will be returned if
  7963. * incompatible with the number of VLAN tags specified for the upstream
  7964. * v-switch.
  7965. */
  7966. #define MC_CMD_VPORT_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
  7967. /* The actual VLAN tags to insert/remove */
  7968. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAGS_OFST 16
  7969. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_LBN 0
  7970. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_WIDTH 16
  7971. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_LBN 16
  7972. #define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_WIDTH 16
  7973. /* MC_CMD_VPORT_ALLOC_OUT msgresponse */
  7974. #define MC_CMD_VPORT_ALLOC_OUT_LEN 4
  7975. /* The handle of the new v-port */
  7976. #define MC_CMD_VPORT_ALLOC_OUT_VPORT_ID_OFST 0
  7977. /***********************************/
  7978. /* MC_CMD_VPORT_FREE
  7979. * de-allocate a v-port.
  7980. */
  7981. #define MC_CMD_VPORT_FREE 0x97
  7982. #define MC_CMD_0x97_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7983. /* MC_CMD_VPORT_FREE_IN msgrequest */
  7984. #define MC_CMD_VPORT_FREE_IN_LEN 4
  7985. /* The handle of the v-port */
  7986. #define MC_CMD_VPORT_FREE_IN_VPORT_ID_OFST 0
  7987. /* MC_CMD_VPORT_FREE_OUT msgresponse */
  7988. #define MC_CMD_VPORT_FREE_OUT_LEN 0
  7989. /***********************************/
  7990. /* MC_CMD_VADAPTOR_ALLOC
  7991. * allocate a v-adaptor.
  7992. */
  7993. #define MC_CMD_VADAPTOR_ALLOC 0x98
  7994. #define MC_CMD_0x98_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  7995. /* MC_CMD_VADAPTOR_ALLOC_IN msgrequest */
  7996. #define MC_CMD_VADAPTOR_ALLOC_IN_LEN 30
  7997. /* The port to connect to the v-adaptor's port. */
  7998. #define MC_CMD_VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  7999. /* Flags controlling v-adaptor creation */
  8000. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAGS_OFST 8
  8001. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_LBN 0
  8002. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_WIDTH 1
  8003. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 1
  8004. #define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
  8005. /* The number of VLAN tags to strip on receive */
  8006. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLANS_OFST 12
  8007. /* The number of VLAN tags to transparently insert/remove. */
  8008. #define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLAN_TAGS_OFST 16
  8009. /* The actual VLAN tags to insert/remove */
  8010. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAGS_OFST 20
  8011. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_LBN 0
  8012. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_WIDTH 16
  8013. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_LBN 16
  8014. #define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_WIDTH 16
  8015. /* The MAC address to assign to this v-adaptor */
  8016. #define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_OFST 24
  8017. #define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_LEN 6
  8018. /* enum: Derive the MAC address from the upstream port */
  8019. #define MC_CMD_VADAPTOR_ALLOC_IN_AUTO_MAC 0x0
  8020. /* MC_CMD_VADAPTOR_ALLOC_OUT msgresponse */
  8021. #define MC_CMD_VADAPTOR_ALLOC_OUT_LEN 0
  8022. /***********************************/
  8023. /* MC_CMD_VADAPTOR_FREE
  8024. * de-allocate a v-adaptor.
  8025. */
  8026. #define MC_CMD_VADAPTOR_FREE 0x99
  8027. #define MC_CMD_0x99_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8028. /* MC_CMD_VADAPTOR_FREE_IN msgrequest */
  8029. #define MC_CMD_VADAPTOR_FREE_IN_LEN 4
  8030. /* The port to which the v-adaptor is connected. */
  8031. #define MC_CMD_VADAPTOR_FREE_IN_UPSTREAM_PORT_ID_OFST 0
  8032. /* MC_CMD_VADAPTOR_FREE_OUT msgresponse */
  8033. #define MC_CMD_VADAPTOR_FREE_OUT_LEN 0
  8034. /***********************************/
  8035. /* MC_CMD_VADAPTOR_SET_MAC
  8036. * assign a new MAC address to a v-adaptor.
  8037. */
  8038. #define MC_CMD_VADAPTOR_SET_MAC 0x5d
  8039. #define MC_CMD_0x5d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8040. /* MC_CMD_VADAPTOR_SET_MAC_IN msgrequest */
  8041. #define MC_CMD_VADAPTOR_SET_MAC_IN_LEN 10
  8042. /* The port to which the v-adaptor is connected. */
  8043. #define MC_CMD_VADAPTOR_SET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
  8044. /* The new MAC address to assign to this v-adaptor */
  8045. #define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_OFST 4
  8046. #define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_LEN 6
  8047. /* MC_CMD_VADAPTOR_SET_MAC_OUT msgresponse */
  8048. #define MC_CMD_VADAPTOR_SET_MAC_OUT_LEN 0
  8049. /***********************************/
  8050. /* MC_CMD_VADAPTOR_GET_MAC
  8051. * read the MAC address assigned to a v-adaptor.
  8052. */
  8053. #define MC_CMD_VADAPTOR_GET_MAC 0x5e
  8054. #define MC_CMD_0x5e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8055. /* MC_CMD_VADAPTOR_GET_MAC_IN msgrequest */
  8056. #define MC_CMD_VADAPTOR_GET_MAC_IN_LEN 4
  8057. /* The port to which the v-adaptor is connected. */
  8058. #define MC_CMD_VADAPTOR_GET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
  8059. /* MC_CMD_VADAPTOR_GET_MAC_OUT msgresponse */
  8060. #define MC_CMD_VADAPTOR_GET_MAC_OUT_LEN 6
  8061. /* The MAC address assigned to this v-adaptor */
  8062. #define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_OFST 0
  8063. #define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_LEN 6
  8064. /***********************************/
  8065. /* MC_CMD_VADAPTOR_QUERY
  8066. * read some config of v-adaptor.
  8067. */
  8068. #define MC_CMD_VADAPTOR_QUERY 0x61
  8069. #define MC_CMD_0x61_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8070. /* MC_CMD_VADAPTOR_QUERY_IN msgrequest */
  8071. #define MC_CMD_VADAPTOR_QUERY_IN_LEN 4
  8072. /* The port to which the v-adaptor is connected. */
  8073. #define MC_CMD_VADAPTOR_QUERY_IN_UPSTREAM_PORT_ID_OFST 0
  8074. /* MC_CMD_VADAPTOR_QUERY_OUT msgresponse */
  8075. #define MC_CMD_VADAPTOR_QUERY_OUT_LEN 12
  8076. /* The EVB port flags as defined at MC_CMD_VPORT_ALLOC. */
  8077. #define MC_CMD_VADAPTOR_QUERY_OUT_PORT_FLAGS_OFST 0
  8078. /* The v-adaptor flags as defined at MC_CMD_VADAPTOR_ALLOC. */
  8079. #define MC_CMD_VADAPTOR_QUERY_OUT_VADAPTOR_FLAGS_OFST 4
  8080. /* The number of VLAN tags that may still be added */
  8081. #define MC_CMD_VADAPTOR_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_OFST 8
  8082. /***********************************/
  8083. /* MC_CMD_EVB_PORT_ASSIGN
  8084. * assign a port to a PCI function.
  8085. */
  8086. #define MC_CMD_EVB_PORT_ASSIGN 0x9a
  8087. #define MC_CMD_0x9a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8088. /* MC_CMD_EVB_PORT_ASSIGN_IN msgrequest */
  8089. #define MC_CMD_EVB_PORT_ASSIGN_IN_LEN 8
  8090. /* The port to assign. */
  8091. #define MC_CMD_EVB_PORT_ASSIGN_IN_PORT_ID_OFST 0
  8092. /* The target function to modify. */
  8093. #define MC_CMD_EVB_PORT_ASSIGN_IN_FUNCTION_OFST 4
  8094. #define MC_CMD_EVB_PORT_ASSIGN_IN_PF_LBN 0
  8095. #define MC_CMD_EVB_PORT_ASSIGN_IN_PF_WIDTH 16
  8096. #define MC_CMD_EVB_PORT_ASSIGN_IN_VF_LBN 16
  8097. #define MC_CMD_EVB_PORT_ASSIGN_IN_VF_WIDTH 16
  8098. /* MC_CMD_EVB_PORT_ASSIGN_OUT msgresponse */
  8099. #define MC_CMD_EVB_PORT_ASSIGN_OUT_LEN 0
  8100. /***********************************/
  8101. /* MC_CMD_RDWR_A64_REGIONS
  8102. * Assign the 64 bit region addresses.
  8103. */
  8104. #define MC_CMD_RDWR_A64_REGIONS 0x9b
  8105. #define MC_CMD_0x9b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8106. /* MC_CMD_RDWR_A64_REGIONS_IN msgrequest */
  8107. #define MC_CMD_RDWR_A64_REGIONS_IN_LEN 17
  8108. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION0_OFST 0
  8109. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION1_OFST 4
  8110. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION2_OFST 8
  8111. #define MC_CMD_RDWR_A64_REGIONS_IN_REGION3_OFST 12
  8112. /* Write enable bits 0-3, set to write, clear to read. */
  8113. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_LBN 128
  8114. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_WIDTH 4
  8115. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_OFST 16
  8116. #define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_LEN 1
  8117. /* MC_CMD_RDWR_A64_REGIONS_OUT msgresponse: This data always included
  8118. * regardless of state of write bits in the request.
  8119. */
  8120. #define MC_CMD_RDWR_A64_REGIONS_OUT_LEN 16
  8121. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION0_OFST 0
  8122. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION1_OFST 4
  8123. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION2_OFST 8
  8124. #define MC_CMD_RDWR_A64_REGIONS_OUT_REGION3_OFST 12
  8125. /***********************************/
  8126. /* MC_CMD_ONLOAD_STACK_ALLOC
  8127. * Allocate an Onload stack ID.
  8128. */
  8129. #define MC_CMD_ONLOAD_STACK_ALLOC 0x9c
  8130. #define MC_CMD_0x9c_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  8131. /* MC_CMD_ONLOAD_STACK_ALLOC_IN msgrequest */
  8132. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_LEN 4
  8133. /* The handle of the owning upstream port */
  8134. #define MC_CMD_ONLOAD_STACK_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  8135. /* MC_CMD_ONLOAD_STACK_ALLOC_OUT msgresponse */
  8136. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_LEN 4
  8137. /* The handle of the new Onload stack */
  8138. #define MC_CMD_ONLOAD_STACK_ALLOC_OUT_ONLOAD_STACK_ID_OFST 0
  8139. /***********************************/
  8140. /* MC_CMD_ONLOAD_STACK_FREE
  8141. * Free an Onload stack ID.
  8142. */
  8143. #define MC_CMD_ONLOAD_STACK_FREE 0x9d
  8144. #define MC_CMD_0x9d_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
  8145. /* MC_CMD_ONLOAD_STACK_FREE_IN msgrequest */
  8146. #define MC_CMD_ONLOAD_STACK_FREE_IN_LEN 4
  8147. /* The handle of the Onload stack */
  8148. #define MC_CMD_ONLOAD_STACK_FREE_IN_ONLOAD_STACK_ID_OFST 0
  8149. /* MC_CMD_ONLOAD_STACK_FREE_OUT msgresponse */
  8150. #define MC_CMD_ONLOAD_STACK_FREE_OUT_LEN 0
  8151. /***********************************/
  8152. /* MC_CMD_RSS_CONTEXT_ALLOC
  8153. * Allocate an RSS context.
  8154. */
  8155. #define MC_CMD_RSS_CONTEXT_ALLOC 0x9e
  8156. #define MC_CMD_0x9e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8157. /* MC_CMD_RSS_CONTEXT_ALLOC_IN msgrequest */
  8158. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN 12
  8159. /* The handle of the owning upstream port */
  8160. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  8161. /* The type of context to allocate */
  8162. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_OFST 4
  8163. /* enum: Allocate a context for exclusive use. The key and indirection table
  8164. * must be explicitly configured.
  8165. */
  8166. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE 0x0
  8167. /* enum: Allocate a context for shared use; this will spread across a range of
  8168. * queues, but the key and indirection table are pre-configured and may not be
  8169. * changed. For this mode, NUM_QUEUES must 2, 4, 8, 16, 32 or 64.
  8170. */
  8171. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_SHARED 0x1
  8172. /* Number of queues spanned by this context, in the range 1-64; valid offsets
  8173. * in the indirection table will be in the range 0 to NUM_QUEUES-1.
  8174. */
  8175. #define MC_CMD_RSS_CONTEXT_ALLOC_IN_NUM_QUEUES_OFST 8
  8176. /* MC_CMD_RSS_CONTEXT_ALLOC_OUT msgresponse */
  8177. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN 4
  8178. /* The handle of the new RSS context. This should be considered opaque to the
  8179. * host, although a value of 0xFFFFFFFF is guaranteed never to be a valid
  8180. * handle.
  8181. */
  8182. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_OFST 0
  8183. /* enum: guaranteed invalid RSS context handle value */
  8184. #define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID 0xffffffff
  8185. /***********************************/
  8186. /* MC_CMD_RSS_CONTEXT_FREE
  8187. * Free an RSS context.
  8188. */
  8189. #define MC_CMD_RSS_CONTEXT_FREE 0x9f
  8190. #define MC_CMD_0x9f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8191. /* MC_CMD_RSS_CONTEXT_FREE_IN msgrequest */
  8192. #define MC_CMD_RSS_CONTEXT_FREE_IN_LEN 4
  8193. /* The handle of the RSS context */
  8194. #define MC_CMD_RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID_OFST 0
  8195. /* MC_CMD_RSS_CONTEXT_FREE_OUT msgresponse */
  8196. #define MC_CMD_RSS_CONTEXT_FREE_OUT_LEN 0
  8197. /***********************************/
  8198. /* MC_CMD_RSS_CONTEXT_SET_KEY
  8199. * Set the Toeplitz hash key for an RSS context.
  8200. */
  8201. #define MC_CMD_RSS_CONTEXT_SET_KEY 0xa0
  8202. #define MC_CMD_0xa0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8203. /* MC_CMD_RSS_CONTEXT_SET_KEY_IN msgrequest */
  8204. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN 44
  8205. /* The handle of the RSS context */
  8206. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID_OFST 0
  8207. /* The 40-byte Toeplitz hash key (TBD endianness issues?) */
  8208. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_OFST 4
  8209. #define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN 40
  8210. /* MC_CMD_RSS_CONTEXT_SET_KEY_OUT msgresponse */
  8211. #define MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN 0
  8212. /***********************************/
  8213. /* MC_CMD_RSS_CONTEXT_GET_KEY
  8214. * Get the Toeplitz hash key for an RSS context.
  8215. */
  8216. #define MC_CMD_RSS_CONTEXT_GET_KEY 0xa1
  8217. #define MC_CMD_0xa1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8218. /* MC_CMD_RSS_CONTEXT_GET_KEY_IN msgrequest */
  8219. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_LEN 4
  8220. /* The handle of the RSS context */
  8221. #define MC_CMD_RSS_CONTEXT_GET_KEY_IN_RSS_CONTEXT_ID_OFST 0
  8222. /* MC_CMD_RSS_CONTEXT_GET_KEY_OUT msgresponse */
  8223. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_LEN 44
  8224. /* The 40-byte Toeplitz hash key (TBD endianness issues?) */
  8225. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_OFST 4
  8226. #define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_LEN 40
  8227. /***********************************/
  8228. /* MC_CMD_RSS_CONTEXT_SET_TABLE
  8229. * Set the indirection table for an RSS context.
  8230. */
  8231. #define MC_CMD_RSS_CONTEXT_SET_TABLE 0xa2
  8232. #define MC_CMD_0xa2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8233. /* MC_CMD_RSS_CONTEXT_SET_TABLE_IN msgrequest */
  8234. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN 132
  8235. /* The handle of the RSS context */
  8236. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
  8237. /* The 128-byte indirection table (1 byte per entry) */
  8238. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_OFST 4
  8239. #define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN 128
  8240. /* MC_CMD_RSS_CONTEXT_SET_TABLE_OUT msgresponse */
  8241. #define MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN 0
  8242. /***********************************/
  8243. /* MC_CMD_RSS_CONTEXT_GET_TABLE
  8244. * Get the indirection table for an RSS context.
  8245. */
  8246. #define MC_CMD_RSS_CONTEXT_GET_TABLE 0xa3
  8247. #define MC_CMD_0xa3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8248. /* MC_CMD_RSS_CONTEXT_GET_TABLE_IN msgrequest */
  8249. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_LEN 4
  8250. /* The handle of the RSS context */
  8251. #define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
  8252. /* MC_CMD_RSS_CONTEXT_GET_TABLE_OUT msgresponse */
  8253. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_LEN 132
  8254. /* The 128-byte indirection table (1 byte per entry) */
  8255. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_OFST 4
  8256. #define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_LEN 128
  8257. /***********************************/
  8258. /* MC_CMD_RSS_CONTEXT_SET_FLAGS
  8259. * Set various control flags for an RSS context.
  8260. */
  8261. #define MC_CMD_RSS_CONTEXT_SET_FLAGS 0xe1
  8262. #define MC_CMD_0xe1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8263. /* MC_CMD_RSS_CONTEXT_SET_FLAGS_IN msgrequest */
  8264. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN 8
  8265. /* The handle of the RSS context */
  8266. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
  8267. /* Hash control flags. The _EN bits are always supported, but new modes are
  8268. * available when ADDITIONAL_RSS_MODES is reported by MC_CMD_GET_CAPABILITIES:
  8269. * in this case, the MODE fields may be set to non-zero values, and will take
  8270. * effect regardless of the settings of the _EN flags. See the RSS_MODE
  8271. * structure for the meaning of the mode bits. Drivers must check the
  8272. * capability before trying to set any _MODE fields, as older firmware will
  8273. * reject any attempt to set the FLAGS field to a value > 0xff with EINVAL. In
  8274. * the case where all the _MODE flags are zero, the _EN flags take effect,
  8275. * providing backward compatibility for existing drivers. (Setting all _MODE
  8276. * *and* all _EN flags to zero is valid, to disable RSS spreading for that
  8277. * particular packet type.)
  8278. */
  8279. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_FLAGS_OFST 4
  8280. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_LBN 0
  8281. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_WIDTH 1
  8282. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_LBN 1
  8283. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_WIDTH 1
  8284. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_LBN 2
  8285. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_WIDTH 1
  8286. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_LBN 3
  8287. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_WIDTH 1
  8288. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RESERVED_LBN 4
  8289. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RESERVED_WIDTH 4
  8290. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_LBN 8
  8291. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_WIDTH 4
  8292. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE_LBN 12
  8293. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE_WIDTH 4
  8294. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_LBN 16
  8295. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_WIDTH 4
  8296. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_LBN 20
  8297. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_WIDTH 4
  8298. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE_LBN 24
  8299. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE_WIDTH 4
  8300. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_LBN 28
  8301. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_WIDTH 4
  8302. /* MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT msgresponse */
  8303. #define MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN 0
  8304. /***********************************/
  8305. /* MC_CMD_RSS_CONTEXT_GET_FLAGS
  8306. * Get various control flags for an RSS context.
  8307. */
  8308. #define MC_CMD_RSS_CONTEXT_GET_FLAGS 0xe2
  8309. #define MC_CMD_0xe2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8310. /* MC_CMD_RSS_CONTEXT_GET_FLAGS_IN msgrequest */
  8311. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_LEN 4
  8312. /* The handle of the RSS context */
  8313. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
  8314. /* MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT msgresponse */
  8315. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_LEN 8
  8316. /* Hash control flags. If all _MODE bits are zero (which will always be true
  8317. * for older firmware which does not report the ADDITIONAL_RSS_MODES
  8318. * capability), the _EN bits report the state. If any _MODE bits are non-zero
  8319. * (which will only be true when the firmware reports ADDITIONAL_RSS_MODES)
  8320. * then the _EN bits should be disregarded, although the _MODE flags are
  8321. * guaranteed to be consistent with the _EN flags for a freshly-allocated RSS
  8322. * context and in the case where the _EN flags were used in the SET. This
  8323. * provides backward compatibility: old drivers will not be attempting to
  8324. * derive any meaning from the _MODE bits (and can never set them to any value
  8325. * not representable by the _EN bits); new drivers can always determine the
  8326. * mode by looking only at the _MODE bits; the value returned by a GET can
  8327. * always be used for a SET regardless of old/new driver vs. old/new firmware.
  8328. */
  8329. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_FLAGS_OFST 4
  8330. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_LBN 0
  8331. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_WIDTH 1
  8332. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_LBN 1
  8333. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_WIDTH 1
  8334. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_LBN 2
  8335. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_WIDTH 1
  8336. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_LBN 3
  8337. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_WIDTH 1
  8338. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_RESERVED_LBN 4
  8339. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_RESERVED_WIDTH 4
  8340. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV4_RSS_MODE_LBN 8
  8341. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV4_RSS_MODE_WIDTH 4
  8342. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_LBN 12
  8343. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_WIDTH 4
  8344. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV4_RSS_MODE_LBN 16
  8345. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV4_RSS_MODE_WIDTH 4
  8346. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV6_RSS_MODE_LBN 20
  8347. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV6_RSS_MODE_WIDTH 4
  8348. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_LBN 24
  8349. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_WIDTH 4
  8350. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV6_RSS_MODE_LBN 28
  8351. #define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV6_RSS_MODE_WIDTH 4
  8352. /***********************************/
  8353. /* MC_CMD_DOT1P_MAPPING_ALLOC
  8354. * Allocate a .1p mapping.
  8355. */
  8356. #define MC_CMD_DOT1P_MAPPING_ALLOC 0xa4
  8357. #define MC_CMD_0xa4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8358. /* MC_CMD_DOT1P_MAPPING_ALLOC_IN msgrequest */
  8359. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_LEN 8
  8360. /* The handle of the owning upstream port */
  8361. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
  8362. /* Number of queues spanned by this mapping, in the range 1-64; valid fixed
  8363. * offsets in the mapping table will be in the range 0 to NUM_QUEUES-1, and
  8364. * referenced RSS contexts must span no more than this number.
  8365. */
  8366. #define MC_CMD_DOT1P_MAPPING_ALLOC_IN_NUM_QUEUES_OFST 4
  8367. /* MC_CMD_DOT1P_MAPPING_ALLOC_OUT msgresponse */
  8368. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_LEN 4
  8369. /* The handle of the new .1p mapping. This should be considered opaque to the
  8370. * host, although a value of 0xFFFFFFFF is guaranteed never to be a valid
  8371. * handle.
  8372. */
  8373. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_OFST 0
  8374. /* enum: guaranteed invalid .1p mapping handle value */
  8375. #define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_INVALID 0xffffffff
  8376. /***********************************/
  8377. /* MC_CMD_DOT1P_MAPPING_FREE
  8378. * Free a .1p mapping.
  8379. */
  8380. #define MC_CMD_DOT1P_MAPPING_FREE 0xa5
  8381. #define MC_CMD_0xa5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8382. /* MC_CMD_DOT1P_MAPPING_FREE_IN msgrequest */
  8383. #define MC_CMD_DOT1P_MAPPING_FREE_IN_LEN 4
  8384. /* The handle of the .1p mapping */
  8385. #define MC_CMD_DOT1P_MAPPING_FREE_IN_DOT1P_MAPPING_ID_OFST 0
  8386. /* MC_CMD_DOT1P_MAPPING_FREE_OUT msgresponse */
  8387. #define MC_CMD_DOT1P_MAPPING_FREE_OUT_LEN 0
  8388. /***********************************/
  8389. /* MC_CMD_DOT1P_MAPPING_SET_TABLE
  8390. * Set the mapping table for a .1p mapping.
  8391. */
  8392. #define MC_CMD_DOT1P_MAPPING_SET_TABLE 0xa6
  8393. #define MC_CMD_0xa6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8394. /* MC_CMD_DOT1P_MAPPING_SET_TABLE_IN msgrequest */
  8395. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_LEN 36
  8396. /* The handle of the .1p mapping */
  8397. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
  8398. /* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
  8399. * handle)
  8400. */
  8401. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_OFST 4
  8402. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_LEN 32
  8403. /* MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT msgresponse */
  8404. #define MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT_LEN 0
  8405. /***********************************/
  8406. /* MC_CMD_DOT1P_MAPPING_GET_TABLE
  8407. * Get the mapping table for a .1p mapping.
  8408. */
  8409. #define MC_CMD_DOT1P_MAPPING_GET_TABLE 0xa7
  8410. #define MC_CMD_0xa7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8411. /* MC_CMD_DOT1P_MAPPING_GET_TABLE_IN msgrequest */
  8412. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_LEN 4
  8413. /* The handle of the .1p mapping */
  8414. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
  8415. /* MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT msgresponse */
  8416. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_LEN 36
  8417. /* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
  8418. * handle)
  8419. */
  8420. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_OFST 4
  8421. #define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_LEN 32
  8422. /***********************************/
  8423. /* MC_CMD_GET_VECTOR_CFG
  8424. * Get Interrupt Vector config for this PF.
  8425. */
  8426. #define MC_CMD_GET_VECTOR_CFG 0xbf
  8427. #define MC_CMD_0xbf_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8428. /* MC_CMD_GET_VECTOR_CFG_IN msgrequest */
  8429. #define MC_CMD_GET_VECTOR_CFG_IN_LEN 0
  8430. /* MC_CMD_GET_VECTOR_CFG_OUT msgresponse */
  8431. #define MC_CMD_GET_VECTOR_CFG_OUT_LEN 12
  8432. /* Base absolute interrupt vector number. */
  8433. #define MC_CMD_GET_VECTOR_CFG_OUT_VEC_BASE_OFST 0
  8434. /* Number of interrupt vectors allocate to this PF. */
  8435. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_PF_OFST 4
  8436. /* Number of interrupt vectors to allocate per VF. */
  8437. #define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_VF_OFST 8
  8438. /***********************************/
  8439. /* MC_CMD_SET_VECTOR_CFG
  8440. * Set Interrupt Vector config for this PF.
  8441. */
  8442. #define MC_CMD_SET_VECTOR_CFG 0xc0
  8443. #define MC_CMD_0xc0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8444. /* MC_CMD_SET_VECTOR_CFG_IN msgrequest */
  8445. #define MC_CMD_SET_VECTOR_CFG_IN_LEN 12
  8446. /* Base absolute interrupt vector number, or MC_CMD_RESOURCE_INSTANCE_ANY to
  8447. * let the system find a suitable base.
  8448. */
  8449. #define MC_CMD_SET_VECTOR_CFG_IN_VEC_BASE_OFST 0
  8450. /* Number of interrupt vectors allocate to this PF. */
  8451. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_PF_OFST 4
  8452. /* Number of interrupt vectors to allocate per VF. */
  8453. #define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_VF_OFST 8
  8454. /* MC_CMD_SET_VECTOR_CFG_OUT msgresponse */
  8455. #define MC_CMD_SET_VECTOR_CFG_OUT_LEN 0
  8456. /***********************************/
  8457. /* MC_CMD_VPORT_ADD_MAC_ADDRESS
  8458. * Add a MAC address to a v-port
  8459. */
  8460. #define MC_CMD_VPORT_ADD_MAC_ADDRESS 0xa8
  8461. #define MC_CMD_0xa8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8462. /* MC_CMD_VPORT_ADD_MAC_ADDRESS_IN msgrequest */
  8463. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_LEN 10
  8464. /* The handle of the v-port */
  8465. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_VPORT_ID_OFST 0
  8466. /* MAC address to add */
  8467. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_OFST 4
  8468. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_LEN 6
  8469. /* MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT msgresponse */
  8470. #define MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT_LEN 0
  8471. /***********************************/
  8472. /* MC_CMD_VPORT_DEL_MAC_ADDRESS
  8473. * Delete a MAC address from a v-port
  8474. */
  8475. #define MC_CMD_VPORT_DEL_MAC_ADDRESS 0xa9
  8476. #define MC_CMD_0xa9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8477. /* MC_CMD_VPORT_DEL_MAC_ADDRESS_IN msgrequest */
  8478. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_LEN 10
  8479. /* The handle of the v-port */
  8480. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_VPORT_ID_OFST 0
  8481. /* MAC address to add */
  8482. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_OFST 4
  8483. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_LEN 6
  8484. /* MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT msgresponse */
  8485. #define MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT_LEN 0
  8486. /***********************************/
  8487. /* MC_CMD_VPORT_GET_MAC_ADDRESSES
  8488. * Delete a MAC address from a v-port
  8489. */
  8490. #define MC_CMD_VPORT_GET_MAC_ADDRESSES 0xaa
  8491. #define MC_CMD_0xaa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8492. /* MC_CMD_VPORT_GET_MAC_ADDRESSES_IN msgrequest */
  8493. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN 4
  8494. /* The handle of the v-port */
  8495. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID_OFST 0
  8496. /* MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT msgresponse */
  8497. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMIN 4
  8498. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX 250
  8499. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LEN(num) (4+6*(num))
  8500. /* The number of MAC addresses returned */
  8501. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT_OFST 0
  8502. /* Array of MAC addresses */
  8503. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_OFST 4
  8504. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_LEN 6
  8505. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MINNUM 0
  8506. #define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MAXNUM 41
  8507. /***********************************/
  8508. /* MC_CMD_VPORT_RECONFIGURE
  8509. * Replace VLAN tags and/or MAC addresses of an existing v-port. If the v-port
  8510. * has already been passed to another function (v-port's user), then that
  8511. * function will be reset before applying the changes.
  8512. */
  8513. #define MC_CMD_VPORT_RECONFIGURE 0xeb
  8514. #define MC_CMD_0xeb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8515. /* MC_CMD_VPORT_RECONFIGURE_IN msgrequest */
  8516. #define MC_CMD_VPORT_RECONFIGURE_IN_LEN 44
  8517. /* The handle of the v-port */
  8518. #define MC_CMD_VPORT_RECONFIGURE_IN_VPORT_ID_OFST 0
  8519. /* Flags requesting what should be changed. */
  8520. #define MC_CMD_VPORT_RECONFIGURE_IN_FLAGS_OFST 4
  8521. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_VLAN_TAGS_LBN 0
  8522. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_VLAN_TAGS_WIDTH 1
  8523. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_MACADDRS_LBN 1
  8524. #define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_MACADDRS_WIDTH 1
  8525. /* The number of VLAN tags to insert/remove. An error will be returned if
  8526. * incompatible with the number of VLAN tags specified for the upstream
  8527. * v-switch.
  8528. */
  8529. #define MC_CMD_VPORT_RECONFIGURE_IN_NUM_VLAN_TAGS_OFST 8
  8530. /* The actual VLAN tags to insert/remove */
  8531. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAGS_OFST 12
  8532. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_0_LBN 0
  8533. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_0_WIDTH 16
  8534. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_1_LBN 16
  8535. #define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_1_WIDTH 16
  8536. /* The number of MAC addresses to add */
  8537. #define MC_CMD_VPORT_RECONFIGURE_IN_NUM_MACADDRS_OFST 16
  8538. /* MAC addresses to add */
  8539. #define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_OFST 20
  8540. #define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_LEN 6
  8541. #define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_NUM 4
  8542. /* MC_CMD_VPORT_RECONFIGURE_OUT msgresponse */
  8543. #define MC_CMD_VPORT_RECONFIGURE_OUT_LEN 4
  8544. #define MC_CMD_VPORT_RECONFIGURE_OUT_FLAGS_OFST 0
  8545. #define MC_CMD_VPORT_RECONFIGURE_OUT_RESET_DONE_LBN 0
  8546. #define MC_CMD_VPORT_RECONFIGURE_OUT_RESET_DONE_WIDTH 1
  8547. /***********************************/
  8548. /* MC_CMD_EVB_PORT_QUERY
  8549. * read some config of v-port.
  8550. */
  8551. #define MC_CMD_EVB_PORT_QUERY 0x62
  8552. #define MC_CMD_0x62_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8553. /* MC_CMD_EVB_PORT_QUERY_IN msgrequest */
  8554. #define MC_CMD_EVB_PORT_QUERY_IN_LEN 4
  8555. /* The handle of the v-port */
  8556. #define MC_CMD_EVB_PORT_QUERY_IN_PORT_ID_OFST 0
  8557. /* MC_CMD_EVB_PORT_QUERY_OUT msgresponse */
  8558. #define MC_CMD_EVB_PORT_QUERY_OUT_LEN 8
  8559. /* The EVB port flags as defined at MC_CMD_VPORT_ALLOC. */
  8560. #define MC_CMD_EVB_PORT_QUERY_OUT_PORT_FLAGS_OFST 0
  8561. /* The number of VLAN tags that may be used on a v-adaptor connected to this
  8562. * EVB port.
  8563. */
  8564. #define MC_CMD_EVB_PORT_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_OFST 4
  8565. /***********************************/
  8566. /* MC_CMD_DUMP_BUFTBL_ENTRIES
  8567. * Dump buffer table entries, mainly for command client debug use. Dumps
  8568. * absolute entries, and does not use chunk handles. All entries must be in
  8569. * range, and used for q page mapping, Although the latter restriction may be
  8570. * lifted in future.
  8571. */
  8572. #define MC_CMD_DUMP_BUFTBL_ENTRIES 0xab
  8573. #define MC_CMD_0xab_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8574. /* MC_CMD_DUMP_BUFTBL_ENTRIES_IN msgrequest */
  8575. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_LEN 8
  8576. /* Index of the first buffer table entry. */
  8577. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_FIRSTID_OFST 0
  8578. /* Number of buffer table entries to dump. */
  8579. #define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 4
  8580. /* MC_CMD_DUMP_BUFTBL_ENTRIES_OUT msgresponse */
  8581. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMIN 12
  8582. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMAX 252
  8583. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LEN(num) (0+12*(num))
  8584. /* Raw buffer table entries, layed out as BUFTBL_ENTRY. */
  8585. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_OFST 0
  8586. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_LEN 12
  8587. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MINNUM 1
  8588. #define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MAXNUM 21
  8589. /***********************************/
  8590. /* MC_CMD_SET_RXDP_CONFIG
  8591. * Set global RXDP configuration settings
  8592. */
  8593. #define MC_CMD_SET_RXDP_CONFIG 0xc1
  8594. #define MC_CMD_0xc1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8595. /* MC_CMD_SET_RXDP_CONFIG_IN msgrequest */
  8596. #define MC_CMD_SET_RXDP_CONFIG_IN_LEN 4
  8597. #define MC_CMD_SET_RXDP_CONFIG_IN_DATA_OFST 0
  8598. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_LBN 0
  8599. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_WIDTH 1
  8600. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_LEN_LBN 1
  8601. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_LEN_WIDTH 2
  8602. /* enum: pad to 64 bytes */
  8603. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64 0x0
  8604. /* enum: pad to 128 bytes (Medford only) */
  8605. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128 0x1
  8606. /* enum: pad to 256 bytes (Medford only) */
  8607. #define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256 0x2
  8608. /* MC_CMD_SET_RXDP_CONFIG_OUT msgresponse */
  8609. #define MC_CMD_SET_RXDP_CONFIG_OUT_LEN 0
  8610. /***********************************/
  8611. /* MC_CMD_GET_RXDP_CONFIG
  8612. * Get global RXDP configuration settings
  8613. */
  8614. #define MC_CMD_GET_RXDP_CONFIG 0xc2
  8615. #define MC_CMD_0xc2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8616. /* MC_CMD_GET_RXDP_CONFIG_IN msgrequest */
  8617. #define MC_CMD_GET_RXDP_CONFIG_IN_LEN 0
  8618. /* MC_CMD_GET_RXDP_CONFIG_OUT msgresponse */
  8619. #define MC_CMD_GET_RXDP_CONFIG_OUT_LEN 4
  8620. #define MC_CMD_GET_RXDP_CONFIG_OUT_DATA_OFST 0
  8621. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_LBN 0
  8622. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_WIDTH 1
  8623. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_LEN_LBN 1
  8624. #define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_LEN_WIDTH 2
  8625. /* Enum values, see field(s): */
  8626. /* MC_CMD_SET_RXDP_CONFIG/MC_CMD_SET_RXDP_CONFIG_IN/PAD_HOST_LEN */
  8627. /***********************************/
  8628. /* MC_CMD_GET_CLOCK
  8629. * Return the system and PDCPU clock frequencies.
  8630. */
  8631. #define MC_CMD_GET_CLOCK 0xac
  8632. #define MC_CMD_0xac_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8633. /* MC_CMD_GET_CLOCK_IN msgrequest */
  8634. #define MC_CMD_GET_CLOCK_IN_LEN 0
  8635. /* MC_CMD_GET_CLOCK_OUT msgresponse */
  8636. #define MC_CMD_GET_CLOCK_OUT_LEN 8
  8637. /* System frequency, MHz */
  8638. #define MC_CMD_GET_CLOCK_OUT_SYS_FREQ_OFST 0
  8639. /* DPCPU frequency, MHz */
  8640. #define MC_CMD_GET_CLOCK_OUT_DPCPU_FREQ_OFST 4
  8641. /***********************************/
  8642. /* MC_CMD_SET_CLOCK
  8643. * Control the system and DPCPU clock frequencies. Changes are lost reboot.
  8644. */
  8645. #define MC_CMD_SET_CLOCK 0xad
  8646. #define MC_CMD_0xad_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8647. /* MC_CMD_SET_CLOCK_IN msgrequest */
  8648. #define MC_CMD_SET_CLOCK_IN_LEN 28
  8649. /* Requested frequency in MHz for system clock domain */
  8650. #define MC_CMD_SET_CLOCK_IN_SYS_FREQ_OFST 0
  8651. /* enum: Leave the system clock domain frequency unchanged */
  8652. #define MC_CMD_SET_CLOCK_IN_SYS_DOMAIN_DONT_CHANGE 0x0
  8653. /* Requested frequency in MHz for inter-core clock domain */
  8654. #define MC_CMD_SET_CLOCK_IN_ICORE_FREQ_OFST 4
  8655. /* enum: Leave the inter-core clock domain frequency unchanged */
  8656. #define MC_CMD_SET_CLOCK_IN_ICORE_DOMAIN_DONT_CHANGE 0x0
  8657. /* Requested frequency in MHz for DPCPU clock domain */
  8658. #define MC_CMD_SET_CLOCK_IN_DPCPU_FREQ_OFST 8
  8659. /* enum: Leave the DPCPU clock domain frequency unchanged */
  8660. #define MC_CMD_SET_CLOCK_IN_DPCPU_DOMAIN_DONT_CHANGE 0x0
  8661. /* Requested frequency in MHz for PCS clock domain */
  8662. #define MC_CMD_SET_CLOCK_IN_PCS_FREQ_OFST 12
  8663. /* enum: Leave the PCS clock domain frequency unchanged */
  8664. #define MC_CMD_SET_CLOCK_IN_PCS_DOMAIN_DONT_CHANGE 0x0
  8665. /* Requested frequency in MHz for MC clock domain */
  8666. #define MC_CMD_SET_CLOCK_IN_MC_FREQ_OFST 16
  8667. /* enum: Leave the MC clock domain frequency unchanged */
  8668. #define MC_CMD_SET_CLOCK_IN_MC_DOMAIN_DONT_CHANGE 0x0
  8669. /* Requested frequency in MHz for rmon clock domain */
  8670. #define MC_CMD_SET_CLOCK_IN_RMON_FREQ_OFST 20
  8671. /* enum: Leave the rmon clock domain frequency unchanged */
  8672. #define MC_CMD_SET_CLOCK_IN_RMON_DOMAIN_DONT_CHANGE 0x0
  8673. /* Requested frequency in MHz for vswitch clock domain */
  8674. #define MC_CMD_SET_CLOCK_IN_VSWITCH_FREQ_OFST 24
  8675. /* enum: Leave the vswitch clock domain frequency unchanged */
  8676. #define MC_CMD_SET_CLOCK_IN_VSWITCH_DOMAIN_DONT_CHANGE 0x0
  8677. /* MC_CMD_SET_CLOCK_OUT msgresponse */
  8678. #define MC_CMD_SET_CLOCK_OUT_LEN 28
  8679. /* Resulting system frequency in MHz */
  8680. #define MC_CMD_SET_CLOCK_OUT_SYS_FREQ_OFST 0
  8681. /* enum: The system clock domain doesn't exist */
  8682. #define MC_CMD_SET_CLOCK_OUT_SYS_DOMAIN_UNSUPPORTED 0x0
  8683. /* Resulting inter-core frequency in MHz */
  8684. #define MC_CMD_SET_CLOCK_OUT_ICORE_FREQ_OFST 4
  8685. /* enum: The inter-core clock domain doesn't exist / isn't used */
  8686. #define MC_CMD_SET_CLOCK_OUT_ICORE_DOMAIN_UNSUPPORTED 0x0
  8687. /* Resulting DPCPU frequency in MHz */
  8688. #define MC_CMD_SET_CLOCK_OUT_DPCPU_FREQ_OFST 8
  8689. /* enum: The dpcpu clock domain doesn't exist */
  8690. #define MC_CMD_SET_CLOCK_OUT_DPCPU_DOMAIN_UNSUPPORTED 0x0
  8691. /* Resulting PCS frequency in MHz */
  8692. #define MC_CMD_SET_CLOCK_OUT_PCS_FREQ_OFST 12
  8693. /* enum: The PCS clock domain doesn't exist / isn't controlled */
  8694. #define MC_CMD_SET_CLOCK_OUT_PCS_DOMAIN_UNSUPPORTED 0x0
  8695. /* Resulting MC frequency in MHz */
  8696. #define MC_CMD_SET_CLOCK_OUT_MC_FREQ_OFST 16
  8697. /* enum: The MC clock domain doesn't exist / isn't controlled */
  8698. #define MC_CMD_SET_CLOCK_OUT_MC_DOMAIN_UNSUPPORTED 0x0
  8699. /* Resulting rmon frequency in MHz */
  8700. #define MC_CMD_SET_CLOCK_OUT_RMON_FREQ_OFST 20
  8701. /* enum: The rmon clock domain doesn't exist / isn't controlled */
  8702. #define MC_CMD_SET_CLOCK_OUT_RMON_DOMAIN_UNSUPPORTED 0x0
  8703. /* Resulting vswitch frequency in MHz */
  8704. #define MC_CMD_SET_CLOCK_OUT_VSWITCH_FREQ_OFST 24
  8705. /* enum: The vswitch clock domain doesn't exist / isn't controlled */
  8706. #define MC_CMD_SET_CLOCK_OUT_VSWITCH_DOMAIN_UNSUPPORTED 0x0
  8707. /***********************************/
  8708. /* MC_CMD_DPCPU_RPC
  8709. * Send an arbitrary DPCPU message.
  8710. */
  8711. #define MC_CMD_DPCPU_RPC 0xae
  8712. #define MC_CMD_0xae_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8713. /* MC_CMD_DPCPU_RPC_IN msgrequest */
  8714. #define MC_CMD_DPCPU_RPC_IN_LEN 36
  8715. #define MC_CMD_DPCPU_RPC_IN_CPU_OFST 0
  8716. /* enum: RxDPCPU0 */
  8717. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX0 0x0
  8718. /* enum: TxDPCPU0 */
  8719. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX0 0x1
  8720. /* enum: TxDPCPU1 */
  8721. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX1 0x2
  8722. /* enum: RxDPCPU1 (Medford only) */
  8723. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX1 0x3
  8724. /* enum: RxDPCPU (will be for the calling function; for now, just an alias of
  8725. * DPCPU_RX0)
  8726. */
  8727. #define MC_CMD_DPCPU_RPC_IN_DPCPU_RX 0x80
  8728. /* enum: TxDPCPU (will be for the calling function; for now, just an alias of
  8729. * DPCPU_TX0)
  8730. */
  8731. #define MC_CMD_DPCPU_RPC_IN_DPCPU_TX 0x81
  8732. /* First 8 bits [39:32] of DATA are consumed by MC-DPCPU protocol and must be
  8733. * initialised to zero
  8734. */
  8735. #define MC_CMD_DPCPU_RPC_IN_DATA_OFST 4
  8736. #define MC_CMD_DPCPU_RPC_IN_DATA_LEN 32
  8737. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_LBN 8
  8738. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_WIDTH 8
  8739. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_READ 0x6 /* enum */
  8740. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_WRITE 0x7 /* enum */
  8741. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_SELF_TEST 0xc /* enum */
  8742. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_CSR_ACCESS 0xe /* enum */
  8743. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_READ 0x46 /* enum */
  8744. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_WRITE 0x47 /* enum */
  8745. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SELF_TEST 0x4a /* enum */
  8746. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_CSR_ACCESS 0x4c /* enum */
  8747. #define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SET_MC_REPLAY_CNTXT 0x4d /* enum */
  8748. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_LBN 16
  8749. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_WIDTH 16
  8750. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_LBN 16
  8751. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_WIDTH 16
  8752. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_LBN 48
  8753. #define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_WIDTH 16
  8754. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_LBN 16
  8755. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_WIDTH 240
  8756. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_LBN 16
  8757. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_WIDTH 16
  8758. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_STOP_RETURN_RESULT 0x0 /* enum */
  8759. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_READ 0x1 /* enum */
  8760. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE 0x2 /* enum */
  8761. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE_READ 0x3 /* enum */
  8762. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_PIPELINED_READ 0x4 /* enum */
  8763. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_LBN 48
  8764. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_WIDTH 16
  8765. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_LBN 64
  8766. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_WIDTH 16
  8767. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_LBN 80
  8768. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_WIDTH 16
  8769. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_LBN 16
  8770. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_WIDTH 16
  8771. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_CUT_THROUGH 0x1 /* enum */
  8772. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD 0x2 /* enum */
  8773. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD_FIRST 0x3 /* enum */
  8774. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_LBN 64
  8775. #define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_WIDTH 16
  8776. #define MC_CMD_DPCPU_RPC_IN_WDATA_OFST 12
  8777. #define MC_CMD_DPCPU_RPC_IN_WDATA_LEN 24
  8778. /* Register data to write. Only valid in write/write-read. */
  8779. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_DATA_OFST 16
  8780. /* Register address. */
  8781. #define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_ADDRESS_OFST 20
  8782. /* MC_CMD_DPCPU_RPC_OUT msgresponse */
  8783. #define MC_CMD_DPCPU_RPC_OUT_LEN 36
  8784. #define MC_CMD_DPCPU_RPC_OUT_RC_OFST 0
  8785. /* DATA */
  8786. #define MC_CMD_DPCPU_RPC_OUT_DATA_OFST 4
  8787. #define MC_CMD_DPCPU_RPC_OUT_DATA_LEN 32
  8788. #define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_LBN 32
  8789. #define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_WIDTH 16
  8790. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_LBN 48
  8791. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_WIDTH 16
  8792. #define MC_CMD_DPCPU_RPC_OUT_RDATA_OFST 12
  8793. #define MC_CMD_DPCPU_RPC_OUT_RDATA_LEN 24
  8794. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_1_OFST 12
  8795. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_2_OFST 16
  8796. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_3_OFST 20
  8797. #define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_4_OFST 24
  8798. /***********************************/
  8799. /* MC_CMD_TRIGGER_INTERRUPT
  8800. * Trigger an interrupt by prodding the BIU.
  8801. */
  8802. #define MC_CMD_TRIGGER_INTERRUPT 0xe3
  8803. #define MC_CMD_0xe3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8804. /* MC_CMD_TRIGGER_INTERRUPT_IN msgrequest */
  8805. #define MC_CMD_TRIGGER_INTERRUPT_IN_LEN 4
  8806. /* Interrupt level relative to base for function. */
  8807. #define MC_CMD_TRIGGER_INTERRUPT_IN_INTR_LEVEL_OFST 0
  8808. /* MC_CMD_TRIGGER_INTERRUPT_OUT msgresponse */
  8809. #define MC_CMD_TRIGGER_INTERRUPT_OUT_LEN 0
  8810. /***********************************/
  8811. /* MC_CMD_SHMBOOT_OP
  8812. * Special operations to support (for now) shmboot.
  8813. */
  8814. #define MC_CMD_SHMBOOT_OP 0xe6
  8815. #define MC_CMD_0xe6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8816. /* MC_CMD_SHMBOOT_OP_IN msgrequest */
  8817. #define MC_CMD_SHMBOOT_OP_IN_LEN 4
  8818. /* Identifies the operation to perform */
  8819. #define MC_CMD_SHMBOOT_OP_IN_SHMBOOT_OP_OFST 0
  8820. /* enum: Copy slave_data section to the slave core. (Greenport only) */
  8821. #define MC_CMD_SHMBOOT_OP_IN_PUSH_SLAVE_DATA 0x0
  8822. /* MC_CMD_SHMBOOT_OP_OUT msgresponse */
  8823. #define MC_CMD_SHMBOOT_OP_OUT_LEN 0
  8824. /***********************************/
  8825. /* MC_CMD_CAP_BLK_READ
  8826. * Read multiple 64bit words from capture block memory
  8827. */
  8828. #define MC_CMD_CAP_BLK_READ 0xe7
  8829. #define MC_CMD_0xe7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8830. /* MC_CMD_CAP_BLK_READ_IN msgrequest */
  8831. #define MC_CMD_CAP_BLK_READ_IN_LEN 12
  8832. #define MC_CMD_CAP_BLK_READ_IN_CAP_REG_OFST 0
  8833. #define MC_CMD_CAP_BLK_READ_IN_ADDR_OFST 4
  8834. #define MC_CMD_CAP_BLK_READ_IN_COUNT_OFST 8
  8835. /* MC_CMD_CAP_BLK_READ_OUT msgresponse */
  8836. #define MC_CMD_CAP_BLK_READ_OUT_LENMIN 8
  8837. #define MC_CMD_CAP_BLK_READ_OUT_LENMAX 248
  8838. #define MC_CMD_CAP_BLK_READ_OUT_LEN(num) (0+8*(num))
  8839. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_OFST 0
  8840. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LEN 8
  8841. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LO_OFST 0
  8842. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_HI_OFST 4
  8843. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MINNUM 1
  8844. #define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MAXNUM 31
  8845. /***********************************/
  8846. /* MC_CMD_DUMP_DO
  8847. * Take a dump of the DUT state
  8848. */
  8849. #define MC_CMD_DUMP_DO 0xe8
  8850. #define MC_CMD_0xe8_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8851. /* MC_CMD_DUMP_DO_IN msgrequest */
  8852. #define MC_CMD_DUMP_DO_IN_LEN 52
  8853. #define MC_CMD_DUMP_DO_IN_PADDING_OFST 0
  8854. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_OFST 4
  8855. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM 0x0 /* enum */
  8856. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_DEFAULT 0x1 /* enum */
  8857. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
  8858. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_NVRAM 0x1 /* enum */
  8859. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY 0x2 /* enum */
  8860. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY_MLI 0x3 /* enum */
  8861. #define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_UART 0x4 /* enum */
  8862. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
  8863. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
  8864. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
  8865. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
  8866. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
  8867. #define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_PAGE_SIZE 0x1000 /* enum */
  8868. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
  8869. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
  8870. #define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_MAX_DEPTH 0x2 /* enum */
  8871. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
  8872. /* enum: The uart port this command was received over (if using a uart
  8873. * transport)
  8874. */
  8875. #define MC_CMD_DUMP_DO_IN_UART_PORT_SRC 0xff
  8876. #define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
  8877. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_OFST 28
  8878. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM 0x0 /* enum */
  8879. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_NVRAM_DUMP_PARTITION 0x1 /* enum */
  8880. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
  8881. /* Enum values, see field(s): */
  8882. /* MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  8883. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
  8884. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
  8885. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
  8886. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
  8887. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
  8888. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
  8889. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
  8890. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
  8891. #define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
  8892. /* MC_CMD_DUMP_DO_OUT msgresponse */
  8893. #define MC_CMD_DUMP_DO_OUT_LEN 4
  8894. #define MC_CMD_DUMP_DO_OUT_DUMPFILE_SIZE_OFST 0
  8895. /***********************************/
  8896. /* MC_CMD_DUMP_CONFIGURE_UNSOLICITED
  8897. * Configure unsolicited dumps
  8898. */
  8899. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED 0xe9
  8900. #define MC_CMD_0xe9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8901. /* MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN msgrequest */
  8902. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_LEN 52
  8903. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_ENABLE_OFST 0
  8904. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_OFST 4
  8905. /* Enum values, see field(s): */
  8906. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC */
  8907. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
  8908. /* Enum values, see field(s): */
  8909. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  8910. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
  8911. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
  8912. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
  8913. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
  8914. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
  8915. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
  8916. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
  8917. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
  8918. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
  8919. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_OFST 28
  8920. /* Enum values, see field(s): */
  8921. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPFILE_DST */
  8922. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
  8923. /* Enum values, see field(s): */
  8924. /* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
  8925. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
  8926. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
  8927. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
  8928. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
  8929. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
  8930. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
  8931. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
  8932. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
  8933. #define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
  8934. /***********************************/
  8935. /* MC_CMD_SET_PSU
  8936. * Adjusts power supply parameters. This is a warranty-voiding operation.
  8937. * Returns: ENOENT if the parameter or rail specified does not exist, EINVAL if
  8938. * the parameter is out of range.
  8939. */
  8940. #define MC_CMD_SET_PSU 0xea
  8941. #define MC_CMD_0xea_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8942. /* MC_CMD_SET_PSU_IN msgrequest */
  8943. #define MC_CMD_SET_PSU_IN_LEN 12
  8944. #define MC_CMD_SET_PSU_IN_PARAM_OFST 0
  8945. #define MC_CMD_SET_PSU_IN_PARAM_SUPPLY_VOLTAGE 0x0 /* enum */
  8946. #define MC_CMD_SET_PSU_IN_RAIL_OFST 4
  8947. #define MC_CMD_SET_PSU_IN_RAIL_0V9 0x0 /* enum */
  8948. #define MC_CMD_SET_PSU_IN_RAIL_1V2 0x1 /* enum */
  8949. /* desired value, eg voltage in mV */
  8950. #define MC_CMD_SET_PSU_IN_VALUE_OFST 8
  8951. /* MC_CMD_SET_PSU_OUT msgresponse */
  8952. #define MC_CMD_SET_PSU_OUT_LEN 0
  8953. /***********************************/
  8954. /* MC_CMD_GET_FUNCTION_INFO
  8955. * Get function information. PF and VF number.
  8956. */
  8957. #define MC_CMD_GET_FUNCTION_INFO 0xec
  8958. #define MC_CMD_0xec_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8959. /* MC_CMD_GET_FUNCTION_INFO_IN msgrequest */
  8960. #define MC_CMD_GET_FUNCTION_INFO_IN_LEN 0
  8961. /* MC_CMD_GET_FUNCTION_INFO_OUT msgresponse */
  8962. #define MC_CMD_GET_FUNCTION_INFO_OUT_LEN 8
  8963. #define MC_CMD_GET_FUNCTION_INFO_OUT_PF_OFST 0
  8964. #define MC_CMD_GET_FUNCTION_INFO_OUT_VF_OFST 4
  8965. /***********************************/
  8966. /* MC_CMD_ENABLE_OFFLINE_BIST
  8967. * Enters offline BIST mode. All queues are torn down, chip enters quiescent
  8968. * mode, calling function gets exclusive MCDI ownership. The only way out is
  8969. * reboot.
  8970. */
  8971. #define MC_CMD_ENABLE_OFFLINE_BIST 0xed
  8972. #define MC_CMD_0xed_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  8973. /* MC_CMD_ENABLE_OFFLINE_BIST_IN msgrequest */
  8974. #define MC_CMD_ENABLE_OFFLINE_BIST_IN_LEN 0
  8975. /* MC_CMD_ENABLE_OFFLINE_BIST_OUT msgresponse */
  8976. #define MC_CMD_ENABLE_OFFLINE_BIST_OUT_LEN 0
  8977. /***********************************/
  8978. /* MC_CMD_UART_SEND_DATA
  8979. * Send checksummed[sic] block of data over the uart. Response is a placeholder
  8980. * should we wish to make this reliable; currently requests are fire-and-
  8981. * forget.
  8982. */
  8983. #define MC_CMD_UART_SEND_DATA 0xee
  8984. #define MC_CMD_0xee_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  8985. /* MC_CMD_UART_SEND_DATA_OUT msgrequest */
  8986. #define MC_CMD_UART_SEND_DATA_OUT_LENMIN 16
  8987. #define MC_CMD_UART_SEND_DATA_OUT_LENMAX 252
  8988. #define MC_CMD_UART_SEND_DATA_OUT_LEN(num) (16+1*(num))
  8989. /* CRC32 over OFFSET, LENGTH, RESERVED, DATA */
  8990. #define MC_CMD_UART_SEND_DATA_OUT_CHECKSUM_OFST 0
  8991. /* Offset at which to write the data */
  8992. #define MC_CMD_UART_SEND_DATA_OUT_OFFSET_OFST 4
  8993. /* Length of data */
  8994. #define MC_CMD_UART_SEND_DATA_OUT_LENGTH_OFST 8
  8995. /* Reserved for future use */
  8996. #define MC_CMD_UART_SEND_DATA_OUT_RESERVED_OFST 12
  8997. #define MC_CMD_UART_SEND_DATA_OUT_DATA_OFST 16
  8998. #define MC_CMD_UART_SEND_DATA_OUT_DATA_LEN 1
  8999. #define MC_CMD_UART_SEND_DATA_OUT_DATA_MINNUM 0
  9000. #define MC_CMD_UART_SEND_DATA_OUT_DATA_MAXNUM 236
  9001. /* MC_CMD_UART_SEND_DATA_IN msgresponse */
  9002. #define MC_CMD_UART_SEND_DATA_IN_LEN 0
  9003. /***********************************/
  9004. /* MC_CMD_UART_RECV_DATA
  9005. * Request checksummed[sic] block of data over the uart. Only a placeholder,
  9006. * subject to change and not currently implemented.
  9007. */
  9008. #define MC_CMD_UART_RECV_DATA 0xef
  9009. #define MC_CMD_0xef_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9010. /* MC_CMD_UART_RECV_DATA_OUT msgrequest */
  9011. #define MC_CMD_UART_RECV_DATA_OUT_LEN 16
  9012. /* CRC32 over OFFSET, LENGTH, RESERVED */
  9013. #define MC_CMD_UART_RECV_DATA_OUT_CHECKSUM_OFST 0
  9014. /* Offset from which to read the data */
  9015. #define MC_CMD_UART_RECV_DATA_OUT_OFFSET_OFST 4
  9016. /* Length of data */
  9017. #define MC_CMD_UART_RECV_DATA_OUT_LENGTH_OFST 8
  9018. /* Reserved for future use */
  9019. #define MC_CMD_UART_RECV_DATA_OUT_RESERVED_OFST 12
  9020. /* MC_CMD_UART_RECV_DATA_IN msgresponse */
  9021. #define MC_CMD_UART_RECV_DATA_IN_LENMIN 16
  9022. #define MC_CMD_UART_RECV_DATA_IN_LENMAX 252
  9023. #define MC_CMD_UART_RECV_DATA_IN_LEN(num) (16+1*(num))
  9024. /* CRC32 over RESERVED1, RESERVED2, RESERVED3, DATA */
  9025. #define MC_CMD_UART_RECV_DATA_IN_CHECKSUM_OFST 0
  9026. /* Offset at which to write the data */
  9027. #define MC_CMD_UART_RECV_DATA_IN_RESERVED1_OFST 4
  9028. /* Length of data */
  9029. #define MC_CMD_UART_RECV_DATA_IN_RESERVED2_OFST 8
  9030. /* Reserved for future use */
  9031. #define MC_CMD_UART_RECV_DATA_IN_RESERVED3_OFST 12
  9032. #define MC_CMD_UART_RECV_DATA_IN_DATA_OFST 16
  9033. #define MC_CMD_UART_RECV_DATA_IN_DATA_LEN 1
  9034. #define MC_CMD_UART_RECV_DATA_IN_DATA_MINNUM 0
  9035. #define MC_CMD_UART_RECV_DATA_IN_DATA_MAXNUM 236
  9036. /***********************************/
  9037. /* MC_CMD_READ_FUSES
  9038. * Read data programmed into the device One-Time-Programmable (OTP) Fuses
  9039. */
  9040. #define MC_CMD_READ_FUSES 0xf0
  9041. #define MC_CMD_0xf0_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  9042. /* MC_CMD_READ_FUSES_IN msgrequest */
  9043. #define MC_CMD_READ_FUSES_IN_LEN 8
  9044. /* Offset in OTP to read */
  9045. #define MC_CMD_READ_FUSES_IN_OFFSET_OFST 0
  9046. /* Length of data to read in bytes */
  9047. #define MC_CMD_READ_FUSES_IN_LENGTH_OFST 4
  9048. /* MC_CMD_READ_FUSES_OUT msgresponse */
  9049. #define MC_CMD_READ_FUSES_OUT_LENMIN 4
  9050. #define MC_CMD_READ_FUSES_OUT_LENMAX 252
  9051. #define MC_CMD_READ_FUSES_OUT_LEN(num) (4+1*(num))
  9052. /* Length of returned OTP data in bytes */
  9053. #define MC_CMD_READ_FUSES_OUT_LENGTH_OFST 0
  9054. /* Returned data */
  9055. #define MC_CMD_READ_FUSES_OUT_DATA_OFST 4
  9056. #define MC_CMD_READ_FUSES_OUT_DATA_LEN 1
  9057. #define MC_CMD_READ_FUSES_OUT_DATA_MINNUM 0
  9058. #define MC_CMD_READ_FUSES_OUT_DATA_MAXNUM 248
  9059. /***********************************/
  9060. /* MC_CMD_KR_TUNE
  9061. * Get or set KR Serdes RXEQ and TX Driver settings
  9062. */
  9063. #define MC_CMD_KR_TUNE 0xf1
  9064. #define MC_CMD_0xf1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  9065. /* MC_CMD_KR_TUNE_IN msgrequest */
  9066. #define MC_CMD_KR_TUNE_IN_LENMIN 4
  9067. #define MC_CMD_KR_TUNE_IN_LENMAX 252
  9068. #define MC_CMD_KR_TUNE_IN_LEN(num) (4+4*(num))
  9069. /* Requested operation */
  9070. #define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_OFST 0
  9071. #define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_LEN 1
  9072. /* enum: Get current RXEQ settings */
  9073. #define MC_CMD_KR_TUNE_IN_RXEQ_GET 0x0
  9074. /* enum: Override RXEQ settings */
  9075. #define MC_CMD_KR_TUNE_IN_RXEQ_SET 0x1
  9076. /* enum: Get current TX Driver settings */
  9077. #define MC_CMD_KR_TUNE_IN_TXEQ_GET 0x2
  9078. /* enum: Override TX Driver settings */
  9079. #define MC_CMD_KR_TUNE_IN_TXEQ_SET 0x3
  9080. /* enum: Force KR Serdes reset / recalibration */
  9081. #define MC_CMD_KR_TUNE_IN_RECAL 0x4
  9082. /* enum: Start KR Serdes Eye diagram plot on a given lane. Lane must have valid
  9083. * signal.
  9084. */
  9085. #define MC_CMD_KR_TUNE_IN_START_EYE_PLOT 0x5
  9086. /* enum: Poll KR Serdes Eye diagram plot. Returns one row of BER data. The
  9087. * caller should call this command repeatedly after starting eye plot, until no
  9088. * more data is returned.
  9089. */
  9090. #define MC_CMD_KR_TUNE_IN_POLL_EYE_PLOT 0x6
  9091. /* enum: Read Figure Of Merit (eye quality, higher is better). */
  9092. #define MC_CMD_KR_TUNE_IN_READ_FOM 0x7
  9093. /* Align the arguments to 32 bits */
  9094. #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_OFST 1
  9095. #define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_LEN 3
  9096. /* Arguments specific to the operation */
  9097. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_OFST 4
  9098. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_LEN 4
  9099. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MINNUM 0
  9100. #define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MAXNUM 62
  9101. /* MC_CMD_KR_TUNE_OUT msgresponse */
  9102. #define MC_CMD_KR_TUNE_OUT_LEN 0
  9103. /* MC_CMD_KR_TUNE_RXEQ_GET_IN msgrequest */
  9104. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_LEN 4
  9105. /* Requested operation */
  9106. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_OFST 0
  9107. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_LEN 1
  9108. /* Align the arguments to 32 bits */
  9109. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
  9110. #define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
  9111. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT msgresponse */
  9112. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMIN 4
  9113. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMAX 252
  9114. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
  9115. /* RXEQ Parameter */
  9116. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
  9117. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
  9118. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
  9119. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
  9120. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
  9121. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
  9122. /* enum: Attenuation (0-15, Huntington) */
  9123. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_ATT 0x0
  9124. /* enum: CTLE Boost (0-15, Huntington) */
  9125. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_BOOST 0x1
  9126. /* enum: Edge DFE Tap1 (Huntington - 0 - max negative, 64 - zero, 127 - max
  9127. * positive, Medford - 0-31)
  9128. */
  9129. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP1 0x2
  9130. /* enum: Edge DFE Tap2 (Huntington - 0 - max negative, 32 - zero, 63 - max
  9131. * positive, Medford - 0-31)
  9132. */
  9133. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP2 0x3
  9134. /* enum: Edge DFE Tap3 (Huntington - 0 - max negative, 32 - zero, 63 - max
  9135. * positive, Medford - 0-16)
  9136. */
  9137. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP3 0x4
  9138. /* enum: Edge DFE Tap4 (Huntington - 0 - max negative, 32 - zero, 63 - max
  9139. * positive, Medford - 0-16)
  9140. */
  9141. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP4 0x5
  9142. /* enum: Edge DFE Tap5 (Huntington - 0 - max negative, 32 - zero, 63 - max
  9143. * positive, Medford - 0-16)
  9144. */
  9145. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP5 0x6
  9146. /* enum: Edge DFE DLEV (0-128 for Medford) */
  9147. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_DLEV 0x7
  9148. /* enum: Variable Gain Amplifier (0-15, Medford) */
  9149. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_VGA 0x8
  9150. /* enum: CTLE EQ Capacitor (0-15, Medford) */
  9151. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_EQC 0x9
  9152. /* enum: CTLE EQ Resistor (0-7, Medford) */
  9153. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_CTLE_EQRES 0xa
  9154. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
  9155. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 3
  9156. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
  9157. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
  9158. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
  9159. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
  9160. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
  9161. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 11
  9162. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1
  9163. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12
  9164. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 4
  9165. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_LBN 16
  9166. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
  9167. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  9168. #define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  9169. /* MC_CMD_KR_TUNE_RXEQ_SET_IN msgrequest */
  9170. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMIN 8
  9171. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMAX 252
  9172. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num))
  9173. /* Requested operation */
  9174. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_OFST 0
  9175. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_LEN 1
  9176. /* Align the arguments to 32 bits */
  9177. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
  9178. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
  9179. /* RXEQ Parameter */
  9180. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_OFST 4
  9181. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LEN 4
  9182. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1
  9183. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62
  9184. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0
  9185. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8
  9186. /* Enum values, see field(s): */
  9187. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_ID */
  9188. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8
  9189. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 3
  9190. /* Enum values, see field(s): */
  9191. /* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  9192. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 11
  9193. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1
  9194. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_LBN 12
  9195. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 4
  9196. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16
  9197. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  9198. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24
  9199. #define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8
  9200. /* MC_CMD_KR_TUNE_RXEQ_SET_OUT msgresponse */
  9201. #define MC_CMD_KR_TUNE_RXEQ_SET_OUT_LEN 0
  9202. /* MC_CMD_KR_TUNE_TXEQ_GET_IN msgrequest */
  9203. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_LEN 4
  9204. /* Requested operation */
  9205. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_OFST 0
  9206. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_LEN 1
  9207. /* Align the arguments to 32 bits */
  9208. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
  9209. #define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
  9210. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT msgresponse */
  9211. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMIN 4
  9212. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMAX 252
  9213. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
  9214. /* TXEQ Parameter */
  9215. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
  9216. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
  9217. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
  9218. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
  9219. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
  9220. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
  9221. /* enum: TX Amplitude (Huntington, Medford) */
  9222. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV 0x0
  9223. /* enum: De-Emphasis Tap1 Magnitude (0-7) (Huntington) */
  9224. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_MODE 0x1
  9225. /* enum: De-Emphasis Tap1 Fine */
  9226. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_DTLEV 0x2
  9227. /* enum: De-Emphasis Tap2 Magnitude (0-6) (Huntington) */
  9228. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2 0x3
  9229. /* enum: De-Emphasis Tap2 Fine (Huntington) */
  9230. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2TLEV 0x4
  9231. /* enum: Pre-Emphasis Magnitude (Huntington) */
  9232. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_E 0x5
  9233. /* enum: Pre-Emphasis Fine (Huntington) */
  9234. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_ETLEV 0x6
  9235. /* enum: TX Slew Rate Coarse control (Huntington) */
  9236. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_PREDRV_DLY 0x7
  9237. /* enum: TX Slew Rate Fine control (Huntington) */
  9238. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_SR_SET 0x8
  9239. /* enum: TX Termination Impedance control (Huntington) */
  9240. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_RT_SET 0x9
  9241. /* enum: TX Amplitude Fine control (Medford) */
  9242. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV_FINE 0xa
  9243. /* enum: Pre-shoot Tap (Medford) */
  9244. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TAP_ADV 0xb
  9245. /* enum: De-emphasis Tap (Medford) */
  9246. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TAP_DLY 0xc
  9247. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
  9248. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 3
  9249. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_0 0x0 /* enum */
  9250. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_1 0x1 /* enum */
  9251. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_2 0x2 /* enum */
  9252. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_3 0x3 /* enum */
  9253. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
  9254. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_LBN 11
  9255. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 5
  9256. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_LBN 16
  9257. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
  9258. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_LBN 24
  9259. #define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_WIDTH 8
  9260. /* MC_CMD_KR_TUNE_TXEQ_SET_IN msgrequest */
  9261. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMIN 8
  9262. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMAX 252
  9263. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_LEN(num) (4+4*(num))
  9264. /* Requested operation */
  9265. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_OFST 0
  9266. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_LEN 1
  9267. /* Align the arguments to 32 bits */
  9268. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
  9269. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
  9270. /* TXEQ Parameter */
  9271. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_OFST 4
  9272. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LEN 4
  9273. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MINNUM 1
  9274. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MAXNUM 62
  9275. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_LBN 0
  9276. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_WIDTH 8
  9277. /* Enum values, see field(s): */
  9278. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_ID */
  9279. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_LBN 8
  9280. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_WIDTH 3
  9281. /* Enum values, see field(s): */
  9282. /* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_LANE */
  9283. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_LBN 11
  9284. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_WIDTH 5
  9285. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_LBN 16
  9286. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  9287. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_LBN 24
  9288. #define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_WIDTH 8
  9289. /* MC_CMD_KR_TUNE_TXEQ_SET_OUT msgresponse */
  9290. #define MC_CMD_KR_TUNE_TXEQ_SET_OUT_LEN 0
  9291. /* MC_CMD_KR_TUNE_RECAL_IN msgrequest */
  9292. #define MC_CMD_KR_TUNE_RECAL_IN_LEN 4
  9293. /* Requested operation */
  9294. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_OFST 0
  9295. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_LEN 1
  9296. /* Align the arguments to 32 bits */
  9297. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_OFST 1
  9298. #define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_LEN 3
  9299. /* MC_CMD_KR_TUNE_RECAL_OUT msgresponse */
  9300. #define MC_CMD_KR_TUNE_RECAL_OUT_LEN 0
  9301. /* MC_CMD_KR_TUNE_START_EYE_PLOT_IN msgrequest */
  9302. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LEN 8
  9303. /* Requested operation */
  9304. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
  9305. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
  9306. /* Align the arguments to 32 bits */
  9307. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
  9308. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
  9309. #define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
  9310. /* MC_CMD_KR_TUNE_START_EYE_PLOT_OUT msgresponse */
  9311. #define MC_CMD_KR_TUNE_START_EYE_PLOT_OUT_LEN 0
  9312. /* MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN msgrequest */
  9313. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_LEN 4
  9314. /* Requested operation */
  9315. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
  9316. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
  9317. /* Align the arguments to 32 bits */
  9318. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
  9319. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
  9320. /* MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT msgresponse */
  9321. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
  9322. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
  9323. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
  9324. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
  9325. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
  9326. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
  9327. #define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
  9328. /* MC_CMD_KR_TUNE_READ_FOM_IN msgrequest */
  9329. #define MC_CMD_KR_TUNE_READ_FOM_IN_LEN 8
  9330. /* Requested operation */
  9331. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_OP_OFST 0
  9332. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_OP_LEN 1
  9333. /* Align the arguments to 32 bits */
  9334. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_OFST 1
  9335. #define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_LEN 3
  9336. #define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_OFST 4
  9337. /* MC_CMD_KR_TUNE_READ_FOM_OUT msgresponse */
  9338. #define MC_CMD_KR_TUNE_READ_FOM_OUT_LEN 4
  9339. #define MC_CMD_KR_TUNE_READ_FOM_OUT_FOM_OFST 0
  9340. /***********************************/
  9341. /* MC_CMD_PCIE_TUNE
  9342. * Get or set PCIE Serdes RXEQ and TX Driver settings
  9343. */
  9344. #define MC_CMD_PCIE_TUNE 0xf2
  9345. #define MC_CMD_0xf2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  9346. /* MC_CMD_PCIE_TUNE_IN msgrequest */
  9347. #define MC_CMD_PCIE_TUNE_IN_LENMIN 4
  9348. #define MC_CMD_PCIE_TUNE_IN_LENMAX 252
  9349. #define MC_CMD_PCIE_TUNE_IN_LEN(num) (4+4*(num))
  9350. /* Requested operation */
  9351. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_OFST 0
  9352. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_LEN 1
  9353. /* enum: Get current RXEQ settings */
  9354. #define MC_CMD_PCIE_TUNE_IN_RXEQ_GET 0x0
  9355. /* enum: Override RXEQ settings */
  9356. #define MC_CMD_PCIE_TUNE_IN_RXEQ_SET 0x1
  9357. /* enum: Get current TX Driver settings */
  9358. #define MC_CMD_PCIE_TUNE_IN_TXEQ_GET 0x2
  9359. /* enum: Override TX Driver settings */
  9360. #define MC_CMD_PCIE_TUNE_IN_TXEQ_SET 0x3
  9361. /* enum: Start PCIe Serdes Eye diagram plot on a given lane. */
  9362. #define MC_CMD_PCIE_TUNE_IN_START_EYE_PLOT 0x5
  9363. /* enum: Poll PCIe Serdes Eye diagram plot. Returns one row of BER data. The
  9364. * caller should call this command repeatedly after starting eye plot, until no
  9365. * more data is returned.
  9366. */
  9367. #define MC_CMD_PCIE_TUNE_IN_POLL_EYE_PLOT 0x6
  9368. /* enum: Enable the SERDES BIST and set it to generate a 200MHz square wave */
  9369. #define MC_CMD_PCIE_TUNE_IN_BIST_SQUARE_WAVE 0x7
  9370. /* Align the arguments to 32 bits */
  9371. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_OFST 1
  9372. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_LEN 3
  9373. /* Arguments specific to the operation */
  9374. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_OFST 4
  9375. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_LEN 4
  9376. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MINNUM 0
  9377. #define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MAXNUM 62
  9378. /* MC_CMD_PCIE_TUNE_OUT msgresponse */
  9379. #define MC_CMD_PCIE_TUNE_OUT_LEN 0
  9380. /* MC_CMD_PCIE_TUNE_RXEQ_GET_IN msgrequest */
  9381. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_LEN 4
  9382. /* Requested operation */
  9383. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
  9384. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
  9385. /* Align the arguments to 32 bits */
  9386. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
  9387. #define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
  9388. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT msgresponse */
  9389. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMIN 4
  9390. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMAX 252
  9391. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
  9392. /* RXEQ Parameter */
  9393. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
  9394. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
  9395. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
  9396. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
  9397. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
  9398. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
  9399. /* enum: Attenuation (0-15) */
  9400. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_ATT 0x0
  9401. /* enum: CTLE Boost (0-15) */
  9402. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_BOOST 0x1
  9403. /* enum: DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive) */
  9404. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP1 0x2
  9405. /* enum: DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive) */
  9406. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP2 0x3
  9407. /* enum: DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive) */
  9408. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP3 0x4
  9409. /* enum: DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive) */
  9410. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x5
  9411. /* enum: DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive) */
  9412. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x6
  9413. /* enum: DFE DLev */
  9414. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_DLEV 0x7
  9415. /* enum: Figure of Merit */
  9416. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_FOM 0x8
  9417. /* enum: CTLE EQ Capacitor (HF Gain) */
  9418. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_CTLE_EQC 0x9
  9419. /* enum: CTLE EQ Resistor (DC Gain) */
  9420. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_CTLE_EQRES 0xa
  9421. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
  9422. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 5
  9423. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
  9424. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
  9425. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
  9426. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
  9427. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_4 0x4 /* enum */
  9428. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_5 0x5 /* enum */
  9429. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_6 0x6 /* enum */
  9430. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_7 0x7 /* enum */
  9431. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_8 0x8 /* enum */
  9432. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_9 0x9 /* enum */
  9433. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_10 0xa /* enum */
  9434. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_11 0xb /* enum */
  9435. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_12 0xc /* enum */
  9436. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_13 0xd /* enum */
  9437. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_14 0xe /* enum */
  9438. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_15 0xf /* enum */
  9439. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_ALL 0x10 /* enum */
  9440. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 13
  9441. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1
  9442. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_LBN 14
  9443. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 10
  9444. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  9445. #define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  9446. /* MC_CMD_PCIE_TUNE_RXEQ_SET_IN msgrequest */
  9447. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LENMIN 8
  9448. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LENMAX 252
  9449. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num))
  9450. /* Requested operation */
  9451. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_OP_OFST 0
  9452. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_OP_LEN 1
  9453. /* Align the arguments to 32 bits */
  9454. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_RSVD_OFST 1
  9455. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PCIE_TUNE_RSVD_LEN 3
  9456. /* RXEQ Parameter */
  9457. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_OFST 4
  9458. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LEN 4
  9459. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1
  9460. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62
  9461. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0
  9462. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8
  9463. /* Enum values, see field(s): */
  9464. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_ID */
  9465. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8
  9466. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 5
  9467. /* Enum values, see field(s): */
  9468. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  9469. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 13
  9470. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1
  9471. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED_LBN 14
  9472. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 2
  9473. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16
  9474. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
  9475. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24
  9476. #define MC_CMD_PCIE_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8
  9477. /* MC_CMD_PCIE_TUNE_RXEQ_SET_OUT msgresponse */
  9478. #define MC_CMD_PCIE_TUNE_RXEQ_SET_OUT_LEN 0
  9479. /* MC_CMD_PCIE_TUNE_TXEQ_GET_IN msgrequest */
  9480. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_LEN 4
  9481. /* Requested operation */
  9482. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
  9483. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
  9484. /* Align the arguments to 32 bits */
  9485. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
  9486. #define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
  9487. /* MC_CMD_PCIE_TUNE_TXEQ_GET_OUT msgresponse */
  9488. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMIN 4
  9489. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMAX 252
  9490. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
  9491. /* RXEQ Parameter */
  9492. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
  9493. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
  9494. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
  9495. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
  9496. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
  9497. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
  9498. /* enum: TxMargin (PIPE) */
  9499. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXMARGIN 0x0
  9500. /* enum: TxSwing (PIPE) */
  9501. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXSWING 0x1
  9502. /* enum: De-emphasis coefficient C(-1) (PIPE) */
  9503. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CM1 0x2
  9504. /* enum: De-emphasis coefficient C(0) (PIPE) */
  9505. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_C0 0x3
  9506. /* enum: De-emphasis coefficient C(+1) (PIPE) */
  9507. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CP1 0x4
  9508. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
  9509. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 4
  9510. /* Enum values, see field(s): */
  9511. /* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */
  9512. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_LBN 12
  9513. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 12
  9514. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_LBN 24
  9515. #define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
  9516. /* MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN msgrequest */
  9517. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LEN 8
  9518. /* Requested operation */
  9519. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
  9520. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
  9521. /* Align the arguments to 32 bits */
  9522. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
  9523. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
  9524. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
  9525. /* MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT msgresponse */
  9526. #define MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT_LEN 0
  9527. /* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN msgrequest */
  9528. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_LEN 4
  9529. /* Requested operation */
  9530. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
  9531. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
  9532. /* Align the arguments to 32 bits */
  9533. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
  9534. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
  9535. /* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT msgresponse */
  9536. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
  9537. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
  9538. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
  9539. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
  9540. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
  9541. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
  9542. #define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
  9543. /* MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_IN msgrequest */
  9544. #define MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_IN_LEN 0
  9545. /* MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_OUT msgrequest */
  9546. #define MC_CMD_PCIE_TUNE_BIST_SQUARE_WAVE_OUT_LEN 0
  9547. /***********************************/
  9548. /* MC_CMD_LICENSING
  9549. * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition
  9550. * - not used for V3 licensing
  9551. */
  9552. #define MC_CMD_LICENSING 0xf3
  9553. #define MC_CMD_0xf3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9554. /* MC_CMD_LICENSING_IN msgrequest */
  9555. #define MC_CMD_LICENSING_IN_LEN 4
  9556. /* identifies the type of operation requested */
  9557. #define MC_CMD_LICENSING_IN_OP_OFST 0
  9558. /* enum: re-read and apply licenses after a license key partition update; note
  9559. * that this operation returns a zero-length response
  9560. */
  9561. #define MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE 0x0
  9562. /* enum: report counts of installed licenses */
  9563. #define MC_CMD_LICENSING_IN_OP_GET_KEY_STATS 0x1
  9564. /* MC_CMD_LICENSING_OUT msgresponse */
  9565. #define MC_CMD_LICENSING_OUT_LEN 28
  9566. /* count of application keys which are valid */
  9567. #define MC_CMD_LICENSING_OUT_VALID_APP_KEYS_OFST 0
  9568. /* sum of UNVERIFIABLE_APP_KEYS + WRONG_NODE_APP_KEYS (for compatibility with
  9569. * MC_CMD_FC_OP_LICENSE)
  9570. */
  9571. #define MC_CMD_LICENSING_OUT_INVALID_APP_KEYS_OFST 4
  9572. /* count of application keys which are invalid due to being blacklisted */
  9573. #define MC_CMD_LICENSING_OUT_BLACKLISTED_APP_KEYS_OFST 8
  9574. /* count of application keys which are invalid due to being unverifiable */
  9575. #define MC_CMD_LICENSING_OUT_UNVERIFIABLE_APP_KEYS_OFST 12
  9576. /* count of application keys which are invalid due to being for the wrong node
  9577. */
  9578. #define MC_CMD_LICENSING_OUT_WRONG_NODE_APP_KEYS_OFST 16
  9579. /* licensing state (for diagnostics; the exact meaning of the bits in this
  9580. * field are private to the firmware)
  9581. */
  9582. #define MC_CMD_LICENSING_OUT_LICENSING_STATE_OFST 20
  9583. /* licensing subsystem self-test report (for manftest) */
  9584. #define MC_CMD_LICENSING_OUT_LICENSING_SELF_TEST_OFST 24
  9585. /* enum: licensing subsystem self-test failed */
  9586. #define MC_CMD_LICENSING_OUT_SELF_TEST_FAIL 0x0
  9587. /* enum: licensing subsystem self-test passed */
  9588. #define MC_CMD_LICENSING_OUT_SELF_TEST_PASS 0x1
  9589. /***********************************/
  9590. /* MC_CMD_LICENSING_V3
  9591. * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition
  9592. * - V3 licensing (Medford)
  9593. */
  9594. #define MC_CMD_LICENSING_V3 0xd0
  9595. #define MC_CMD_0xd0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9596. /* MC_CMD_LICENSING_V3_IN msgrequest */
  9597. #define MC_CMD_LICENSING_V3_IN_LEN 4
  9598. /* identifies the type of operation requested */
  9599. #define MC_CMD_LICENSING_V3_IN_OP_OFST 0
  9600. /* enum: re-read and apply licenses after a license key partition update; note
  9601. * that this operation returns a zero-length response
  9602. */
  9603. #define MC_CMD_LICENSING_V3_IN_OP_UPDATE_LICENSE 0x0
  9604. /* enum: report counts of installed licenses Returns EAGAIN if license
  9605. * processing (updating) has been started but not yet completed.
  9606. */
  9607. #define MC_CMD_LICENSING_V3_IN_OP_REPORT_LICENSE 0x1
  9608. /* MC_CMD_LICENSING_V3_OUT msgresponse */
  9609. #define MC_CMD_LICENSING_V3_OUT_LEN 88
  9610. /* count of keys which are valid */
  9611. #define MC_CMD_LICENSING_V3_OUT_VALID_KEYS_OFST 0
  9612. /* sum of UNVERIFIABLE_KEYS + WRONG_NODE_KEYS (for compatibility with
  9613. * MC_CMD_FC_OP_LICENSE)
  9614. */
  9615. #define MC_CMD_LICENSING_V3_OUT_INVALID_KEYS_OFST 4
  9616. /* count of keys which are invalid due to being unverifiable */
  9617. #define MC_CMD_LICENSING_V3_OUT_UNVERIFIABLE_KEYS_OFST 8
  9618. /* count of keys which are invalid due to being for the wrong node */
  9619. #define MC_CMD_LICENSING_V3_OUT_WRONG_NODE_KEYS_OFST 12
  9620. /* licensing state (for diagnostics; the exact meaning of the bits in this
  9621. * field are private to the firmware)
  9622. */
  9623. #define MC_CMD_LICENSING_V3_OUT_LICENSING_STATE_OFST 16
  9624. /* licensing subsystem self-test report (for manftest) */
  9625. #define MC_CMD_LICENSING_V3_OUT_LICENSING_SELF_TEST_OFST 20
  9626. /* enum: licensing subsystem self-test failed */
  9627. #define MC_CMD_LICENSING_V3_OUT_SELF_TEST_FAIL 0x0
  9628. /* enum: licensing subsystem self-test passed */
  9629. #define MC_CMD_LICENSING_V3_OUT_SELF_TEST_PASS 0x1
  9630. /* bitmask of licensed applications */
  9631. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_OFST 24
  9632. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_LEN 8
  9633. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_LO_OFST 24
  9634. #define MC_CMD_LICENSING_V3_OUT_LICENSED_APPS_HI_OFST 28
  9635. /* reserved for future use */
  9636. #define MC_CMD_LICENSING_V3_OUT_RESERVED_0_OFST 32
  9637. #define MC_CMD_LICENSING_V3_OUT_RESERVED_0_LEN 24
  9638. /* bitmask of licensed features */
  9639. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_OFST 56
  9640. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_LEN 8
  9641. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_LO_OFST 56
  9642. #define MC_CMD_LICENSING_V3_OUT_LICENSED_FEATURES_HI_OFST 60
  9643. /* reserved for future use */
  9644. #define MC_CMD_LICENSING_V3_OUT_RESERVED_1_OFST 64
  9645. #define MC_CMD_LICENSING_V3_OUT_RESERVED_1_LEN 24
  9646. /***********************************/
  9647. /* MC_CMD_LICENSING_GET_ID_V3
  9648. * Get ID and type from the NVRAM_PARTITION_TYPE_LICENSE application license
  9649. * partition - V3 licensing (Medford)
  9650. */
  9651. #define MC_CMD_LICENSING_GET_ID_V3 0xd1
  9652. #define MC_CMD_0xd1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9653. /* MC_CMD_LICENSING_GET_ID_V3_IN msgrequest */
  9654. #define MC_CMD_LICENSING_GET_ID_V3_IN_LEN 0
  9655. /* MC_CMD_LICENSING_GET_ID_V3_OUT msgresponse */
  9656. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN 8
  9657. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX 252
  9658. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LEN(num) (8+1*(num))
  9659. /* type of license (eg 3) */
  9660. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_TYPE_OFST 0
  9661. /* length of the license ID (in bytes) */
  9662. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH_OFST 4
  9663. /* the unique license ID of the adapter */
  9664. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST 8
  9665. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_LEN 1
  9666. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_MINNUM 0
  9667. #define MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_MAXNUM 244
  9668. /***********************************/
  9669. /* MC_CMD_MC2MC_PROXY
  9670. * Execute an arbitrary MCDI command on the slave MC of a dual-core device.
  9671. * This will fail on a single-core system.
  9672. */
  9673. #define MC_CMD_MC2MC_PROXY 0xf4
  9674. #define MC_CMD_0xf4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9675. /* MC_CMD_MC2MC_PROXY_IN msgrequest */
  9676. #define MC_CMD_MC2MC_PROXY_IN_LEN 0
  9677. /* MC_CMD_MC2MC_PROXY_OUT msgresponse */
  9678. #define MC_CMD_MC2MC_PROXY_OUT_LEN 0
  9679. /***********************************/
  9680. /* MC_CMD_GET_LICENSED_APP_STATE
  9681. * Query the state of an individual licensed application. (Note that the actual
  9682. * state may be invalidated by the MC_CMD_LICENSING OP_UPDATE_LICENSE operation
  9683. * or a reboot of the MC.) Not used for V3 licensing
  9684. */
  9685. #define MC_CMD_GET_LICENSED_APP_STATE 0xf5
  9686. #define MC_CMD_0xf5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9687. /* MC_CMD_GET_LICENSED_APP_STATE_IN msgrequest */
  9688. #define MC_CMD_GET_LICENSED_APP_STATE_IN_LEN 4
  9689. /* application ID to query (LICENSED_APP_ID_xxx) */
  9690. #define MC_CMD_GET_LICENSED_APP_STATE_IN_APP_ID_OFST 0
  9691. /* MC_CMD_GET_LICENSED_APP_STATE_OUT msgresponse */
  9692. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN 4
  9693. /* state of this application */
  9694. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_STATE_OFST 0
  9695. /* enum: no (or invalid) license is present for the application */
  9696. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED 0x0
  9697. /* enum: a valid license is present for the application */
  9698. #define MC_CMD_GET_LICENSED_APP_STATE_OUT_LICENSED 0x1
  9699. /***********************************/
  9700. /* MC_CMD_GET_LICENSED_V3_APP_STATE
  9701. * Query the state of an individual licensed application. (Note that the actual
  9702. * state may be invalidated by the MC_CMD_LICENSING_V3 OP_UPDATE_LICENSE
  9703. * operation or a reboot of the MC.) Used for V3 licensing (Medford)
  9704. */
  9705. #define MC_CMD_GET_LICENSED_V3_APP_STATE 0xd2
  9706. #define MC_CMD_0xd2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9707. /* MC_CMD_GET_LICENSED_V3_APP_STATE_IN msgrequest */
  9708. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN 8
  9709. /* application ID to query (LICENSED_V3_APPS_xxx) expressed as a single bit
  9710. * mask
  9711. */
  9712. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_OFST 0
  9713. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_LEN 8
  9714. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_LO_OFST 0
  9715. #define MC_CMD_GET_LICENSED_V3_APP_STATE_IN_APP_ID_HI_OFST 4
  9716. /* MC_CMD_GET_LICENSED_V3_APP_STATE_OUT msgresponse */
  9717. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN 4
  9718. /* state of this application */
  9719. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_STATE_OFST 0
  9720. /* enum: no (or invalid) license is present for the application */
  9721. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_NOT_LICENSED 0x0
  9722. /* enum: a valid license is present for the application */
  9723. #define MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LICENSED 0x1
  9724. /***********************************/
  9725. /* MC_CMD_GET_LICENSED_V3_FEATURE_STATES
  9726. * Query the state of an one or more licensed features. (Note that the actual
  9727. * state may be invalidated by the MC_CMD_LICENSING_V3 OP_UPDATE_LICENSE
  9728. * operation or a reboot of the MC.) Used for V3 licensing (Medford)
  9729. */
  9730. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES 0xd3
  9731. #define MC_CMD_0xd3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9732. /* MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN msgrequest */
  9733. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_LEN 8
  9734. /* features to query (LICENSED_V3_FEATURES_xxx) expressed as a mask with one or
  9735. * more bits set
  9736. */
  9737. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_OFST 0
  9738. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_LEN 8
  9739. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_LO_OFST 0
  9740. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_IN_FEATURES_HI_OFST 4
  9741. /* MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT msgresponse */
  9742. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_LEN 8
  9743. /* states of these features - bit set for licensed, clear for not licensed */
  9744. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_OFST 0
  9745. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_LEN 8
  9746. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_LO_OFST 0
  9747. #define MC_CMD_GET_LICENSED_V3_FEATURE_STATES_OUT_STATES_HI_OFST 4
  9748. /***********************************/
  9749. /* MC_CMD_LICENSED_APP_OP
  9750. * Perform an action for an individual licensed application - not used for V3
  9751. * licensing.
  9752. */
  9753. #define MC_CMD_LICENSED_APP_OP 0xf6
  9754. #define MC_CMD_0xf6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9755. /* MC_CMD_LICENSED_APP_OP_IN msgrequest */
  9756. #define MC_CMD_LICENSED_APP_OP_IN_LENMIN 8
  9757. #define MC_CMD_LICENSED_APP_OP_IN_LENMAX 252
  9758. #define MC_CMD_LICENSED_APP_OP_IN_LEN(num) (8+4*(num))
  9759. /* application ID */
  9760. #define MC_CMD_LICENSED_APP_OP_IN_APP_ID_OFST 0
  9761. /* the type of operation requested */
  9762. #define MC_CMD_LICENSED_APP_OP_IN_OP_OFST 4
  9763. /* enum: validate application */
  9764. #define MC_CMD_LICENSED_APP_OP_IN_OP_VALIDATE 0x0
  9765. /* enum: mask application */
  9766. #define MC_CMD_LICENSED_APP_OP_IN_OP_MASK 0x1
  9767. /* arguments specific to this particular operation */
  9768. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_OFST 8
  9769. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_LEN 4
  9770. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_MINNUM 0
  9771. #define MC_CMD_LICENSED_APP_OP_IN_ARGS_MAXNUM 61
  9772. /* MC_CMD_LICENSED_APP_OP_OUT msgresponse */
  9773. #define MC_CMD_LICENSED_APP_OP_OUT_LENMIN 0
  9774. #define MC_CMD_LICENSED_APP_OP_OUT_LENMAX 252
  9775. #define MC_CMD_LICENSED_APP_OP_OUT_LEN(num) (0+4*(num))
  9776. /* result specific to this particular operation */
  9777. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_OFST 0
  9778. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_LEN 4
  9779. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MINNUM 0
  9780. #define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MAXNUM 63
  9781. /* MC_CMD_LICENSED_APP_OP_VALIDATE_IN msgrequest */
  9782. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_LEN 72
  9783. /* application ID */
  9784. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_APP_ID_OFST 0
  9785. /* the type of operation requested */
  9786. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_OP_OFST 4
  9787. /* validation challenge */
  9788. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_OFST 8
  9789. #define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_LEN 64
  9790. /* MC_CMD_LICENSED_APP_OP_VALIDATE_OUT msgresponse */
  9791. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_LEN 68
  9792. /* feature expiry (time_t) */
  9793. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_EXPIRY_OFST 0
  9794. /* validation response */
  9795. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_OFST 4
  9796. #define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_LEN 64
  9797. /* MC_CMD_LICENSED_APP_OP_MASK_IN msgrequest */
  9798. #define MC_CMD_LICENSED_APP_OP_MASK_IN_LEN 12
  9799. /* application ID */
  9800. #define MC_CMD_LICENSED_APP_OP_MASK_IN_APP_ID_OFST 0
  9801. /* the type of operation requested */
  9802. #define MC_CMD_LICENSED_APP_OP_MASK_IN_OP_OFST 4
  9803. /* flag */
  9804. #define MC_CMD_LICENSED_APP_OP_MASK_IN_FLAG_OFST 8
  9805. /* MC_CMD_LICENSED_APP_OP_MASK_OUT msgresponse */
  9806. #define MC_CMD_LICENSED_APP_OP_MASK_OUT_LEN 0
  9807. /***********************************/
  9808. /* MC_CMD_LICENSED_V3_VALIDATE_APP
  9809. * Perform validation for an individual licensed application - V3 licensing
  9810. * (Medford)
  9811. */
  9812. #define MC_CMD_LICENSED_V3_VALIDATE_APP 0xd4
  9813. #define MC_CMD_0xd4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9814. /* MC_CMD_LICENSED_V3_VALIDATE_APP_IN msgrequest */
  9815. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 56
  9816. /* challenge for validation (384 bits) */
  9817. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 0
  9818. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 48
  9819. /* application ID expressed as a single bit mask */
  9820. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_OFST 48
  9821. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LEN 8
  9822. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 48
  9823. #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 52
  9824. /* MC_CMD_LICENSED_V3_VALIDATE_APP_OUT msgresponse */
  9825. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 116
  9826. /* validation response to challenge in the form of ECDSA signature consisting
  9827. * of two 384-bit integers, r and s, in big-endian order. The signature signs a
  9828. * SHA-384 digest of a message constructed from the concatenation of the input
  9829. * message and the remaining fields of this output message, e.g. challenge[48
  9830. * bytes] ... expiry_time[4 bytes] ...
  9831. */
  9832. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_OFST 0
  9833. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_LEN 96
  9834. /* application expiry time */
  9835. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_OFST 96
  9836. /* application expiry units */
  9837. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_OFST 100
  9838. /* enum: expiry units are accounting units */
  9839. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_ACC 0x0
  9840. /* enum: expiry units are calendar days */
  9841. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_DAYS 0x1
  9842. /* base MAC address of the NIC stored in NVRAM (note that this is a constant
  9843. * value for a given NIC regardless which function is calling, effectively this
  9844. * is PF0 base MAC address)
  9845. */
  9846. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_BASE_MACADDR_OFST 104
  9847. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_BASE_MACADDR_LEN 6
  9848. /* MAC address of v-adaptor associated with the client. If no such v-adapator
  9849. * exists, then the field is filled with 0xFF.
  9850. */
  9851. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_VADAPTOR_MACADDR_OFST 110
  9852. #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_VADAPTOR_MACADDR_LEN 6
  9853. /***********************************/
  9854. /* MC_CMD_LICENSED_V3_MASK_FEATURES
  9855. * Mask features - V3 licensing (Medford)
  9856. */
  9857. #define MC_CMD_LICENSED_V3_MASK_FEATURES 0xd5
  9858. #define MC_CMD_0xd5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9859. /* MC_CMD_LICENSED_V3_MASK_FEATURES_IN msgrequest */
  9860. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_LEN 12
  9861. /* mask to be applied to features to be changed */
  9862. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_OFST 0
  9863. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_LEN 8
  9864. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_LO_OFST 0
  9865. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_MASK_HI_OFST 4
  9866. /* whether to turn on or turn off the masked features */
  9867. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_FLAG_OFST 8
  9868. /* enum: turn the features off */
  9869. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_OFF 0x0
  9870. /* enum: turn the features back on */
  9871. #define MC_CMD_LICENSED_V3_MASK_FEATURES_IN_ON 0x1
  9872. /* MC_CMD_LICENSED_V3_MASK_FEATURES_OUT msgresponse */
  9873. #define MC_CMD_LICENSED_V3_MASK_FEATURES_OUT_LEN 0
  9874. /***********************************/
  9875. /* MC_CMD_LICENSING_V3_TEMPORARY
  9876. * Perform operations to support installation of a single temporary license in
  9877. * the adapter, in addition to those found in the licensing partition. See
  9878. * SF-116124-SW for an overview of how this could be used. The license is
  9879. * stored in MC persistent data and so will survive a MC reboot, but will be
  9880. * erased when the adapter is power cycled
  9881. */
  9882. #define MC_CMD_LICENSING_V3_TEMPORARY 0xd6
  9883. #define MC_CMD_0xd6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9884. /* MC_CMD_LICENSING_V3_TEMPORARY_IN msgrequest */
  9885. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_LEN 4
  9886. /* operation code */
  9887. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_OP_OFST 0
  9888. /* enum: install a new license, overwriting any existing temporary license.
  9889. * This is an asynchronous operation owing to the time taken to validate an
  9890. * ECDSA license
  9891. */
  9892. #define MC_CMD_LICENSING_V3_TEMPORARY_SET 0x0
  9893. /* enum: clear the license immediately rather than waiting for the next power
  9894. * cycle
  9895. */
  9896. #define MC_CMD_LICENSING_V3_TEMPORARY_CLEAR 0x1
  9897. /* enum: get the status of the asynchronous MC_CMD_LICENSING_V3_TEMPORARY_SET
  9898. * operation
  9899. */
  9900. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS 0x2
  9901. /* MC_CMD_LICENSING_V3_TEMPORARY_IN_SET msgrequest */
  9902. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LEN 164
  9903. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_OP_OFST 0
  9904. /* ECDSA license and signature */
  9905. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_OFST 4
  9906. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_LEN 160
  9907. /* MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR msgrequest */
  9908. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_LEN 4
  9909. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_OP_OFST 0
  9910. /* MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS msgrequest */
  9911. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_LEN 4
  9912. #define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_OP_OFST 0
  9913. /* MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS msgresponse */
  9914. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LEN 12
  9915. /* status code */
  9916. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_STATUS_OFST 0
  9917. /* enum: finished validating and installing license */
  9918. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_OK 0x0
  9919. /* enum: license validation and installation in progress */
  9920. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_IN_PROGRESS 0x1
  9921. /* enum: licensing error. More specific error messages are not provided to
  9922. * avoid exposing details of the licensing system to the client
  9923. */
  9924. #define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_ERROR 0x2
  9925. /* bitmask of licensed features */
  9926. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_OFST 4
  9927. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LEN 8
  9928. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LO_OFST 4
  9929. #define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_HI_OFST 8
  9930. /***********************************/
  9931. /* MC_CMD_SET_PORT_SNIFF_CONFIG
  9932. * Configure RX port sniffing for the physical port associated with the calling
  9933. * function. Only a privileged function may change the port sniffing
  9934. * configuration. A copy of all traffic delivered to the host (non-promiscuous
  9935. * mode) or all traffic arriving at the port (promiscuous mode) may be
  9936. * delivered to a specific queue, or a set of queues with RSS.
  9937. */
  9938. #define MC_CMD_SET_PORT_SNIFF_CONFIG 0xf7
  9939. #define MC_CMD_0xf7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  9940. /* MC_CMD_SET_PORT_SNIFF_CONFIG_IN msgrequest */
  9941. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_LEN 16
  9942. /* configuration flags */
  9943. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
  9944. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
  9945. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
  9946. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_LBN 1
  9947. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_WIDTH 1
  9948. /* receive queue handle (for RSS mode, this is the base queue) */
  9949. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
  9950. /* receive mode */
  9951. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
  9952. /* enum: receive to just the specified queue */
  9953. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
  9954. /* enum: receive to multiple queues using RSS context */
  9955. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
  9956. /* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
  9957. * that these handles should be considered opaque to the host, although a value
  9958. * of 0xFFFFFFFF is guaranteed never to be a valid handle.
  9959. */
  9960. #define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
  9961. /* MC_CMD_SET_PORT_SNIFF_CONFIG_OUT msgresponse */
  9962. #define MC_CMD_SET_PORT_SNIFF_CONFIG_OUT_LEN 0
  9963. /***********************************/
  9964. /* MC_CMD_GET_PORT_SNIFF_CONFIG
  9965. * Obtain the current RX port sniffing configuration for the physical port
  9966. * associated with the calling function. Only a privileged function may read
  9967. * the configuration.
  9968. */
  9969. #define MC_CMD_GET_PORT_SNIFF_CONFIG 0xf8
  9970. #define MC_CMD_0xf8_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  9971. /* MC_CMD_GET_PORT_SNIFF_CONFIG_IN msgrequest */
  9972. #define MC_CMD_GET_PORT_SNIFF_CONFIG_IN_LEN 0
  9973. /* MC_CMD_GET_PORT_SNIFF_CONFIG_OUT msgresponse */
  9974. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_LEN 16
  9975. /* configuration flags */
  9976. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
  9977. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
  9978. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
  9979. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_LBN 1
  9980. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_WIDTH 1
  9981. /* receiving queue handle (for RSS mode, this is the base queue) */
  9982. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
  9983. /* receive mode */
  9984. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
  9985. /* enum: receiving to just the specified queue */
  9986. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
  9987. /* enum: receiving to multiple queues using RSS context */
  9988. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
  9989. /* RSS context (for RX_MODE_RSS) */
  9990. #define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
  9991. /***********************************/
  9992. /* MC_CMD_SET_PARSER_DISP_CONFIG
  9993. * Change configuration related to the parser-dispatcher subsystem.
  9994. */
  9995. #define MC_CMD_SET_PARSER_DISP_CONFIG 0xf9
  9996. #define MC_CMD_0xf9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  9997. /* MC_CMD_SET_PARSER_DISP_CONFIG_IN msgrequest */
  9998. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LENMIN 12
  9999. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LENMAX 252
  10000. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LEN(num) (8+4*(num))
  10001. /* the type of configuration setting to change */
  10002. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TYPE_OFST 0
  10003. /* enum: Per-TXQ enable for multicast UDP destination lookup for possible
  10004. * internal loopback. (ENTITY is a queue handle, VALUE is a single boolean.)
  10005. */
  10006. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TXQ_MCAST_UDP_DST_LOOKUP_EN 0x0
  10007. /* enum: Per-v-adaptor enable for suppression of self-transmissions on the
  10008. * internal loopback path. (ENTITY is an EVB_PORT_ID, VALUE is a single
  10009. * boolean.)
  10010. */
  10011. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VADAPTOR_SUPPRESS_SELF_TX 0x1
  10012. /* handle for the entity to update: queue handle, EVB port ID, etc. depending
  10013. * on the type of configuration setting being changed
  10014. */
  10015. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_ENTITY_OFST 4
  10016. /* new value: the details depend on the type of configuration setting being
  10017. * changed
  10018. */
  10019. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_OFST 8
  10020. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_LEN 4
  10021. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_MINNUM 1
  10022. #define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_MAXNUM 61
  10023. /* MC_CMD_SET_PARSER_DISP_CONFIG_OUT msgresponse */
  10024. #define MC_CMD_SET_PARSER_DISP_CONFIG_OUT_LEN 0
  10025. /***********************************/
  10026. /* MC_CMD_GET_PARSER_DISP_CONFIG
  10027. * Read configuration related to the parser-dispatcher subsystem.
  10028. */
  10029. #define MC_CMD_GET_PARSER_DISP_CONFIG 0xfa
  10030. #define MC_CMD_0xfa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10031. /* MC_CMD_GET_PARSER_DISP_CONFIG_IN msgrequest */
  10032. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_LEN 8
  10033. /* the type of configuration setting to read */
  10034. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_TYPE_OFST 0
  10035. /* Enum values, see field(s): */
  10036. /* MC_CMD_SET_PARSER_DISP_CONFIG/MC_CMD_SET_PARSER_DISP_CONFIG_IN/TYPE */
  10037. /* handle for the entity to query: queue handle, EVB port ID, etc. depending on
  10038. * the type of configuration setting being read
  10039. */
  10040. #define MC_CMD_GET_PARSER_DISP_CONFIG_IN_ENTITY_OFST 4
  10041. /* MC_CMD_GET_PARSER_DISP_CONFIG_OUT msgresponse */
  10042. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LENMIN 4
  10043. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LENMAX 252
  10044. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LEN(num) (0+4*(num))
  10045. /* current value: the details depend on the type of configuration setting being
  10046. * read
  10047. */
  10048. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_OFST 0
  10049. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_LEN 4
  10050. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_MINNUM 1
  10051. #define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_MAXNUM 63
  10052. /***********************************/
  10053. /* MC_CMD_SET_TX_PORT_SNIFF_CONFIG
  10054. * Configure TX port sniffing for the physical port associated with the calling
  10055. * function. Only a privileged function may change the port sniffing
  10056. * configuration. A copy of all traffic transmitted through the port may be
  10057. * delivered to a specific queue, or a set of queues with RSS. Note that these
  10058. * packets are delivered with transmit timestamps in the packet prefix, not
  10059. * receive timestamps, so it is likely that the queue(s) will need to be
  10060. * dedicated as TX sniff receivers.
  10061. */
  10062. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG 0xfb
  10063. #define MC_CMD_0xfb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10064. /* MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN msgrequest */
  10065. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_LEN 16
  10066. /* configuration flags */
  10067. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
  10068. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
  10069. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
  10070. /* receive queue handle (for RSS mode, this is the base queue) */
  10071. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
  10072. /* receive mode */
  10073. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
  10074. /* enum: receive to just the specified queue */
  10075. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
  10076. /* enum: receive to multiple queues using RSS context */
  10077. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
  10078. /* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
  10079. * that these handles should be considered opaque to the host, although a value
  10080. * of 0xFFFFFFFF is guaranteed never to be a valid handle.
  10081. */
  10082. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
  10083. /* MC_CMD_SET_TX_PORT_SNIFF_CONFIG_OUT msgresponse */
  10084. #define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_OUT_LEN 0
  10085. /***********************************/
  10086. /* MC_CMD_GET_TX_PORT_SNIFF_CONFIG
  10087. * Obtain the current TX port sniffing configuration for the physical port
  10088. * associated with the calling function. Only a privileged function may read
  10089. * the configuration.
  10090. */
  10091. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG 0xfc
  10092. #define MC_CMD_0xfc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10093. /* MC_CMD_GET_TX_PORT_SNIFF_CONFIG_IN msgrequest */
  10094. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_IN_LEN 0
  10095. /* MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT msgresponse */
  10096. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_LEN 16
  10097. /* configuration flags */
  10098. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
  10099. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
  10100. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
  10101. /* receiving queue handle (for RSS mode, this is the base queue) */
  10102. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
  10103. /* receive mode */
  10104. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
  10105. /* enum: receiving to just the specified queue */
  10106. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
  10107. /* enum: receiving to multiple queues using RSS context */
  10108. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
  10109. /* RSS context (for RX_MODE_RSS) */
  10110. #define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
  10111. /***********************************/
  10112. /* MC_CMD_RMON_STATS_RX_ERRORS
  10113. * Per queue rx error stats.
  10114. */
  10115. #define MC_CMD_RMON_STATS_RX_ERRORS 0xfe
  10116. #define MC_CMD_0xfe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10117. /* MC_CMD_RMON_STATS_RX_ERRORS_IN msgrequest */
  10118. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_LEN 8
  10119. /* The rx queue to get stats for. */
  10120. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RX_QUEUE_OFST 0
  10121. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_FLAGS_OFST 4
  10122. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RST_LBN 0
  10123. #define MC_CMD_RMON_STATS_RX_ERRORS_IN_RST_WIDTH 1
  10124. /* MC_CMD_RMON_STATS_RX_ERRORS_OUT msgresponse */
  10125. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_LEN 16
  10126. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_CRC_ERRORS_OFST 0
  10127. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_TRUNC_ERRORS_OFST 4
  10128. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_NO_DESC_DROPS_OFST 8
  10129. #define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_ABORT_OFST 12
  10130. /***********************************/
  10131. /* MC_CMD_GET_PCIE_RESOURCE_INFO
  10132. * Find out about available PCIE resources
  10133. */
  10134. #define MC_CMD_GET_PCIE_RESOURCE_INFO 0xfd
  10135. /* MC_CMD_GET_PCIE_RESOURCE_INFO_IN msgrequest */
  10136. #define MC_CMD_GET_PCIE_RESOURCE_INFO_IN_LEN 0
  10137. /* MC_CMD_GET_PCIE_RESOURCE_INFO_OUT msgresponse */
  10138. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_LEN 28
  10139. /* The maximum number of PFs the device can expose */
  10140. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PFS_OFST 0
  10141. /* The maximum number of VFs the device can expose in total */
  10142. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VFS_OFST 4
  10143. /* The maximum number of MSI-X vectors the device can provide in total */
  10144. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VECTORS_OFST 8
  10145. /* the number of MSI-X vectors the device will allocate by default to each PF
  10146. */
  10147. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_PF_VECTORS_OFST 12
  10148. /* the number of MSI-X vectors the device will allocate by default to each VF
  10149. */
  10150. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_VF_VECTORS_OFST 16
  10151. /* the maximum number of MSI-X vectors the device can allocate to any one PF */
  10152. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PF_VECTORS_OFST 20
  10153. /* the maximum number of MSI-X vectors the device can allocate to any one VF */
  10154. #define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VF_VECTORS_OFST 24
  10155. /***********************************/
  10156. /* MC_CMD_GET_PORT_MODES
  10157. * Find out about available port modes
  10158. */
  10159. #define MC_CMD_GET_PORT_MODES 0xff
  10160. #define MC_CMD_0xff_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10161. /* MC_CMD_GET_PORT_MODES_IN msgrequest */
  10162. #define MC_CMD_GET_PORT_MODES_IN_LEN 0
  10163. /* MC_CMD_GET_PORT_MODES_OUT msgresponse */
  10164. #define MC_CMD_GET_PORT_MODES_OUT_LEN 12
  10165. /* Bitmask of port modes available on the board (indexed by TLV_PORT_MODE_*) */
  10166. #define MC_CMD_GET_PORT_MODES_OUT_MODES_OFST 0
  10167. /* Default (canonical) board mode */
  10168. #define MC_CMD_GET_PORT_MODES_OUT_DEFAULT_MODE_OFST 4
  10169. /* Current board mode */
  10170. #define MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST 8
  10171. /***********************************/
  10172. /* MC_CMD_READ_ATB
  10173. * Sample voltages on the ATB
  10174. */
  10175. #define MC_CMD_READ_ATB 0x100
  10176. #define MC_CMD_0x100_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10177. /* MC_CMD_READ_ATB_IN msgrequest */
  10178. #define MC_CMD_READ_ATB_IN_LEN 16
  10179. #define MC_CMD_READ_ATB_IN_SIGNAL_BUS_OFST 0
  10180. #define MC_CMD_READ_ATB_IN_BUS_CCOM 0x0 /* enum */
  10181. #define MC_CMD_READ_ATB_IN_BUS_CKR 0x1 /* enum */
  10182. #define MC_CMD_READ_ATB_IN_BUS_CPCIE 0x8 /* enum */
  10183. #define MC_CMD_READ_ATB_IN_SIGNAL_EN_BITNO_OFST 4
  10184. #define MC_CMD_READ_ATB_IN_SIGNAL_SEL_OFST 8
  10185. #define MC_CMD_READ_ATB_IN_SETTLING_TIME_US_OFST 12
  10186. /* MC_CMD_READ_ATB_OUT msgresponse */
  10187. #define MC_CMD_READ_ATB_OUT_LEN 4
  10188. #define MC_CMD_READ_ATB_OUT_SAMPLE_MV_OFST 0
  10189. /***********************************/
  10190. /* MC_CMD_GET_WORKAROUNDS
  10191. * Read the list of all implemented and all currently enabled workarounds. The
  10192. * enums here must correspond with those in MC_CMD_WORKAROUND.
  10193. */
  10194. #define MC_CMD_GET_WORKAROUNDS 0x59
  10195. #define MC_CMD_0x59_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10196. /* MC_CMD_GET_WORKAROUNDS_OUT msgresponse */
  10197. #define MC_CMD_GET_WORKAROUNDS_OUT_LEN 8
  10198. /* Each workaround is represented by a single bit according to the enums below.
  10199. */
  10200. #define MC_CMD_GET_WORKAROUNDS_OUT_IMPLEMENTED_OFST 0
  10201. #define MC_CMD_GET_WORKAROUNDS_OUT_ENABLED_OFST 4
  10202. /* enum: Bug 17230 work around. */
  10203. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG17230 0x2
  10204. /* enum: Bug 35388 work around (unsafe EVQ writes). */
  10205. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG35388 0x4
  10206. /* enum: Bug35017 workaround (A64 tables must be identity map) */
  10207. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG35017 0x8
  10208. /* enum: Bug 41750 present (MC_CMD_TRIGGER_INTERRUPT won't work) */
  10209. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG41750 0x10
  10210. /* enum: Bug 42008 present (Interrupts can overtake associated events). Caution
  10211. * - before adding code that queries this workaround, remember that there's
  10212. * released Monza firmware that doesn't understand MC_CMD_WORKAROUND_BUG42008,
  10213. * and will hence (incorrectly) report that the bug doesn't exist.
  10214. */
  10215. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG42008 0x20
  10216. /* enum: Bug 26807 features present in firmware (multicast filter chaining) */
  10217. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 0x40
  10218. /* enum: Bug 61265 work around (broken EVQ TMR writes). */
  10219. #define MC_CMD_GET_WORKAROUNDS_OUT_BUG61265 0x80
  10220. /***********************************/
  10221. /* MC_CMD_PRIVILEGE_MASK
  10222. * Read/set privileges of an arbitrary PCIe function
  10223. */
  10224. #define MC_CMD_PRIVILEGE_MASK 0x5a
  10225. #define MC_CMD_0x5a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10226. /* MC_CMD_PRIVILEGE_MASK_IN msgrequest */
  10227. #define MC_CMD_PRIVILEGE_MASK_IN_LEN 8
  10228. /* The target function to have its mask read or set e.g. PF 0 = 0xFFFF0000, VF
  10229. * 1,3 = 0x00030001
  10230. */
  10231. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_OFST 0
  10232. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_PF_LBN 0
  10233. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_PF_WIDTH 16
  10234. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_VF_LBN 16
  10235. #define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_VF_WIDTH 16
  10236. #define MC_CMD_PRIVILEGE_MASK_IN_VF_NULL 0xffff /* enum */
  10237. /* New privilege mask to be set. The mask will only be changed if the MSB is
  10238. * set to 1.
  10239. */
  10240. #define MC_CMD_PRIVILEGE_MASK_IN_NEW_MASK_OFST 4
  10241. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN 0x1 /* enum */
  10242. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK 0x2 /* enum */
  10243. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD 0x4 /* enum */
  10244. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP 0x8 /* enum */
  10245. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS 0x10 /* enum */
  10246. /* enum: Deprecated. Equivalent to MAC_SPOOFING_TX combined with CHANGE_MAC. */
  10247. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING 0x20
  10248. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST 0x40 /* enum */
  10249. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST 0x80 /* enum */
  10250. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST 0x100 /* enum */
  10251. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST 0x200 /* enum */
  10252. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS 0x400 /* enum */
  10253. /* enum: Allows to set the TX packets' source MAC address to any arbitrary MAC
  10254. * adress.
  10255. */
  10256. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX 0x800
  10257. /* enum: Privilege that allows a Function to change the MAC address configured
  10258. * in its associated vAdapter/vPort.
  10259. */
  10260. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC 0x1000
  10261. /* enum: Privilege that allows a Function to install filters that specify VLANs
  10262. * that are not in the permit list for the associated vPort. This privilege is
  10263. * primarily to support ESX where vPorts are created that restrict traffic to
  10264. * only a set of permitted VLANs. See the vPort flag FLAG_VLAN_RESTRICT.
  10265. */
  10266. #define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNRESTRICTED_VLAN 0x2000
  10267. /* enum: Set this bit to indicate that a new privilege mask is to be set,
  10268. * otherwise the command will only read the existing mask.
  10269. */
  10270. #define MC_CMD_PRIVILEGE_MASK_IN_DO_CHANGE 0x80000000
  10271. /* MC_CMD_PRIVILEGE_MASK_OUT msgresponse */
  10272. #define MC_CMD_PRIVILEGE_MASK_OUT_LEN 4
  10273. /* For an admin function, always all the privileges are reported. */
  10274. #define MC_CMD_PRIVILEGE_MASK_OUT_OLD_MASK_OFST 0
  10275. /***********************************/
  10276. /* MC_CMD_LINK_STATE_MODE
  10277. * Read/set link state mode of a VF
  10278. */
  10279. #define MC_CMD_LINK_STATE_MODE 0x5c
  10280. #define MC_CMD_0x5c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10281. /* MC_CMD_LINK_STATE_MODE_IN msgrequest */
  10282. #define MC_CMD_LINK_STATE_MODE_IN_LEN 8
  10283. /* The target function to have its link state mode read or set, must be a VF
  10284. * e.g. VF 1,3 = 0x00030001
  10285. */
  10286. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_OFST 0
  10287. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_LBN 0
  10288. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_WIDTH 16
  10289. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_LBN 16
  10290. #define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_WIDTH 16
  10291. /* New link state mode to be set */
  10292. #define MC_CMD_LINK_STATE_MODE_IN_NEW_MODE_OFST 4
  10293. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_AUTO 0x0 /* enum */
  10294. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_UP 0x1 /* enum */
  10295. #define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_DOWN 0x2 /* enum */
  10296. /* enum: Use this value to just read the existing setting without modifying it.
  10297. */
  10298. #define MC_CMD_LINK_STATE_MODE_IN_DO_NOT_CHANGE 0xffffffff
  10299. /* MC_CMD_LINK_STATE_MODE_OUT msgresponse */
  10300. #define MC_CMD_LINK_STATE_MODE_OUT_LEN 4
  10301. #define MC_CMD_LINK_STATE_MODE_OUT_OLD_MODE_OFST 0
  10302. /***********************************/
  10303. /* MC_CMD_GET_SNAPSHOT_LENGTH
  10304. * Obtain the curent range of allowable values for the SNAPSHOT_LENGTH
  10305. * parameter to MC_CMD_INIT_RXQ.
  10306. */
  10307. #define MC_CMD_GET_SNAPSHOT_LENGTH 0x101
  10308. #define MC_CMD_0x101_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10309. /* MC_CMD_GET_SNAPSHOT_LENGTH_IN msgrequest */
  10310. #define MC_CMD_GET_SNAPSHOT_LENGTH_IN_LEN 0
  10311. /* MC_CMD_GET_SNAPSHOT_LENGTH_OUT msgresponse */
  10312. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_LEN 8
  10313. /* Minimum acceptable snapshot length. */
  10314. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MIN_OFST 0
  10315. /* Maximum acceptable snapshot length. */
  10316. #define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MAX_OFST 4
  10317. /***********************************/
  10318. /* MC_CMD_FUSE_DIAGS
  10319. * Additional fuse diagnostics
  10320. */
  10321. #define MC_CMD_FUSE_DIAGS 0x102
  10322. #define MC_CMD_0x102_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10323. /* MC_CMD_FUSE_DIAGS_IN msgrequest */
  10324. #define MC_CMD_FUSE_DIAGS_IN_LEN 0
  10325. /* MC_CMD_FUSE_DIAGS_OUT msgresponse */
  10326. #define MC_CMD_FUSE_DIAGS_OUT_LEN 48
  10327. /* Total number of mismatched bits between pairs in area 0 */
  10328. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_MISMATCH_BITS_OFST 0
  10329. /* Total number of unexpectedly clear (set in B but not A) bits in area 0 */
  10330. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_A_BAD_BITS_OFST 4
  10331. /* Total number of unexpectedly clear (set in A but not B) bits in area 0 */
  10332. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_B_BAD_BITS_OFST 8
  10333. /* Checksum of data after logical OR of pairs in area 0 */
  10334. #define MC_CMD_FUSE_DIAGS_OUT_AREA0_CHECKSUM_OFST 12
  10335. /* Total number of mismatched bits between pairs in area 1 */
  10336. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_MISMATCH_BITS_OFST 16
  10337. /* Total number of unexpectedly clear (set in B but not A) bits in area 1 */
  10338. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_A_BAD_BITS_OFST 20
  10339. /* Total number of unexpectedly clear (set in A but not B) bits in area 1 */
  10340. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_B_BAD_BITS_OFST 24
  10341. /* Checksum of data after logical OR of pairs in area 1 */
  10342. #define MC_CMD_FUSE_DIAGS_OUT_AREA1_CHECKSUM_OFST 28
  10343. /* Total number of mismatched bits between pairs in area 2 */
  10344. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_MISMATCH_BITS_OFST 32
  10345. /* Total number of unexpectedly clear (set in B but not A) bits in area 2 */
  10346. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_A_BAD_BITS_OFST 36
  10347. /* Total number of unexpectedly clear (set in A but not B) bits in area 2 */
  10348. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_B_BAD_BITS_OFST 40
  10349. /* Checksum of data after logical OR of pairs in area 2 */
  10350. #define MC_CMD_FUSE_DIAGS_OUT_AREA2_CHECKSUM_OFST 44
  10351. /***********************************/
  10352. /* MC_CMD_PRIVILEGE_MODIFY
  10353. * Modify the privileges of a set of PCIe functions. Note that this operation
  10354. * only effects non-admin functions unless the admin privilege itself is
  10355. * included in one of the masks provided.
  10356. */
  10357. #define MC_CMD_PRIVILEGE_MODIFY 0x60
  10358. #define MC_CMD_0x60_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10359. /* MC_CMD_PRIVILEGE_MODIFY_IN msgrequest */
  10360. #define MC_CMD_PRIVILEGE_MODIFY_IN_LEN 16
  10361. /* The groups of functions to have their privilege masks modified. */
  10362. #define MC_CMD_PRIVILEGE_MODIFY_IN_FN_GROUP_OFST 0
  10363. #define MC_CMD_PRIVILEGE_MODIFY_IN_NONE 0x0 /* enum */
  10364. #define MC_CMD_PRIVILEGE_MODIFY_IN_ALL 0x1 /* enum */
  10365. #define MC_CMD_PRIVILEGE_MODIFY_IN_PFS_ONLY 0x2 /* enum */
  10366. #define MC_CMD_PRIVILEGE_MODIFY_IN_VFS_ONLY 0x3 /* enum */
  10367. #define MC_CMD_PRIVILEGE_MODIFY_IN_VFS_OF_PF 0x4 /* enum */
  10368. #define MC_CMD_PRIVILEGE_MODIFY_IN_ONE 0x5 /* enum */
  10369. /* For VFS_OF_PF specify the PF, for ONE specify the target function */
  10370. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_OFST 4
  10371. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_PF_LBN 0
  10372. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_PF_WIDTH 16
  10373. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_VF_LBN 16
  10374. #define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_VF_WIDTH 16
  10375. /* Privileges to be added to the target functions. For privilege definitions
  10376. * refer to the command MC_CMD_PRIVILEGE_MASK
  10377. */
  10378. #define MC_CMD_PRIVILEGE_MODIFY_IN_ADD_MASK_OFST 8
  10379. /* Privileges to be removed from the target functions. For privilege
  10380. * definitions refer to the command MC_CMD_PRIVILEGE_MASK
  10381. */
  10382. #define MC_CMD_PRIVILEGE_MODIFY_IN_REMOVE_MASK_OFST 12
  10383. /* MC_CMD_PRIVILEGE_MODIFY_OUT msgresponse */
  10384. #define MC_CMD_PRIVILEGE_MODIFY_OUT_LEN 0
  10385. /***********************************/
  10386. /* MC_CMD_XPM_READ_BYTES
  10387. * Read XPM memory
  10388. */
  10389. #define MC_CMD_XPM_READ_BYTES 0x103
  10390. #define MC_CMD_0x103_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10391. /* MC_CMD_XPM_READ_BYTES_IN msgrequest */
  10392. #define MC_CMD_XPM_READ_BYTES_IN_LEN 8
  10393. /* Start address (byte) */
  10394. #define MC_CMD_XPM_READ_BYTES_IN_ADDR_OFST 0
  10395. /* Count (bytes) */
  10396. #define MC_CMD_XPM_READ_BYTES_IN_COUNT_OFST 4
  10397. /* MC_CMD_XPM_READ_BYTES_OUT msgresponse */
  10398. #define MC_CMD_XPM_READ_BYTES_OUT_LENMIN 0
  10399. #define MC_CMD_XPM_READ_BYTES_OUT_LENMAX 252
  10400. #define MC_CMD_XPM_READ_BYTES_OUT_LEN(num) (0+1*(num))
  10401. /* Data */
  10402. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_OFST 0
  10403. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_LEN 1
  10404. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_MINNUM 0
  10405. #define MC_CMD_XPM_READ_BYTES_OUT_DATA_MAXNUM 252
  10406. /***********************************/
  10407. /* MC_CMD_XPM_WRITE_BYTES
  10408. * Write XPM memory
  10409. */
  10410. #define MC_CMD_XPM_WRITE_BYTES 0x104
  10411. #define MC_CMD_0x104_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10412. /* MC_CMD_XPM_WRITE_BYTES_IN msgrequest */
  10413. #define MC_CMD_XPM_WRITE_BYTES_IN_LENMIN 8
  10414. #define MC_CMD_XPM_WRITE_BYTES_IN_LENMAX 252
  10415. #define MC_CMD_XPM_WRITE_BYTES_IN_LEN(num) (8+1*(num))
  10416. /* Start address (byte) */
  10417. #define MC_CMD_XPM_WRITE_BYTES_IN_ADDR_OFST 0
  10418. /* Count (bytes) */
  10419. #define MC_CMD_XPM_WRITE_BYTES_IN_COUNT_OFST 4
  10420. /* Data */
  10421. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_OFST 8
  10422. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_LEN 1
  10423. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_MINNUM 0
  10424. #define MC_CMD_XPM_WRITE_BYTES_IN_DATA_MAXNUM 244
  10425. /* MC_CMD_XPM_WRITE_BYTES_OUT msgresponse */
  10426. #define MC_CMD_XPM_WRITE_BYTES_OUT_LEN 0
  10427. /***********************************/
  10428. /* MC_CMD_XPM_READ_SECTOR
  10429. * Read XPM sector
  10430. */
  10431. #define MC_CMD_XPM_READ_SECTOR 0x105
  10432. #define MC_CMD_0x105_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10433. /* MC_CMD_XPM_READ_SECTOR_IN msgrequest */
  10434. #define MC_CMD_XPM_READ_SECTOR_IN_LEN 8
  10435. /* Sector index */
  10436. #define MC_CMD_XPM_READ_SECTOR_IN_INDEX_OFST 0
  10437. /* Sector size */
  10438. #define MC_CMD_XPM_READ_SECTOR_IN_SIZE_OFST 4
  10439. /* MC_CMD_XPM_READ_SECTOR_OUT msgresponse */
  10440. #define MC_CMD_XPM_READ_SECTOR_OUT_LENMIN 4
  10441. #define MC_CMD_XPM_READ_SECTOR_OUT_LENMAX 36
  10442. #define MC_CMD_XPM_READ_SECTOR_OUT_LEN(num) (4+1*(num))
  10443. /* Sector type */
  10444. #define MC_CMD_XPM_READ_SECTOR_OUT_TYPE_OFST 0
  10445. #define MC_CMD_XPM_READ_SECTOR_OUT_BLANK 0x0 /* enum */
  10446. #define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_KEY_128 0x1 /* enum */
  10447. #define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_KEY_256 0x2 /* enum */
  10448. #define MC_CMD_XPM_READ_SECTOR_OUT_INVALID 0xff /* enum */
  10449. /* Sector data */
  10450. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_OFST 4
  10451. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_LEN 1
  10452. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_MINNUM 0
  10453. #define MC_CMD_XPM_READ_SECTOR_OUT_DATA_MAXNUM 32
  10454. /***********************************/
  10455. /* MC_CMD_XPM_WRITE_SECTOR
  10456. * Write XPM sector
  10457. */
  10458. #define MC_CMD_XPM_WRITE_SECTOR 0x106
  10459. #define MC_CMD_0x106_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10460. /* MC_CMD_XPM_WRITE_SECTOR_IN msgrequest */
  10461. #define MC_CMD_XPM_WRITE_SECTOR_IN_LENMIN 12
  10462. #define MC_CMD_XPM_WRITE_SECTOR_IN_LENMAX 44
  10463. #define MC_CMD_XPM_WRITE_SECTOR_IN_LEN(num) (12+1*(num))
  10464. /* If writing fails due to an uncorrectable error, try up to RETRIES following
  10465. * sectors (or until no more space available). If 0, only one write attempt is
  10466. * made. Note that uncorrectable errors are unlikely, thanks to XPM self-repair
  10467. * mechanism.
  10468. */
  10469. #define MC_CMD_XPM_WRITE_SECTOR_IN_RETRIES_OFST 0
  10470. #define MC_CMD_XPM_WRITE_SECTOR_IN_RETRIES_LEN 1
  10471. #define MC_CMD_XPM_WRITE_SECTOR_IN_RESERVED_OFST 1
  10472. #define MC_CMD_XPM_WRITE_SECTOR_IN_RESERVED_LEN 3
  10473. /* Sector type */
  10474. #define MC_CMD_XPM_WRITE_SECTOR_IN_TYPE_OFST 4
  10475. /* Enum values, see field(s): */
  10476. /* MC_CMD_XPM_READ_SECTOR/MC_CMD_XPM_READ_SECTOR_OUT/TYPE */
  10477. /* Sector size */
  10478. #define MC_CMD_XPM_WRITE_SECTOR_IN_SIZE_OFST 8
  10479. /* Sector data */
  10480. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_OFST 12
  10481. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_LEN 1
  10482. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_MINNUM 0
  10483. #define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_MAXNUM 32
  10484. /* MC_CMD_XPM_WRITE_SECTOR_OUT msgresponse */
  10485. #define MC_CMD_XPM_WRITE_SECTOR_OUT_LEN 4
  10486. /* New sector index */
  10487. #define MC_CMD_XPM_WRITE_SECTOR_OUT_INDEX_OFST 0
  10488. /***********************************/
  10489. /* MC_CMD_XPM_INVALIDATE_SECTOR
  10490. * Invalidate XPM sector
  10491. */
  10492. #define MC_CMD_XPM_INVALIDATE_SECTOR 0x107
  10493. #define MC_CMD_0x107_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10494. /* MC_CMD_XPM_INVALIDATE_SECTOR_IN msgrequest */
  10495. #define MC_CMD_XPM_INVALIDATE_SECTOR_IN_LEN 4
  10496. /* Sector index */
  10497. #define MC_CMD_XPM_INVALIDATE_SECTOR_IN_INDEX_OFST 0
  10498. /* MC_CMD_XPM_INVALIDATE_SECTOR_OUT msgresponse */
  10499. #define MC_CMD_XPM_INVALIDATE_SECTOR_OUT_LEN 0
  10500. /***********************************/
  10501. /* MC_CMD_XPM_BLANK_CHECK
  10502. * Blank-check XPM memory and report bad locations
  10503. */
  10504. #define MC_CMD_XPM_BLANK_CHECK 0x108
  10505. #define MC_CMD_0x108_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10506. /* MC_CMD_XPM_BLANK_CHECK_IN msgrequest */
  10507. #define MC_CMD_XPM_BLANK_CHECK_IN_LEN 8
  10508. /* Start address (byte) */
  10509. #define MC_CMD_XPM_BLANK_CHECK_IN_ADDR_OFST 0
  10510. /* Count (bytes) */
  10511. #define MC_CMD_XPM_BLANK_CHECK_IN_COUNT_OFST 4
  10512. /* MC_CMD_XPM_BLANK_CHECK_OUT msgresponse */
  10513. #define MC_CMD_XPM_BLANK_CHECK_OUT_LENMIN 4
  10514. #define MC_CMD_XPM_BLANK_CHECK_OUT_LENMAX 252
  10515. #define MC_CMD_XPM_BLANK_CHECK_OUT_LEN(num) (4+2*(num))
  10516. /* Total number of bad (non-blank) locations */
  10517. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_COUNT_OFST 0
  10518. /* Addresses of bad locations (may be less than BAD_COUNT, if all cannot fit
  10519. * into MCDI response)
  10520. */
  10521. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_OFST 4
  10522. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_LEN 2
  10523. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_MINNUM 0
  10524. #define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_MAXNUM 124
  10525. /***********************************/
  10526. /* MC_CMD_XPM_REPAIR
  10527. * Blank-check and repair XPM memory
  10528. */
  10529. #define MC_CMD_XPM_REPAIR 0x109
  10530. #define MC_CMD_0x109_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10531. /* MC_CMD_XPM_REPAIR_IN msgrequest */
  10532. #define MC_CMD_XPM_REPAIR_IN_LEN 8
  10533. /* Start address (byte) */
  10534. #define MC_CMD_XPM_REPAIR_IN_ADDR_OFST 0
  10535. /* Count (bytes) */
  10536. #define MC_CMD_XPM_REPAIR_IN_COUNT_OFST 4
  10537. /* MC_CMD_XPM_REPAIR_OUT msgresponse */
  10538. #define MC_CMD_XPM_REPAIR_OUT_LEN 0
  10539. /***********************************/
  10540. /* MC_CMD_XPM_DECODER_TEST
  10541. * Test XPM memory address decoders for gross manufacturing defects. Can only
  10542. * be performed on an unprogrammed part.
  10543. */
  10544. #define MC_CMD_XPM_DECODER_TEST 0x10a
  10545. #define MC_CMD_0x10a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10546. /* MC_CMD_XPM_DECODER_TEST_IN msgrequest */
  10547. #define MC_CMD_XPM_DECODER_TEST_IN_LEN 0
  10548. /* MC_CMD_XPM_DECODER_TEST_OUT msgresponse */
  10549. #define MC_CMD_XPM_DECODER_TEST_OUT_LEN 0
  10550. /***********************************/
  10551. /* MC_CMD_XPM_WRITE_TEST
  10552. * XPM memory write test. Test XPM write logic for gross manufacturing defects
  10553. * by writing to a dedicated test row. There are 16 locations in the test row
  10554. * and the test can only be performed on locations that have not been
  10555. * previously used (i.e. can be run at most 16 times). The test will pick the
  10556. * first available location to use, or fail with ENOSPC if none left.
  10557. */
  10558. #define MC_CMD_XPM_WRITE_TEST 0x10b
  10559. #define MC_CMD_0x10b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10560. /* MC_CMD_XPM_WRITE_TEST_IN msgrequest */
  10561. #define MC_CMD_XPM_WRITE_TEST_IN_LEN 0
  10562. /* MC_CMD_XPM_WRITE_TEST_OUT msgresponse */
  10563. #define MC_CMD_XPM_WRITE_TEST_OUT_LEN 0
  10564. /***********************************/
  10565. /* MC_CMD_EXEC_SIGNED
  10566. * Check the CMAC of the contents of IMEM and DMEM against the value supplied
  10567. * and if correct begin execution from the start of IMEM. The caller supplies a
  10568. * key ID, the length of IMEM and DMEM to validate and the expected CMAC. CMAC
  10569. * computation runs from the start of IMEM, and from the start of DMEM + 16k,
  10570. * to match flash booting. The command will respond with EINVAL if the CMAC
  10571. * does match, otherwise it will respond with success before it jumps to IMEM.
  10572. */
  10573. #define MC_CMD_EXEC_SIGNED 0x10c
  10574. #define MC_CMD_0x10c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10575. /* MC_CMD_EXEC_SIGNED_IN msgrequest */
  10576. #define MC_CMD_EXEC_SIGNED_IN_LEN 28
  10577. /* the length of code to include in the CMAC */
  10578. #define MC_CMD_EXEC_SIGNED_IN_CODELEN_OFST 0
  10579. /* the length of date to include in the CMAC */
  10580. #define MC_CMD_EXEC_SIGNED_IN_DATALEN_OFST 4
  10581. /* the XPM sector containing the key to use */
  10582. #define MC_CMD_EXEC_SIGNED_IN_KEYSECTOR_OFST 8
  10583. /* the expected CMAC value */
  10584. #define MC_CMD_EXEC_SIGNED_IN_CMAC_OFST 12
  10585. #define MC_CMD_EXEC_SIGNED_IN_CMAC_LEN 16
  10586. /* MC_CMD_EXEC_SIGNED_OUT msgresponse */
  10587. #define MC_CMD_EXEC_SIGNED_OUT_LEN 0
  10588. /***********************************/
  10589. /* MC_CMD_PREPARE_SIGNED
  10590. * Prepare to upload a signed image. This will scrub the specified length of
  10591. * the data region, which must be at least as large as the DATALEN supplied to
  10592. * MC_CMD_EXEC_SIGNED.
  10593. */
  10594. #define MC_CMD_PREPARE_SIGNED 0x10d
  10595. #define MC_CMD_0x10d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10596. /* MC_CMD_PREPARE_SIGNED_IN msgrequest */
  10597. #define MC_CMD_PREPARE_SIGNED_IN_LEN 4
  10598. /* the length of data area to clear */
  10599. #define MC_CMD_PREPARE_SIGNED_IN_DATALEN_OFST 0
  10600. /* MC_CMD_PREPARE_SIGNED_OUT msgresponse */
  10601. #define MC_CMD_PREPARE_SIGNED_OUT_LEN 0
  10602. /***********************************/
  10603. /* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS
  10604. * Configure UDP ports for tunnel encapsulation hardware acceleration. The
  10605. * parser-dispatcher will attempt to parse traffic on these ports as tunnel
  10606. * encapsulation PDUs and filter them using the tunnel encapsulation filter
  10607. * chain rather than the standard filter chain. Note that this command can
  10608. * cause all functions to see a reset. (Available on Medford only.)
  10609. */
  10610. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS 0x117
  10611. #define MC_CMD_0x117_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10612. /* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN msgrequest */
  10613. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMIN 4
  10614. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LENMAX 68
  10615. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_LEN(num) (4+4*(num))
  10616. /* Flags */
  10617. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS_OFST 0
  10618. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_FLAGS_LEN 2
  10619. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING_LBN 0
  10620. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_UNLOADING_WIDTH 1
  10621. /* The number of entries in the ENTRIES array */
  10622. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES_OFST 2
  10623. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_NUM_ENTRIES_LEN 2
  10624. /* Entries defining the UDP port to protocol mapping, each laid out as a
  10625. * TUNNEL_ENCAP_UDP_PORT_ENTRY
  10626. */
  10627. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_OFST 4
  10628. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_LEN 4
  10629. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MINNUM 0
  10630. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_IN_ENTRIES_MAXNUM 16
  10631. /* MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT msgresponse */
  10632. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_LEN 2
  10633. /* Flags */
  10634. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS_OFST 0
  10635. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_FLAGS_LEN 2
  10636. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING_LBN 0
  10637. #define MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS_OUT_RESETTING_WIDTH 1
  10638. /***********************************/
  10639. /* MC_CMD_RX_BALANCING
  10640. * Configure a port upconverter to distribute the packets on both RX engines.
  10641. * Packets are distributed based on a table with the destination vFIFO. The
  10642. * index of the table is a hash of source and destination of IPV4 and VLAN
  10643. * priority.
  10644. */
  10645. #define MC_CMD_RX_BALANCING 0x118
  10646. #define MC_CMD_0x118_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10647. /* MC_CMD_RX_BALANCING_IN msgrequest */
  10648. #define MC_CMD_RX_BALANCING_IN_LEN 16
  10649. /* The RX port whose upconverter table will be modified */
  10650. #define MC_CMD_RX_BALANCING_IN_PORT_OFST 0
  10651. /* The VLAN priority associated to the table index and vFIFO */
  10652. #define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 4
  10653. /* The resulting bit of SRC^DST for indexing the table */
  10654. #define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 8
  10655. /* The RX engine to which the vFIFO in the table entry will point to */
  10656. #define MC_CMD_RX_BALANCING_IN_ENG_OFST 12
  10657. /* MC_CMD_RX_BALANCING_OUT msgresponse */
  10658. #define MC_CMD_RX_BALANCING_OUT_LEN 0
  10659. /***********************************/
  10660. /* MC_CMD_NVRAM_PRIVATE_APPEND
  10661. * Append a single TLV to the MC_USAGE_TLV partition. Returns MC_CMD_ERR_EEXIST
  10662. * if the tag is already present.
  10663. */
  10664. #define MC_CMD_NVRAM_PRIVATE_APPEND 0x11c
  10665. #define MC_CMD_0x11c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10666. /* MC_CMD_NVRAM_PRIVATE_APPEND_IN msgrequest */
  10667. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMIN 9
  10668. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMAX 252
  10669. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LEN(num) (8+1*(num))
  10670. /* The tag to be appended */
  10671. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_TAG_OFST 0
  10672. /* The length of the data */
  10673. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENGTH_OFST 4
  10674. /* The data to be contained in the TLV structure */
  10675. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_OFST 8
  10676. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_LEN 1
  10677. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MINNUM 1
  10678. #define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MAXNUM 244
  10679. /* MC_CMD_NVRAM_PRIVATE_APPEND_OUT msgresponse */
  10680. #define MC_CMD_NVRAM_PRIVATE_APPEND_OUT_LEN 0
  10681. /***********************************/
  10682. /* MC_CMD_XPM_VERIFY_CONTENTS
  10683. * Verify that the contents of the XPM memory is correct (Medford only). This
  10684. * is used during manufacture to check that the XPM memory has been programmed
  10685. * correctly at ATE.
  10686. */
  10687. #define MC_CMD_XPM_VERIFY_CONTENTS 0x11b
  10688. #define MC_CMD_0x11b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10689. /* MC_CMD_XPM_VERIFY_CONTENTS_IN msgrequest */
  10690. #define MC_CMD_XPM_VERIFY_CONTENTS_IN_LEN 4
  10691. /* Data type to be checked */
  10692. #define MC_CMD_XPM_VERIFY_CONTENTS_IN_DATA_TYPE_OFST 0
  10693. /* MC_CMD_XPM_VERIFY_CONTENTS_OUT msgresponse */
  10694. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMIN 12
  10695. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMAX 252
  10696. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LEN(num) (12+1*(num))
  10697. /* Number of sectors found (test builds only) */
  10698. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_SECTORS_OFST 0
  10699. /* Number of bytes found (test builds only) */
  10700. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_BYTES_OFST 4
  10701. /* Length of signature */
  10702. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIG_LENGTH_OFST 8
  10703. /* Signature */
  10704. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_OFST 12
  10705. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_LEN 1
  10706. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MINNUM 0
  10707. #define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MAXNUM 240
  10708. /***********************************/
  10709. /* MC_CMD_SET_EVQ_TMR
  10710. * Update the timer load, timer reload and timer mode values for a given EVQ.
  10711. * The requested timer values (in TMR_LOAD_REQ_NS and TMR_RELOAD_REQ_NS) will
  10712. * be rounded up to the granularity supported by the hardware, then truncated
  10713. * to the range supported by the hardware. The resulting value after the
  10714. * rounding and truncation will be returned to the caller (in TMR_LOAD_ACT_NS
  10715. * and TMR_RELOAD_ACT_NS).
  10716. */
  10717. #define MC_CMD_SET_EVQ_TMR 0x120
  10718. #define MC_CMD_0x120_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10719. /* MC_CMD_SET_EVQ_TMR_IN msgrequest */
  10720. #define MC_CMD_SET_EVQ_TMR_IN_LEN 16
  10721. /* Function-relative queue instance */
  10722. #define MC_CMD_SET_EVQ_TMR_IN_INSTANCE_OFST 0
  10723. /* Requested value for timer load (in nanoseconds) */
  10724. #define MC_CMD_SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS_OFST 4
  10725. /* Requested value for timer reload (in nanoseconds) */
  10726. #define MC_CMD_SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS_OFST 8
  10727. /* Timer mode. Meanings as per EVQ_TMR_REG.TC_TIMER_VAL */
  10728. #define MC_CMD_SET_EVQ_TMR_IN_TMR_MODE_OFST 12
  10729. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_DIS 0x0 /* enum */
  10730. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_IMMED_START 0x1 /* enum */
  10731. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_TRIG_START 0x2 /* enum */
  10732. #define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_INT_HLDOFF 0x3 /* enum */
  10733. /* MC_CMD_SET_EVQ_TMR_OUT msgresponse */
  10734. #define MC_CMD_SET_EVQ_TMR_OUT_LEN 8
  10735. /* Actual value for timer load (in nanoseconds) */
  10736. #define MC_CMD_SET_EVQ_TMR_OUT_TMR_LOAD_ACT_NS_OFST 0
  10737. /* Actual value for timer reload (in nanoseconds) */
  10738. #define MC_CMD_SET_EVQ_TMR_OUT_TMR_RELOAD_ACT_NS_OFST 4
  10739. /***********************************/
  10740. /* MC_CMD_GET_EVQ_TMR_PROPERTIES
  10741. * Query properties about the event queue timers.
  10742. */
  10743. #define MC_CMD_GET_EVQ_TMR_PROPERTIES 0x122
  10744. #define MC_CMD_0x122_PRIVILEGE_CTG SRIOV_CTG_GENERAL
  10745. /* MC_CMD_GET_EVQ_TMR_PROPERTIES_IN msgrequest */
  10746. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_IN_LEN 0
  10747. /* MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT msgresponse */
  10748. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_LEN 36
  10749. /* Reserved for future use. */
  10750. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_FLAGS_OFST 0
  10751. /* For timers updated via writes to EVQ_TMR_REG, this is the time interval (in
  10752. * nanoseconds) for each increment of the timer load/reload count. The
  10753. * requested duration of a timer is this value multiplied by the timer
  10754. * load/reload count.
  10755. */
  10756. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_NS_PER_COUNT_OFST 4
  10757. /* For timers updated via writes to EVQ_TMR_REG, this is the maximum value
  10758. * allowed for timer load/reload counts.
  10759. */
  10760. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_MAX_COUNT_OFST 8
  10761. /* For timers updated via writes to EVQ_TMR_REG, timer load/reload counts not a
  10762. * multiple of this step size will be rounded in an implementation defined
  10763. * manner.
  10764. */
  10765. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_STEP_OFST 12
  10766. /* Maximum timer duration (in nanoseconds) for timers updated via MCDI. Only
  10767. * meaningful if MC_CMD_SET_EVQ_TMR is implemented.
  10768. */
  10769. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_MAX_NS_OFST 16
  10770. /* Timer durations requested via MCDI that are not a multiple of this step size
  10771. * will be rounded up. Only meaningful if MC_CMD_SET_EVQ_TMR is implemented.
  10772. */
  10773. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_STEP_NS_OFST 20
  10774. /* For timers updated using the bug35388 workaround, this is the time interval
  10775. * (in nanoseconds) for each increment of the timer load/reload count. The
  10776. * requested duration of a timer is this value multiplied by the timer
  10777. * load/reload count. This field is only meaningful if the bug35388 workaround
  10778. * is enabled.
  10779. */
  10780. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_NS_PER_COUNT_OFST 24
  10781. /* For timers updated using the bug35388 workaround, this is the maximum value
  10782. * allowed for timer load/reload counts. This field is only meaningful if the
  10783. * bug35388 workaround is enabled.
  10784. */
  10785. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_MAX_COUNT_OFST 28
  10786. /* For timers updated using the bug35388 workaround, timer load/reload counts
  10787. * not a multiple of this step size will be rounded in an implementation
  10788. * defined manner. This field is only meaningful if the bug35388 workaround is
  10789. * enabled.
  10790. */
  10791. #define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_STEP_OFST 32
  10792. /***********************************/
  10793. /* MC_CMD_ALLOCATE_TX_VFIFO_CP
  10794. * When we use the TX_vFIFO_ULL mode, we can allocate common pools using the
  10795. * non used switch buffers.
  10796. */
  10797. #define MC_CMD_ALLOCATE_TX_VFIFO_CP 0x11d
  10798. #define MC_CMD_0x11d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10799. /* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN msgrequest */
  10800. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_LEN 20
  10801. /* Desired instance. Must be set to a specific instance, which is a function
  10802. * local queue index.
  10803. */
  10804. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INSTANCE_OFST 0
  10805. /* Will the common pool be used as TX_vFIFO_ULL (1) */
  10806. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_MODE_OFST 4
  10807. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_ENABLED 0x1 /* enum */
  10808. /* enum: Using this interface without TX_vFIFO_ULL is not supported for now */
  10809. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_DISABLED 0x0
  10810. /* Number of buffers to reserve for the common pool */
  10811. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_SIZE_OFST 8
  10812. /* TX datapath to which the Common Pool is connected to. */
  10813. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INGRESS_OFST 12
  10814. /* enum: Extracts information from function */
  10815. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1
  10816. /* Network port or RX Engine to which the common pool connects. */
  10817. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_EGRESS_OFST 16
  10818. /* enum: Extracts information from function */
  10819. /* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1 */
  10820. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT0 0x0 /* enum */
  10821. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT1 0x1 /* enum */
  10822. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT2 0x2 /* enum */
  10823. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT3 0x3 /* enum */
  10824. /* enum: To enable Switch loopback with Rx engine 0 */
  10825. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE0 0x4
  10826. /* enum: To enable Switch loopback with Rx engine 1 */
  10827. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE1 0x5
  10828. /* MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT msgresponse */
  10829. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_LEN 4
  10830. /* ID of the common pool allocated */
  10831. #define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_CP_ID_OFST 0
  10832. /***********************************/
  10833. /* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO
  10834. * When we use the TX_vFIFO_ULL mode, we can allocate vFIFOs using the
  10835. * previously allocated common pools.
  10836. */
  10837. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO 0x11e
  10838. #define MC_CMD_0x11e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10839. /* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN msgrequest */
  10840. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LEN 20
  10841. /* Common pool previously allocated to which the new vFIFO will be associated
  10842. */
  10843. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_CP_OFST 0
  10844. /* Port or RX engine to associate the vFIFO egress */
  10845. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_EGRESS_OFST 4
  10846. /* enum: Extracts information from common pool */
  10847. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_USE_CP_VALUE -0x1
  10848. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT0 0x0 /* enum */
  10849. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT1 0x1 /* enum */
  10850. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT2 0x2 /* enum */
  10851. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT3 0x3 /* enum */
  10852. /* enum: To enable Switch loopback with Rx engine 0 */
  10853. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE0 0x4
  10854. /* enum: To enable Switch loopback with Rx engine 1 */
  10855. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE1 0x5
  10856. /* Minimum number of buffers that the pool must have */
  10857. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_SIZE_OFST 8
  10858. /* enum: Do not check the space available */
  10859. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_NO_MINIMUM 0x0
  10860. /* Will the vFIFO be used as TX_vFIFO_ULL */
  10861. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_MODE_OFST 12
  10862. /* Network priority of the vFIFO,if applicable */
  10863. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PRIORITY_OFST 16
  10864. /* enum: Search for the lowest unused priority */
  10865. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LOWEST_AVAILABLE -0x1
  10866. /* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT msgresponse */
  10867. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_LEN 8
  10868. /* Short vFIFO ID */
  10869. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_VID_OFST 0
  10870. /* Network priority of the vFIFO */
  10871. #define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_PRIORITY_OFST 4
  10872. /***********************************/
  10873. /* MC_CMD_TEARDOWN_TX_VFIFO_VF
  10874. * This interface clears the configuration of the given vFIFO and leaves it
  10875. * ready to be re-used.
  10876. */
  10877. #define MC_CMD_TEARDOWN_TX_VFIFO_VF 0x11f
  10878. #define MC_CMD_0x11f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10879. /* MC_CMD_TEARDOWN_TX_VFIFO_VF_IN msgrequest */
  10880. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_LEN 4
  10881. /* Short vFIFO ID */
  10882. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_VFIFO_OFST 0
  10883. /* MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT msgresponse */
  10884. #define MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT_LEN 0
  10885. /***********************************/
  10886. /* MC_CMD_DEALLOCATE_TX_VFIFO_CP
  10887. * This interface clears the configuration of the given common pool and leaves
  10888. * it ready to be re-used.
  10889. */
  10890. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP 0x121
  10891. #define MC_CMD_0x121_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10892. /* MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN msgrequest */
  10893. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_LEN 4
  10894. /* Common pool ID given when pool allocated */
  10895. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_POOL_ID_OFST 0
  10896. /* MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT msgresponse */
  10897. #define MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT_LEN 0
  10898. /***********************************/
  10899. /* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS
  10900. * This interface allows the host to find out how many common pool buffers are
  10901. * not yet assigned.
  10902. */
  10903. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS 0x124
  10904. #define MC_CMD_0x124_PRIVILEGE_CTG SRIOV_CTG_ADMIN
  10905. /* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_IN msgrequest */
  10906. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_IN_LEN 0
  10907. /* MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT msgresponse */
  10908. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_LEN 8
  10909. /* Available buffers for the ENG to NET vFIFOs. */
  10910. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_NET_OFST 0
  10911. /* Available buffers for the ENG to ENG and NET to ENG vFIFOs. */
  10912. #define MC_CMD_SWITCH_GET_UNASSIGNED_BUFFERS_OUT_ENG_OFST 4
  10913. #endif /* MCDI_PCOL_H */