pinctrl-atlas7.c 198 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162
  1. /*
  2. * pinctrl pads, groups, functions for CSR SiRFatlasVII
  3. *
  4. * Copyright (c) 2011 - 2014 Cambridge Silicon Radio Limited, a CSR plc group
  5. * company.
  6. *
  7. * Licensed under GPLv2 or later.
  8. */
  9. #include <linux/init.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/io.h>
  12. #include <linux/bitops.h>
  13. #include <linux/irq.h>
  14. #include <linux/slab.h>
  15. #include <linux/clk.h>
  16. #include <linux/of.h>
  17. #include <linux/of_address.h>
  18. #include <linux/of_device.h>
  19. #include <linux/of_platform.h>
  20. #include <linux/of_irq.h>
  21. #include <linux/of_gpio.h>
  22. #include <linux/pinctrl/machine.h>
  23. #include <linux/pinctrl/pinconf.h>
  24. #include <linux/pinctrl/pinctrl.h>
  25. #include <linux/pinctrl/pinmux.h>
  26. #include <linux/pinctrl/consumer.h>
  27. #include <linux/pinctrl/pinconf-generic.h>
  28. #include <linux/gpio.h>
  29. /* Definition of Pad&Mux Properties */
  30. #define N 0
  31. /* The Bank contains input-disable regisgers */
  32. #define BANK_DS 0
  33. /* Clear Register offset */
  34. #define CLR_REG(r) ((r) + 0x04)
  35. /* Definition of multiple function select register */
  36. #define FUNC_CLEAR_MASK 0x7
  37. #define FUNC_GPIO 0
  38. #define FUNC_ANALOGUE 0x8
  39. #define ANA_CLEAR_MASK 0x1
  40. /* The Atlas7's Pad Type List */
  41. enum altas7_pad_type {
  42. PAD_T_4WE_PD = 0, /* ZIO_PAD3V_4WE_PD */
  43. PAD_T_4WE_PU, /* ZIO_PAD3V_4WE_PD */
  44. PAD_T_16ST, /* ZIO_PAD3V_SDCLK_PD */
  45. PAD_T_M31_0204_PD, /* PRDW0204SDGZ_M311311_PD */
  46. PAD_T_M31_0204_PU, /* PRDW0204SDGZ_M311311_PU */
  47. PAD_T_M31_0610_PD, /* PRUW0610SDGZ_M311311_PD */
  48. PAD_T_M31_0610_PU, /* PRUW0610SDGZ_M311311_PU */
  49. PAD_T_AD, /* PRDWUWHW08SCDG_HZ */
  50. };
  51. /* Raw value of Driver-Strength Bits */
  52. #define DS3 BIT(3)
  53. #define DS2 BIT(2)
  54. #define DS1 BIT(1)
  55. #define DS0 BIT(0)
  56. #define DSZ 0
  57. /* Drive-Strength Intermediate Values */
  58. #define DS_NULL -1
  59. #define DS_1BIT_IM_VAL DS0
  60. #define DS_1BIT_MASK 0x1
  61. #define DS_2BIT_IM_VAL (DS1 | DS0)
  62. #define DS_2BIT_MASK 0x3
  63. #define DS_4BIT_IM_VAL (DS3 | DS2 | DS1 | DS0)
  64. #define DS_4BIT_MASK 0xf
  65. /* The Drive-Strength of 4WE Pad DS1 0 CO */
  66. #define DS_4WE_3 (DS1 | DS0) /* 1 1 3 */
  67. #define DS_4WE_2 (DS1) /* 1 0 2 */
  68. #define DS_4WE_1 (DS0) /* 0 1 1 */
  69. #define DS_4WE_0 (DSZ) /* 0 0 0 */
  70. /* The Drive-Strength of 16st Pad DS3 2 1 0 CO */
  71. #define DS_16ST_15 (DS3 | DS2 | DS1 | DS0) /* 1 1 1 1 15 */
  72. #define DS_16ST_14 (DS3 | DS2 | DS0) /* 1 1 0 1 13 */
  73. #define DS_16ST_13 (DS3 | DS2 | DS1) /* 1 1 1 0 14 */
  74. #define DS_16ST_12 (DS2 | DS1 | DS0) /* 0 1 1 1 7 */
  75. #define DS_16ST_11 (DS2 | DS0) /* 0 1 0 1 5 */
  76. #define DS_16ST_10 (DS3 | DS1 | DS0) /* 1 0 1 1 11 */
  77. #define DS_16ST_9 (DS3 | DS0) /* 1 0 0 1 9 */
  78. #define DS_16ST_8 (DS1 | DS0) /* 0 0 1 1 3 */
  79. #define DS_16ST_7 (DS2 | DS1) /* 0 1 1 0 6 */
  80. #define DS_16ST_6 (DS3 | DS2) /* 1 1 0 0 12 */
  81. #define DS_16ST_5 (DS2) /* 0 1 0 0 4 */
  82. #define DS_16ST_4 (DS3 | DS1) /* 1 0 1 0 10 */
  83. #define DS_16ST_3 (DS1) /* 0 0 1 0 2 */
  84. #define DS_16ST_2 (DS0) /* 0 0 0 1 1 */
  85. #define DS_16ST_1 (DSZ) /* 0 0 0 0 0 */
  86. #define DS_16ST_0 (DS3) /* 1 0 0 0 8 */
  87. /* The Drive-Strength of M31 Pad DS0 CO */
  88. #define DS_M31_0 (DSZ) /* 0 0 */
  89. #define DS_M31_1 (DS0) /* 1 1 */
  90. /* Raw values of Pull Option Bits */
  91. #define PUN BIT(1)
  92. #define PD BIT(0)
  93. #define PE BIT(0)
  94. #define PZ 0
  95. /* Definition of Pull Types */
  96. #define PULL_UP 0
  97. #define HIGH_HYSTERESIS 1
  98. #define HIGH_Z 2
  99. #define PULL_DOWN 3
  100. #define PULL_DISABLE 4
  101. #define PULL_ENABLE 5
  102. #define PULL_UNKNOWN -1
  103. /* Pull Options for 4WE Pad PUN PD CO */
  104. #define P4WE_PULL_MASK 0x3
  105. #define P4WE_PULL_DOWN (PUN | PD) /* 1 1 3 */
  106. #define P4WE_HIGH_Z (PUN) /* 1 0 2 */
  107. #define P4WE_HIGH_HYSTERESIS (PD) /* 0 1 1 */
  108. #define P4WE_PULL_UP (PZ) /* 0 0 0 */
  109. /* Pull Options for 16ST Pad PUN PD CO */
  110. #define P16ST_PULL_MASK 0x3
  111. #define P16ST_PULL_DOWN (PUN | PD) /* 1 1 3 */
  112. #define P16ST_HIGH_Z (PUN) /* 1 0 2 */
  113. #define P16ST_PULL_UP (PZ) /* 0 0 0 */
  114. /* Pull Options for M31 Pad PE */
  115. #define PM31_PULL_MASK 0x1
  116. #define PM31_PULL_ENABLED (PE) /* 1 */
  117. #define PM31_PULL_DISABLED (PZ) /* 0 */
  118. /* Pull Options for A/D Pad PUN PD CO */
  119. #define PANGD_PULL_MASK 0x3
  120. #define PANGD_PULL_DOWN (PUN | PD) /* 1 1 3 */
  121. #define PANGD_HIGH_Z (PUN) /* 1 0 2 */
  122. #define PANGD_PULL_UP (PZ) /* 0 0 0 */
  123. /* Definition of Input Disable */
  124. #define DI_MASK 0x1
  125. #define DI_DISABLE 0x1
  126. #define DI_ENABLE 0x0
  127. /* Definition of Input Disable Value */
  128. #define DIV_MASK 0x1
  129. #define DIV_DISABLE 0x1
  130. #define DIV_ENABLE 0x0
  131. /* Number of Function input disable registers */
  132. #define NUM_OF_IN_DISABLE_REG 0x2
  133. /* Offset of Function input disable registers */
  134. #define IN_DISABLE_0_REG_SET 0x0A00
  135. #define IN_DISABLE_0_REG_CLR 0x0A04
  136. #define IN_DISABLE_1_REG_SET 0x0A08
  137. #define IN_DISABLE_1_REG_CLR 0x0A0C
  138. #define IN_DISABLE_VAL_0_REG_SET 0x0A80
  139. #define IN_DISABLE_VAL_0_REG_CLR 0x0A84
  140. #define IN_DISABLE_VAL_1_REG_SET 0x0A88
  141. #define IN_DISABLE_VAL_1_REG_CLR 0x0A8C
  142. /* Offset of the SDIO9SEL*/
  143. #define SYS2PCI_SDIO9SEL 0x14
  144. struct dt_params {
  145. const char *property;
  146. int value;
  147. };
  148. /**
  149. * struct atlas7_pad_conf - Atlas7 Pad Configuration
  150. * @id The ID of this Pad.
  151. * @type: The type of this Pad.
  152. * @mux_reg: The mux register offset.
  153. * This register contains the mux.
  154. * @pupd_reg: The pull-up/down register offset.
  155. * @drvstr_reg: The drive-strength register offset.
  156. * @ad_ctrl_reg: The Analogue/Digital Control register.
  157. *
  158. * @mux_bit: The start bit of mux register.
  159. * @pupd_bit: The start bit of pull-up/down register.
  160. * @drvstr_bit: The start bit of drive-strength register.
  161. * @ad_ctrl_bit: The start bit of analogue/digital register.
  162. */
  163. struct atlas7_pad_config {
  164. const u32 id;
  165. u32 type;
  166. u32 mux_reg;
  167. u32 pupd_reg;
  168. u32 drvstr_reg;
  169. u32 ad_ctrl_reg;
  170. /* bits in register */
  171. u8 mux_bit;
  172. u8 pupd_bit;
  173. u8 drvstr_bit;
  174. u8 ad_ctrl_bit;
  175. };
  176. #define PADCONF(pad, t, mr, pr, dsr, adr, mb, pb, dsb, adb) \
  177. { \
  178. .id = pad, \
  179. .type = t, \
  180. .mux_reg = mr, \
  181. .pupd_reg = pr, \
  182. .drvstr_reg = dsr, \
  183. .ad_ctrl_reg = adr, \
  184. .mux_bit = mb, \
  185. .pupd_bit = pb, \
  186. .drvstr_bit = dsb, \
  187. .ad_ctrl_bit = adb, \
  188. }
  189. /**
  190. * struct atlas7_pad_status - Atlas7 Pad status
  191. */
  192. struct atlas7_pad_status {
  193. u8 func;
  194. u8 pull;
  195. u8 dstr;
  196. u8 reserved;
  197. };
  198. /**
  199. * struct atlas7_pad_mux - Atlas7 mux
  200. * @bank: The bank of this pad's registers on.
  201. * @pin : The ID of this Pad.
  202. * @func: The mux func on this Pad.
  203. * @dinput_reg: The Input-Disable register offset.
  204. * @dinput_bit: The start bit of Input-Disable register.
  205. * @dinput_val_reg: The Input-Disable-value register offset.
  206. * This register is used to set the value of this pad
  207. * if this pad was disabled.
  208. * @dinput_val_bit: The start bit of Input-Disable Value register.
  209. */
  210. struct atlas7_pad_mux {
  211. u32 bank;
  212. u32 pin;
  213. u32 func;
  214. u32 dinput_reg;
  215. u32 dinput_bit;
  216. u32 dinput_val_reg;
  217. u32 dinput_val_bit;
  218. };
  219. #define MUX(b, pad, f, dr, db, dvr, dvb) \
  220. { \
  221. .bank = b, \
  222. .pin = pad, \
  223. .func = f, \
  224. .dinput_reg = dr, \
  225. .dinput_bit = db, \
  226. .dinput_val_reg = dvr, \
  227. .dinput_val_bit = dvb, \
  228. }
  229. struct atlas7_grp_mux {
  230. unsigned int group;
  231. unsigned int pad_mux_count;
  232. const struct atlas7_pad_mux *pad_mux_list;
  233. };
  234. /**
  235. * struct sirfsoc_pin_group - describes a SiRFprimaII pin group
  236. * @name: the name of this specific pin group
  237. * @pins: an array of discrete physical pins used in this group, taken
  238. * from the driver-local pin enumeration space
  239. * @num_pins: the number of pins in this group array, i.e. the number of
  240. * elements in .pins so we can iterate over that array
  241. */
  242. struct atlas7_pin_group {
  243. const char *name;
  244. const unsigned int *pins;
  245. const unsigned num_pins;
  246. };
  247. #define GROUP(n, p) \
  248. { \
  249. .name = n, \
  250. .pins = p, \
  251. .num_pins = ARRAY_SIZE(p), \
  252. }
  253. struct atlas7_pmx_func {
  254. const char *name;
  255. const char * const *groups;
  256. const unsigned num_groups;
  257. const struct atlas7_grp_mux *grpmux;
  258. };
  259. #define FUNCTION(n, g, m) \
  260. { \
  261. .name = n, \
  262. .groups = g, \
  263. .num_groups = ARRAY_SIZE(g), \
  264. .grpmux = m, \
  265. }
  266. struct atlas7_pinctrl_data {
  267. struct pinctrl_pin_desc *pads;
  268. int pads_cnt;
  269. struct atlas7_pin_group *grps;
  270. int grps_cnt;
  271. struct atlas7_pmx_func *funcs;
  272. int funcs_cnt;
  273. struct atlas7_pad_config *confs;
  274. int confs_cnt;
  275. };
  276. /* Platform info of atlas7 pinctrl */
  277. #define ATLAS7_PINCTRL_REG_BANKS 2
  278. #define ATLAS7_PINCTRL_BANK_0_PINS 18
  279. #define ATLAS7_PINCTRL_BANK_1_PINS 141
  280. #define ATLAS7_PINCTRL_TOTAL_PINS \
  281. (ATLAS7_PINCTRL_BANK_0_PINS + ATLAS7_PINCTRL_BANK_1_PINS)
  282. /**
  283. * Atlas7 GPIO Chip
  284. */
  285. #define NGPIO_OF_BANK 32
  286. #define GPIO_TO_BANK(gpio) ((gpio) / NGPIO_OF_BANK)
  287. /* Registers of GPIO Controllers */
  288. #define ATLAS7_GPIO_BASE(g, b) ((g)->reg + 0x100 * (b))
  289. #define ATLAS7_GPIO_CTRL(b, i) ((b)->base + 4 * (i))
  290. #define ATLAS7_GPIO_INT_STATUS(b) ((b)->base + 0x8C)
  291. /* Definition bits of GPIO Control Registers */
  292. #define ATLAS7_GPIO_CTL_INTR_LOW_MASK BIT(0)
  293. #define ATLAS7_GPIO_CTL_INTR_HIGH_MASK BIT(1)
  294. #define ATLAS7_GPIO_CTL_INTR_TYPE_MASK BIT(2)
  295. #define ATLAS7_GPIO_CTL_INTR_EN_MASK BIT(3)
  296. #define ATLAS7_GPIO_CTL_INTR_STATUS_MASK BIT(4)
  297. #define ATLAS7_GPIO_CTL_OUT_EN_MASK BIT(5)
  298. #define ATLAS7_GPIO_CTL_DATAOUT_MASK BIT(6)
  299. #define ATLAS7_GPIO_CTL_DATAIN_MASK BIT(7)
  300. struct atlas7_gpio_bank {
  301. int id;
  302. int irq;
  303. void __iomem *base;
  304. unsigned int gpio_offset;
  305. unsigned int ngpio;
  306. const unsigned int *gpio_pins;
  307. u32 sleep_data[NGPIO_OF_BANK];
  308. };
  309. struct atlas7_gpio_chip {
  310. const char *name;
  311. void __iomem *reg;
  312. struct clk *clk;
  313. int nbank;
  314. spinlock_t lock;
  315. struct gpio_chip chip;
  316. struct atlas7_gpio_bank banks[0];
  317. };
  318. /**
  319. * @dev: a pointer back to containing device
  320. * @virtbase: the offset to the controller in virtual memory
  321. */
  322. struct atlas7_pmx {
  323. struct device *dev;
  324. struct pinctrl_dev *pctl;
  325. struct pinctrl_desc pctl_desc;
  326. struct atlas7_pinctrl_data *pctl_data;
  327. void __iomem *regs[ATLAS7_PINCTRL_REG_BANKS];
  328. void __iomem *sys2pci_base;
  329. u32 status_ds[NUM_OF_IN_DISABLE_REG];
  330. u32 status_dsv[NUM_OF_IN_DISABLE_REG];
  331. struct atlas7_pad_status sleep_data[ATLAS7_PINCTRL_TOTAL_PINS];
  332. };
  333. /*
  334. * Pad list for the pinmux subsystem
  335. * refer to A7DA IO Summary - CS-314158-DD-4E.xls
  336. */
  337. /*Pads in IOC RTC & TOP */
  338. static const struct pinctrl_pin_desc atlas7_ioc_pads[] = {
  339. /* RTC PADs */
  340. PINCTRL_PIN(0, "rtc_gpio_0"),
  341. PINCTRL_PIN(1, "rtc_gpio_1"),
  342. PINCTRL_PIN(2, "rtc_gpio_2"),
  343. PINCTRL_PIN(3, "rtc_gpio_3"),
  344. PINCTRL_PIN(4, "low_bat_ind_b"),
  345. PINCTRL_PIN(5, "on_key_b"),
  346. PINCTRL_PIN(6, "ext_on"),
  347. PINCTRL_PIN(7, "mem_on"),
  348. PINCTRL_PIN(8, "core_on"),
  349. PINCTRL_PIN(9, "io_on"),
  350. PINCTRL_PIN(10, "can0_tx"),
  351. PINCTRL_PIN(11, "can0_rx"),
  352. PINCTRL_PIN(12, "spi0_clk"),
  353. PINCTRL_PIN(13, "spi0_cs_b"),
  354. PINCTRL_PIN(14, "spi0_io_0"),
  355. PINCTRL_PIN(15, "spi0_io_1"),
  356. PINCTRL_PIN(16, "spi0_io_2"),
  357. PINCTRL_PIN(17, "spi0_io_3"),
  358. /* TOP PADs */
  359. PINCTRL_PIN(18, "spi1_en"),
  360. PINCTRL_PIN(19, "spi1_clk"),
  361. PINCTRL_PIN(20, "spi1_din"),
  362. PINCTRL_PIN(21, "spi1_dout"),
  363. PINCTRL_PIN(22, "trg_spi_clk"),
  364. PINCTRL_PIN(23, "trg_spi_di"),
  365. PINCTRL_PIN(24, "trg_spi_do"),
  366. PINCTRL_PIN(25, "trg_spi_cs_b"),
  367. PINCTRL_PIN(26, "trg_acq_d1"),
  368. PINCTRL_PIN(27, "trg_irq_b"),
  369. PINCTRL_PIN(28, "trg_acq_d0"),
  370. PINCTRL_PIN(29, "trg_acq_clk"),
  371. PINCTRL_PIN(30, "trg_shutdown_b_out"),
  372. PINCTRL_PIN(31, "sdio2_clk"),
  373. PINCTRL_PIN(32, "sdio2_cmd"),
  374. PINCTRL_PIN(33, "sdio2_dat_0"),
  375. PINCTRL_PIN(34, "sdio2_dat_1"),
  376. PINCTRL_PIN(35, "sdio2_dat_2"),
  377. PINCTRL_PIN(36, "sdio2_dat_3"),
  378. PINCTRL_PIN(37, "df_ad_7"),
  379. PINCTRL_PIN(38, "df_ad_6"),
  380. PINCTRL_PIN(39, "df_ad_5"),
  381. PINCTRL_PIN(40, "df_ad_4"),
  382. PINCTRL_PIN(41, "df_ad_3"),
  383. PINCTRL_PIN(42, "df_ad_2"),
  384. PINCTRL_PIN(43, "df_ad_1"),
  385. PINCTRL_PIN(44, "df_ad_0"),
  386. PINCTRL_PIN(45, "df_dqs"),
  387. PINCTRL_PIN(46, "df_cle"),
  388. PINCTRL_PIN(47, "df_ale"),
  389. PINCTRL_PIN(48, "df_we_b"),
  390. PINCTRL_PIN(49, "df_re_b"),
  391. PINCTRL_PIN(50, "df_ry_by"),
  392. PINCTRL_PIN(51, "df_cs_b_1"),
  393. PINCTRL_PIN(52, "df_cs_b_0"),
  394. PINCTRL_PIN(53, "l_pclk"),
  395. PINCTRL_PIN(54, "l_lck"),
  396. PINCTRL_PIN(55, "l_fck"),
  397. PINCTRL_PIN(56, "l_de"),
  398. PINCTRL_PIN(57, "ldd_0"),
  399. PINCTRL_PIN(58, "ldd_1"),
  400. PINCTRL_PIN(59, "ldd_2"),
  401. PINCTRL_PIN(60, "ldd_3"),
  402. PINCTRL_PIN(61, "ldd_4"),
  403. PINCTRL_PIN(62, "ldd_5"),
  404. PINCTRL_PIN(63, "ldd_6"),
  405. PINCTRL_PIN(64, "ldd_7"),
  406. PINCTRL_PIN(65, "ldd_8"),
  407. PINCTRL_PIN(66, "ldd_9"),
  408. PINCTRL_PIN(67, "ldd_10"),
  409. PINCTRL_PIN(68, "ldd_11"),
  410. PINCTRL_PIN(69, "ldd_12"),
  411. PINCTRL_PIN(70, "ldd_13"),
  412. PINCTRL_PIN(71, "ldd_14"),
  413. PINCTRL_PIN(72, "ldd_15"),
  414. PINCTRL_PIN(73, "lcd_gpio_20"),
  415. PINCTRL_PIN(74, "vip_0"),
  416. PINCTRL_PIN(75, "vip_1"),
  417. PINCTRL_PIN(76, "vip_2"),
  418. PINCTRL_PIN(77, "vip_3"),
  419. PINCTRL_PIN(78, "vip_4"),
  420. PINCTRL_PIN(79, "vip_5"),
  421. PINCTRL_PIN(80, "vip_6"),
  422. PINCTRL_PIN(81, "vip_7"),
  423. PINCTRL_PIN(82, "vip_pxclk"),
  424. PINCTRL_PIN(83, "vip_hsync"),
  425. PINCTRL_PIN(84, "vip_vsync"),
  426. PINCTRL_PIN(85, "sdio3_clk"),
  427. PINCTRL_PIN(86, "sdio3_cmd"),
  428. PINCTRL_PIN(87, "sdio3_dat_0"),
  429. PINCTRL_PIN(88, "sdio3_dat_1"),
  430. PINCTRL_PIN(89, "sdio3_dat_2"),
  431. PINCTRL_PIN(90, "sdio3_dat_3"),
  432. PINCTRL_PIN(91, "sdio5_clk"),
  433. PINCTRL_PIN(92, "sdio5_cmd"),
  434. PINCTRL_PIN(93, "sdio5_dat_0"),
  435. PINCTRL_PIN(94, "sdio5_dat_1"),
  436. PINCTRL_PIN(95, "sdio5_dat_2"),
  437. PINCTRL_PIN(96, "sdio5_dat_3"),
  438. PINCTRL_PIN(97, "rgmii_txd_0"),
  439. PINCTRL_PIN(98, "rgmii_txd_1"),
  440. PINCTRL_PIN(99, "rgmii_txd_2"),
  441. PINCTRL_PIN(100, "rgmii_txd_3"),
  442. PINCTRL_PIN(101, "rgmii_txclk"),
  443. PINCTRL_PIN(102, "rgmii_tx_ctl"),
  444. PINCTRL_PIN(103, "rgmii_rxd_0"),
  445. PINCTRL_PIN(104, "rgmii_rxd_1"),
  446. PINCTRL_PIN(105, "rgmii_rxd_2"),
  447. PINCTRL_PIN(106, "rgmii_rxd_3"),
  448. PINCTRL_PIN(107, "rgmii_rx_clk"),
  449. PINCTRL_PIN(108, "rgmii_rxc_ctl"),
  450. PINCTRL_PIN(109, "rgmii_mdio"),
  451. PINCTRL_PIN(110, "rgmii_mdc"),
  452. PINCTRL_PIN(111, "rgmii_intr_n"),
  453. PINCTRL_PIN(112, "i2s_mclk"),
  454. PINCTRL_PIN(113, "i2s_bclk"),
  455. PINCTRL_PIN(114, "i2s_ws"),
  456. PINCTRL_PIN(115, "i2s_dout0"),
  457. PINCTRL_PIN(116, "i2s_dout1"),
  458. PINCTRL_PIN(117, "i2s_dout2"),
  459. PINCTRL_PIN(118, "i2s_din"),
  460. PINCTRL_PIN(119, "gpio_0"),
  461. PINCTRL_PIN(120, "gpio_1"),
  462. PINCTRL_PIN(121, "gpio_2"),
  463. PINCTRL_PIN(122, "gpio_3"),
  464. PINCTRL_PIN(123, "gpio_4"),
  465. PINCTRL_PIN(124, "gpio_5"),
  466. PINCTRL_PIN(125, "gpio_6"),
  467. PINCTRL_PIN(126, "gpio_7"),
  468. PINCTRL_PIN(127, "sda_0"),
  469. PINCTRL_PIN(128, "scl_0"),
  470. PINCTRL_PIN(129, "coex_pio_0"),
  471. PINCTRL_PIN(130, "coex_pio_1"),
  472. PINCTRL_PIN(131, "coex_pio_2"),
  473. PINCTRL_PIN(132, "coex_pio_3"),
  474. PINCTRL_PIN(133, "uart0_tx"),
  475. PINCTRL_PIN(134, "uart0_rx"),
  476. PINCTRL_PIN(135, "uart1_tx"),
  477. PINCTRL_PIN(136, "uart1_rx"),
  478. PINCTRL_PIN(137, "uart3_tx"),
  479. PINCTRL_PIN(138, "uart3_rx"),
  480. PINCTRL_PIN(139, "uart4_tx"),
  481. PINCTRL_PIN(140, "uart4_rx"),
  482. PINCTRL_PIN(141, "usp0_clk"),
  483. PINCTRL_PIN(142, "usp0_tx"),
  484. PINCTRL_PIN(143, "usp0_rx"),
  485. PINCTRL_PIN(144, "usp0_fs"),
  486. PINCTRL_PIN(145, "usp1_clk"),
  487. PINCTRL_PIN(146, "usp1_tx"),
  488. PINCTRL_PIN(147, "usp1_rx"),
  489. PINCTRL_PIN(148, "usp1_fs"),
  490. PINCTRL_PIN(149, "lvds_tx0d4p"),
  491. PINCTRL_PIN(150, "lvds_tx0d4n"),
  492. PINCTRL_PIN(151, "lvds_tx0d3p"),
  493. PINCTRL_PIN(152, "lvds_tx0d3n"),
  494. PINCTRL_PIN(153, "lvds_tx0d2p"),
  495. PINCTRL_PIN(154, "lvds_tx0d2n"),
  496. PINCTRL_PIN(155, "lvds_tx0d1p"),
  497. PINCTRL_PIN(156, "lvds_tx0d1n"),
  498. PINCTRL_PIN(157, "lvds_tx0d0p"),
  499. PINCTRL_PIN(158, "lvds_tx0d0n"),
  500. PINCTRL_PIN(159, "jtag_tdo"),
  501. PINCTRL_PIN(160, "jtag_tms"),
  502. PINCTRL_PIN(161, "jtag_tck"),
  503. PINCTRL_PIN(162, "jtag_tdi"),
  504. PINCTRL_PIN(163, "jtag_trstn"),
  505. };
  506. struct atlas7_pad_config atlas7_ioc_pad_confs[] = {
  507. /* The Configuration of IOC_RTC Pads */
  508. PADCONF(0, 3, 0x0, 0x100, 0x200, -1, 0, 0, 0, 0),
  509. PADCONF(1, 3, 0x0, 0x100, 0x200, -1, 4, 2, 2, 0),
  510. PADCONF(2, 3, 0x0, 0x100, 0x200, -1, 8, 4, 4, 0),
  511. PADCONF(3, 5, 0x0, 0x100, 0x200, -1, 12, 6, 6, 0),
  512. PADCONF(4, 4, 0x0, 0x100, 0x200, -1, 16, 8, 8, 0),
  513. PADCONF(5, 4, 0x0, 0x100, 0x200, -1, 20, 10, 10, 0),
  514. PADCONF(6, 3, 0x0, 0x100, 0x200, -1, 24, 12, 12, 0),
  515. PADCONF(7, 3, 0x0, 0x100, 0x200, -1, 28, 14, 14, 0),
  516. PADCONF(8, 3, 0x8, 0x100, 0x200, -1, 0, 16, 16, 0),
  517. PADCONF(9, 3, 0x8, 0x100, 0x200, -1, 4, 18, 18, 0),
  518. PADCONF(10, 4, 0x8, 0x100, 0x200, -1, 8, 20, 20, 0),
  519. PADCONF(11, 4, 0x8, 0x100, 0x200, -1, 12, 22, 22, 0),
  520. PADCONF(12, 5, 0x8, 0x100, 0x200, -1, 16, 24, 24, 0),
  521. PADCONF(13, 6, 0x8, 0x100, 0x200, -1, 20, 26, 26, 0),
  522. PADCONF(14, 5, 0x8, 0x100, 0x200, -1, 24, 28, 28, 0),
  523. PADCONF(15, 5, 0x8, 0x100, 0x200, -1, 28, 30, 30, 0),
  524. PADCONF(16, 5, 0x10, 0x108, 0x208, -1, 0, 0, 0, 0),
  525. PADCONF(17, 5, 0x10, 0x108, 0x208, -1, 4, 2, 2, 0),
  526. /* The Configuration of IOC_TOP Pads */
  527. PADCONF(18, 5, 0x80, 0x180, 0x300, -1, 0, 0, 0, 0),
  528. PADCONF(19, 5, 0x80, 0x180, 0x300, -1, 4, 2, 2, 0),
  529. PADCONF(20, 5, 0x80, 0x180, 0x300, -1, 8, 4, 4, 0),
  530. PADCONF(21, 5, 0x80, 0x180, 0x300, -1, 12, 6, 6, 0),
  531. PADCONF(22, 5, 0x88, 0x188, 0x308, -1, 0, 0, 0, 0),
  532. PADCONF(23, 5, 0x88, 0x188, 0x308, -1, 4, 2, 2, 0),
  533. PADCONF(24, 5, 0x88, 0x188, 0x308, -1, 8, 4, 4, 0),
  534. PADCONF(25, 6, 0x88, 0x188, 0x308, -1, 12, 6, 6, 0),
  535. PADCONF(26, 5, 0x88, 0x188, 0x308, -1, 16, 8, 8, 0),
  536. PADCONF(27, 6, 0x88, 0x188, 0x308, -1, 20, 10, 10, 0),
  537. PADCONF(28, 5, 0x88, 0x188, 0x308, -1, 24, 12, 12, 0),
  538. PADCONF(29, 5, 0x88, 0x188, 0x308, -1, 28, 14, 14, 0),
  539. PADCONF(30, 5, 0x90, 0x188, 0x308, -1, 0, 16, 16, 0),
  540. PADCONF(31, 2, 0x98, 0x190, 0x310, -1, 0, 0, 0, 0),
  541. PADCONF(32, 1, 0x98, 0x190, 0x310, -1, 4, 2, 4, 0),
  542. PADCONF(33, 1, 0x98, 0x190, 0x310, -1, 8, 4, 6, 0),
  543. PADCONF(34, 1, 0x98, 0x190, 0x310, -1, 12, 6, 8, 0),
  544. PADCONF(35, 1, 0x98, 0x190, 0x310, -1, 16, 8, 10, 0),
  545. PADCONF(36, 1, 0x98, 0x190, 0x310, -1, 20, 10, 12, 0),
  546. PADCONF(37, 1, 0xa0, 0x198, 0x318, -1, 0, 0, 0, 0),
  547. PADCONF(38, 1, 0xa0, 0x198, 0x318, -1, 4, 2, 2, 0),
  548. PADCONF(39, 1, 0xa0, 0x198, 0x318, -1, 8, 4, 4, 0),
  549. PADCONF(40, 1, 0xa0, 0x198, 0x318, -1, 12, 6, 6, 0),
  550. PADCONF(41, 1, 0xa0, 0x198, 0x318, -1, 16, 8, 8, 0),
  551. PADCONF(42, 1, 0xa0, 0x198, 0x318, -1, 20, 10, 10, 0),
  552. PADCONF(43, 1, 0xa0, 0x198, 0x318, -1, 24, 12, 12, 0),
  553. PADCONF(44, 1, 0xa0, 0x198, 0x318, -1, 28, 14, 14, 0),
  554. PADCONF(45, 0, 0xa8, 0x198, 0x318, -1, 0, 16, 16, 0),
  555. PADCONF(46, 0, 0xa8, 0x198, 0x318, -1, 4, 18, 18, 0),
  556. PADCONF(47, 1, 0xa8, 0x198, 0x318, -1, 8, 20, 20, 0),
  557. PADCONF(48, 1, 0xa8, 0x198, 0x318, -1, 12, 22, 22, 0),
  558. PADCONF(49, 1, 0xa8, 0x198, 0x318, -1, 16, 24, 24, 0),
  559. PADCONF(50, 1, 0xa8, 0x198, 0x318, -1, 20, 26, 26, 0),
  560. PADCONF(51, 1, 0xa8, 0x198, 0x318, -1, 24, 28, 28, 0),
  561. PADCONF(52, 1, 0xa8, 0x198, 0x318, -1, 28, 30, 30, 0),
  562. PADCONF(53, 0, 0xb0, 0x1a0, 0x320, -1, 0, 0, 0, 0),
  563. PADCONF(54, 0, 0xb0, 0x1a0, 0x320, -1, 4, 2, 2, 0),
  564. PADCONF(55, 0, 0xb0, 0x1a0, 0x320, -1, 8, 4, 4, 0),
  565. PADCONF(56, 0, 0xb0, 0x1a0, 0x320, -1, 12, 6, 6, 0),
  566. PADCONF(57, 0, 0xb0, 0x1a0, 0x320, -1, 16, 8, 8, 0),
  567. PADCONF(58, 0, 0xb0, 0x1a0, 0x320, -1, 20, 10, 10, 0),
  568. PADCONF(59, 0, 0xb0, 0x1a0, 0x320, -1, 24, 12, 12, 0),
  569. PADCONF(60, 0, 0xb0, 0x1a0, 0x320, -1, 28, 14, 14, 0),
  570. PADCONF(61, 0, 0xb8, 0x1a0, 0x320, -1, 0, 16, 16, 0),
  571. PADCONF(62, 0, 0xb8, 0x1a0, 0x320, -1, 4, 18, 18, 0),
  572. PADCONF(63, 0, 0xb8, 0x1a0, 0x320, -1, 8, 20, 20, 0),
  573. PADCONF(64, 0, 0xb8, 0x1a0, 0x320, -1, 12, 22, 22, 0),
  574. PADCONF(65, 0, 0xb8, 0x1a0, 0x320, -1, 16, 24, 24, 0),
  575. PADCONF(66, 0, 0xb8, 0x1a0, 0x320, -1, 20, 26, 26, 0),
  576. PADCONF(67, 0, 0xb8, 0x1a0, 0x320, -1, 24, 28, 28, 0),
  577. PADCONF(68, 0, 0xb8, 0x1a0, 0x320, -1, 28, 30, 30, 0),
  578. PADCONF(69, 0, 0xc0, 0x1a8, 0x328, -1, 0, 0, 0, 0),
  579. PADCONF(70, 0, 0xc0, 0x1a8, 0x328, -1, 4, 2, 2, 0),
  580. PADCONF(71, 0, 0xc0, 0x1a8, 0x328, -1, 8, 4, 4, 0),
  581. PADCONF(72, 0, 0xc0, 0x1a8, 0x328, -1, 12, 6, 6, 0),
  582. PADCONF(73, 0, 0xc0, 0x1a8, 0x328, -1, 16, 8, 8, 0),
  583. PADCONF(74, 0, 0xc8, 0x1b0, 0x330, -1, 0, 0, 0, 0),
  584. PADCONF(75, 0, 0xc8, 0x1b0, 0x330, -1, 4, 2, 2, 0),
  585. PADCONF(76, 0, 0xc8, 0x1b0, 0x330, -1, 8, 4, 4, 0),
  586. PADCONF(77, 0, 0xc8, 0x1b0, 0x330, -1, 12, 6, 6, 0),
  587. PADCONF(78, 0, 0xc8, 0x1b0, 0x330, -1, 16, 8, 8, 0),
  588. PADCONF(79, 0, 0xc8, 0x1b0, 0x330, -1, 20, 10, 10, 0),
  589. PADCONF(80, 0, 0xc8, 0x1b0, 0x330, -1, 24, 12, 12, 0),
  590. PADCONF(81, 0, 0xc8, 0x1b0, 0x330, -1, 28, 14, 14, 0),
  591. PADCONF(82, 0, 0xd0, 0x1b0, 0x330, -1, 0, 16, 16, 0),
  592. PADCONF(83, 0, 0xd0, 0x1b0, 0x330, -1, 4, 18, 18, 0),
  593. PADCONF(84, 0, 0xd0, 0x1b0, 0x330, -1, 8, 20, 20, 0),
  594. PADCONF(85, 2, 0xd8, 0x1b8, 0x338, -1, 0, 0, 0, 0),
  595. PADCONF(86, 1, 0xd8, 0x1b8, 0x338, -1, 4, 4, 4, 0),
  596. PADCONF(87, 1, 0xd8, 0x1b8, 0x338, -1, 8, 6, 6, 0),
  597. PADCONF(88, 1, 0xd8, 0x1b8, 0x338, -1, 12, 8, 8, 0),
  598. PADCONF(89, 1, 0xd8, 0x1b8, 0x338, -1, 16, 10, 10, 0),
  599. PADCONF(90, 1, 0xd8, 0x1b8, 0x338, -1, 20, 12, 12, 0),
  600. PADCONF(91, 2, 0xe0, 0x1c0, 0x340, -1, 0, 0, 0, 0),
  601. PADCONF(92, 1, 0xe0, 0x1c0, 0x340, -1, 4, 4, 4, 0),
  602. PADCONF(93, 1, 0xe0, 0x1c0, 0x340, -1, 8, 6, 6, 0),
  603. PADCONF(94, 1, 0xe0, 0x1c0, 0x340, -1, 12, 8, 8, 0),
  604. PADCONF(95, 1, 0xe0, 0x1c0, 0x340, -1, 16, 10, 10, 0),
  605. PADCONF(96, 1, 0xe0, 0x1c0, 0x340, -1, 20, 12, 12, 0),
  606. PADCONF(97, 0, 0xe8, 0x1c8, 0x348, -1, 0, 0, 0, 0),
  607. PADCONF(98, 0, 0xe8, 0x1c8, 0x348, -1, 4, 2, 2, 0),
  608. PADCONF(99, 0, 0xe8, 0x1c8, 0x348, -1, 8, 4, 4, 0),
  609. PADCONF(100, 0, 0xe8, 0x1c8, 0x348, -1, 12, 6, 6, 0),
  610. PADCONF(101, 2, 0xe8, 0x1c8, 0x348, -1, 16, 8, 8, 0),
  611. PADCONF(102, 0, 0xe8, 0x1c8, 0x348, -1, 20, 12, 12, 0),
  612. PADCONF(103, 0, 0xe8, 0x1c8, 0x348, -1, 24, 14, 14, 0),
  613. PADCONF(104, 0, 0xe8, 0x1c8, 0x348, -1, 28, 16, 16, 0),
  614. PADCONF(105, 0, 0xf0, 0x1c8, 0x348, -1, 0, 18, 18, 0),
  615. PADCONF(106, 0, 0xf0, 0x1c8, 0x348, -1, 4, 20, 20, 0),
  616. PADCONF(107, 0, 0xf0, 0x1c8, 0x348, -1, 8, 22, 22, 0),
  617. PADCONF(108, 0, 0xf0, 0x1c8, 0x348, -1, 12, 24, 24, 0),
  618. PADCONF(109, 1, 0xf0, 0x1c8, 0x348, -1, 16, 26, 26, 0),
  619. PADCONF(110, 0, 0xf0, 0x1c8, 0x348, -1, 20, 28, 28, 0),
  620. PADCONF(111, 1, 0xf0, 0x1c8, 0x348, -1, 24, 30, 30, 0),
  621. PADCONF(112, 5, 0xf8, 0x200, 0x350, -1, 0, 0, 0, 0),
  622. PADCONF(113, 5, 0xf8, 0x200, 0x350, -1, 4, 2, 2, 0),
  623. PADCONF(114, 5, 0xf8, 0x200, 0x350, -1, 8, 4, 4, 0),
  624. PADCONF(115, 5, 0xf8, 0x200, 0x350, -1, 12, 6, 6, 0),
  625. PADCONF(116, 5, 0xf8, 0x200, 0x350, -1, 16, 8, 8, 0),
  626. PADCONF(117, 5, 0xf8, 0x200, 0x350, -1, 20, 10, 10, 0),
  627. PADCONF(118, 5, 0xf8, 0x200, 0x350, -1, 24, 12, 12, 0),
  628. PADCONF(119, 5, 0x100, 0x250, 0x358, -1, 0, 0, 0, 0),
  629. PADCONF(120, 5, 0x100, 0x250, 0x358, -1, 4, 2, 2, 0),
  630. PADCONF(121, 5, 0x100, 0x250, 0x358, -1, 8, 4, 4, 0),
  631. PADCONF(122, 5, 0x100, 0x250, 0x358, -1, 12, 6, 6, 0),
  632. PADCONF(123, 6, 0x100, 0x250, 0x358, -1, 16, 8, 8, 0),
  633. PADCONF(124, 6, 0x100, 0x250, 0x358, -1, 20, 10, 10, 0),
  634. PADCONF(125, 6, 0x100, 0x250, 0x358, -1, 24, 12, 12, 0),
  635. PADCONF(126, 6, 0x100, 0x250, 0x358, -1, 28, 14, 14, 0),
  636. PADCONF(127, 6, 0x108, 0x250, 0x358, -1, 16, 24, 24, 0),
  637. PADCONF(128, 6, 0x108, 0x250, 0x358, -1, 20, 26, 26, 0),
  638. PADCONF(129, 0, 0x110, 0x258, 0x360, -1, 0, 0, 0, 0),
  639. PADCONF(130, 0, 0x110, 0x258, 0x360, -1, 4, 2, 2, 0),
  640. PADCONF(131, 0, 0x110, 0x258, 0x360, -1, 8, 4, 4, 0),
  641. PADCONF(132, 0, 0x110, 0x258, 0x360, -1, 12, 6, 6, 0),
  642. PADCONF(133, 6, 0x118, 0x260, 0x368, -1, 0, 0, 0, 0),
  643. PADCONF(134, 6, 0x118, 0x260, 0x368, -1, 4, 2, 2, 0),
  644. PADCONF(135, 6, 0x118, 0x260, 0x368, -1, 16, 8, 8, 0),
  645. PADCONF(136, 6, 0x118, 0x260, 0x368, -1, 20, 10, 10, 0),
  646. PADCONF(137, 6, 0x118, 0x260, 0x368, -1, 24, 12, 12, 0),
  647. PADCONF(138, 6, 0x118, 0x260, 0x368, -1, 28, 14, 14, 0),
  648. PADCONF(139, 6, 0x120, 0x260, 0x368, -1, 0, 16, 16, 0),
  649. PADCONF(140, 6, 0x120, 0x260, 0x368, -1, 4, 18, 18, 0),
  650. PADCONF(141, 5, 0x128, 0x268, 0x378, -1, 0, 0, 0, 0),
  651. PADCONF(142, 5, 0x128, 0x268, 0x378, -1, 4, 2, 2, 0),
  652. PADCONF(143, 5, 0x128, 0x268, 0x378, -1, 8, 4, 4, 0),
  653. PADCONF(144, 5, 0x128, 0x268, 0x378, -1, 12, 6, 6, 0),
  654. PADCONF(145, 5, 0x128, 0x268, 0x378, -1, 16, 8, 8, 0),
  655. PADCONF(146, 5, 0x128, 0x268, 0x378, -1, 20, 10, 10, 0),
  656. PADCONF(147, 5, 0x128, 0x268, 0x378, -1, 24, 12, 12, 0),
  657. PADCONF(148, 5, 0x128, 0x268, 0x378, -1, 28, 14, 14, 0),
  658. PADCONF(149, 7, 0x130, 0x270, -1, 0x480, 0, 0, 0, 0),
  659. PADCONF(150, 7, 0x130, 0x270, -1, 0x480, 4, 2, 0, 1),
  660. PADCONF(151, 7, 0x130, 0x270, -1, 0x480, 8, 4, 0, 2),
  661. PADCONF(152, 7, 0x130, 0x270, -1, 0x480, 12, 6, 0, 3),
  662. PADCONF(153, 7, 0x130, 0x270, -1, 0x480, 16, 8, 0, 4),
  663. PADCONF(154, 7, 0x130, 0x270, -1, 0x480, 20, 10, 0, 5),
  664. PADCONF(155, 7, 0x130, 0x270, -1, 0x480, 24, 12, 0, 6),
  665. PADCONF(156, 7, 0x130, 0x270, -1, 0x480, 28, 14, 0, 7),
  666. PADCONF(157, 7, 0x138, 0x278, -1, 0x480, 0, 0, 0, 8),
  667. PADCONF(158, 7, 0x138, 0x278, -1, 0x480, 4, 2, 0, 9),
  668. PADCONF(159, 5, 0x140, 0x280, 0x380, -1, 0, 0, 0, 0),
  669. PADCONF(160, 6, 0x140, 0x280, 0x380, -1, 4, 2, 2, 0),
  670. PADCONF(161, 5, 0x140, 0x280, 0x380, -1, 8, 4, 4, 0),
  671. PADCONF(162, 6, 0x140, 0x280, 0x380, -1, 12, 6, 6, 0),
  672. PADCONF(163, 6, 0x140, 0x280, 0x380, -1, 16, 8, 8, 0),
  673. };
  674. /* pin list of each pin group */
  675. static const unsigned int gnss_gpio_pins[] = { 119, 120, 121, 122, 123, 124,
  676. 125, 126, 127, 128, 22, 23, 24, 25, 26, 27, 28, 29, 30, };
  677. static const unsigned int lcd_vip_gpio_pins[] = { 74, 75, 76, 77, 78, 79, 80,
  678. 81, 82, 83, 84, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  679. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, };
  680. static const unsigned int sdio_i2s_gpio_pins[] = { 31, 32, 33, 34, 35, 36,
  681. 85, 86, 87, 88, 89, 90, 129, 130, 131, 132, 91, 92, 93, 94,
  682. 95, 96, 112, 113, 114, 115, 116, 117, 118, };
  683. static const unsigned int sp_rgmii_gpio_pins[] = { 97, 98, 99, 100, 101, 102,
  684. 103, 104, 105, 106, 107, 108, 109, 110, 111, 18, 19, 20, 21,
  685. 141, 142, 143, 144, 145, 146, 147, 148, };
  686. static const unsigned int lvds_gpio_pins[] = { 157, 158, 155, 156, 153, 154,
  687. 151, 152, 149, 150, };
  688. static const unsigned int jtag_uart_nand_gpio_pins[] = { 44, 43, 42, 41, 40,
  689. 39, 38, 37, 46, 47, 48, 49, 50, 52, 51, 45, 133, 134, 135,
  690. 136, 137, 138, 139, 140, 159, 160, 161, 162, 163, };
  691. static const unsigned int rtc_gpio_pins[] = { 0, 1, 2, 3, 4, 10, 11, 12, 13,
  692. 14, 15, 16, 17, 9, };
  693. static const unsigned int audio_ac97_pins[] = { 113, 118, 115, 114, };
  694. static const unsigned int audio_digmic_pins0[] = { 51, };
  695. static const unsigned int audio_digmic_pins1[] = { 122, };
  696. static const unsigned int audio_digmic_pins2[] = { 161, };
  697. static const unsigned int audio_func_dbg_pins[] = { 141, 144, 44, 43, 42, 41,
  698. 40, 39, 38, 37, 74, 75, 76, 77, 78, 79, 81, 113, 114, 118,
  699. 115, 49, 50, 142, 143, 80, };
  700. static const unsigned int audio_i2s_pins[] = { 118, 115, 116, 117, 112, 113,
  701. 114, };
  702. static const unsigned int audio_i2s_2ch_pins[] = { 118, 115, 112, 113, 114, };
  703. static const unsigned int audio_i2s_extclk_pins[] = { 112, };
  704. static const unsigned int audio_spdif_out_pins0[] = { 112, };
  705. static const unsigned int audio_spdif_out_pins1[] = { 116, };
  706. static const unsigned int audio_spdif_out_pins2[] = { 142, };
  707. static const unsigned int audio_uart0_basic_pins[] = { 143, 142, 141, 144, };
  708. static const unsigned int audio_uart0_urfs_pins0[] = { 117, };
  709. static const unsigned int audio_uart0_urfs_pins1[] = { 139, };
  710. static const unsigned int audio_uart0_urfs_pins2[] = { 163, };
  711. static const unsigned int audio_uart0_urfs_pins3[] = { 162, };
  712. static const unsigned int audio_uart1_basic_pins[] = { 147, 146, 145, 148, };
  713. static const unsigned int audio_uart1_urfs_pins0[] = { 117, };
  714. static const unsigned int audio_uart1_urfs_pins1[] = { 140, };
  715. static const unsigned int audio_uart1_urfs_pins2[] = { 163, };
  716. static const unsigned int audio_uart2_urfs_pins0[] = { 139, };
  717. static const unsigned int audio_uart2_urfs_pins1[] = { 163, };
  718. static const unsigned int audio_uart2_urfs_pins2[] = { 96, };
  719. static const unsigned int audio_uart2_urxd_pins0[] = { 20, };
  720. static const unsigned int audio_uart2_urxd_pins1[] = { 109, };
  721. static const unsigned int audio_uart2_urxd_pins2[] = { 93, };
  722. static const unsigned int audio_uart2_usclk_pins0[] = { 19, };
  723. static const unsigned int audio_uart2_usclk_pins1[] = { 101, };
  724. static const unsigned int audio_uart2_usclk_pins2[] = { 91, };
  725. static const unsigned int audio_uart2_utfs_pins0[] = { 18, };
  726. static const unsigned int audio_uart2_utfs_pins1[] = { 111, };
  727. static const unsigned int audio_uart2_utfs_pins2[] = { 94, };
  728. static const unsigned int audio_uart2_utxd_pins0[] = { 21, };
  729. static const unsigned int audio_uart2_utxd_pins1[] = { 110, };
  730. static const unsigned int audio_uart2_utxd_pins2[] = { 92, };
  731. static const unsigned int c_can_trnsvr_en_pins0[] = { 2, };
  732. static const unsigned int c_can_trnsvr_en_pins1[] = { 0, };
  733. static const unsigned int c_can_trnsvr_intr_pins[] = { 1, };
  734. static const unsigned int c_can_trnsvr_stb_n_pins[] = { 3, };
  735. static const unsigned int c0_can_rxd_trnsv0_pins[] = { 11, };
  736. static const unsigned int c0_can_rxd_trnsv1_pins[] = { 2, };
  737. static const unsigned int c0_can_txd_trnsv0_pins[] = { 10, };
  738. static const unsigned int c0_can_txd_trnsv1_pins[] = { 3, };
  739. static const unsigned int c1_can_rxd_pins0[] = { 138, };
  740. static const unsigned int c1_can_rxd_pins1[] = { 147, };
  741. static const unsigned int c1_can_rxd_pins2[] = { 2, };
  742. static const unsigned int c1_can_rxd_pins3[] = { 162, };
  743. static const unsigned int c1_can_txd_pins0[] = { 137, };
  744. static const unsigned int c1_can_txd_pins1[] = { 146, };
  745. static const unsigned int c1_can_txd_pins2[] = { 3, };
  746. static const unsigned int c1_can_txd_pins3[] = { 161, };
  747. static const unsigned int ca_audio_lpc_pins[] = { 62, 63, 64, 65, 66, 67, 68,
  748. 69, 70, 71, };
  749. static const unsigned int ca_bt_lpc_pins[] = { 85, 86, 87, 88, 89, 90, };
  750. static const unsigned int ca_coex_pins[] = { 129, 130, 131, 132, };
  751. static const unsigned int ca_curator_lpc_pins[] = { 57, 58, 59, 60, };
  752. static const unsigned int ca_pcm_debug_pins[] = { 91, 93, 94, 92, };
  753. static const unsigned int ca_pio_pins[] = { 121, 122, 125, 126, 38, 37, 47,
  754. 49, 50, 54, 55, 56, };
  755. static const unsigned int ca_sdio_debug_pins[] = { 40, 39, 44, 43, 42, 41, };
  756. static const unsigned int ca_spi_pins[] = { 82, 79, 80, 81, };
  757. static const unsigned int ca_trb_pins[] = { 91, 93, 94, 95, 96, 78, 74, 75,
  758. 76, 77, };
  759. static const unsigned int ca_uart_debug_pins[] = { 136, 135, 134, 133, };
  760. static const unsigned int clkc_pins0[] = { 30, 47, };
  761. static const unsigned int clkc_pins1[] = { 78, 54, };
  762. static const unsigned int gn_gnss_i2c_pins[] = { 128, 127, };
  763. static const unsigned int gn_gnss_uart_nopause_pins[] = { 134, 133, };
  764. static const unsigned int gn_gnss_uart_pins[] = { 134, 133, 136, 135, };
  765. static const unsigned int gn_trg_spi_pins0[] = { 22, 25, 23, 24, };
  766. static const unsigned int gn_trg_spi_pins1[] = { 82, 79, 80, 81, };
  767. static const unsigned int cvbs_dbg_pins[] = { 54, 53, 82, 74, 75, 76, 77, 78,
  768. 79, 80, 81, 83, 84, 73, 55, 56, };
  769. static const unsigned int cvbs_dbg_test_pins0[] = { 57, };
  770. static const unsigned int cvbs_dbg_test_pins1[] = { 58, };
  771. static const unsigned int cvbs_dbg_test_pins2[] = { 59, };
  772. static const unsigned int cvbs_dbg_test_pins3[] = { 60, };
  773. static const unsigned int cvbs_dbg_test_pins4[] = { 61, };
  774. static const unsigned int cvbs_dbg_test_pins5[] = { 62, };
  775. static const unsigned int cvbs_dbg_test_pins6[] = { 63, };
  776. static const unsigned int cvbs_dbg_test_pins7[] = { 64, };
  777. static const unsigned int cvbs_dbg_test_pins8[] = { 65, };
  778. static const unsigned int cvbs_dbg_test_pins9[] = { 66, };
  779. static const unsigned int cvbs_dbg_test_pins10[] = { 67, };
  780. static const unsigned int cvbs_dbg_test_pins11[] = { 68, };
  781. static const unsigned int cvbs_dbg_test_pins12[] = { 69, };
  782. static const unsigned int cvbs_dbg_test_pins13[] = { 70, };
  783. static const unsigned int cvbs_dbg_test_pins14[] = { 71, };
  784. static const unsigned int cvbs_dbg_test_pins15[] = { 72, };
  785. static const unsigned int gn_gnss_power_pins[] = { 123, 124, 121, 122, 125,
  786. 120, };
  787. static const unsigned int gn_gnss_sw_status_pins[] = { 57, 58, 59, 60, 61,
  788. 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 53, 55, 56, 54, };
  789. static const unsigned int gn_gnss_eclk_pins[] = { 113, };
  790. static const unsigned int gn_gnss_irq1_pins0[] = { 112, };
  791. static const unsigned int gn_gnss_irq2_pins0[] = { 118, };
  792. static const unsigned int gn_gnss_tm_pins[] = { 115, };
  793. static const unsigned int gn_gnss_tsync_pins[] = { 114, };
  794. static const unsigned int gn_io_gnsssys_sw_cfg_pins[] = { 44, 43, 42, 41, 40,
  795. 39, 38, 37, 49, 50, 91, 92, 93, 94, 95, 96, };
  796. static const unsigned int gn_trg_pins0[] = { 29, 28, 26, 27, };
  797. static const unsigned int gn_trg_pins1[] = { 77, 76, 74, 75, };
  798. static const unsigned int gn_trg_shutdown_pins0[] = { 30, };
  799. static const unsigned int gn_trg_shutdown_pins1[] = { 83, };
  800. static const unsigned int gn_trg_shutdown_pins2[] = { 117, };
  801. static const unsigned int gn_trg_shutdown_pins3[] = { 123, };
  802. static const unsigned int i2c0_pins[] = { 128, 127, };
  803. static const unsigned int i2c1_pins[] = { 126, 125, };
  804. static const unsigned int i2s0_pins[] = { 91, 93, 94, 92, };
  805. static const unsigned int i2s1_basic_pins[] = { 95, 96, };
  806. static const unsigned int i2s1_rxd0_pins0[] = { 61, };
  807. static const unsigned int i2s1_rxd0_pins1[] = { 131, };
  808. static const unsigned int i2s1_rxd0_pins2[] = { 129, };
  809. static const unsigned int i2s1_rxd0_pins3[] = { 117, };
  810. static const unsigned int i2s1_rxd0_pins4[] = { 83, };
  811. static const unsigned int i2s1_rxd1_pins0[] = { 72, };
  812. static const unsigned int i2s1_rxd1_pins1[] = { 132, };
  813. static const unsigned int i2s1_rxd1_pins2[] = { 130, };
  814. static const unsigned int i2s1_rxd1_pins3[] = { 118, };
  815. static const unsigned int i2s1_rxd1_pins4[] = { 84, };
  816. static const unsigned int jtag_jt_dbg_nsrst_pins[] = { 125, };
  817. static const unsigned int jtag_ntrst_pins0[] = { 4, };
  818. static const unsigned int jtag_ntrst_pins1[] = { 163, };
  819. static const unsigned int jtag_swdiotms_pins0[] = { 2, };
  820. static const unsigned int jtag_swdiotms_pins1[] = { 160, };
  821. static const unsigned int jtag_tck_pins0[] = { 0, };
  822. static const unsigned int jtag_tck_pins1[] = { 161, };
  823. static const unsigned int jtag_tdi_pins0[] = { 1, };
  824. static const unsigned int jtag_tdi_pins1[] = { 162, };
  825. static const unsigned int jtag_tdo_pins0[] = { 3, };
  826. static const unsigned int jtag_tdo_pins1[] = { 159, };
  827. static const unsigned int ks_kas_spi_pins0[] = { 141, 144, 143, 142, };
  828. static const unsigned int ld_ldd_pins[] = { 57, 58, 59, 60, 61, 62, 63, 64,
  829. 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80,
  830. 81, 56, 53, };
  831. static const unsigned int ld_ldd_16bit_pins[] = { 57, 58, 59, 60, 61, 62, 63,
  832. 64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, };
  833. static const unsigned int ld_ldd_fck_pins[] = { 55, };
  834. static const unsigned int ld_ldd_lck_pins[] = { 54, };
  835. static const unsigned int lr_lcdrom_pins[] = { 73, 54, 57, 58, 59, 60, 61,
  836. 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, 55, };
  837. static const unsigned int lvds_analog_pins[] = { 149, 150, 151, 152, 153, 154,
  838. 155, 156, 157, 158, };
  839. static const unsigned int nd_df_basic_pins[] = { 44, 43, 42, 41, 40, 39, 38,
  840. 37, 47, 46, 52, 45, 49, 50, 48, };
  841. static const unsigned int nd_df_wp_pins[] = { 124, };
  842. static const unsigned int nd_df_cs_pins[] = { 51, };
  843. static const unsigned int ps_pins[] = { 120, 119, 121, };
  844. static const unsigned int ps_no_dir_pins[] = { 119, };
  845. static const unsigned int pwc_core_on_pins[] = { 8, };
  846. static const unsigned int pwc_ext_on_pins[] = { 6, };
  847. static const unsigned int pwc_gpio3_clk_pins[] = { 3, };
  848. static const unsigned int pwc_io_on_pins[] = { 9, };
  849. static const unsigned int pwc_lowbatt_b_pins0[] = { 4, };
  850. static const unsigned int pwc_mem_on_pins[] = { 7, };
  851. static const unsigned int pwc_on_key_b_pins0[] = { 5, };
  852. static const unsigned int pwc_wakeup_src0_pins[] = { 0, };
  853. static const unsigned int pwc_wakeup_src1_pins[] = { 1, };
  854. static const unsigned int pwc_wakeup_src2_pins[] = { 2, };
  855. static const unsigned int pwc_wakeup_src3_pins[] = { 3, };
  856. static const unsigned int pw_cko0_pins0[] = { 123, };
  857. static const unsigned int pw_cko0_pins1[] = { 101, };
  858. static const unsigned int pw_cko0_pins2[] = { 82, };
  859. static const unsigned int pw_cko0_pins3[] = { 162, };
  860. static const unsigned int pw_cko1_pins0[] = { 124, };
  861. static const unsigned int pw_cko1_pins1[] = { 110, };
  862. static const unsigned int pw_cko1_pins2[] = { 163, };
  863. static const unsigned int pw_i2s01_clk_pins0[] = { 125, };
  864. static const unsigned int pw_i2s01_clk_pins1[] = { 117, };
  865. static const unsigned int pw_i2s01_clk_pins2[] = { 132, };
  866. static const unsigned int pw_pwm0_pins0[] = { 119, };
  867. static const unsigned int pw_pwm0_pins1[] = { 159, };
  868. static const unsigned int pw_pwm1_pins0[] = { 120, };
  869. static const unsigned int pw_pwm1_pins1[] = { 160, };
  870. static const unsigned int pw_pwm1_pins2[] = { 131, };
  871. static const unsigned int pw_pwm2_pins0[] = { 121, };
  872. static const unsigned int pw_pwm2_pins1[] = { 98, };
  873. static const unsigned int pw_pwm2_pins2[] = { 161, };
  874. static const unsigned int pw_pwm3_pins0[] = { 122, };
  875. static const unsigned int pw_pwm3_pins1[] = { 73, };
  876. static const unsigned int pw_pwm_cpu_vol_pins0[] = { 121, };
  877. static const unsigned int pw_pwm_cpu_vol_pins1[] = { 98, };
  878. static const unsigned int pw_pwm_cpu_vol_pins2[] = { 161, };
  879. static const unsigned int pw_backlight_pins0[] = { 122, };
  880. static const unsigned int pw_backlight_pins1[] = { 73, };
  881. static const unsigned int rg_eth_mac_pins[] = { 108, 103, 104, 105, 106, 107,
  882. 102, 97, 98, 99, 100, 101, };
  883. static const unsigned int rg_gmac_phy_intr_n_pins[] = { 111, };
  884. static const unsigned int rg_rgmii_mac_pins[] = { 109, 110, };
  885. static const unsigned int rg_rgmii_phy_ref_clk_pins0[] = { 111, };
  886. static const unsigned int rg_rgmii_phy_ref_clk_pins1[] = { 53, };
  887. static const unsigned int sd0_pins[] = { 46, 47, 44, 43, 42, 41, 40, 39, 38,
  888. 37, };
  889. static const unsigned int sd0_4bit_pins[] = { 46, 47, 44, 43, 42, 41, };
  890. static const unsigned int sd1_pins[] = { 48, 49, 44, 43, 42, 41, 40, 39, 38,
  891. 37, };
  892. static const unsigned int sd1_4bit_pins0[] = { 48, 49, 44, 43, 42, 41, };
  893. static const unsigned int sd1_4bit_pins1[] = { 48, 49, 40, 39, 38, 37, };
  894. static const unsigned int sd2_basic_pins[] = { 31, 32, 33, 34, 35, 36, };
  895. static const unsigned int sd2_cdb_pins0[] = { 124, };
  896. static const unsigned int sd2_cdb_pins1[] = { 161, };
  897. static const unsigned int sd2_wpb_pins0[] = { 123, };
  898. static const unsigned int sd2_wpb_pins1[] = { 163, };
  899. static const unsigned int sd3_9_pins[] = { 85, 86, 87, 88, 89, 90, };
  900. static const unsigned int sd5_pins[] = { 91, 92, 93, 94, 95, 96, };
  901. static const unsigned int sd6_pins0[] = { 79, 78, 74, 75, 76, 77, };
  902. static const unsigned int sd6_pins1[] = { 101, 99, 100, 110, 109, 111, };
  903. static const unsigned int sp0_ext_ldo_on_pins[] = { 4, };
  904. static const unsigned int sp0_qspi_pins[] = { 12, 13, 14, 15, 16, 17, };
  905. static const unsigned int sp1_spi_pins[] = { 19, 20, 21, 18, };
  906. static const unsigned int tpiu_trace_pins[] = { 53, 56, 57, 58, 59, 60, 61,
  907. 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, };
  908. static const unsigned int uart0_pins[] = { 121, 120, 134, 133, };
  909. static const unsigned int uart0_nopause_pins[] = { 134, 133, };
  910. static const unsigned int uart1_pins[] = { 136, 135, };
  911. static const unsigned int uart2_cts_pins0[] = { 132, };
  912. static const unsigned int uart2_cts_pins1[] = { 162, };
  913. static const unsigned int uart2_rts_pins0[] = { 131, };
  914. static const unsigned int uart2_rts_pins1[] = { 161, };
  915. static const unsigned int uart2_rxd_pins0[] = { 11, };
  916. static const unsigned int uart2_rxd_pins1[] = { 160, };
  917. static const unsigned int uart2_rxd_pins2[] = { 130, };
  918. static const unsigned int uart2_txd_pins0[] = { 10, };
  919. static const unsigned int uart2_txd_pins1[] = { 159, };
  920. static const unsigned int uart2_txd_pins2[] = { 129, };
  921. static const unsigned int uart3_cts_pins0[] = { 125, };
  922. static const unsigned int uart3_cts_pins1[] = { 111, };
  923. static const unsigned int uart3_cts_pins2[] = { 140, };
  924. static const unsigned int uart3_rts_pins0[] = { 126, };
  925. static const unsigned int uart3_rts_pins1[] = { 109, };
  926. static const unsigned int uart3_rts_pins2[] = { 139, };
  927. static const unsigned int uart3_rxd_pins0[] = { 138, };
  928. static const unsigned int uart3_rxd_pins1[] = { 84, };
  929. static const unsigned int uart3_rxd_pins2[] = { 162, };
  930. static const unsigned int uart3_txd_pins0[] = { 137, };
  931. static const unsigned int uart3_txd_pins1[] = { 83, };
  932. static const unsigned int uart3_txd_pins2[] = { 161, };
  933. static const unsigned int uart4_basic_pins[] = { 140, 139, };
  934. static const unsigned int uart4_cts_pins0[] = { 122, };
  935. static const unsigned int uart4_cts_pins1[] = { 100, };
  936. static const unsigned int uart4_cts_pins2[] = { 117, };
  937. static const unsigned int uart4_rts_pins0[] = { 123, };
  938. static const unsigned int uart4_rts_pins1[] = { 99, };
  939. static const unsigned int uart4_rts_pins2[] = { 116, };
  940. static const unsigned int usb0_drvvbus_pins0[] = { 51, };
  941. static const unsigned int usb0_drvvbus_pins1[] = { 162, };
  942. static const unsigned int usb1_drvvbus_pins0[] = { 134, };
  943. static const unsigned int usb1_drvvbus_pins1[] = { 163, };
  944. static const unsigned int visbus_dout_pins[] = { 57, 58, 59, 60, 61, 62, 63,
  945. 64, 65, 66, 67, 68, 69, 70, 71, 72, 53, 54, 55, 56, 85, 86,
  946. 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, };
  947. static const unsigned int vi_vip1_pins[] = { 74, 75, 76, 77, 78, 79, 80, 81,
  948. 82, 83, 84, 103, 104, 105, 106, 107, 102, 97, 98, };
  949. static const unsigned int vi_vip1_ext_pins[] = { 74, 75, 76, 77, 78, 79, 80,
  950. 81, 82, 83, 84, 108, 103, 104, 105, 106, 107, 102, 97, 98,
  951. 99, 100, };
  952. static const unsigned int vi_vip1_low8bit_pins[] = { 74, 75, 76, 77, 78, 79,
  953. 80, 81, 82, 83, 84, };
  954. static const unsigned int vi_vip1_high8bit_pins[] = { 82, 83, 84, 103, 104,
  955. 105, 106, 107, 102, 97, 98, };
  956. /* definition of pin group table */
  957. struct atlas7_pin_group altas7_pin_groups[] = {
  958. GROUP("gnss_gpio_grp", gnss_gpio_pins),
  959. GROUP("lcd_vip_gpio_grp", lcd_vip_gpio_pins),
  960. GROUP("sdio_i2s_gpio_grp", sdio_i2s_gpio_pins),
  961. GROUP("sp_rgmii_gpio_grp", sp_rgmii_gpio_pins),
  962. GROUP("lvds_gpio_grp", lvds_gpio_pins),
  963. GROUP("jtag_uart_nand_gpio_grp", jtag_uart_nand_gpio_pins),
  964. GROUP("rtc_gpio_grp", rtc_gpio_pins),
  965. GROUP("audio_ac97_grp", audio_ac97_pins),
  966. GROUP("audio_digmic_grp0", audio_digmic_pins0),
  967. GROUP("audio_digmic_grp1", audio_digmic_pins1),
  968. GROUP("audio_digmic_grp2", audio_digmic_pins2),
  969. GROUP("audio_func_dbg_grp", audio_func_dbg_pins),
  970. GROUP("audio_i2s_grp", audio_i2s_pins),
  971. GROUP("audio_i2s_2ch_grp", audio_i2s_2ch_pins),
  972. GROUP("audio_i2s_extclk_grp", audio_i2s_extclk_pins),
  973. GROUP("audio_spdif_out_grp0", audio_spdif_out_pins0),
  974. GROUP("audio_spdif_out_grp1", audio_spdif_out_pins1),
  975. GROUP("audio_spdif_out_grp2", audio_spdif_out_pins2),
  976. GROUP("audio_uart0_basic_grp", audio_uart0_basic_pins),
  977. GROUP("audio_uart0_urfs_grp0", audio_uart0_urfs_pins0),
  978. GROUP("audio_uart0_urfs_grp1", audio_uart0_urfs_pins1),
  979. GROUP("audio_uart0_urfs_grp2", audio_uart0_urfs_pins2),
  980. GROUP("audio_uart0_urfs_grp3", audio_uart0_urfs_pins3),
  981. GROUP("audio_uart1_basic_grp", audio_uart1_basic_pins),
  982. GROUP("audio_uart1_urfs_grp0", audio_uart1_urfs_pins0),
  983. GROUP("audio_uart1_urfs_grp1", audio_uart1_urfs_pins1),
  984. GROUP("audio_uart1_urfs_grp2", audio_uart1_urfs_pins2),
  985. GROUP("audio_uart2_urfs_grp0", audio_uart2_urfs_pins0),
  986. GROUP("audio_uart2_urfs_grp1", audio_uart2_urfs_pins1),
  987. GROUP("audio_uart2_urfs_grp2", audio_uart2_urfs_pins2),
  988. GROUP("audio_uart2_urxd_grp0", audio_uart2_urxd_pins0),
  989. GROUP("audio_uart2_urxd_grp1", audio_uart2_urxd_pins1),
  990. GROUP("audio_uart2_urxd_grp2", audio_uart2_urxd_pins2),
  991. GROUP("audio_uart2_usclk_grp0", audio_uart2_usclk_pins0),
  992. GROUP("audio_uart2_usclk_grp1", audio_uart2_usclk_pins1),
  993. GROUP("audio_uart2_usclk_grp2", audio_uart2_usclk_pins2),
  994. GROUP("audio_uart2_utfs_grp0", audio_uart2_utfs_pins0),
  995. GROUP("audio_uart2_utfs_grp1", audio_uart2_utfs_pins1),
  996. GROUP("audio_uart2_utfs_grp2", audio_uart2_utfs_pins2),
  997. GROUP("audio_uart2_utxd_grp0", audio_uart2_utxd_pins0),
  998. GROUP("audio_uart2_utxd_grp1", audio_uart2_utxd_pins1),
  999. GROUP("audio_uart2_utxd_grp2", audio_uart2_utxd_pins2),
  1000. GROUP("c_can_trnsvr_en_grp0", c_can_trnsvr_en_pins0),
  1001. GROUP("c_can_trnsvr_en_grp1", c_can_trnsvr_en_pins1),
  1002. GROUP("c_can_trnsvr_intr_grp", c_can_trnsvr_intr_pins),
  1003. GROUP("c_can_trnsvr_stb_n_grp", c_can_trnsvr_stb_n_pins),
  1004. GROUP("c0_can_rxd_trnsv0_grp", c0_can_rxd_trnsv0_pins),
  1005. GROUP("c0_can_rxd_trnsv1_grp", c0_can_rxd_trnsv1_pins),
  1006. GROUP("c0_can_txd_trnsv0_grp", c0_can_txd_trnsv0_pins),
  1007. GROUP("c0_can_txd_trnsv1_grp", c0_can_txd_trnsv1_pins),
  1008. GROUP("c1_can_rxd_grp0", c1_can_rxd_pins0),
  1009. GROUP("c1_can_rxd_grp1", c1_can_rxd_pins1),
  1010. GROUP("c1_can_rxd_grp2", c1_can_rxd_pins2),
  1011. GROUP("c1_can_rxd_grp3", c1_can_rxd_pins3),
  1012. GROUP("c1_can_txd_grp0", c1_can_txd_pins0),
  1013. GROUP("c1_can_txd_grp1", c1_can_txd_pins1),
  1014. GROUP("c1_can_txd_grp2", c1_can_txd_pins2),
  1015. GROUP("c1_can_txd_grp3", c1_can_txd_pins3),
  1016. GROUP("ca_audio_lpc_grp", ca_audio_lpc_pins),
  1017. GROUP("ca_bt_lpc_grp", ca_bt_lpc_pins),
  1018. GROUP("ca_coex_grp", ca_coex_pins),
  1019. GROUP("ca_curator_lpc_grp", ca_curator_lpc_pins),
  1020. GROUP("ca_pcm_debug_grp", ca_pcm_debug_pins),
  1021. GROUP("ca_pio_grp", ca_pio_pins),
  1022. GROUP("ca_sdio_debug_grp", ca_sdio_debug_pins),
  1023. GROUP("ca_spi_grp", ca_spi_pins),
  1024. GROUP("ca_trb_grp", ca_trb_pins),
  1025. GROUP("ca_uart_debug_grp", ca_uart_debug_pins),
  1026. GROUP("clkc_grp0", clkc_pins0),
  1027. GROUP("clkc_grp1", clkc_pins1),
  1028. GROUP("gn_gnss_i2c_grp", gn_gnss_i2c_pins),
  1029. GROUP("gn_gnss_uart_nopause_grp", gn_gnss_uart_nopause_pins),
  1030. GROUP("gn_gnss_uart_grp", gn_gnss_uart_pins),
  1031. GROUP("gn_trg_spi_grp0", gn_trg_spi_pins0),
  1032. GROUP("gn_trg_spi_grp1", gn_trg_spi_pins1),
  1033. GROUP("cvbs_dbg_grp", cvbs_dbg_pins),
  1034. GROUP("cvbs_dbg_test_grp0", cvbs_dbg_test_pins0),
  1035. GROUP("cvbs_dbg_test_grp1", cvbs_dbg_test_pins1),
  1036. GROUP("cvbs_dbg_test_grp2", cvbs_dbg_test_pins2),
  1037. GROUP("cvbs_dbg_test_grp3", cvbs_dbg_test_pins3),
  1038. GROUP("cvbs_dbg_test_grp4", cvbs_dbg_test_pins4),
  1039. GROUP("cvbs_dbg_test_grp5", cvbs_dbg_test_pins5),
  1040. GROUP("cvbs_dbg_test_grp6", cvbs_dbg_test_pins6),
  1041. GROUP("cvbs_dbg_test_grp7", cvbs_dbg_test_pins7),
  1042. GROUP("cvbs_dbg_test_grp8", cvbs_dbg_test_pins8),
  1043. GROUP("cvbs_dbg_test_grp9", cvbs_dbg_test_pins9),
  1044. GROUP("cvbs_dbg_test_grp10", cvbs_dbg_test_pins10),
  1045. GROUP("cvbs_dbg_test_grp11", cvbs_dbg_test_pins11),
  1046. GROUP("cvbs_dbg_test_grp12", cvbs_dbg_test_pins12),
  1047. GROUP("cvbs_dbg_test_grp13", cvbs_dbg_test_pins13),
  1048. GROUP("cvbs_dbg_test_grp14", cvbs_dbg_test_pins14),
  1049. GROUP("cvbs_dbg_test_grp15", cvbs_dbg_test_pins15),
  1050. GROUP("gn_gnss_power_grp", gn_gnss_power_pins),
  1051. GROUP("gn_gnss_sw_status_grp", gn_gnss_sw_status_pins),
  1052. GROUP("gn_gnss_eclk_grp", gn_gnss_eclk_pins),
  1053. GROUP("gn_gnss_irq1_grp0", gn_gnss_irq1_pins0),
  1054. GROUP("gn_gnss_irq2_grp0", gn_gnss_irq2_pins0),
  1055. GROUP("gn_gnss_tm_grp", gn_gnss_tm_pins),
  1056. GROUP("gn_gnss_tsync_grp", gn_gnss_tsync_pins),
  1057. GROUP("gn_io_gnsssys_sw_cfg_grp", gn_io_gnsssys_sw_cfg_pins),
  1058. GROUP("gn_trg_grp0", gn_trg_pins0),
  1059. GROUP("gn_trg_grp1", gn_trg_pins1),
  1060. GROUP("gn_trg_shutdown_grp0", gn_trg_shutdown_pins0),
  1061. GROUP("gn_trg_shutdown_grp1", gn_trg_shutdown_pins1),
  1062. GROUP("gn_trg_shutdown_grp2", gn_trg_shutdown_pins2),
  1063. GROUP("gn_trg_shutdown_grp3", gn_trg_shutdown_pins3),
  1064. GROUP("i2c0_grp", i2c0_pins),
  1065. GROUP("i2c1_grp", i2c1_pins),
  1066. GROUP("i2s0_grp", i2s0_pins),
  1067. GROUP("i2s1_basic_grp", i2s1_basic_pins),
  1068. GROUP("i2s1_rxd0_grp0", i2s1_rxd0_pins0),
  1069. GROUP("i2s1_rxd0_grp1", i2s1_rxd0_pins1),
  1070. GROUP("i2s1_rxd0_grp2", i2s1_rxd0_pins2),
  1071. GROUP("i2s1_rxd0_grp3", i2s1_rxd0_pins3),
  1072. GROUP("i2s1_rxd0_grp4", i2s1_rxd0_pins4),
  1073. GROUP("i2s1_rxd1_grp0", i2s1_rxd1_pins0),
  1074. GROUP("i2s1_rxd1_grp1", i2s1_rxd1_pins1),
  1075. GROUP("i2s1_rxd1_grp2", i2s1_rxd1_pins2),
  1076. GROUP("i2s1_rxd1_grp3", i2s1_rxd1_pins3),
  1077. GROUP("i2s1_rxd1_grp4", i2s1_rxd1_pins4),
  1078. GROUP("jtag_jt_dbg_nsrst_grp", jtag_jt_dbg_nsrst_pins),
  1079. GROUP("jtag_ntrst_grp0", jtag_ntrst_pins0),
  1080. GROUP("jtag_ntrst_grp1", jtag_ntrst_pins1),
  1081. GROUP("jtag_swdiotms_grp0", jtag_swdiotms_pins0),
  1082. GROUP("jtag_swdiotms_grp1", jtag_swdiotms_pins1),
  1083. GROUP("jtag_tck_grp0", jtag_tck_pins0),
  1084. GROUP("jtag_tck_grp1", jtag_tck_pins1),
  1085. GROUP("jtag_tdi_grp0", jtag_tdi_pins0),
  1086. GROUP("jtag_tdi_grp1", jtag_tdi_pins1),
  1087. GROUP("jtag_tdo_grp0", jtag_tdo_pins0),
  1088. GROUP("jtag_tdo_grp1", jtag_tdo_pins1),
  1089. GROUP("ks_kas_spi_grp0", ks_kas_spi_pins0),
  1090. GROUP("ld_ldd_grp", ld_ldd_pins),
  1091. GROUP("ld_ldd_16bit_grp", ld_ldd_16bit_pins),
  1092. GROUP("ld_ldd_fck_grp", ld_ldd_fck_pins),
  1093. GROUP("ld_ldd_lck_grp", ld_ldd_lck_pins),
  1094. GROUP("lr_lcdrom_grp", lr_lcdrom_pins),
  1095. GROUP("lvds_analog_grp", lvds_analog_pins),
  1096. GROUP("nd_df_basic_grp", nd_df_basic_pins),
  1097. GROUP("nd_df_wp_grp", nd_df_wp_pins),
  1098. GROUP("nd_df_cs_grp", nd_df_cs_pins),
  1099. GROUP("ps_grp", ps_pins),
  1100. GROUP("ps_no_dir_grp", ps_no_dir_pins),
  1101. GROUP("pwc_core_on_grp", pwc_core_on_pins),
  1102. GROUP("pwc_ext_on_grp", pwc_ext_on_pins),
  1103. GROUP("pwc_gpio3_clk_grp", pwc_gpio3_clk_pins),
  1104. GROUP("pwc_io_on_grp", pwc_io_on_pins),
  1105. GROUP("pwc_lowbatt_b_grp0", pwc_lowbatt_b_pins0),
  1106. GROUP("pwc_mem_on_grp", pwc_mem_on_pins),
  1107. GROUP("pwc_on_key_b_grp0", pwc_on_key_b_pins0),
  1108. GROUP("pwc_wakeup_src0_grp", pwc_wakeup_src0_pins),
  1109. GROUP("pwc_wakeup_src1_grp", pwc_wakeup_src1_pins),
  1110. GROUP("pwc_wakeup_src2_grp", pwc_wakeup_src2_pins),
  1111. GROUP("pwc_wakeup_src3_grp", pwc_wakeup_src3_pins),
  1112. GROUP("pw_cko0_grp0", pw_cko0_pins0),
  1113. GROUP("pw_cko0_grp1", pw_cko0_pins1),
  1114. GROUP("pw_cko0_grp2", pw_cko0_pins2),
  1115. GROUP("pw_cko0_grp3", pw_cko0_pins3),
  1116. GROUP("pw_cko1_grp0", pw_cko1_pins0),
  1117. GROUP("pw_cko1_grp1", pw_cko1_pins1),
  1118. GROUP("pw_cko1_grp2", pw_cko1_pins2),
  1119. GROUP("pw_i2s01_clk_grp0", pw_i2s01_clk_pins0),
  1120. GROUP("pw_i2s01_clk_grp1", pw_i2s01_clk_pins1),
  1121. GROUP("pw_i2s01_clk_grp2", pw_i2s01_clk_pins2),
  1122. GROUP("pw_pwm0_grp0", pw_pwm0_pins0),
  1123. GROUP("pw_pwm0_grp1", pw_pwm0_pins1),
  1124. GROUP("pw_pwm1_grp0", pw_pwm1_pins0),
  1125. GROUP("pw_pwm1_grp1", pw_pwm1_pins1),
  1126. GROUP("pw_pwm1_grp2", pw_pwm1_pins2),
  1127. GROUP("pw_pwm2_grp0", pw_pwm2_pins0),
  1128. GROUP("pw_pwm2_grp1", pw_pwm2_pins1),
  1129. GROUP("pw_pwm2_grp2", pw_pwm2_pins2),
  1130. GROUP("pw_pwm3_grp0", pw_pwm3_pins0),
  1131. GROUP("pw_pwm3_grp1", pw_pwm3_pins1),
  1132. GROUP("pw_pwm_cpu_vol_grp0", pw_pwm_cpu_vol_pins0),
  1133. GROUP("pw_pwm_cpu_vol_grp1", pw_pwm_cpu_vol_pins1),
  1134. GROUP("pw_pwm_cpu_vol_grp2", pw_pwm_cpu_vol_pins2),
  1135. GROUP("pw_backlight_grp0", pw_backlight_pins0),
  1136. GROUP("pw_backlight_grp1", pw_backlight_pins1),
  1137. GROUP("rg_eth_mac_grp", rg_eth_mac_pins),
  1138. GROUP("rg_gmac_phy_intr_n_grp", rg_gmac_phy_intr_n_pins),
  1139. GROUP("rg_rgmii_mac_grp", rg_rgmii_mac_pins),
  1140. GROUP("rg_rgmii_phy_ref_clk_grp0", rg_rgmii_phy_ref_clk_pins0),
  1141. GROUP("rg_rgmii_phy_ref_clk_grp1", rg_rgmii_phy_ref_clk_pins1),
  1142. GROUP("sd0_grp", sd0_pins),
  1143. GROUP("sd0_4bit_grp", sd0_4bit_pins),
  1144. GROUP("sd1_grp", sd1_pins),
  1145. GROUP("sd1_4bit_grp0", sd1_4bit_pins0),
  1146. GROUP("sd1_4bit_grp1", sd1_4bit_pins1),
  1147. GROUP("sd2_basic_grp", sd2_basic_pins),
  1148. GROUP("sd2_cdb_grp0", sd2_cdb_pins0),
  1149. GROUP("sd2_cdb_grp1", sd2_cdb_pins1),
  1150. GROUP("sd2_wpb_grp0", sd2_wpb_pins0),
  1151. GROUP("sd2_wpb_grp1", sd2_wpb_pins1),
  1152. GROUP("sd3_9_grp", sd3_9_pins),
  1153. GROUP("sd5_grp", sd5_pins),
  1154. GROUP("sd6_grp0", sd6_pins0),
  1155. GROUP("sd6_grp1", sd6_pins1),
  1156. GROUP("sp0_ext_ldo_on_grp", sp0_ext_ldo_on_pins),
  1157. GROUP("sp0_qspi_grp", sp0_qspi_pins),
  1158. GROUP("sp1_spi_grp", sp1_spi_pins),
  1159. GROUP("tpiu_trace_grp", tpiu_trace_pins),
  1160. GROUP("uart0_grp", uart0_pins),
  1161. GROUP("uart0_nopause_grp", uart0_nopause_pins),
  1162. GROUP("uart1_grp", uart1_pins),
  1163. GROUP("uart2_cts_grp0", uart2_cts_pins0),
  1164. GROUP("uart2_cts_grp1", uart2_cts_pins1),
  1165. GROUP("uart2_rts_grp0", uart2_rts_pins0),
  1166. GROUP("uart2_rts_grp1", uart2_rts_pins1),
  1167. GROUP("uart2_rxd_grp0", uart2_rxd_pins0),
  1168. GROUP("uart2_rxd_grp1", uart2_rxd_pins1),
  1169. GROUP("uart2_rxd_grp2", uart2_rxd_pins2),
  1170. GROUP("uart2_txd_grp0", uart2_txd_pins0),
  1171. GROUP("uart2_txd_grp1", uart2_txd_pins1),
  1172. GROUP("uart2_txd_grp2", uart2_txd_pins2),
  1173. GROUP("uart3_cts_grp0", uart3_cts_pins0),
  1174. GROUP("uart3_cts_grp1", uart3_cts_pins1),
  1175. GROUP("uart3_cts_grp2", uart3_cts_pins2),
  1176. GROUP("uart3_rts_grp0", uart3_rts_pins0),
  1177. GROUP("uart3_rts_grp1", uart3_rts_pins1),
  1178. GROUP("uart3_rts_grp2", uart3_rts_pins2),
  1179. GROUP("uart3_rxd_grp0", uart3_rxd_pins0),
  1180. GROUP("uart3_rxd_grp1", uart3_rxd_pins1),
  1181. GROUP("uart3_rxd_grp2", uart3_rxd_pins2),
  1182. GROUP("uart3_txd_grp0", uart3_txd_pins0),
  1183. GROUP("uart3_txd_grp1", uart3_txd_pins1),
  1184. GROUP("uart3_txd_grp2", uart3_txd_pins2),
  1185. GROUP("uart4_basic_grp", uart4_basic_pins),
  1186. GROUP("uart4_cts_grp0", uart4_cts_pins0),
  1187. GROUP("uart4_cts_grp1", uart4_cts_pins1),
  1188. GROUP("uart4_cts_grp2", uart4_cts_pins2),
  1189. GROUP("uart4_rts_grp0", uart4_rts_pins0),
  1190. GROUP("uart4_rts_grp1", uart4_rts_pins1),
  1191. GROUP("uart4_rts_grp2", uart4_rts_pins2),
  1192. GROUP("usb0_drvvbus_grp0", usb0_drvvbus_pins0),
  1193. GROUP("usb0_drvvbus_grp1", usb0_drvvbus_pins1),
  1194. GROUP("usb1_drvvbus_grp0", usb1_drvvbus_pins0),
  1195. GROUP("usb1_drvvbus_grp1", usb1_drvvbus_pins1),
  1196. GROUP("visbus_dout_grp", visbus_dout_pins),
  1197. GROUP("vi_vip1_grp", vi_vip1_pins),
  1198. GROUP("vi_vip1_ext_grp", vi_vip1_ext_pins),
  1199. GROUP("vi_vip1_low8bit_grp", vi_vip1_low8bit_pins),
  1200. GROUP("vi_vip1_high8bit_grp", vi_vip1_high8bit_pins),
  1201. };
  1202. /* How many groups that a function can use */
  1203. static const char * const gnss_gpio_grp[] = { "gnss_gpio_grp", };
  1204. static const char * const lcd_vip_gpio_grp[] = { "lcd_vip_gpio_grp", };
  1205. static const char * const sdio_i2s_gpio_grp[] = { "sdio_i2s_gpio_grp", };
  1206. static const char * const sp_rgmii_gpio_grp[] = { "sp_rgmii_gpio_grp", };
  1207. static const char * const lvds_gpio_grp[] = { "lvds_gpio_grp", };
  1208. static const char * const jtag_uart_nand_gpio_grp[] = {
  1209. "jtag_uart_nand_gpio_grp", };
  1210. static const char * const rtc_gpio_grp[] = { "rtc_gpio_grp", };
  1211. static const char * const audio_ac97_grp[] = { "audio_ac97_grp", };
  1212. static const char * const audio_digmic_grp0[] = { "audio_digmic_grp0", };
  1213. static const char * const audio_digmic_grp1[] = { "audio_digmic_grp1", };
  1214. static const char * const audio_digmic_grp2[] = { "audio_digmic_grp2", };
  1215. static const char * const audio_func_dbg_grp[] = { "audio_func_dbg_grp", };
  1216. static const char * const audio_i2s_grp[] = { "audio_i2s_grp", };
  1217. static const char * const audio_i2s_2ch_grp[] = { "audio_i2s_2ch_grp", };
  1218. static const char * const audio_i2s_extclk_grp[] = { "audio_i2s_extclk_grp", };
  1219. static const char * const audio_spdif_out_grp0[] = { "audio_spdif_out_grp0", };
  1220. static const char * const audio_spdif_out_grp1[] = { "audio_spdif_out_grp1", };
  1221. static const char * const audio_spdif_out_grp2[] = { "audio_spdif_out_grp2", };
  1222. static const char * const audio_uart0_basic_grp[] = {
  1223. "audio_uart0_basic_grp", };
  1224. static const char * const audio_uart0_urfs_grp0[] = {
  1225. "audio_uart0_urfs_grp0", };
  1226. static const char * const audio_uart0_urfs_grp1[] = {
  1227. "audio_uart0_urfs_grp1", };
  1228. static const char * const audio_uart0_urfs_grp2[] = {
  1229. "audio_uart0_urfs_grp2", };
  1230. static const char * const audio_uart0_urfs_grp3[] = {
  1231. "audio_uart0_urfs_grp3", };
  1232. static const char * const audio_uart1_basic_grp[] = {
  1233. "audio_uart1_basic_grp", };
  1234. static const char * const audio_uart1_urfs_grp0[] = {
  1235. "audio_uart1_urfs_grp0", };
  1236. static const char * const audio_uart1_urfs_grp1[] = {
  1237. "audio_uart1_urfs_grp1", };
  1238. static const char * const audio_uart1_urfs_grp2[] = {
  1239. "audio_uart1_urfs_grp2", };
  1240. static const char * const audio_uart2_urfs_grp0[] = {
  1241. "audio_uart2_urfs_grp0", };
  1242. static const char * const audio_uart2_urfs_grp1[] = {
  1243. "audio_uart2_urfs_grp1", };
  1244. static const char * const audio_uart2_urfs_grp2[] = {
  1245. "audio_uart2_urfs_grp2", };
  1246. static const char * const audio_uart2_urxd_grp0[] = {
  1247. "audio_uart2_urxd_grp0", };
  1248. static const char * const audio_uart2_urxd_grp1[] = {
  1249. "audio_uart2_urxd_grp1", };
  1250. static const char * const audio_uart2_urxd_grp2[] = {
  1251. "audio_uart2_urxd_grp2", };
  1252. static const char * const audio_uart2_usclk_grp0[] = {
  1253. "audio_uart2_usclk_grp0", };
  1254. static const char * const audio_uart2_usclk_grp1[] = {
  1255. "audio_uart2_usclk_grp1", };
  1256. static const char * const audio_uart2_usclk_grp2[] = {
  1257. "audio_uart2_usclk_grp2", };
  1258. static const char * const audio_uart2_utfs_grp0[] = {
  1259. "audio_uart2_utfs_grp0", };
  1260. static const char * const audio_uart2_utfs_grp1[] = {
  1261. "audio_uart2_utfs_grp1", };
  1262. static const char * const audio_uart2_utfs_grp2[] = {
  1263. "audio_uart2_utfs_grp2", };
  1264. static const char * const audio_uart2_utxd_grp0[] = {
  1265. "audio_uart2_utxd_grp0", };
  1266. static const char * const audio_uart2_utxd_grp1[] = {
  1267. "audio_uart2_utxd_grp1", };
  1268. static const char * const audio_uart2_utxd_grp2[] = {
  1269. "audio_uart2_utxd_grp2", };
  1270. static const char * const c_can_trnsvr_en_grp0[] = { "c_can_trnsvr_en_grp0", };
  1271. static const char * const c_can_trnsvr_en_grp1[] = { "c_can_trnsvr_en_grp1", };
  1272. static const char * const c_can_trnsvr_intr_grp[] = {
  1273. "c_can_trnsvr_intr_grp", };
  1274. static const char * const c_can_trnsvr_stb_n_grp[] = {
  1275. "c_can_trnsvr_stb_n_grp", };
  1276. static const char * const c0_can_rxd_trnsv0_grp[] = {
  1277. "c0_can_rxd_trnsv0_grp", };
  1278. static const char * const c0_can_rxd_trnsv1_grp[] = {
  1279. "c0_can_rxd_trnsv1_grp", };
  1280. static const char * const c0_can_txd_trnsv0_grp[] = {
  1281. "c0_can_txd_trnsv0_grp", };
  1282. static const char * const c0_can_txd_trnsv1_grp[] = {
  1283. "c0_can_txd_trnsv1_grp", };
  1284. static const char * const c1_can_rxd_grp0[] = { "c1_can_rxd_grp0", };
  1285. static const char * const c1_can_rxd_grp1[] = { "c1_can_rxd_grp1", };
  1286. static const char * const c1_can_rxd_grp2[] = { "c1_can_rxd_grp2", };
  1287. static const char * const c1_can_rxd_grp3[] = { "c1_can_rxd_grp3", };
  1288. static const char * const c1_can_txd_grp0[] = { "c1_can_txd_grp0", };
  1289. static const char * const c1_can_txd_grp1[] = { "c1_can_txd_grp1", };
  1290. static const char * const c1_can_txd_grp2[] = { "c1_can_txd_grp2", };
  1291. static const char * const c1_can_txd_grp3[] = { "c1_can_txd_grp3", };
  1292. static const char * const ca_audio_lpc_grp[] = { "ca_audio_lpc_grp", };
  1293. static const char * const ca_bt_lpc_grp[] = { "ca_bt_lpc_grp", };
  1294. static const char * const ca_coex_grp[] = { "ca_coex_grp", };
  1295. static const char * const ca_curator_lpc_grp[] = { "ca_curator_lpc_grp", };
  1296. static const char * const ca_pcm_debug_grp[] = { "ca_pcm_debug_grp", };
  1297. static const char * const ca_pio_grp[] = { "ca_pio_grp", };
  1298. static const char * const ca_sdio_debug_grp[] = { "ca_sdio_debug_grp", };
  1299. static const char * const ca_spi_grp[] = { "ca_spi_grp", };
  1300. static const char * const ca_trb_grp[] = { "ca_trb_grp", };
  1301. static const char * const ca_uart_debug_grp[] = { "ca_uart_debug_grp", };
  1302. static const char * const clkc_grp0[] = { "clkc_grp0", };
  1303. static const char * const clkc_grp1[] = { "clkc_grp1", };
  1304. static const char * const gn_gnss_i2c_grp[] = { "gn_gnss_i2c_grp", };
  1305. static const char * const gn_gnss_uart_nopause_grp[] = {
  1306. "gn_gnss_uart_nopause_grp", };
  1307. static const char * const gn_gnss_uart_grp[] = { "gn_gnss_uart_grp", };
  1308. static const char * const gn_trg_spi_grp0[] = { "gn_trg_spi_grp0", };
  1309. static const char * const gn_trg_spi_grp1[] = { "gn_trg_spi_grp1", };
  1310. static const char * const cvbs_dbg_grp[] = { "cvbs_dbg_grp", };
  1311. static const char * const cvbs_dbg_test_grp0[] = { "cvbs_dbg_test_grp0", };
  1312. static const char * const cvbs_dbg_test_grp1[] = { "cvbs_dbg_test_grp1", };
  1313. static const char * const cvbs_dbg_test_grp2[] = { "cvbs_dbg_test_grp2", };
  1314. static const char * const cvbs_dbg_test_grp3[] = { "cvbs_dbg_test_grp3", };
  1315. static const char * const cvbs_dbg_test_grp4[] = { "cvbs_dbg_test_grp4", };
  1316. static const char * const cvbs_dbg_test_grp5[] = { "cvbs_dbg_test_grp5", };
  1317. static const char * const cvbs_dbg_test_grp6[] = { "cvbs_dbg_test_grp6", };
  1318. static const char * const cvbs_dbg_test_grp7[] = { "cvbs_dbg_test_grp7", };
  1319. static const char * const cvbs_dbg_test_grp8[] = { "cvbs_dbg_test_grp8", };
  1320. static const char * const cvbs_dbg_test_grp9[] = { "cvbs_dbg_test_grp9", };
  1321. static const char * const cvbs_dbg_test_grp10[] = { "cvbs_dbg_test_grp10", };
  1322. static const char * const cvbs_dbg_test_grp11[] = { "cvbs_dbg_test_grp11", };
  1323. static const char * const cvbs_dbg_test_grp12[] = { "cvbs_dbg_test_grp12", };
  1324. static const char * const cvbs_dbg_test_grp13[] = { "cvbs_dbg_test_grp13", };
  1325. static const char * const cvbs_dbg_test_grp14[] = { "cvbs_dbg_test_grp14", };
  1326. static const char * const cvbs_dbg_test_grp15[] = { "cvbs_dbg_test_grp15", };
  1327. static const char * const gn_gnss_power_grp[] = { "gn_gnss_power_grp", };
  1328. static const char * const gn_gnss_sw_status_grp[] = {
  1329. "gn_gnss_sw_status_grp", };
  1330. static const char * const gn_gnss_eclk_grp[] = { "gn_gnss_eclk_grp", };
  1331. static const char * const gn_gnss_irq1_grp0[] = { "gn_gnss_irq1_grp0", };
  1332. static const char * const gn_gnss_irq2_grp0[] = { "gn_gnss_irq2_grp0", };
  1333. static const char * const gn_gnss_tm_grp[] = { "gn_gnss_tm_grp", };
  1334. static const char * const gn_gnss_tsync_grp[] = { "gn_gnss_tsync_grp", };
  1335. static const char * const gn_io_gnsssys_sw_cfg_grp[] = {
  1336. "gn_io_gnsssys_sw_cfg_grp", };
  1337. static const char * const gn_trg_grp0[] = { "gn_trg_grp0", };
  1338. static const char * const gn_trg_grp1[] = { "gn_trg_grp1", };
  1339. static const char * const gn_trg_shutdown_grp0[] = { "gn_trg_shutdown_grp0", };
  1340. static const char * const gn_trg_shutdown_grp1[] = { "gn_trg_shutdown_grp1", };
  1341. static const char * const gn_trg_shutdown_grp2[] = { "gn_trg_shutdown_grp2", };
  1342. static const char * const gn_trg_shutdown_grp3[] = { "gn_trg_shutdown_grp3", };
  1343. static const char * const i2c0_grp[] = { "i2c0_grp", };
  1344. static const char * const i2c1_grp[] = { "i2c1_grp", };
  1345. static const char * const i2s0_grp[] = { "i2s0_grp", };
  1346. static const char * const i2s1_basic_grp[] = { "i2s1_basic_grp", };
  1347. static const char * const i2s1_rxd0_grp0[] = { "i2s1_rxd0_grp0", };
  1348. static const char * const i2s1_rxd0_grp1[] = { "i2s1_rxd0_grp1", };
  1349. static const char * const i2s1_rxd0_grp2[] = { "i2s1_rxd0_grp2", };
  1350. static const char * const i2s1_rxd0_grp3[] = { "i2s1_rxd0_grp3", };
  1351. static const char * const i2s1_rxd0_grp4[] = { "i2s1_rxd0_grp4", };
  1352. static const char * const i2s1_rxd1_grp0[] = { "i2s1_rxd1_grp0", };
  1353. static const char * const i2s1_rxd1_grp1[] = { "i2s1_rxd1_grp1", };
  1354. static const char * const i2s1_rxd1_grp2[] = { "i2s1_rxd1_grp2", };
  1355. static const char * const i2s1_rxd1_grp3[] = { "i2s1_rxd1_grp3", };
  1356. static const char * const i2s1_rxd1_grp4[] = { "i2s1_rxd1_grp4", };
  1357. static const char * const jtag_jt_dbg_nsrst_grp[] = {
  1358. "jtag_jt_dbg_nsrst_grp", };
  1359. static const char * const jtag_ntrst_grp0[] = { "jtag_ntrst_grp0", };
  1360. static const char * const jtag_ntrst_grp1[] = { "jtag_ntrst_grp1", };
  1361. static const char * const jtag_swdiotms_grp0[] = { "jtag_swdiotms_grp0", };
  1362. static const char * const jtag_swdiotms_grp1[] = { "jtag_swdiotms_grp1", };
  1363. static const char * const jtag_tck_grp0[] = { "jtag_tck_grp0", };
  1364. static const char * const jtag_tck_grp1[] = { "jtag_tck_grp1", };
  1365. static const char * const jtag_tdi_grp0[] = { "jtag_tdi_grp0", };
  1366. static const char * const jtag_tdi_grp1[] = { "jtag_tdi_grp1", };
  1367. static const char * const jtag_tdo_grp0[] = { "jtag_tdo_grp0", };
  1368. static const char * const jtag_tdo_grp1[] = { "jtag_tdo_grp1", };
  1369. static const char * const ks_kas_spi_grp0[] = { "ks_kas_spi_grp0", };
  1370. static const char * const ld_ldd_grp[] = { "ld_ldd_grp", };
  1371. static const char * const ld_ldd_16bit_grp[] = { "ld_ldd_16bit_grp", };
  1372. static const char * const ld_ldd_fck_grp[] = { "ld_ldd_fck_grp", };
  1373. static const char * const ld_ldd_lck_grp[] = { "ld_ldd_lck_grp", };
  1374. static const char * const lr_lcdrom_grp[] = { "lr_lcdrom_grp", };
  1375. static const char * const lvds_analog_grp[] = { "lvds_analog_grp", };
  1376. static const char * const nd_df_basic_grp[] = { "nd_df_basic_grp", };
  1377. static const char * const nd_df_wp_grp[] = { "nd_df_wp_grp", };
  1378. static const char * const nd_df_cs_grp[] = { "nd_df_cs_grp", };
  1379. static const char * const ps_grp[] = { "ps_grp", };
  1380. static const char * const ps_no_dir_grp[] = { "ps_no_dir_grp", };
  1381. static const char * const pwc_core_on_grp[] = { "pwc_core_on_grp", };
  1382. static const char * const pwc_ext_on_grp[] = { "pwc_ext_on_grp", };
  1383. static const char * const pwc_gpio3_clk_grp[] = { "pwc_gpio3_clk_grp", };
  1384. static const char * const pwc_io_on_grp[] = { "pwc_io_on_grp", };
  1385. static const char * const pwc_lowbatt_b_grp0[] = { "pwc_lowbatt_b_grp0", };
  1386. static const char * const pwc_mem_on_grp[] = { "pwc_mem_on_grp", };
  1387. static const char * const pwc_on_key_b_grp0[] = { "pwc_on_key_b_grp0", };
  1388. static const char * const pwc_wakeup_src0_grp[] = { "pwc_wakeup_src0_grp", };
  1389. static const char * const pwc_wakeup_src1_grp[] = { "pwc_wakeup_src1_grp", };
  1390. static const char * const pwc_wakeup_src2_grp[] = { "pwc_wakeup_src2_grp", };
  1391. static const char * const pwc_wakeup_src3_grp[] = { "pwc_wakeup_src3_grp", };
  1392. static const char * const pw_cko0_grp0[] = { "pw_cko0_grp0", };
  1393. static const char * const pw_cko0_grp1[] = { "pw_cko0_grp1", };
  1394. static const char * const pw_cko0_grp2[] = { "pw_cko0_grp2", };
  1395. static const char * const pw_cko0_grp3[] = { "pw_cko0_grp3", };
  1396. static const char * const pw_cko1_grp0[] = { "pw_cko1_grp0", };
  1397. static const char * const pw_cko1_grp1[] = { "pw_cko1_grp1", };
  1398. static const char * const pw_cko1_grp2[] = { "pw_cko1_grp2", };
  1399. static const char * const pw_i2s01_clk_grp0[] = { "pw_i2s01_clk_grp0", };
  1400. static const char * const pw_i2s01_clk_grp1[] = { "pw_i2s01_clk_grp1", };
  1401. static const char * const pw_i2s01_clk_grp2[] = { "pw_i2s01_clk_grp2", };
  1402. static const char * const pw_pwm0_grp0[] = { "pw_pwm0_grp0", };
  1403. static const char * const pw_pwm0_grp1[] = { "pw_pwm0_grp1", };
  1404. static const char * const pw_pwm1_grp0[] = { "pw_pwm1_grp0", };
  1405. static const char * const pw_pwm1_grp1[] = { "pw_pwm1_grp1", };
  1406. static const char * const pw_pwm1_grp2[] = { "pw_pwm1_grp2", };
  1407. static const char * const pw_pwm2_grp0[] = { "pw_pwm2_grp0", };
  1408. static const char * const pw_pwm2_grp1[] = { "pw_pwm2_grp1", };
  1409. static const char * const pw_pwm2_grp2[] = { "pw_pwm2_grp2", };
  1410. static const char * const pw_pwm3_grp0[] = { "pw_pwm3_grp0", };
  1411. static const char * const pw_pwm3_grp1[] = { "pw_pwm3_grp1", };
  1412. static const char * const pw_pwm_cpu_vol_grp0[] = { "pw_pwm_cpu_vol_grp0", };
  1413. static const char * const pw_pwm_cpu_vol_grp1[] = { "pw_pwm_cpu_vol_grp1", };
  1414. static const char * const pw_pwm_cpu_vol_grp2[] = { "pw_pwm_cpu_vol_grp2", };
  1415. static const char * const pw_backlight_grp0[] = { "pw_backlight_grp0", };
  1416. static const char * const pw_backlight_grp1[] = { "pw_backlight_grp1", };
  1417. static const char * const rg_eth_mac_grp[] = { "rg_eth_mac_grp", };
  1418. static const char * const rg_gmac_phy_intr_n_grp[] = {
  1419. "rg_gmac_phy_intr_n_grp", };
  1420. static const char * const rg_rgmii_mac_grp[] = { "rg_rgmii_mac_grp", };
  1421. static const char * const rg_rgmii_phy_ref_clk_grp0[] = {
  1422. "rg_rgmii_phy_ref_clk_grp0", };
  1423. static const char * const rg_rgmii_phy_ref_clk_grp1[] = {
  1424. "rg_rgmii_phy_ref_clk_grp1", };
  1425. static const char * const sd0_grp[] = { "sd0_grp", };
  1426. static const char * const sd0_4bit_grp[] = { "sd0_4bit_grp", };
  1427. static const char * const sd1_grp[] = { "sd1_grp", };
  1428. static const char * const sd1_4bit_grp0[] = { "sd1_4bit_grp0", };
  1429. static const char * const sd1_4bit_grp1[] = { "sd1_4bit_grp1", };
  1430. static const char * const sd2_basic_grp[] = { "sd2_basic_grp", };
  1431. static const char * const sd2_cdb_grp0[] = { "sd2_cdb_grp0", };
  1432. static const char * const sd2_cdb_grp1[] = { "sd2_cdb_grp1", };
  1433. static const char * const sd2_wpb_grp0[] = { "sd2_wpb_grp0", };
  1434. static const char * const sd2_wpb_grp1[] = { "sd2_wpb_grp1", };
  1435. static const char * const sd3_9_grp[] = { "sd3_9_grp", };
  1436. static const char * const sd5_grp[] = { "sd5_grp", };
  1437. static const char * const sd6_grp0[] = { "sd6_grp0", };
  1438. static const char * const sd6_grp1[] = { "sd6_grp1", };
  1439. static const char * const sp0_ext_ldo_on_grp[] = { "sp0_ext_ldo_on_grp", };
  1440. static const char * const sp0_qspi_grp[] = { "sp0_qspi_grp", };
  1441. static const char * const sp1_spi_grp[] = { "sp1_spi_grp", };
  1442. static const char * const tpiu_trace_grp[] = { "tpiu_trace_grp", };
  1443. static const char * const uart0_grp[] = { "uart0_grp", };
  1444. static const char * const uart0_nopause_grp[] = { "uart0_nopause_grp", };
  1445. static const char * const uart1_grp[] = { "uart1_grp", };
  1446. static const char * const uart2_cts_grp0[] = { "uart2_cts_grp0", };
  1447. static const char * const uart2_cts_grp1[] = { "uart2_cts_grp1", };
  1448. static const char * const uart2_rts_grp0[] = { "uart2_rts_grp0", };
  1449. static const char * const uart2_rts_grp1[] = { "uart2_rts_grp1", };
  1450. static const char * const uart2_rxd_grp0[] = { "uart2_rxd_grp0", };
  1451. static const char * const uart2_rxd_grp1[] = { "uart2_rxd_grp1", };
  1452. static const char * const uart2_rxd_grp2[] = { "uart2_rxd_grp2", };
  1453. static const char * const uart2_txd_grp0[] = { "uart2_txd_grp0", };
  1454. static const char * const uart2_txd_grp1[] = { "uart2_txd_grp1", };
  1455. static const char * const uart2_txd_grp2[] = { "uart2_txd_grp2", };
  1456. static const char * const uart3_cts_grp0[] = { "uart3_cts_grp0", };
  1457. static const char * const uart3_cts_grp1[] = { "uart3_cts_grp1", };
  1458. static const char * const uart3_cts_grp2[] = { "uart3_cts_grp2", };
  1459. static const char * const uart3_rts_grp0[] = { "uart3_rts_grp0", };
  1460. static const char * const uart3_rts_grp1[] = { "uart3_rts_grp1", };
  1461. static const char * const uart3_rts_grp2[] = { "uart3_rts_grp2", };
  1462. static const char * const uart3_rxd_grp0[] = { "uart3_rxd_grp0", };
  1463. static const char * const uart3_rxd_grp1[] = { "uart3_rxd_grp1", };
  1464. static const char * const uart3_rxd_grp2[] = { "uart3_rxd_grp2", };
  1465. static const char * const uart3_txd_grp0[] = { "uart3_txd_grp0", };
  1466. static const char * const uart3_txd_grp1[] = { "uart3_txd_grp1", };
  1467. static const char * const uart3_txd_grp2[] = { "uart3_txd_grp2", };
  1468. static const char * const uart4_basic_grp[] = { "uart4_basic_grp", };
  1469. static const char * const uart4_cts_grp0[] = { "uart4_cts_grp0", };
  1470. static const char * const uart4_cts_grp1[] = { "uart4_cts_grp1", };
  1471. static const char * const uart4_cts_grp2[] = { "uart4_cts_grp2", };
  1472. static const char * const uart4_rts_grp0[] = { "uart4_rts_grp0", };
  1473. static const char * const uart4_rts_grp1[] = { "uart4_rts_grp1", };
  1474. static const char * const uart4_rts_grp2[] = { "uart4_rts_grp2", };
  1475. static const char * const usb0_drvvbus_grp0[] = { "usb0_drvvbus_grp0", };
  1476. static const char * const usb0_drvvbus_grp1[] = { "usb0_drvvbus_grp1", };
  1477. static const char * const usb1_drvvbus_grp0[] = { "usb1_drvvbus_grp0", };
  1478. static const char * const usb1_drvvbus_grp1[] = { "usb1_drvvbus_grp1", };
  1479. static const char * const visbus_dout_grp[] = { "visbus_dout_grp", };
  1480. static const char * const vi_vip1_grp[] = { "vi_vip1_grp", };
  1481. static const char * const vi_vip1_ext_grp[] = { "vi_vip1_ext_grp", };
  1482. static const char * const vi_vip1_low8bit_grp[] = { "vi_vip1_low8bit_grp", };
  1483. static const char * const vi_vip1_high8bit_grp[] = { "vi_vip1_high8bit_grp", };
  1484. static struct atlas7_pad_mux gnss_gpio_grp_pad_mux[] = {
  1485. MUX(1, 119, 0, N, N, N, N),
  1486. MUX(1, 120, 0, N, N, N, N),
  1487. MUX(1, 121, 0, N, N, N, N),
  1488. MUX(1, 122, 0, N, N, N, N),
  1489. MUX(1, 123, 0, N, N, N, N),
  1490. MUX(1, 124, 0, N, N, N, N),
  1491. MUX(1, 125, 0, N, N, N, N),
  1492. MUX(1, 126, 0, N, N, N, N),
  1493. MUX(1, 127, 0, N, N, N, N),
  1494. MUX(1, 128, 0, N, N, N, N),
  1495. MUX(1, 22, 0, N, N, N, N),
  1496. MUX(1, 23, 0, N, N, N, N),
  1497. MUX(1, 24, 0, N, N, N, N),
  1498. MUX(1, 25, 0, N, N, N, N),
  1499. MUX(1, 26, 0, N, N, N, N),
  1500. MUX(1, 27, 0, N, N, N, N),
  1501. MUX(1, 28, 0, N, N, N, N),
  1502. MUX(1, 29, 0, N, N, N, N),
  1503. MUX(1, 30, 0, N, N, N, N),
  1504. };
  1505. static struct atlas7_grp_mux gnss_gpio_grp_mux = {
  1506. .pad_mux_count = ARRAY_SIZE(gnss_gpio_grp_pad_mux),
  1507. .pad_mux_list = gnss_gpio_grp_pad_mux,
  1508. };
  1509. static struct atlas7_pad_mux lcd_vip_gpio_grp_pad_mux[] = {
  1510. MUX(1, 74, 0, N, N, N, N),
  1511. MUX(1, 75, 0, N, N, N, N),
  1512. MUX(1, 76, 0, N, N, N, N),
  1513. MUX(1, 77, 0, N, N, N, N),
  1514. MUX(1, 78, 0, N, N, N, N),
  1515. MUX(1, 79, 0, N, N, N, N),
  1516. MUX(1, 80, 0, N, N, N, N),
  1517. MUX(1, 81, 0, N, N, N, N),
  1518. MUX(1, 82, 0, N, N, N, N),
  1519. MUX(1, 83, 0, N, N, N, N),
  1520. MUX(1, 84, 0, N, N, N, N),
  1521. MUX(1, 53, 0, N, N, N, N),
  1522. MUX(1, 54, 0, N, N, N, N),
  1523. MUX(1, 55, 0, N, N, N, N),
  1524. MUX(1, 56, 0, N, N, N, N),
  1525. MUX(1, 57, 0, N, N, N, N),
  1526. MUX(1, 58, 0, N, N, N, N),
  1527. MUX(1, 59, 0, N, N, N, N),
  1528. MUX(1, 60, 0, N, N, N, N),
  1529. MUX(1, 61, 0, N, N, N, N),
  1530. MUX(1, 62, 0, N, N, N, N),
  1531. MUX(1, 63, 0, N, N, N, N),
  1532. MUX(1, 64, 0, N, N, N, N),
  1533. MUX(1, 65, 0, N, N, N, N),
  1534. MUX(1, 66, 0, N, N, N, N),
  1535. MUX(1, 67, 0, N, N, N, N),
  1536. MUX(1, 68, 0, N, N, N, N),
  1537. MUX(1, 69, 0, N, N, N, N),
  1538. MUX(1, 70, 0, N, N, N, N),
  1539. MUX(1, 71, 0, N, N, N, N),
  1540. MUX(1, 72, 0, N, N, N, N),
  1541. MUX(1, 73, 0, N, N, N, N),
  1542. };
  1543. static struct atlas7_grp_mux lcd_vip_gpio_grp_mux = {
  1544. .pad_mux_count = ARRAY_SIZE(lcd_vip_gpio_grp_pad_mux),
  1545. .pad_mux_list = lcd_vip_gpio_grp_pad_mux,
  1546. };
  1547. static struct atlas7_pad_mux sdio_i2s_gpio_grp_pad_mux[] = {
  1548. MUX(1, 31, 0, N, N, N, N),
  1549. MUX(1, 32, 0, N, N, N, N),
  1550. MUX(1, 33, 0, N, N, N, N),
  1551. MUX(1, 34, 0, N, N, N, N),
  1552. MUX(1, 35, 0, N, N, N, N),
  1553. MUX(1, 36, 0, N, N, N, N),
  1554. MUX(1, 85, 0, N, N, N, N),
  1555. MUX(1, 86, 0, N, N, N, N),
  1556. MUX(1, 87, 0, N, N, N, N),
  1557. MUX(1, 88, 0, N, N, N, N),
  1558. MUX(1, 89, 0, N, N, N, N),
  1559. MUX(1, 90, 0, N, N, N, N),
  1560. MUX(1, 129, 0, N, N, N, N),
  1561. MUX(1, 130, 0, N, N, N, N),
  1562. MUX(1, 131, 0, N, N, N, N),
  1563. MUX(1, 132, 0, N, N, N, N),
  1564. MUX(1, 91, 0, N, N, N, N),
  1565. MUX(1, 92, 0, N, N, N, N),
  1566. MUX(1, 93, 0, N, N, N, N),
  1567. MUX(1, 94, 0, N, N, N, N),
  1568. MUX(1, 95, 0, N, N, N, N),
  1569. MUX(1, 96, 0, N, N, N, N),
  1570. MUX(1, 112, 0, N, N, N, N),
  1571. MUX(1, 113, 0, N, N, N, N),
  1572. MUX(1, 114, 0, N, N, N, N),
  1573. MUX(1, 115, 0, N, N, N, N),
  1574. MUX(1, 116, 0, N, N, N, N),
  1575. MUX(1, 117, 0, N, N, N, N),
  1576. MUX(1, 118, 0, N, N, N, N),
  1577. };
  1578. static struct atlas7_grp_mux sdio_i2s_gpio_grp_mux = {
  1579. .pad_mux_count = ARRAY_SIZE(sdio_i2s_gpio_grp_pad_mux),
  1580. .pad_mux_list = sdio_i2s_gpio_grp_pad_mux,
  1581. };
  1582. static struct atlas7_pad_mux sp_rgmii_gpio_grp_pad_mux[] = {
  1583. MUX(1, 97, 0, N, N, N, N),
  1584. MUX(1, 98, 0, N, N, N, N),
  1585. MUX(1, 99, 0, N, N, N, N),
  1586. MUX(1, 100, 0, N, N, N, N),
  1587. MUX(1, 101, 0, N, N, N, N),
  1588. MUX(1, 102, 0, N, N, N, N),
  1589. MUX(1, 103, 0, N, N, N, N),
  1590. MUX(1, 104, 0, N, N, N, N),
  1591. MUX(1, 105, 0, N, N, N, N),
  1592. MUX(1, 106, 0, N, N, N, N),
  1593. MUX(1, 107, 0, N, N, N, N),
  1594. MUX(1, 108, 0, N, N, N, N),
  1595. MUX(1, 109, 0, N, N, N, N),
  1596. MUX(1, 110, 0, N, N, N, N),
  1597. MUX(1, 111, 0, N, N, N, N),
  1598. MUX(1, 18, 0, N, N, N, N),
  1599. MUX(1, 19, 0, N, N, N, N),
  1600. MUX(1, 20, 0, N, N, N, N),
  1601. MUX(1, 21, 0, N, N, N, N),
  1602. MUX(1, 141, 0, N, N, N, N),
  1603. MUX(1, 142, 0, N, N, N, N),
  1604. MUX(1, 143, 0, N, N, N, N),
  1605. MUX(1, 144, 0, N, N, N, N),
  1606. MUX(1, 145, 0, N, N, N, N),
  1607. MUX(1, 146, 0, N, N, N, N),
  1608. MUX(1, 147, 0, N, N, N, N),
  1609. MUX(1, 148, 0, N, N, N, N),
  1610. };
  1611. static struct atlas7_grp_mux sp_rgmii_gpio_grp_mux = {
  1612. .pad_mux_count = ARRAY_SIZE(sp_rgmii_gpio_grp_pad_mux),
  1613. .pad_mux_list = sp_rgmii_gpio_grp_pad_mux,
  1614. };
  1615. static struct atlas7_pad_mux lvds_gpio_grp_pad_mux[] = {
  1616. MUX(1, 157, 0, N, N, N, N),
  1617. MUX(1, 158, 0, N, N, N, N),
  1618. MUX(1, 155, 0, N, N, N, N),
  1619. MUX(1, 156, 0, N, N, N, N),
  1620. MUX(1, 153, 0, N, N, N, N),
  1621. MUX(1, 154, 0, N, N, N, N),
  1622. MUX(1, 151, 0, N, N, N, N),
  1623. MUX(1, 152, 0, N, N, N, N),
  1624. MUX(1, 149, 0, N, N, N, N),
  1625. MUX(1, 150, 0, N, N, N, N),
  1626. };
  1627. static struct atlas7_grp_mux lvds_gpio_grp_mux = {
  1628. .pad_mux_count = ARRAY_SIZE(lvds_gpio_grp_pad_mux),
  1629. .pad_mux_list = lvds_gpio_grp_pad_mux,
  1630. };
  1631. static struct atlas7_pad_mux jtag_uart_nand_gpio_grp_pad_mux[] = {
  1632. MUX(1, 44, 0, N, N, N, N),
  1633. MUX(1, 43, 0, N, N, N, N),
  1634. MUX(1, 42, 0, N, N, N, N),
  1635. MUX(1, 41, 0, N, N, N, N),
  1636. MUX(1, 40, 0, N, N, N, N),
  1637. MUX(1, 39, 0, N, N, N, N),
  1638. MUX(1, 38, 0, N, N, N, N),
  1639. MUX(1, 37, 0, N, N, N, N),
  1640. MUX(1, 46, 0, N, N, N, N),
  1641. MUX(1, 47, 0, N, N, N, N),
  1642. MUX(1, 48, 0, N, N, N, N),
  1643. MUX(1, 49, 0, N, N, N, N),
  1644. MUX(1, 50, 0, N, N, N, N),
  1645. MUX(1, 52, 0, N, N, N, N),
  1646. MUX(1, 51, 0, N, N, N, N),
  1647. MUX(1, 45, 0, N, N, N, N),
  1648. MUX(1, 133, 0, N, N, N, N),
  1649. MUX(1, 134, 0, N, N, N, N),
  1650. MUX(1, 135, 0, N, N, N, N),
  1651. MUX(1, 136, 0, N, N, N, N),
  1652. MUX(1, 137, 0, N, N, N, N),
  1653. MUX(1, 138, 0, N, N, N, N),
  1654. MUX(1, 139, 0, N, N, N, N),
  1655. MUX(1, 140, 0, N, N, N, N),
  1656. MUX(1, 159, 0, N, N, N, N),
  1657. MUX(1, 160, 0, N, N, N, N),
  1658. MUX(1, 161, 0, N, N, N, N),
  1659. MUX(1, 162, 0, N, N, N, N),
  1660. MUX(1, 163, 0, N, N, N, N),
  1661. };
  1662. static struct atlas7_grp_mux jtag_uart_nand_gpio_grp_mux = {
  1663. .pad_mux_count = ARRAY_SIZE(jtag_uart_nand_gpio_grp_pad_mux),
  1664. .pad_mux_list = jtag_uart_nand_gpio_grp_pad_mux,
  1665. };
  1666. static struct atlas7_pad_mux rtc_gpio_grp_pad_mux[] = {
  1667. MUX(0, 0, 0, N, N, N, N),
  1668. MUX(0, 1, 0, N, N, N, N),
  1669. MUX(0, 2, 0, N, N, N, N),
  1670. MUX(0, 3, 0, N, N, N, N),
  1671. MUX(0, 4, 0, N, N, N, N),
  1672. MUX(0, 10, 0, N, N, N, N),
  1673. MUX(0, 11, 0, N, N, N, N),
  1674. MUX(0, 12, 0, N, N, N, N),
  1675. MUX(0, 13, 0, N, N, N, N),
  1676. MUX(0, 14, 0, N, N, N, N),
  1677. MUX(0, 15, 0, N, N, N, N),
  1678. MUX(0, 16, 0, N, N, N, N),
  1679. MUX(0, 17, 0, N, N, N, N),
  1680. MUX(0, 9, 0, N, N, N, N),
  1681. };
  1682. static struct atlas7_grp_mux rtc_gpio_grp_mux = {
  1683. .pad_mux_count = ARRAY_SIZE(rtc_gpio_grp_pad_mux),
  1684. .pad_mux_list = rtc_gpio_grp_pad_mux,
  1685. };
  1686. static struct atlas7_pad_mux audio_ac97_grp_pad_mux[] = {
  1687. MUX(1, 113, 2, N, N, N, N),
  1688. MUX(1, 118, 2, N, N, N, N),
  1689. MUX(1, 115, 2, N, N, N, N),
  1690. MUX(1, 114, 2, N, N, N, N),
  1691. };
  1692. static struct atlas7_grp_mux audio_ac97_grp_mux = {
  1693. .pad_mux_count = ARRAY_SIZE(audio_ac97_grp_pad_mux),
  1694. .pad_mux_list = audio_ac97_grp_pad_mux,
  1695. };
  1696. static struct atlas7_pad_mux audio_digmic_grp0_pad_mux[] = {
  1697. MUX(1, 51, 3, 0xa10, 20, 0xa90, 20),
  1698. };
  1699. static struct atlas7_grp_mux audio_digmic_grp0_mux = {
  1700. .pad_mux_count = ARRAY_SIZE(audio_digmic_grp0_pad_mux),
  1701. .pad_mux_list = audio_digmic_grp0_pad_mux,
  1702. };
  1703. static struct atlas7_pad_mux audio_digmic_grp1_pad_mux[] = {
  1704. MUX(1, 122, 5, 0xa10, 20, 0xa90, 20),
  1705. };
  1706. static struct atlas7_grp_mux audio_digmic_grp1_mux = {
  1707. .pad_mux_count = ARRAY_SIZE(audio_digmic_grp1_pad_mux),
  1708. .pad_mux_list = audio_digmic_grp1_pad_mux,
  1709. };
  1710. static struct atlas7_pad_mux audio_digmic_grp2_pad_mux[] = {
  1711. MUX(1, 161, 7, 0xa10, 20, 0xa90, 20),
  1712. };
  1713. static struct atlas7_grp_mux audio_digmic_grp2_mux = {
  1714. .pad_mux_count = ARRAY_SIZE(audio_digmic_grp2_pad_mux),
  1715. .pad_mux_list = audio_digmic_grp2_pad_mux,
  1716. };
  1717. static struct atlas7_pad_mux audio_func_dbg_grp_pad_mux[] = {
  1718. MUX(1, 141, 4, N, N, N, N),
  1719. MUX(1, 144, 4, N, N, N, N),
  1720. MUX(1, 44, 6, N, N, N, N),
  1721. MUX(1, 43, 6, N, N, N, N),
  1722. MUX(1, 42, 6, N, N, N, N),
  1723. MUX(1, 41, 6, N, N, N, N),
  1724. MUX(1, 40, 6, N, N, N, N),
  1725. MUX(1, 39, 6, N, N, N, N),
  1726. MUX(1, 38, 6, N, N, N, N),
  1727. MUX(1, 37, 6, N, N, N, N),
  1728. MUX(1, 74, 6, N, N, N, N),
  1729. MUX(1, 75, 6, N, N, N, N),
  1730. MUX(1, 76, 6, N, N, N, N),
  1731. MUX(1, 77, 6, N, N, N, N),
  1732. MUX(1, 78, 6, N, N, N, N),
  1733. MUX(1, 79, 6, N, N, N, N),
  1734. MUX(1, 81, 6, N, N, N, N),
  1735. MUX(1, 113, 6, N, N, N, N),
  1736. MUX(1, 114, 6, N, N, N, N),
  1737. MUX(1, 118, 6, N, N, N, N),
  1738. MUX(1, 115, 6, N, N, N, N),
  1739. MUX(1, 49, 6, N, N, N, N),
  1740. MUX(1, 50, 6, N, N, N, N),
  1741. MUX(1, 142, 4, N, N, N, N),
  1742. MUX(1, 143, 4, N, N, N, N),
  1743. MUX(1, 80, 6, N, N, N, N),
  1744. };
  1745. static struct atlas7_grp_mux audio_func_dbg_grp_mux = {
  1746. .pad_mux_count = ARRAY_SIZE(audio_func_dbg_grp_pad_mux),
  1747. .pad_mux_list = audio_func_dbg_grp_pad_mux,
  1748. };
  1749. static struct atlas7_pad_mux audio_i2s_grp_pad_mux[] = {
  1750. MUX(1, 118, 1, N, N, N, N),
  1751. MUX(1, 115, 1, N, N, N, N),
  1752. MUX(1, 116, 1, N, N, N, N),
  1753. MUX(1, 117, 1, N, N, N, N),
  1754. MUX(1, 112, 1, N, N, N, N),
  1755. MUX(1, 113, 1, N, N, N, N),
  1756. MUX(1, 114, 1, N, N, N, N),
  1757. };
  1758. static struct atlas7_grp_mux audio_i2s_grp_mux = {
  1759. .pad_mux_count = ARRAY_SIZE(audio_i2s_grp_pad_mux),
  1760. .pad_mux_list = audio_i2s_grp_pad_mux,
  1761. };
  1762. static struct atlas7_pad_mux audio_i2s_2ch_grp_pad_mux[] = {
  1763. MUX(1, 118, 1, N, N, N, N),
  1764. MUX(1, 115, 1, N, N, N, N),
  1765. MUX(1, 112, 1, N, N, N, N),
  1766. MUX(1, 113, 1, N, N, N, N),
  1767. MUX(1, 114, 1, N, N, N, N),
  1768. };
  1769. static struct atlas7_grp_mux audio_i2s_2ch_grp_mux = {
  1770. .pad_mux_count = ARRAY_SIZE(audio_i2s_2ch_grp_pad_mux),
  1771. .pad_mux_list = audio_i2s_2ch_grp_pad_mux,
  1772. };
  1773. static struct atlas7_pad_mux audio_i2s_extclk_grp_pad_mux[] = {
  1774. MUX(1, 112, 2, N, N, N, N),
  1775. };
  1776. static struct atlas7_grp_mux audio_i2s_extclk_grp_mux = {
  1777. .pad_mux_count = ARRAY_SIZE(audio_i2s_extclk_grp_pad_mux),
  1778. .pad_mux_list = audio_i2s_extclk_grp_pad_mux,
  1779. };
  1780. static struct atlas7_pad_mux audio_spdif_out_grp0_pad_mux[] = {
  1781. MUX(1, 112, 3, N, N, N, N),
  1782. };
  1783. static struct atlas7_grp_mux audio_spdif_out_grp0_mux = {
  1784. .pad_mux_count = ARRAY_SIZE(audio_spdif_out_grp0_pad_mux),
  1785. .pad_mux_list = audio_spdif_out_grp0_pad_mux,
  1786. };
  1787. static struct atlas7_pad_mux audio_spdif_out_grp1_pad_mux[] = {
  1788. MUX(1, 116, 3, N, N, N, N),
  1789. };
  1790. static struct atlas7_grp_mux audio_spdif_out_grp1_mux = {
  1791. .pad_mux_count = ARRAY_SIZE(audio_spdif_out_grp1_pad_mux),
  1792. .pad_mux_list = audio_spdif_out_grp1_pad_mux,
  1793. };
  1794. static struct atlas7_pad_mux audio_spdif_out_grp2_pad_mux[] = {
  1795. MUX(1, 142, 3, N, N, N, N),
  1796. };
  1797. static struct atlas7_grp_mux audio_spdif_out_grp2_mux = {
  1798. .pad_mux_count = ARRAY_SIZE(audio_spdif_out_grp2_pad_mux),
  1799. .pad_mux_list = audio_spdif_out_grp2_pad_mux,
  1800. };
  1801. static struct atlas7_pad_mux audio_uart0_basic_grp_pad_mux[] = {
  1802. MUX(1, 143, 1, N, N, N, N),
  1803. MUX(1, 142, 1, N, N, N, N),
  1804. MUX(1, 141, 1, N, N, N, N),
  1805. MUX(1, 144, 1, N, N, N, N),
  1806. };
  1807. static struct atlas7_grp_mux audio_uart0_basic_grp_mux = {
  1808. .pad_mux_count = ARRAY_SIZE(audio_uart0_basic_grp_pad_mux),
  1809. .pad_mux_list = audio_uart0_basic_grp_pad_mux,
  1810. };
  1811. static struct atlas7_pad_mux audio_uart0_urfs_grp0_pad_mux[] = {
  1812. MUX(1, 117, 5, 0xa10, 28, 0xa90, 28),
  1813. };
  1814. static struct atlas7_grp_mux audio_uart0_urfs_grp0_mux = {
  1815. .pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp0_pad_mux),
  1816. .pad_mux_list = audio_uart0_urfs_grp0_pad_mux,
  1817. };
  1818. static struct atlas7_pad_mux audio_uart0_urfs_grp1_pad_mux[] = {
  1819. MUX(1, 139, 3, 0xa10, 28, 0xa90, 28),
  1820. };
  1821. static struct atlas7_grp_mux audio_uart0_urfs_grp1_mux = {
  1822. .pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp1_pad_mux),
  1823. .pad_mux_list = audio_uart0_urfs_grp1_pad_mux,
  1824. };
  1825. static struct atlas7_pad_mux audio_uart0_urfs_grp2_pad_mux[] = {
  1826. MUX(1, 163, 3, 0xa10, 28, 0xa90, 28),
  1827. };
  1828. static struct atlas7_grp_mux audio_uart0_urfs_grp2_mux = {
  1829. .pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp2_pad_mux),
  1830. .pad_mux_list = audio_uart0_urfs_grp2_pad_mux,
  1831. };
  1832. static struct atlas7_pad_mux audio_uart0_urfs_grp3_pad_mux[] = {
  1833. MUX(1, 162, 6, 0xa10, 28, 0xa90, 28),
  1834. };
  1835. static struct atlas7_grp_mux audio_uart0_urfs_grp3_mux = {
  1836. .pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp3_pad_mux),
  1837. .pad_mux_list = audio_uart0_urfs_grp3_pad_mux,
  1838. };
  1839. static struct atlas7_pad_mux audio_uart1_basic_grp_pad_mux[] = {
  1840. MUX(1, 147, 1, 0xa10, 24, 0xa90, 24),
  1841. MUX(1, 146, 1, 0xa10, 25, 0xa90, 25),
  1842. MUX(1, 145, 1, 0xa10, 23, 0xa90, 23),
  1843. MUX(1, 148, 1, 0xa10, 22, 0xa90, 22),
  1844. };
  1845. static struct atlas7_grp_mux audio_uart1_basic_grp_mux = {
  1846. .pad_mux_count = ARRAY_SIZE(audio_uart1_basic_grp_pad_mux),
  1847. .pad_mux_list = audio_uart1_basic_grp_pad_mux,
  1848. };
  1849. static struct atlas7_pad_mux audio_uart1_urfs_grp0_pad_mux[] = {
  1850. MUX(1, 117, 6, 0xa10, 29, 0xa90, 29),
  1851. };
  1852. static struct atlas7_grp_mux audio_uart1_urfs_grp0_mux = {
  1853. .pad_mux_count = ARRAY_SIZE(audio_uart1_urfs_grp0_pad_mux),
  1854. .pad_mux_list = audio_uart1_urfs_grp0_pad_mux,
  1855. };
  1856. static struct atlas7_pad_mux audio_uart1_urfs_grp1_pad_mux[] = {
  1857. MUX(1, 140, 3, 0xa10, 29, 0xa90, 29),
  1858. };
  1859. static struct atlas7_grp_mux audio_uart1_urfs_grp1_mux = {
  1860. .pad_mux_count = ARRAY_SIZE(audio_uart1_urfs_grp1_pad_mux),
  1861. .pad_mux_list = audio_uart1_urfs_grp1_pad_mux,
  1862. };
  1863. static struct atlas7_pad_mux audio_uart1_urfs_grp2_pad_mux[] = {
  1864. MUX(1, 163, 4, 0xa10, 29, 0xa90, 29),
  1865. };
  1866. static struct atlas7_grp_mux audio_uart1_urfs_grp2_mux = {
  1867. .pad_mux_count = ARRAY_SIZE(audio_uart1_urfs_grp2_pad_mux),
  1868. .pad_mux_list = audio_uart1_urfs_grp2_pad_mux,
  1869. };
  1870. static struct atlas7_pad_mux audio_uart2_urfs_grp0_pad_mux[] = {
  1871. MUX(1, 139, 4, 0xa10, 30, 0xa90, 30),
  1872. };
  1873. static struct atlas7_grp_mux audio_uart2_urfs_grp0_mux = {
  1874. .pad_mux_count = ARRAY_SIZE(audio_uart2_urfs_grp0_pad_mux),
  1875. .pad_mux_list = audio_uart2_urfs_grp0_pad_mux,
  1876. };
  1877. static struct atlas7_pad_mux audio_uart2_urfs_grp1_pad_mux[] = {
  1878. MUX(1, 163, 6, 0xa10, 30, 0xa90, 30),
  1879. };
  1880. static struct atlas7_grp_mux audio_uart2_urfs_grp1_mux = {
  1881. .pad_mux_count = ARRAY_SIZE(audio_uart2_urfs_grp1_pad_mux),
  1882. .pad_mux_list = audio_uart2_urfs_grp1_pad_mux,
  1883. };
  1884. static struct atlas7_pad_mux audio_uart2_urfs_grp2_pad_mux[] = {
  1885. MUX(1, 96, 3, 0xa10, 30, 0xa90, 30),
  1886. };
  1887. static struct atlas7_grp_mux audio_uart2_urfs_grp2_mux = {
  1888. .pad_mux_count = ARRAY_SIZE(audio_uart2_urfs_grp2_pad_mux),
  1889. .pad_mux_list = audio_uart2_urfs_grp2_pad_mux,
  1890. };
  1891. static struct atlas7_pad_mux audio_uart2_urxd_grp0_pad_mux[] = {
  1892. MUX(1, 20, 2, 0xa00, 24, 0xa80, 24),
  1893. };
  1894. static struct atlas7_grp_mux audio_uart2_urxd_grp0_mux = {
  1895. .pad_mux_count = ARRAY_SIZE(audio_uart2_urxd_grp0_pad_mux),
  1896. .pad_mux_list = audio_uart2_urxd_grp0_pad_mux,
  1897. };
  1898. static struct atlas7_pad_mux audio_uart2_urxd_grp1_pad_mux[] = {
  1899. MUX(1, 109, 2, 0xa00, 24, 0xa80, 24),
  1900. };
  1901. static struct atlas7_grp_mux audio_uart2_urxd_grp1_mux = {
  1902. .pad_mux_count = ARRAY_SIZE(audio_uart2_urxd_grp1_pad_mux),
  1903. .pad_mux_list = audio_uart2_urxd_grp1_pad_mux,
  1904. };
  1905. static struct atlas7_pad_mux audio_uart2_urxd_grp2_pad_mux[] = {
  1906. MUX(1, 93, 3, 0xa00, 24, 0xa80, 24),
  1907. };
  1908. static struct atlas7_grp_mux audio_uart2_urxd_grp2_mux = {
  1909. .pad_mux_count = ARRAY_SIZE(audio_uart2_urxd_grp2_pad_mux),
  1910. .pad_mux_list = audio_uart2_urxd_grp2_pad_mux,
  1911. };
  1912. static struct atlas7_pad_mux audio_uart2_usclk_grp0_pad_mux[] = {
  1913. MUX(1, 19, 2, 0xa00, 23, 0xa80, 23),
  1914. };
  1915. static struct atlas7_grp_mux audio_uart2_usclk_grp0_mux = {
  1916. .pad_mux_count = ARRAY_SIZE(audio_uart2_usclk_grp0_pad_mux),
  1917. .pad_mux_list = audio_uart2_usclk_grp0_pad_mux,
  1918. };
  1919. static struct atlas7_pad_mux audio_uart2_usclk_grp1_pad_mux[] = {
  1920. MUX(1, 101, 2, 0xa00, 23, 0xa80, 23),
  1921. };
  1922. static struct atlas7_grp_mux audio_uart2_usclk_grp1_mux = {
  1923. .pad_mux_count = ARRAY_SIZE(audio_uart2_usclk_grp1_pad_mux),
  1924. .pad_mux_list = audio_uart2_usclk_grp1_pad_mux,
  1925. };
  1926. static struct atlas7_pad_mux audio_uart2_usclk_grp2_pad_mux[] = {
  1927. MUX(1, 91, 3, 0xa00, 23, 0xa80, 23),
  1928. };
  1929. static struct atlas7_grp_mux audio_uart2_usclk_grp2_mux = {
  1930. .pad_mux_count = ARRAY_SIZE(audio_uart2_usclk_grp2_pad_mux),
  1931. .pad_mux_list = audio_uart2_usclk_grp2_pad_mux,
  1932. };
  1933. static struct atlas7_pad_mux audio_uart2_utfs_grp0_pad_mux[] = {
  1934. MUX(1, 18, 2, 0xa00, 22, 0xa80, 22),
  1935. };
  1936. static struct atlas7_grp_mux audio_uart2_utfs_grp0_mux = {
  1937. .pad_mux_count = ARRAY_SIZE(audio_uart2_utfs_grp0_pad_mux),
  1938. .pad_mux_list = audio_uart2_utfs_grp0_pad_mux,
  1939. };
  1940. static struct atlas7_pad_mux audio_uart2_utfs_grp1_pad_mux[] = {
  1941. MUX(1, 111, 2, 0xa00, 22, 0xa80, 22),
  1942. };
  1943. static struct atlas7_grp_mux audio_uart2_utfs_grp1_mux = {
  1944. .pad_mux_count = ARRAY_SIZE(audio_uart2_utfs_grp1_pad_mux),
  1945. .pad_mux_list = audio_uart2_utfs_grp1_pad_mux,
  1946. };
  1947. static struct atlas7_pad_mux audio_uart2_utfs_grp2_pad_mux[] = {
  1948. MUX(1, 94, 3, 0xa00, 22, 0xa80, 22),
  1949. };
  1950. static struct atlas7_grp_mux audio_uart2_utfs_grp2_mux = {
  1951. .pad_mux_count = ARRAY_SIZE(audio_uart2_utfs_grp2_pad_mux),
  1952. .pad_mux_list = audio_uart2_utfs_grp2_pad_mux,
  1953. };
  1954. static struct atlas7_pad_mux audio_uart2_utxd_grp0_pad_mux[] = {
  1955. MUX(1, 21, 2, 0xa00, 25, 0xa80, 25),
  1956. };
  1957. static struct atlas7_grp_mux audio_uart2_utxd_grp0_mux = {
  1958. .pad_mux_count = ARRAY_SIZE(audio_uart2_utxd_grp0_pad_mux),
  1959. .pad_mux_list = audio_uart2_utxd_grp0_pad_mux,
  1960. };
  1961. static struct atlas7_pad_mux audio_uart2_utxd_grp1_pad_mux[] = {
  1962. MUX(1, 110, 2, 0xa00, 25, 0xa80, 25),
  1963. };
  1964. static struct atlas7_grp_mux audio_uart2_utxd_grp1_mux = {
  1965. .pad_mux_count = ARRAY_SIZE(audio_uart2_utxd_grp1_pad_mux),
  1966. .pad_mux_list = audio_uart2_utxd_grp1_pad_mux,
  1967. };
  1968. static struct atlas7_pad_mux audio_uart2_utxd_grp2_pad_mux[] = {
  1969. MUX(1, 92, 3, 0xa00, 25, 0xa80, 25),
  1970. };
  1971. static struct atlas7_grp_mux audio_uart2_utxd_grp2_mux = {
  1972. .pad_mux_count = ARRAY_SIZE(audio_uart2_utxd_grp2_pad_mux),
  1973. .pad_mux_list = audio_uart2_utxd_grp2_pad_mux,
  1974. };
  1975. static struct atlas7_pad_mux c_can_trnsvr_en_grp0_pad_mux[] = {
  1976. MUX(0, 2, 6, N, N, N, N),
  1977. };
  1978. static struct atlas7_grp_mux c_can_trnsvr_en_grp0_mux = {
  1979. .pad_mux_count = ARRAY_SIZE(c_can_trnsvr_en_grp0_pad_mux),
  1980. .pad_mux_list = c_can_trnsvr_en_grp0_pad_mux,
  1981. };
  1982. static struct atlas7_pad_mux c_can_trnsvr_en_grp1_pad_mux[] = {
  1983. MUX(0, 0, 2, N, N, N, N),
  1984. };
  1985. static struct atlas7_grp_mux c_can_trnsvr_en_grp1_mux = {
  1986. .pad_mux_count = ARRAY_SIZE(c_can_trnsvr_en_grp1_pad_mux),
  1987. .pad_mux_list = c_can_trnsvr_en_grp1_pad_mux,
  1988. };
  1989. static struct atlas7_pad_mux c_can_trnsvr_intr_grp_pad_mux[] = {
  1990. MUX(0, 1, 2, N, N, N, N),
  1991. };
  1992. static struct atlas7_grp_mux c_can_trnsvr_intr_grp_mux = {
  1993. .pad_mux_count = ARRAY_SIZE(c_can_trnsvr_intr_grp_pad_mux),
  1994. .pad_mux_list = c_can_trnsvr_intr_grp_pad_mux,
  1995. };
  1996. static struct atlas7_pad_mux c_can_trnsvr_stb_n_grp_pad_mux[] = {
  1997. MUX(0, 3, 6, N, N, N, N),
  1998. };
  1999. static struct atlas7_grp_mux c_can_trnsvr_stb_n_grp_mux = {
  2000. .pad_mux_count = ARRAY_SIZE(c_can_trnsvr_stb_n_grp_pad_mux),
  2001. .pad_mux_list = c_can_trnsvr_stb_n_grp_pad_mux,
  2002. };
  2003. static struct atlas7_pad_mux c0_can_rxd_trnsv0_grp_pad_mux[] = {
  2004. MUX(0, 11, 1, 0xa08, 9, 0xa88, 9),
  2005. };
  2006. static struct atlas7_grp_mux c0_can_rxd_trnsv0_grp_mux = {
  2007. .pad_mux_count = ARRAY_SIZE(c0_can_rxd_trnsv0_grp_pad_mux),
  2008. .pad_mux_list = c0_can_rxd_trnsv0_grp_pad_mux,
  2009. };
  2010. static struct atlas7_pad_mux c0_can_rxd_trnsv1_grp_pad_mux[] = {
  2011. MUX(0, 2, 5, 0xa10, 9, 0xa90, 9),
  2012. };
  2013. static struct atlas7_grp_mux c0_can_rxd_trnsv1_grp_mux = {
  2014. .pad_mux_count = ARRAY_SIZE(c0_can_rxd_trnsv1_grp_pad_mux),
  2015. .pad_mux_list = c0_can_rxd_trnsv1_grp_pad_mux,
  2016. };
  2017. static struct atlas7_pad_mux c0_can_txd_trnsv0_grp_pad_mux[] = {
  2018. MUX(0, 10, 1, N, N, N, N),
  2019. };
  2020. static struct atlas7_grp_mux c0_can_txd_trnsv0_grp_mux = {
  2021. .pad_mux_count = ARRAY_SIZE(c0_can_txd_trnsv0_grp_pad_mux),
  2022. .pad_mux_list = c0_can_txd_trnsv0_grp_pad_mux,
  2023. };
  2024. static struct atlas7_pad_mux c0_can_txd_trnsv1_grp_pad_mux[] = {
  2025. MUX(0, 3, 5, N, N, N, N),
  2026. };
  2027. static struct atlas7_grp_mux c0_can_txd_trnsv1_grp_mux = {
  2028. .pad_mux_count = ARRAY_SIZE(c0_can_txd_trnsv1_grp_pad_mux),
  2029. .pad_mux_list = c0_can_txd_trnsv1_grp_pad_mux,
  2030. };
  2031. static struct atlas7_pad_mux c1_can_rxd_grp0_pad_mux[] = {
  2032. MUX(1, 138, 2, 0xa00, 4, 0xa80, 4),
  2033. };
  2034. static struct atlas7_grp_mux c1_can_rxd_grp0_mux = {
  2035. .pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp0_pad_mux),
  2036. .pad_mux_list = c1_can_rxd_grp0_pad_mux,
  2037. };
  2038. static struct atlas7_pad_mux c1_can_rxd_grp1_pad_mux[] = {
  2039. MUX(1, 147, 2, 0xa00, 4, 0xa80, 4),
  2040. };
  2041. static struct atlas7_grp_mux c1_can_rxd_grp1_mux = {
  2042. .pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp1_pad_mux),
  2043. .pad_mux_list = c1_can_rxd_grp1_pad_mux,
  2044. };
  2045. static struct atlas7_pad_mux c1_can_rxd_grp2_pad_mux[] = {
  2046. MUX(0, 2, 2, 0xa00, 4, 0xa80, 4),
  2047. };
  2048. static struct atlas7_grp_mux c1_can_rxd_grp2_mux = {
  2049. .pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp2_pad_mux),
  2050. .pad_mux_list = c1_can_rxd_grp2_pad_mux,
  2051. };
  2052. static struct atlas7_pad_mux c1_can_rxd_grp3_pad_mux[] = {
  2053. MUX(1, 162, 4, 0xa00, 4, 0xa80, 4),
  2054. };
  2055. static struct atlas7_grp_mux c1_can_rxd_grp3_mux = {
  2056. .pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp3_pad_mux),
  2057. .pad_mux_list = c1_can_rxd_grp3_pad_mux,
  2058. };
  2059. static struct atlas7_pad_mux c1_can_txd_grp0_pad_mux[] = {
  2060. MUX(1, 137, 2, N, N, N, N),
  2061. };
  2062. static struct atlas7_grp_mux c1_can_txd_grp0_mux = {
  2063. .pad_mux_count = ARRAY_SIZE(c1_can_txd_grp0_pad_mux),
  2064. .pad_mux_list = c1_can_txd_grp0_pad_mux,
  2065. };
  2066. static struct atlas7_pad_mux c1_can_txd_grp1_pad_mux[] = {
  2067. MUX(1, 146, 2, N, N, N, N),
  2068. };
  2069. static struct atlas7_grp_mux c1_can_txd_grp1_mux = {
  2070. .pad_mux_count = ARRAY_SIZE(c1_can_txd_grp1_pad_mux),
  2071. .pad_mux_list = c1_can_txd_grp1_pad_mux,
  2072. };
  2073. static struct atlas7_pad_mux c1_can_txd_grp2_pad_mux[] = {
  2074. MUX(0, 3, 2, N, N, N, N),
  2075. };
  2076. static struct atlas7_grp_mux c1_can_txd_grp2_mux = {
  2077. .pad_mux_count = ARRAY_SIZE(c1_can_txd_grp2_pad_mux),
  2078. .pad_mux_list = c1_can_txd_grp2_pad_mux,
  2079. };
  2080. static struct atlas7_pad_mux c1_can_txd_grp3_pad_mux[] = {
  2081. MUX(1, 161, 4, N, N, N, N),
  2082. };
  2083. static struct atlas7_grp_mux c1_can_txd_grp3_mux = {
  2084. .pad_mux_count = ARRAY_SIZE(c1_can_txd_grp3_pad_mux),
  2085. .pad_mux_list = c1_can_txd_grp3_pad_mux,
  2086. };
  2087. static struct atlas7_pad_mux ca_audio_lpc_grp_pad_mux[] = {
  2088. MUX(1, 62, 4, N, N, N, N),
  2089. MUX(1, 63, 4, N, N, N, N),
  2090. MUX(1, 64, 4, N, N, N, N),
  2091. MUX(1, 65, 4, N, N, N, N),
  2092. MUX(1, 66, 4, N, N, N, N),
  2093. MUX(1, 67, 4, N, N, N, N),
  2094. MUX(1, 68, 4, N, N, N, N),
  2095. MUX(1, 69, 4, N, N, N, N),
  2096. MUX(1, 70, 4, N, N, N, N),
  2097. MUX(1, 71, 4, N, N, N, N),
  2098. };
  2099. static struct atlas7_grp_mux ca_audio_lpc_grp_mux = {
  2100. .pad_mux_count = ARRAY_SIZE(ca_audio_lpc_grp_pad_mux),
  2101. .pad_mux_list = ca_audio_lpc_grp_pad_mux,
  2102. };
  2103. static struct atlas7_pad_mux ca_bt_lpc_grp_pad_mux[] = {
  2104. MUX(1, 85, 5, N, N, N, N),
  2105. MUX(1, 86, 5, N, N, N, N),
  2106. MUX(1, 87, 5, N, N, N, N),
  2107. MUX(1, 88, 5, N, N, N, N),
  2108. MUX(1, 89, 5, N, N, N, N),
  2109. MUX(1, 90, 5, N, N, N, N),
  2110. };
  2111. static struct atlas7_grp_mux ca_bt_lpc_grp_mux = {
  2112. .pad_mux_count = ARRAY_SIZE(ca_bt_lpc_grp_pad_mux),
  2113. .pad_mux_list = ca_bt_lpc_grp_pad_mux,
  2114. };
  2115. static struct atlas7_pad_mux ca_coex_grp_pad_mux[] = {
  2116. MUX(1, 129, 1, N, N, N, N),
  2117. MUX(1, 130, 1, N, N, N, N),
  2118. MUX(1, 131, 1, N, N, N, N),
  2119. MUX(1, 132, 1, N, N, N, N),
  2120. };
  2121. static struct atlas7_grp_mux ca_coex_grp_mux = {
  2122. .pad_mux_count = ARRAY_SIZE(ca_coex_grp_pad_mux),
  2123. .pad_mux_list = ca_coex_grp_pad_mux,
  2124. };
  2125. static struct atlas7_pad_mux ca_curator_lpc_grp_pad_mux[] = {
  2126. MUX(1, 57, 4, N, N, N, N),
  2127. MUX(1, 58, 4, N, N, N, N),
  2128. MUX(1, 59, 4, N, N, N, N),
  2129. MUX(1, 60, 4, N, N, N, N),
  2130. };
  2131. static struct atlas7_grp_mux ca_curator_lpc_grp_mux = {
  2132. .pad_mux_count = ARRAY_SIZE(ca_curator_lpc_grp_pad_mux),
  2133. .pad_mux_list = ca_curator_lpc_grp_pad_mux,
  2134. };
  2135. static struct atlas7_pad_mux ca_pcm_debug_grp_pad_mux[] = {
  2136. MUX(1, 91, 5, N, N, N, N),
  2137. MUX(1, 93, 5, N, N, N, N),
  2138. MUX(1, 94, 5, N, N, N, N),
  2139. MUX(1, 92, 5, N, N, N, N),
  2140. };
  2141. static struct atlas7_grp_mux ca_pcm_debug_grp_mux = {
  2142. .pad_mux_count = ARRAY_SIZE(ca_pcm_debug_grp_pad_mux),
  2143. .pad_mux_list = ca_pcm_debug_grp_pad_mux,
  2144. };
  2145. static struct atlas7_pad_mux ca_pio_grp_pad_mux[] = {
  2146. MUX(1, 121, 2, N, N, N, N),
  2147. MUX(1, 122, 2, N, N, N, N),
  2148. MUX(1, 125, 6, N, N, N, N),
  2149. MUX(1, 126, 6, N, N, N, N),
  2150. MUX(1, 38, 5, N, N, N, N),
  2151. MUX(1, 37, 5, N, N, N, N),
  2152. MUX(1, 47, 5, N, N, N, N),
  2153. MUX(1, 49, 5, N, N, N, N),
  2154. MUX(1, 50, 5, N, N, N, N),
  2155. MUX(1, 54, 4, N, N, N, N),
  2156. MUX(1, 55, 4, N, N, N, N),
  2157. MUX(1, 56, 4, N, N, N, N),
  2158. };
  2159. static struct atlas7_grp_mux ca_pio_grp_mux = {
  2160. .pad_mux_count = ARRAY_SIZE(ca_pio_grp_pad_mux),
  2161. .pad_mux_list = ca_pio_grp_pad_mux,
  2162. };
  2163. static struct atlas7_pad_mux ca_sdio_debug_grp_pad_mux[] = {
  2164. MUX(1, 40, 5, N, N, N, N),
  2165. MUX(1, 39, 5, N, N, N, N),
  2166. MUX(1, 44, 5, N, N, N, N),
  2167. MUX(1, 43, 5, N, N, N, N),
  2168. MUX(1, 42, 5, N, N, N, N),
  2169. MUX(1, 41, 5, N, N, N, N),
  2170. };
  2171. static struct atlas7_grp_mux ca_sdio_debug_grp_mux = {
  2172. .pad_mux_count = ARRAY_SIZE(ca_sdio_debug_grp_pad_mux),
  2173. .pad_mux_list = ca_sdio_debug_grp_pad_mux,
  2174. };
  2175. static struct atlas7_pad_mux ca_spi_grp_pad_mux[] = {
  2176. MUX(1, 82, 5, N, N, N, N),
  2177. MUX(1, 79, 5, 0xa08, 6, 0xa88, 6),
  2178. MUX(1, 80, 5, N, N, N, N),
  2179. MUX(1, 81, 5, N, N, N, N),
  2180. };
  2181. static struct atlas7_grp_mux ca_spi_grp_mux = {
  2182. .pad_mux_count = ARRAY_SIZE(ca_spi_grp_pad_mux),
  2183. .pad_mux_list = ca_spi_grp_pad_mux,
  2184. };
  2185. static struct atlas7_pad_mux ca_trb_grp_pad_mux[] = {
  2186. MUX(1, 91, 4, N, N, N, N),
  2187. MUX(1, 93, 4, N, N, N, N),
  2188. MUX(1, 94, 4, N, N, N, N),
  2189. MUX(1, 95, 4, N, N, N, N),
  2190. MUX(1, 96, 4, N, N, N, N),
  2191. MUX(1, 78, 5, N, N, N, N),
  2192. MUX(1, 74, 5, N, N, N, N),
  2193. MUX(1, 75, 5, N, N, N, N),
  2194. MUX(1, 76, 5, N, N, N, N),
  2195. MUX(1, 77, 5, N, N, N, N),
  2196. };
  2197. static struct atlas7_grp_mux ca_trb_grp_mux = {
  2198. .pad_mux_count = ARRAY_SIZE(ca_trb_grp_pad_mux),
  2199. .pad_mux_list = ca_trb_grp_pad_mux,
  2200. };
  2201. static struct atlas7_pad_mux ca_uart_debug_grp_pad_mux[] = {
  2202. MUX(1, 136, 3, N, N, N, N),
  2203. MUX(1, 135, 3, N, N, N, N),
  2204. MUX(1, 134, 3, N, N, N, N),
  2205. MUX(1, 133, 3, N, N, N, N),
  2206. };
  2207. static struct atlas7_grp_mux ca_uart_debug_grp_mux = {
  2208. .pad_mux_count = ARRAY_SIZE(ca_uart_debug_grp_pad_mux),
  2209. .pad_mux_list = ca_uart_debug_grp_pad_mux,
  2210. };
  2211. static struct atlas7_pad_mux clkc_grp0_pad_mux[] = {
  2212. MUX(1, 30, 2, 0xa08, 14, 0xa88, 14),
  2213. MUX(1, 47, 6, N, N, N, N),
  2214. };
  2215. static struct atlas7_grp_mux clkc_grp0_mux = {
  2216. .pad_mux_count = ARRAY_SIZE(clkc_grp0_pad_mux),
  2217. .pad_mux_list = clkc_grp0_pad_mux,
  2218. };
  2219. static struct atlas7_pad_mux clkc_grp1_pad_mux[] = {
  2220. MUX(1, 78, 3, 0xa08, 14, 0xa88, 14),
  2221. MUX(1, 54, 5, N, N, N, N),
  2222. };
  2223. static struct atlas7_grp_mux clkc_grp1_mux = {
  2224. .pad_mux_count = ARRAY_SIZE(clkc_grp1_pad_mux),
  2225. .pad_mux_list = clkc_grp1_pad_mux,
  2226. };
  2227. static struct atlas7_pad_mux gn_gnss_i2c_grp_pad_mux[] = {
  2228. MUX(1, 128, 2, N, N, N, N),
  2229. MUX(1, 127, 2, N, N, N, N),
  2230. };
  2231. static struct atlas7_grp_mux gn_gnss_i2c_grp_mux = {
  2232. .pad_mux_count = ARRAY_SIZE(gn_gnss_i2c_grp_pad_mux),
  2233. .pad_mux_list = gn_gnss_i2c_grp_pad_mux,
  2234. };
  2235. static struct atlas7_pad_mux gn_gnss_uart_nopause_grp_pad_mux[] = {
  2236. MUX(1, 134, 4, N, N, N, N),
  2237. MUX(1, 133, 4, N, N, N, N),
  2238. };
  2239. static struct atlas7_grp_mux gn_gnss_uart_nopause_grp_mux = {
  2240. .pad_mux_count = ARRAY_SIZE(gn_gnss_uart_nopause_grp_pad_mux),
  2241. .pad_mux_list = gn_gnss_uart_nopause_grp_pad_mux,
  2242. };
  2243. static struct atlas7_pad_mux gn_gnss_uart_grp_pad_mux[] = {
  2244. MUX(1, 134, 4, N, N, N, N),
  2245. MUX(1, 133, 4, N, N, N, N),
  2246. MUX(1, 136, 4, N, N, N, N),
  2247. MUX(1, 135, 4, N, N, N, N),
  2248. };
  2249. static struct atlas7_grp_mux gn_gnss_uart_grp_mux = {
  2250. .pad_mux_count = ARRAY_SIZE(gn_gnss_uart_grp_pad_mux),
  2251. .pad_mux_list = gn_gnss_uart_grp_pad_mux,
  2252. };
  2253. static struct atlas7_pad_mux gn_trg_spi_grp0_pad_mux[] = {
  2254. MUX(1, 22, 1, N, N, N, N),
  2255. MUX(1, 25, 1, N, N, N, N),
  2256. MUX(1, 23, 1, 0xa00, 10, 0xa80, 10),
  2257. MUX(1, 24, 1, N, N, N, N),
  2258. };
  2259. static struct atlas7_grp_mux gn_trg_spi_grp0_mux = {
  2260. .pad_mux_count = ARRAY_SIZE(gn_trg_spi_grp0_pad_mux),
  2261. .pad_mux_list = gn_trg_spi_grp0_pad_mux,
  2262. };
  2263. static struct atlas7_pad_mux gn_trg_spi_grp1_pad_mux[] = {
  2264. MUX(1, 82, 3, N, N, N, N),
  2265. MUX(1, 79, 3, N, N, N, N),
  2266. MUX(1, 80, 3, 0xa00, 10, 0xa80, 10),
  2267. MUX(1, 81, 3, N, N, N, N),
  2268. };
  2269. static struct atlas7_grp_mux gn_trg_spi_grp1_mux = {
  2270. .pad_mux_count = ARRAY_SIZE(gn_trg_spi_grp1_pad_mux),
  2271. .pad_mux_list = gn_trg_spi_grp1_pad_mux,
  2272. };
  2273. static struct atlas7_pad_mux cvbs_dbg_grp_pad_mux[] = {
  2274. MUX(1, 54, 3, N, N, N, N),
  2275. MUX(1, 53, 3, N, N, N, N),
  2276. MUX(1, 82, 7, N, N, N, N),
  2277. MUX(1, 74, 7, N, N, N, N),
  2278. MUX(1, 75, 7, N, N, N, N),
  2279. MUX(1, 76, 7, N, N, N, N),
  2280. MUX(1, 77, 7, N, N, N, N),
  2281. MUX(1, 78, 7, N, N, N, N),
  2282. MUX(1, 79, 7, N, N, N, N),
  2283. MUX(1, 80, 7, N, N, N, N),
  2284. MUX(1, 81, 7, N, N, N, N),
  2285. MUX(1, 83, 7, N, N, N, N),
  2286. MUX(1, 84, 7, N, N, N, N),
  2287. MUX(1, 73, 3, N, N, N, N),
  2288. MUX(1, 55, 3, N, N, N, N),
  2289. MUX(1, 56, 3, N, N, N, N),
  2290. };
  2291. static struct atlas7_grp_mux cvbs_dbg_grp_mux = {
  2292. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_grp_pad_mux),
  2293. .pad_mux_list = cvbs_dbg_grp_pad_mux,
  2294. };
  2295. static struct atlas7_pad_mux cvbs_dbg_test_grp0_pad_mux[] = {
  2296. MUX(1, 57, 3, N, N, N, N),
  2297. };
  2298. static struct atlas7_grp_mux cvbs_dbg_test_grp0_mux = {
  2299. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp0_pad_mux),
  2300. .pad_mux_list = cvbs_dbg_test_grp0_pad_mux,
  2301. };
  2302. static struct atlas7_pad_mux cvbs_dbg_test_grp1_pad_mux[] = {
  2303. MUX(1, 58, 3, N, N, N, N),
  2304. };
  2305. static struct atlas7_grp_mux cvbs_dbg_test_grp1_mux = {
  2306. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp1_pad_mux),
  2307. .pad_mux_list = cvbs_dbg_test_grp1_pad_mux,
  2308. };
  2309. static struct atlas7_pad_mux cvbs_dbg_test_grp2_pad_mux[] = {
  2310. MUX(1, 59, 3, N, N, N, N),
  2311. };
  2312. static struct atlas7_grp_mux cvbs_dbg_test_grp2_mux = {
  2313. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp2_pad_mux),
  2314. .pad_mux_list = cvbs_dbg_test_grp2_pad_mux,
  2315. };
  2316. static struct atlas7_pad_mux cvbs_dbg_test_grp3_pad_mux[] = {
  2317. MUX(1, 60, 3, N, N, N, N),
  2318. };
  2319. static struct atlas7_grp_mux cvbs_dbg_test_grp3_mux = {
  2320. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp3_pad_mux),
  2321. .pad_mux_list = cvbs_dbg_test_grp3_pad_mux,
  2322. };
  2323. static struct atlas7_pad_mux cvbs_dbg_test_grp4_pad_mux[] = {
  2324. MUX(1, 61, 3, N, N, N, N),
  2325. };
  2326. static struct atlas7_grp_mux cvbs_dbg_test_grp4_mux = {
  2327. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp4_pad_mux),
  2328. .pad_mux_list = cvbs_dbg_test_grp4_pad_mux,
  2329. };
  2330. static struct atlas7_pad_mux cvbs_dbg_test_grp5_pad_mux[] = {
  2331. MUX(1, 62, 3, N, N, N, N),
  2332. };
  2333. static struct atlas7_grp_mux cvbs_dbg_test_grp5_mux = {
  2334. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp5_pad_mux),
  2335. .pad_mux_list = cvbs_dbg_test_grp5_pad_mux,
  2336. };
  2337. static struct atlas7_pad_mux cvbs_dbg_test_grp6_pad_mux[] = {
  2338. MUX(1, 63, 3, N, N, N, N),
  2339. };
  2340. static struct atlas7_grp_mux cvbs_dbg_test_grp6_mux = {
  2341. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp6_pad_mux),
  2342. .pad_mux_list = cvbs_dbg_test_grp6_pad_mux,
  2343. };
  2344. static struct atlas7_pad_mux cvbs_dbg_test_grp7_pad_mux[] = {
  2345. MUX(1, 64, 3, N, N, N, N),
  2346. };
  2347. static struct atlas7_grp_mux cvbs_dbg_test_grp7_mux = {
  2348. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp7_pad_mux),
  2349. .pad_mux_list = cvbs_dbg_test_grp7_pad_mux,
  2350. };
  2351. static struct atlas7_pad_mux cvbs_dbg_test_grp8_pad_mux[] = {
  2352. MUX(1, 65, 3, N, N, N, N),
  2353. };
  2354. static struct atlas7_grp_mux cvbs_dbg_test_grp8_mux = {
  2355. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp8_pad_mux),
  2356. .pad_mux_list = cvbs_dbg_test_grp8_pad_mux,
  2357. };
  2358. static struct atlas7_pad_mux cvbs_dbg_test_grp9_pad_mux[] = {
  2359. MUX(1, 66, 3, N, N, N, N),
  2360. };
  2361. static struct atlas7_grp_mux cvbs_dbg_test_grp9_mux = {
  2362. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp9_pad_mux),
  2363. .pad_mux_list = cvbs_dbg_test_grp9_pad_mux,
  2364. };
  2365. static struct atlas7_pad_mux cvbs_dbg_test_grp10_pad_mux[] = {
  2366. MUX(1, 67, 3, N, N, N, N),
  2367. };
  2368. static struct atlas7_grp_mux cvbs_dbg_test_grp10_mux = {
  2369. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp10_pad_mux),
  2370. .pad_mux_list = cvbs_dbg_test_grp10_pad_mux,
  2371. };
  2372. static struct atlas7_pad_mux cvbs_dbg_test_grp11_pad_mux[] = {
  2373. MUX(1, 68, 3, N, N, N, N),
  2374. };
  2375. static struct atlas7_grp_mux cvbs_dbg_test_grp11_mux = {
  2376. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp11_pad_mux),
  2377. .pad_mux_list = cvbs_dbg_test_grp11_pad_mux,
  2378. };
  2379. static struct atlas7_pad_mux cvbs_dbg_test_grp12_pad_mux[] = {
  2380. MUX(1, 69, 3, N, N, N, N),
  2381. };
  2382. static struct atlas7_grp_mux cvbs_dbg_test_grp12_mux = {
  2383. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp12_pad_mux),
  2384. .pad_mux_list = cvbs_dbg_test_grp12_pad_mux,
  2385. };
  2386. static struct atlas7_pad_mux cvbs_dbg_test_grp13_pad_mux[] = {
  2387. MUX(1, 70, 3, N, N, N, N),
  2388. };
  2389. static struct atlas7_grp_mux cvbs_dbg_test_grp13_mux = {
  2390. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp13_pad_mux),
  2391. .pad_mux_list = cvbs_dbg_test_grp13_pad_mux,
  2392. };
  2393. static struct atlas7_pad_mux cvbs_dbg_test_grp14_pad_mux[] = {
  2394. MUX(1, 71, 3, N, N, N, N),
  2395. };
  2396. static struct atlas7_grp_mux cvbs_dbg_test_grp14_mux = {
  2397. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp14_pad_mux),
  2398. .pad_mux_list = cvbs_dbg_test_grp14_pad_mux,
  2399. };
  2400. static struct atlas7_pad_mux cvbs_dbg_test_grp15_pad_mux[] = {
  2401. MUX(1, 72, 3, N, N, N, N),
  2402. };
  2403. static struct atlas7_grp_mux cvbs_dbg_test_grp15_mux = {
  2404. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp15_pad_mux),
  2405. .pad_mux_list = cvbs_dbg_test_grp15_pad_mux,
  2406. };
  2407. static struct atlas7_pad_mux gn_gnss_power_grp_pad_mux[] = {
  2408. MUX(1, 123, 7, N, N, N, N),
  2409. MUX(1, 124, 7, N, N, N, N),
  2410. MUX(1, 121, 7, N, N, N, N),
  2411. MUX(1, 122, 7, N, N, N, N),
  2412. MUX(1, 125, 7, N, N, N, N),
  2413. MUX(1, 120, 7, N, N, N, N),
  2414. };
  2415. static struct atlas7_grp_mux gn_gnss_power_grp_mux = {
  2416. .pad_mux_count = ARRAY_SIZE(gn_gnss_power_grp_pad_mux),
  2417. .pad_mux_list = gn_gnss_power_grp_pad_mux,
  2418. };
  2419. static struct atlas7_pad_mux gn_gnss_sw_status_grp_pad_mux[] = {
  2420. MUX(1, 57, 7, N, N, N, N),
  2421. MUX(1, 58, 7, N, N, N, N),
  2422. MUX(1, 59, 7, N, N, N, N),
  2423. MUX(1, 60, 7, N, N, N, N),
  2424. MUX(1, 61, 7, N, N, N, N),
  2425. MUX(1, 62, 7, N, N, N, N),
  2426. MUX(1, 63, 7, N, N, N, N),
  2427. MUX(1, 64, 7, N, N, N, N),
  2428. MUX(1, 65, 7, N, N, N, N),
  2429. MUX(1, 66, 7, N, N, N, N),
  2430. MUX(1, 67, 7, N, N, N, N),
  2431. MUX(1, 68, 7, N, N, N, N),
  2432. MUX(1, 69, 7, N, N, N, N),
  2433. MUX(1, 70, 7, N, N, N, N),
  2434. MUX(1, 71, 7, N, N, N, N),
  2435. MUX(1, 72, 7, N, N, N, N),
  2436. MUX(1, 53, 7, N, N, N, N),
  2437. MUX(1, 55, 7, N, N, N, N),
  2438. MUX(1, 56, 7, 0xa08, 12, 0xa88, 12),
  2439. MUX(1, 54, 7, N, N, N, N),
  2440. };
  2441. static struct atlas7_grp_mux gn_gnss_sw_status_grp_mux = {
  2442. .pad_mux_count = ARRAY_SIZE(gn_gnss_sw_status_grp_pad_mux),
  2443. .pad_mux_list = gn_gnss_sw_status_grp_pad_mux,
  2444. };
  2445. static struct atlas7_pad_mux gn_gnss_eclk_grp_pad_mux[] = {
  2446. MUX(1, 113, 4, N, N, N, N),
  2447. };
  2448. static struct atlas7_grp_mux gn_gnss_eclk_grp_mux = {
  2449. .pad_mux_count = ARRAY_SIZE(gn_gnss_eclk_grp_pad_mux),
  2450. .pad_mux_list = gn_gnss_eclk_grp_pad_mux,
  2451. };
  2452. static struct atlas7_pad_mux gn_gnss_irq1_grp0_pad_mux[] = {
  2453. MUX(1, 112, 4, 0xa08, 10, 0xa88, 10),
  2454. };
  2455. static struct atlas7_grp_mux gn_gnss_irq1_grp0_mux = {
  2456. .pad_mux_count = ARRAY_SIZE(gn_gnss_irq1_grp0_pad_mux),
  2457. .pad_mux_list = gn_gnss_irq1_grp0_pad_mux,
  2458. };
  2459. static struct atlas7_pad_mux gn_gnss_irq2_grp0_pad_mux[] = {
  2460. MUX(1, 118, 4, 0xa08, 11, 0xa88, 11),
  2461. };
  2462. static struct atlas7_grp_mux gn_gnss_irq2_grp0_mux = {
  2463. .pad_mux_count = ARRAY_SIZE(gn_gnss_irq2_grp0_pad_mux),
  2464. .pad_mux_list = gn_gnss_irq2_grp0_pad_mux,
  2465. };
  2466. static struct atlas7_pad_mux gn_gnss_tm_grp_pad_mux[] = {
  2467. MUX(1, 115, 4, N, N, N, N),
  2468. };
  2469. static struct atlas7_grp_mux gn_gnss_tm_grp_mux = {
  2470. .pad_mux_count = ARRAY_SIZE(gn_gnss_tm_grp_pad_mux),
  2471. .pad_mux_list = gn_gnss_tm_grp_pad_mux,
  2472. };
  2473. static struct atlas7_pad_mux gn_gnss_tsync_grp_pad_mux[] = {
  2474. MUX(1, 114, 4, N, N, N, N),
  2475. };
  2476. static struct atlas7_grp_mux gn_gnss_tsync_grp_mux = {
  2477. .pad_mux_count = ARRAY_SIZE(gn_gnss_tsync_grp_pad_mux),
  2478. .pad_mux_list = gn_gnss_tsync_grp_pad_mux,
  2479. };
  2480. static struct atlas7_pad_mux gn_io_gnsssys_sw_cfg_grp_pad_mux[] = {
  2481. MUX(1, 44, 7, N, N, N, N),
  2482. MUX(1, 43, 7, N, N, N, N),
  2483. MUX(1, 42, 7, N, N, N, N),
  2484. MUX(1, 41, 7, N, N, N, N),
  2485. MUX(1, 40, 7, N, N, N, N),
  2486. MUX(1, 39, 7, N, N, N, N),
  2487. MUX(1, 38, 7, N, N, N, N),
  2488. MUX(1, 37, 7, N, N, N, N),
  2489. MUX(1, 49, 7, N, N, N, N),
  2490. MUX(1, 50, 7, N, N, N, N),
  2491. MUX(1, 91, 7, N, N, N, N),
  2492. MUX(1, 92, 7, N, N, N, N),
  2493. MUX(1, 93, 7, N, N, N, N),
  2494. MUX(1, 94, 7, N, N, N, N),
  2495. MUX(1, 95, 7, N, N, N, N),
  2496. MUX(1, 96, 7, N, N, N, N),
  2497. };
  2498. static struct atlas7_grp_mux gn_io_gnsssys_sw_cfg_grp_mux = {
  2499. .pad_mux_count = ARRAY_SIZE(gn_io_gnsssys_sw_cfg_grp_pad_mux),
  2500. .pad_mux_list = gn_io_gnsssys_sw_cfg_grp_pad_mux,
  2501. };
  2502. static struct atlas7_pad_mux gn_trg_grp0_pad_mux[] = {
  2503. MUX(1, 29, 1, 0xa00, 6, 0xa80, 6),
  2504. MUX(1, 28, 1, 0xa00, 7, 0xa80, 7),
  2505. MUX(1, 26, 1, 0xa00, 8, 0xa80, 8),
  2506. MUX(1, 27, 1, 0xa00, 9, 0xa80, 9),
  2507. };
  2508. static struct atlas7_grp_mux gn_trg_grp0_mux = {
  2509. .pad_mux_count = ARRAY_SIZE(gn_trg_grp0_pad_mux),
  2510. .pad_mux_list = gn_trg_grp0_pad_mux,
  2511. };
  2512. static struct atlas7_pad_mux gn_trg_grp1_pad_mux[] = {
  2513. MUX(1, 77, 3, 0xa00, 6, 0xa80, 6),
  2514. MUX(1, 76, 3, 0xa00, 7, 0xa80, 7),
  2515. MUX(1, 74, 3, 0xa00, 8, 0xa80, 8),
  2516. MUX(1, 75, 3, 0xa00, 9, 0xa80, 9),
  2517. };
  2518. static struct atlas7_grp_mux gn_trg_grp1_mux = {
  2519. .pad_mux_count = ARRAY_SIZE(gn_trg_grp1_pad_mux),
  2520. .pad_mux_list = gn_trg_grp1_pad_mux,
  2521. };
  2522. static struct atlas7_pad_mux gn_trg_shutdown_grp0_pad_mux[] = {
  2523. MUX(1, 30, 1, N, N, N, N),
  2524. };
  2525. static struct atlas7_grp_mux gn_trg_shutdown_grp0_mux = {
  2526. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp0_pad_mux),
  2527. .pad_mux_list = gn_trg_shutdown_grp0_pad_mux,
  2528. };
  2529. static struct atlas7_pad_mux gn_trg_shutdown_grp1_pad_mux[] = {
  2530. MUX(1, 83, 3, N, N, N, N),
  2531. };
  2532. static struct atlas7_grp_mux gn_trg_shutdown_grp1_mux = {
  2533. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp1_pad_mux),
  2534. .pad_mux_list = gn_trg_shutdown_grp1_pad_mux,
  2535. };
  2536. static struct atlas7_pad_mux gn_trg_shutdown_grp2_pad_mux[] = {
  2537. MUX(1, 117, 4, N, N, N, N),
  2538. };
  2539. static struct atlas7_grp_mux gn_trg_shutdown_grp2_mux = {
  2540. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp2_pad_mux),
  2541. .pad_mux_list = gn_trg_shutdown_grp2_pad_mux,
  2542. };
  2543. static struct atlas7_pad_mux gn_trg_shutdown_grp3_pad_mux[] = {
  2544. MUX(1, 123, 5, N, N, N, N),
  2545. };
  2546. static struct atlas7_grp_mux gn_trg_shutdown_grp3_mux = {
  2547. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp3_pad_mux),
  2548. .pad_mux_list = gn_trg_shutdown_grp3_pad_mux,
  2549. };
  2550. static struct atlas7_pad_mux i2c0_grp_pad_mux[] = {
  2551. MUX(1, 128, 1, N, N, N, N),
  2552. MUX(1, 127, 1, N, N, N, N),
  2553. };
  2554. static struct atlas7_grp_mux i2c0_grp_mux = {
  2555. .pad_mux_count = ARRAY_SIZE(i2c0_grp_pad_mux),
  2556. .pad_mux_list = i2c0_grp_pad_mux,
  2557. };
  2558. static struct atlas7_pad_mux i2c1_grp_pad_mux[] = {
  2559. MUX(1, 126, 4, N, N, N, N),
  2560. MUX(1, 125, 4, N, N, N, N),
  2561. };
  2562. static struct atlas7_grp_mux i2c1_grp_mux = {
  2563. .pad_mux_count = ARRAY_SIZE(i2c1_grp_pad_mux),
  2564. .pad_mux_list = i2c1_grp_pad_mux,
  2565. };
  2566. static struct atlas7_pad_mux i2s0_grp_pad_mux[] = {
  2567. MUX(1, 91, 2, 0xa10, 12, 0xa90, 12),
  2568. MUX(1, 93, 2, 0xa10, 13, 0xa90, 13),
  2569. MUX(1, 94, 2, 0xa10, 14, 0xa90, 14),
  2570. MUX(1, 92, 2, 0xa10, 15, 0xa90, 15),
  2571. };
  2572. static struct atlas7_grp_mux i2s0_grp_mux = {
  2573. .pad_mux_count = ARRAY_SIZE(i2s0_grp_pad_mux),
  2574. .pad_mux_list = i2s0_grp_pad_mux,
  2575. };
  2576. static struct atlas7_pad_mux i2s1_basic_grp_pad_mux[] = {
  2577. MUX(1, 95, 2, 0xa10, 16, 0xa90, 16),
  2578. MUX(1, 96, 2, 0xa10, 19, 0xa90, 19),
  2579. };
  2580. static struct atlas7_grp_mux i2s1_basic_grp_mux = {
  2581. .pad_mux_count = ARRAY_SIZE(i2s1_basic_grp_pad_mux),
  2582. .pad_mux_list = i2s1_basic_grp_pad_mux,
  2583. };
  2584. static struct atlas7_pad_mux i2s1_rxd0_grp0_pad_mux[] = {
  2585. MUX(1, 61, 4, 0xa10, 17, 0xa90, 17),
  2586. };
  2587. static struct atlas7_grp_mux i2s1_rxd0_grp0_mux = {
  2588. .pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp0_pad_mux),
  2589. .pad_mux_list = i2s1_rxd0_grp0_pad_mux,
  2590. };
  2591. static struct atlas7_pad_mux i2s1_rxd0_grp1_pad_mux[] = {
  2592. MUX(1, 131, 4, 0xa10, 17, 0xa90, 17),
  2593. };
  2594. static struct atlas7_grp_mux i2s1_rxd0_grp1_mux = {
  2595. .pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp1_pad_mux),
  2596. .pad_mux_list = i2s1_rxd0_grp1_pad_mux,
  2597. };
  2598. static struct atlas7_pad_mux i2s1_rxd0_grp2_pad_mux[] = {
  2599. MUX(1, 129, 2, 0xa10, 17, 0xa90, 17),
  2600. };
  2601. static struct atlas7_grp_mux i2s1_rxd0_grp2_mux = {
  2602. .pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp2_pad_mux),
  2603. .pad_mux_list = i2s1_rxd0_grp2_pad_mux,
  2604. };
  2605. static struct atlas7_pad_mux i2s1_rxd0_grp3_pad_mux[] = {
  2606. MUX(1, 117, 7, 0xa10, 17, 0xa90, 17),
  2607. };
  2608. static struct atlas7_grp_mux i2s1_rxd0_grp3_mux = {
  2609. .pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp3_pad_mux),
  2610. .pad_mux_list = i2s1_rxd0_grp3_pad_mux,
  2611. };
  2612. static struct atlas7_pad_mux i2s1_rxd0_grp4_pad_mux[] = {
  2613. MUX(1, 83, 4, 0xa10, 17, 0xa90, 17),
  2614. };
  2615. static struct atlas7_grp_mux i2s1_rxd0_grp4_mux = {
  2616. .pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp4_pad_mux),
  2617. .pad_mux_list = i2s1_rxd0_grp4_pad_mux,
  2618. };
  2619. static struct atlas7_pad_mux i2s1_rxd1_grp0_pad_mux[] = {
  2620. MUX(1, 72, 4, 0xa10, 18, 0xa90, 18),
  2621. };
  2622. static struct atlas7_grp_mux i2s1_rxd1_grp0_mux = {
  2623. .pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp0_pad_mux),
  2624. .pad_mux_list = i2s1_rxd1_grp0_pad_mux,
  2625. };
  2626. static struct atlas7_pad_mux i2s1_rxd1_grp1_pad_mux[] = {
  2627. MUX(1, 132, 4, 0xa10, 18, 0xa90, 18),
  2628. };
  2629. static struct atlas7_grp_mux i2s1_rxd1_grp1_mux = {
  2630. .pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp1_pad_mux),
  2631. .pad_mux_list = i2s1_rxd1_grp1_pad_mux,
  2632. };
  2633. static struct atlas7_pad_mux i2s1_rxd1_grp2_pad_mux[] = {
  2634. MUX(1, 130, 2, 0xa10, 18, 0xa90, 18),
  2635. };
  2636. static struct atlas7_grp_mux i2s1_rxd1_grp2_mux = {
  2637. .pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp2_pad_mux),
  2638. .pad_mux_list = i2s1_rxd1_grp2_pad_mux,
  2639. };
  2640. static struct atlas7_pad_mux i2s1_rxd1_grp3_pad_mux[] = {
  2641. MUX(1, 118, 7, 0xa10, 18, 0xa90, 18),
  2642. };
  2643. static struct atlas7_grp_mux i2s1_rxd1_grp3_mux = {
  2644. .pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp3_pad_mux),
  2645. .pad_mux_list = i2s1_rxd1_grp3_pad_mux,
  2646. };
  2647. static struct atlas7_pad_mux i2s1_rxd1_grp4_pad_mux[] = {
  2648. MUX(1, 84, 4, 0xa10, 18, 0xa90, 18),
  2649. };
  2650. static struct atlas7_grp_mux i2s1_rxd1_grp4_mux = {
  2651. .pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp4_pad_mux),
  2652. .pad_mux_list = i2s1_rxd1_grp4_pad_mux,
  2653. };
  2654. static struct atlas7_pad_mux jtag_jt_dbg_nsrst_grp_pad_mux[] = {
  2655. MUX(1, 125, 5, 0xa08, 2, 0xa88, 2),
  2656. };
  2657. static struct atlas7_grp_mux jtag_jt_dbg_nsrst_grp_mux = {
  2658. .pad_mux_count = ARRAY_SIZE(jtag_jt_dbg_nsrst_grp_pad_mux),
  2659. .pad_mux_list = jtag_jt_dbg_nsrst_grp_pad_mux,
  2660. };
  2661. static struct atlas7_pad_mux jtag_ntrst_grp0_pad_mux[] = {
  2662. MUX(0, 4, 3, 0xa08, 3, 0xa88, 3),
  2663. };
  2664. static struct atlas7_grp_mux jtag_ntrst_grp0_mux = {
  2665. .pad_mux_count = ARRAY_SIZE(jtag_ntrst_grp0_pad_mux),
  2666. .pad_mux_list = jtag_ntrst_grp0_pad_mux,
  2667. };
  2668. static struct atlas7_pad_mux jtag_ntrst_grp1_pad_mux[] = {
  2669. MUX(1, 163, 1, 0xa08, 3, 0xa88, 3),
  2670. };
  2671. static struct atlas7_grp_mux jtag_ntrst_grp1_mux = {
  2672. .pad_mux_count = ARRAY_SIZE(jtag_ntrst_grp1_pad_mux),
  2673. .pad_mux_list = jtag_ntrst_grp1_pad_mux,
  2674. };
  2675. static struct atlas7_pad_mux jtag_swdiotms_grp0_pad_mux[] = {
  2676. MUX(0, 2, 3, 0xa10, 10, 0xa90, 10),
  2677. };
  2678. static struct atlas7_grp_mux jtag_swdiotms_grp0_mux = {
  2679. .pad_mux_count = ARRAY_SIZE(jtag_swdiotms_grp0_pad_mux),
  2680. .pad_mux_list = jtag_swdiotms_grp0_pad_mux,
  2681. };
  2682. static struct atlas7_pad_mux jtag_swdiotms_grp1_pad_mux[] = {
  2683. MUX(1, 160, 1, 0xa10, 10, 0xa90, 10),
  2684. };
  2685. static struct atlas7_grp_mux jtag_swdiotms_grp1_mux = {
  2686. .pad_mux_count = ARRAY_SIZE(jtag_swdiotms_grp1_pad_mux),
  2687. .pad_mux_list = jtag_swdiotms_grp1_pad_mux,
  2688. };
  2689. static struct atlas7_pad_mux jtag_tck_grp0_pad_mux[] = {
  2690. MUX(0, 0, 3, 0xa10, 11, 0xa90, 11),
  2691. };
  2692. static struct atlas7_grp_mux jtag_tck_grp0_mux = {
  2693. .pad_mux_count = ARRAY_SIZE(jtag_tck_grp0_pad_mux),
  2694. .pad_mux_list = jtag_tck_grp0_pad_mux,
  2695. };
  2696. static struct atlas7_pad_mux jtag_tck_grp1_pad_mux[] = {
  2697. MUX(1, 161, 1, 0xa10, 11, 0xa90, 11),
  2698. };
  2699. static struct atlas7_grp_mux jtag_tck_grp1_mux = {
  2700. .pad_mux_count = ARRAY_SIZE(jtag_tck_grp1_pad_mux),
  2701. .pad_mux_list = jtag_tck_grp1_pad_mux,
  2702. };
  2703. static struct atlas7_pad_mux jtag_tdi_grp0_pad_mux[] = {
  2704. MUX(0, 1, 3, 0xa10, 31, 0xa90, 31),
  2705. };
  2706. static struct atlas7_grp_mux jtag_tdi_grp0_mux = {
  2707. .pad_mux_count = ARRAY_SIZE(jtag_tdi_grp0_pad_mux),
  2708. .pad_mux_list = jtag_tdi_grp0_pad_mux,
  2709. };
  2710. static struct atlas7_pad_mux jtag_tdi_grp1_pad_mux[] = {
  2711. MUX(1, 162, 1, 0xa10, 31, 0xa90, 31),
  2712. };
  2713. static struct atlas7_grp_mux jtag_tdi_grp1_mux = {
  2714. .pad_mux_count = ARRAY_SIZE(jtag_tdi_grp1_pad_mux),
  2715. .pad_mux_list = jtag_tdi_grp1_pad_mux,
  2716. };
  2717. static struct atlas7_pad_mux jtag_tdo_grp0_pad_mux[] = {
  2718. MUX(0, 3, 3, N, N, N, N),
  2719. };
  2720. static struct atlas7_grp_mux jtag_tdo_grp0_mux = {
  2721. .pad_mux_count = ARRAY_SIZE(jtag_tdo_grp0_pad_mux),
  2722. .pad_mux_list = jtag_tdo_grp0_pad_mux,
  2723. };
  2724. static struct atlas7_pad_mux jtag_tdo_grp1_pad_mux[] = {
  2725. MUX(1, 159, 1, N, N, N, N),
  2726. };
  2727. static struct atlas7_grp_mux jtag_tdo_grp1_mux = {
  2728. .pad_mux_count = ARRAY_SIZE(jtag_tdo_grp1_pad_mux),
  2729. .pad_mux_list = jtag_tdo_grp1_pad_mux,
  2730. };
  2731. static struct atlas7_pad_mux ks_kas_spi_grp0_pad_mux[] = {
  2732. MUX(1, 141, 2, N, N, N, N),
  2733. MUX(1, 144, 2, 0xa08, 8, 0xa88, 8),
  2734. MUX(1, 143, 2, N, N, N, N),
  2735. MUX(1, 142, 2, N, N, N, N),
  2736. };
  2737. static struct atlas7_grp_mux ks_kas_spi_grp0_mux = {
  2738. .pad_mux_count = ARRAY_SIZE(ks_kas_spi_grp0_pad_mux),
  2739. .pad_mux_list = ks_kas_spi_grp0_pad_mux,
  2740. };
  2741. static struct atlas7_pad_mux ld_ldd_grp_pad_mux[] = {
  2742. MUX(1, 57, 1, N, N, N, N),
  2743. MUX(1, 58, 1, N, N, N, N),
  2744. MUX(1, 59, 1, N, N, N, N),
  2745. MUX(1, 60, 1, N, N, N, N),
  2746. MUX(1, 61, 1, N, N, N, N),
  2747. MUX(1, 62, 1, N, N, N, N),
  2748. MUX(1, 63, 1, N, N, N, N),
  2749. MUX(1, 64, 1, N, N, N, N),
  2750. MUX(1, 65, 1, N, N, N, N),
  2751. MUX(1, 66, 1, N, N, N, N),
  2752. MUX(1, 67, 1, N, N, N, N),
  2753. MUX(1, 68, 1, N, N, N, N),
  2754. MUX(1, 69, 1, N, N, N, N),
  2755. MUX(1, 70, 1, N, N, N, N),
  2756. MUX(1, 71, 1, N, N, N, N),
  2757. MUX(1, 72, 1, N, N, N, N),
  2758. MUX(1, 74, 2, N, N, N, N),
  2759. MUX(1, 75, 2, N, N, N, N),
  2760. MUX(1, 76, 2, N, N, N, N),
  2761. MUX(1, 77, 2, N, N, N, N),
  2762. MUX(1, 78, 2, N, N, N, N),
  2763. MUX(1, 79, 2, N, N, N, N),
  2764. MUX(1, 80, 2, N, N, N, N),
  2765. MUX(1, 81, 2, N, N, N, N),
  2766. MUX(1, 56, 1, N, N, N, N),
  2767. MUX(1, 53, 1, N, N, N, N),
  2768. };
  2769. static struct atlas7_grp_mux ld_ldd_grp_mux = {
  2770. .pad_mux_count = ARRAY_SIZE(ld_ldd_grp_pad_mux),
  2771. .pad_mux_list = ld_ldd_grp_pad_mux,
  2772. };
  2773. static struct atlas7_pad_mux ld_ldd_16bit_grp_pad_mux[] = {
  2774. MUX(1, 57, 1, N, N, N, N),
  2775. MUX(1, 58, 1, N, N, N, N),
  2776. MUX(1, 59, 1, N, N, N, N),
  2777. MUX(1, 60, 1, N, N, N, N),
  2778. MUX(1, 61, 1, N, N, N, N),
  2779. MUX(1, 62, 1, N, N, N, N),
  2780. MUX(1, 63, 1, N, N, N, N),
  2781. MUX(1, 64, 1, N, N, N, N),
  2782. MUX(1, 65, 1, N, N, N, N),
  2783. MUX(1, 66, 1, N, N, N, N),
  2784. MUX(1, 67, 1, N, N, N, N),
  2785. MUX(1, 68, 1, N, N, N, N),
  2786. MUX(1, 69, 1, N, N, N, N),
  2787. MUX(1, 70, 1, N, N, N, N),
  2788. MUX(1, 71, 1, N, N, N, N),
  2789. MUX(1, 72, 1, N, N, N, N),
  2790. MUX(1, 56, 1, N, N, N, N),
  2791. MUX(1, 53, 1, N, N, N, N),
  2792. };
  2793. static struct atlas7_grp_mux ld_ldd_16bit_grp_mux = {
  2794. .pad_mux_count = ARRAY_SIZE(ld_ldd_16bit_grp_pad_mux),
  2795. .pad_mux_list = ld_ldd_16bit_grp_pad_mux,
  2796. };
  2797. static struct atlas7_pad_mux ld_ldd_fck_grp_pad_mux[] = {
  2798. MUX(1, 55, 1, N, N, N, N),
  2799. };
  2800. static struct atlas7_grp_mux ld_ldd_fck_grp_mux = {
  2801. .pad_mux_count = ARRAY_SIZE(ld_ldd_fck_grp_pad_mux),
  2802. .pad_mux_list = ld_ldd_fck_grp_pad_mux,
  2803. };
  2804. static struct atlas7_pad_mux ld_ldd_lck_grp_pad_mux[] = {
  2805. MUX(1, 54, 1, N, N, N, N),
  2806. };
  2807. static struct atlas7_grp_mux ld_ldd_lck_grp_mux = {
  2808. .pad_mux_count = ARRAY_SIZE(ld_ldd_lck_grp_pad_mux),
  2809. .pad_mux_list = ld_ldd_lck_grp_pad_mux,
  2810. };
  2811. static struct atlas7_pad_mux lr_lcdrom_grp_pad_mux[] = {
  2812. MUX(1, 73, 2, N, N, N, N),
  2813. MUX(1, 54, 2, N, N, N, N),
  2814. MUX(1, 57, 2, N, N, N, N),
  2815. MUX(1, 58, 2, N, N, N, N),
  2816. MUX(1, 59, 2, N, N, N, N),
  2817. MUX(1, 60, 2, N, N, N, N),
  2818. MUX(1, 61, 2, N, N, N, N),
  2819. MUX(1, 62, 2, N, N, N, N),
  2820. MUX(1, 63, 2, N, N, N, N),
  2821. MUX(1, 64, 2, N, N, N, N),
  2822. MUX(1, 65, 2, N, N, N, N),
  2823. MUX(1, 66, 2, N, N, N, N),
  2824. MUX(1, 67, 2, N, N, N, N),
  2825. MUX(1, 68, 2, N, N, N, N),
  2826. MUX(1, 69, 2, N, N, N, N),
  2827. MUX(1, 70, 2, N, N, N, N),
  2828. MUX(1, 71, 2, N, N, N, N),
  2829. MUX(1, 72, 2, N, N, N, N),
  2830. MUX(1, 56, 2, N, N, N, N),
  2831. MUX(1, 53, 2, N, N, N, N),
  2832. MUX(1, 55, 2, N, N, N, N),
  2833. };
  2834. static struct atlas7_grp_mux lr_lcdrom_grp_mux = {
  2835. .pad_mux_count = ARRAY_SIZE(lr_lcdrom_grp_pad_mux),
  2836. .pad_mux_list = lr_lcdrom_grp_pad_mux,
  2837. };
  2838. static struct atlas7_pad_mux lvds_analog_grp_pad_mux[] = {
  2839. MUX(1, 149, 8, N, N, N, N),
  2840. MUX(1, 150, 8, N, N, N, N),
  2841. MUX(1, 151, 8, N, N, N, N),
  2842. MUX(1, 152, 8, N, N, N, N),
  2843. MUX(1, 153, 8, N, N, N, N),
  2844. MUX(1, 154, 8, N, N, N, N),
  2845. MUX(1, 155, 8, N, N, N, N),
  2846. MUX(1, 156, 8, N, N, N, N),
  2847. MUX(1, 157, 8, N, N, N, N),
  2848. MUX(1, 158, 8, N, N, N, N),
  2849. };
  2850. static struct atlas7_grp_mux lvds_analog_grp_mux = {
  2851. .pad_mux_count = ARRAY_SIZE(lvds_analog_grp_pad_mux),
  2852. .pad_mux_list = lvds_analog_grp_pad_mux,
  2853. };
  2854. static struct atlas7_pad_mux nd_df_basic_grp_pad_mux[] = {
  2855. MUX(1, 44, 1, N, N, N, N),
  2856. MUX(1, 43, 1, N, N, N, N),
  2857. MUX(1, 42, 1, N, N, N, N),
  2858. MUX(1, 41, 1, N, N, N, N),
  2859. MUX(1, 40, 1, N, N, N, N),
  2860. MUX(1, 39, 1, N, N, N, N),
  2861. MUX(1, 38, 1, N, N, N, N),
  2862. MUX(1, 37, 1, N, N, N, N),
  2863. MUX(1, 47, 1, N, N, N, N),
  2864. MUX(1, 46, 1, N, N, N, N),
  2865. MUX(1, 52, 1, N, N, N, N),
  2866. MUX(1, 45, 1, N, N, N, N),
  2867. MUX(1, 49, 1, N, N, N, N),
  2868. MUX(1, 50, 1, N, N, N, N),
  2869. MUX(1, 48, 1, N, N, N, N),
  2870. };
  2871. static struct atlas7_grp_mux nd_df_basic_grp_mux = {
  2872. .pad_mux_count = ARRAY_SIZE(nd_df_basic_grp_pad_mux),
  2873. .pad_mux_list = nd_df_basic_grp_pad_mux,
  2874. };
  2875. static struct atlas7_pad_mux nd_df_wp_grp_pad_mux[] = {
  2876. MUX(1, 124, 4, N, N, N, N),
  2877. };
  2878. static struct atlas7_grp_mux nd_df_wp_grp_mux = {
  2879. .pad_mux_count = ARRAY_SIZE(nd_df_wp_grp_pad_mux),
  2880. .pad_mux_list = nd_df_wp_grp_pad_mux,
  2881. };
  2882. static struct atlas7_pad_mux nd_df_cs_grp_pad_mux[] = {
  2883. MUX(1, 51, 1, N, N, N, N),
  2884. };
  2885. static struct atlas7_grp_mux nd_df_cs_grp_mux = {
  2886. .pad_mux_count = ARRAY_SIZE(nd_df_cs_grp_pad_mux),
  2887. .pad_mux_list = nd_df_cs_grp_pad_mux,
  2888. };
  2889. static struct atlas7_pad_mux ps_grp_pad_mux[] = {
  2890. MUX(1, 120, 2, N, N, N, N),
  2891. MUX(1, 119, 2, N, N, N, N),
  2892. MUX(1, 121, 5, N, N, N, N),
  2893. };
  2894. static struct atlas7_grp_mux ps_grp_mux = {
  2895. .pad_mux_count = ARRAY_SIZE(ps_grp_pad_mux),
  2896. .pad_mux_list = ps_grp_pad_mux,
  2897. };
  2898. static struct atlas7_pad_mux ps_no_dir_grp_pad_mux[] = {
  2899. MUX(1, 119, 2, N, N, N, N),
  2900. };
  2901. static struct atlas7_grp_mux ps_no_dir_grp_mux = {
  2902. .pad_mux_count = ARRAY_SIZE(ps_no_dir_grp_pad_mux),
  2903. .pad_mux_list = ps_no_dir_grp_pad_mux,
  2904. };
  2905. static struct atlas7_pad_mux pwc_core_on_grp_pad_mux[] = {
  2906. MUX(0, 8, 1, N, N, N, N),
  2907. };
  2908. static struct atlas7_grp_mux pwc_core_on_grp_mux = {
  2909. .pad_mux_count = ARRAY_SIZE(pwc_core_on_grp_pad_mux),
  2910. .pad_mux_list = pwc_core_on_grp_pad_mux,
  2911. };
  2912. static struct atlas7_pad_mux pwc_ext_on_grp_pad_mux[] = {
  2913. MUX(0, 6, 1, N, N, N, N),
  2914. };
  2915. static struct atlas7_grp_mux pwc_ext_on_grp_mux = {
  2916. .pad_mux_count = ARRAY_SIZE(pwc_ext_on_grp_pad_mux),
  2917. .pad_mux_list = pwc_ext_on_grp_pad_mux,
  2918. };
  2919. static struct atlas7_pad_mux pwc_gpio3_clk_grp_pad_mux[] = {
  2920. MUX(0, 3, 4, N, N, N, N),
  2921. };
  2922. static struct atlas7_grp_mux pwc_gpio3_clk_grp_mux = {
  2923. .pad_mux_count = ARRAY_SIZE(pwc_gpio3_clk_grp_pad_mux),
  2924. .pad_mux_list = pwc_gpio3_clk_grp_pad_mux,
  2925. };
  2926. static struct atlas7_pad_mux pwc_io_on_grp_pad_mux[] = {
  2927. MUX(0, 9, 1, N, N, N, N),
  2928. };
  2929. static struct atlas7_grp_mux pwc_io_on_grp_mux = {
  2930. .pad_mux_count = ARRAY_SIZE(pwc_io_on_grp_pad_mux),
  2931. .pad_mux_list = pwc_io_on_grp_pad_mux,
  2932. };
  2933. static struct atlas7_pad_mux pwc_lowbatt_b_grp0_pad_mux[] = {
  2934. MUX(0, 4, 1, 0xa08, 4, 0xa88, 4),
  2935. };
  2936. static struct atlas7_grp_mux pwc_lowbatt_b_grp0_mux = {
  2937. .pad_mux_count = ARRAY_SIZE(pwc_lowbatt_b_grp0_pad_mux),
  2938. .pad_mux_list = pwc_lowbatt_b_grp0_pad_mux,
  2939. };
  2940. static struct atlas7_pad_mux pwc_mem_on_grp_pad_mux[] = {
  2941. MUX(0, 7, 1, N, N, N, N),
  2942. };
  2943. static struct atlas7_grp_mux pwc_mem_on_grp_mux = {
  2944. .pad_mux_count = ARRAY_SIZE(pwc_mem_on_grp_pad_mux),
  2945. .pad_mux_list = pwc_mem_on_grp_pad_mux,
  2946. };
  2947. static struct atlas7_pad_mux pwc_on_key_b_grp0_pad_mux[] = {
  2948. MUX(0, 5, 1, 0xa08, 5, 0xa88, 5),
  2949. };
  2950. static struct atlas7_grp_mux pwc_on_key_b_grp0_mux = {
  2951. .pad_mux_count = ARRAY_SIZE(pwc_on_key_b_grp0_pad_mux),
  2952. .pad_mux_list = pwc_on_key_b_grp0_pad_mux,
  2953. };
  2954. static struct atlas7_pad_mux pwc_wakeup_src0_grp_pad_mux[] = {
  2955. MUX(0, 0, 1, N, N, N, N),
  2956. };
  2957. static struct atlas7_grp_mux pwc_wakeup_src0_grp_mux = {
  2958. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src0_grp_pad_mux),
  2959. .pad_mux_list = pwc_wakeup_src0_grp_pad_mux,
  2960. };
  2961. static struct atlas7_pad_mux pwc_wakeup_src1_grp_pad_mux[] = {
  2962. MUX(0, 1, 1, N, N, N, N),
  2963. };
  2964. static struct atlas7_grp_mux pwc_wakeup_src1_grp_mux = {
  2965. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src1_grp_pad_mux),
  2966. .pad_mux_list = pwc_wakeup_src1_grp_pad_mux,
  2967. };
  2968. static struct atlas7_pad_mux pwc_wakeup_src2_grp_pad_mux[] = {
  2969. MUX(0, 2, 1, N, N, N, N),
  2970. };
  2971. static struct atlas7_grp_mux pwc_wakeup_src2_grp_mux = {
  2972. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src2_grp_pad_mux),
  2973. .pad_mux_list = pwc_wakeup_src2_grp_pad_mux,
  2974. };
  2975. static struct atlas7_pad_mux pwc_wakeup_src3_grp_pad_mux[] = {
  2976. MUX(0, 3, 1, N, N, N, N),
  2977. };
  2978. static struct atlas7_grp_mux pwc_wakeup_src3_grp_mux = {
  2979. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src3_grp_pad_mux),
  2980. .pad_mux_list = pwc_wakeup_src3_grp_pad_mux,
  2981. };
  2982. static struct atlas7_pad_mux pw_cko0_grp0_pad_mux[] = {
  2983. MUX(1, 123, 3, N, N, N, N),
  2984. };
  2985. static struct atlas7_grp_mux pw_cko0_grp0_mux = {
  2986. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp0_pad_mux),
  2987. .pad_mux_list = pw_cko0_grp0_pad_mux,
  2988. };
  2989. static struct atlas7_pad_mux pw_cko0_grp1_pad_mux[] = {
  2990. MUX(1, 101, 4, N, N, N, N),
  2991. };
  2992. static struct atlas7_grp_mux pw_cko0_grp1_mux = {
  2993. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp1_pad_mux),
  2994. .pad_mux_list = pw_cko0_grp1_pad_mux,
  2995. };
  2996. static struct atlas7_pad_mux pw_cko0_grp2_pad_mux[] = {
  2997. MUX(1, 82, 2, N, N, N, N),
  2998. };
  2999. static struct atlas7_grp_mux pw_cko0_grp2_mux = {
  3000. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp2_pad_mux),
  3001. .pad_mux_list = pw_cko0_grp2_pad_mux,
  3002. };
  3003. static struct atlas7_pad_mux pw_cko0_grp3_pad_mux[] = {
  3004. MUX(1, 162, 5, N, N, N, N),
  3005. };
  3006. static struct atlas7_grp_mux pw_cko0_grp3_mux = {
  3007. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp3_pad_mux),
  3008. .pad_mux_list = pw_cko0_grp3_pad_mux,
  3009. };
  3010. static struct atlas7_pad_mux pw_cko1_grp0_pad_mux[] = {
  3011. MUX(1, 124, 3, N, N, N, N),
  3012. };
  3013. static struct atlas7_grp_mux pw_cko1_grp0_mux = {
  3014. .pad_mux_count = ARRAY_SIZE(pw_cko1_grp0_pad_mux),
  3015. .pad_mux_list = pw_cko1_grp0_pad_mux,
  3016. };
  3017. static struct atlas7_pad_mux pw_cko1_grp1_pad_mux[] = {
  3018. MUX(1, 110, 4, N, N, N, N),
  3019. };
  3020. static struct atlas7_grp_mux pw_cko1_grp1_mux = {
  3021. .pad_mux_count = ARRAY_SIZE(pw_cko1_grp1_pad_mux),
  3022. .pad_mux_list = pw_cko1_grp1_pad_mux,
  3023. };
  3024. static struct atlas7_pad_mux pw_cko1_grp2_pad_mux[] = {
  3025. MUX(1, 163, 5, N, N, N, N),
  3026. };
  3027. static struct atlas7_grp_mux pw_cko1_grp2_mux = {
  3028. .pad_mux_count = ARRAY_SIZE(pw_cko1_grp2_pad_mux),
  3029. .pad_mux_list = pw_cko1_grp2_pad_mux,
  3030. };
  3031. static struct atlas7_pad_mux pw_i2s01_clk_grp0_pad_mux[] = {
  3032. MUX(1, 125, 3, N, N, N, N),
  3033. };
  3034. static struct atlas7_grp_mux pw_i2s01_clk_grp0_mux = {
  3035. .pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp0_pad_mux),
  3036. .pad_mux_list = pw_i2s01_clk_grp0_pad_mux,
  3037. };
  3038. static struct atlas7_pad_mux pw_i2s01_clk_grp1_pad_mux[] = {
  3039. MUX(1, 117, 3, N, N, N, N),
  3040. };
  3041. static struct atlas7_grp_mux pw_i2s01_clk_grp1_mux = {
  3042. .pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp1_pad_mux),
  3043. .pad_mux_list = pw_i2s01_clk_grp1_pad_mux,
  3044. };
  3045. static struct atlas7_pad_mux pw_i2s01_clk_grp2_pad_mux[] = {
  3046. MUX(1, 132, 2, N, N, N, N),
  3047. };
  3048. static struct atlas7_grp_mux pw_i2s01_clk_grp2_mux = {
  3049. .pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp2_pad_mux),
  3050. .pad_mux_list = pw_i2s01_clk_grp2_pad_mux,
  3051. };
  3052. static struct atlas7_pad_mux pw_pwm0_grp0_pad_mux[] = {
  3053. MUX(1, 119, 3, N, N, N, N),
  3054. };
  3055. static struct atlas7_grp_mux pw_pwm0_grp0_mux = {
  3056. .pad_mux_count = ARRAY_SIZE(pw_pwm0_grp0_pad_mux),
  3057. .pad_mux_list = pw_pwm0_grp0_pad_mux,
  3058. };
  3059. static struct atlas7_pad_mux pw_pwm0_grp1_pad_mux[] = {
  3060. MUX(1, 159, 5, N, N, N, N),
  3061. };
  3062. static struct atlas7_grp_mux pw_pwm0_grp1_mux = {
  3063. .pad_mux_count = ARRAY_SIZE(pw_pwm0_grp1_pad_mux),
  3064. .pad_mux_list = pw_pwm0_grp1_pad_mux,
  3065. };
  3066. static struct atlas7_pad_mux pw_pwm1_grp0_pad_mux[] = {
  3067. MUX(1, 120, 3, N, N, N, N),
  3068. };
  3069. static struct atlas7_grp_mux pw_pwm1_grp0_mux = {
  3070. .pad_mux_count = ARRAY_SIZE(pw_pwm1_grp0_pad_mux),
  3071. .pad_mux_list = pw_pwm1_grp0_pad_mux,
  3072. };
  3073. static struct atlas7_pad_mux pw_pwm1_grp1_pad_mux[] = {
  3074. MUX(1, 160, 5, N, N, N, N),
  3075. };
  3076. static struct atlas7_grp_mux pw_pwm1_grp1_mux = {
  3077. .pad_mux_count = ARRAY_SIZE(pw_pwm1_grp1_pad_mux),
  3078. .pad_mux_list = pw_pwm1_grp1_pad_mux,
  3079. };
  3080. static struct atlas7_pad_mux pw_pwm1_grp2_pad_mux[] = {
  3081. MUX(1, 131, 2, N, N, N, N),
  3082. };
  3083. static struct atlas7_grp_mux pw_pwm1_grp2_mux = {
  3084. .pad_mux_count = ARRAY_SIZE(pw_pwm1_grp2_pad_mux),
  3085. .pad_mux_list = pw_pwm1_grp2_pad_mux,
  3086. };
  3087. static struct atlas7_pad_mux pw_pwm2_grp0_pad_mux[] = {
  3088. MUX(1, 121, 3, N, N, N, N),
  3089. };
  3090. static struct atlas7_grp_mux pw_pwm2_grp0_mux = {
  3091. .pad_mux_count = ARRAY_SIZE(pw_pwm2_grp0_pad_mux),
  3092. .pad_mux_list = pw_pwm2_grp0_pad_mux,
  3093. };
  3094. static struct atlas7_pad_mux pw_pwm2_grp1_pad_mux[] = {
  3095. MUX(1, 98, 3, N, N, N, N),
  3096. };
  3097. static struct atlas7_grp_mux pw_pwm2_grp1_mux = {
  3098. .pad_mux_count = ARRAY_SIZE(pw_pwm2_grp1_pad_mux),
  3099. .pad_mux_list = pw_pwm2_grp1_pad_mux,
  3100. };
  3101. static struct atlas7_pad_mux pw_pwm2_grp2_pad_mux[] = {
  3102. MUX(1, 161, 5, N, N, N, N),
  3103. };
  3104. static struct atlas7_grp_mux pw_pwm2_grp2_mux = {
  3105. .pad_mux_count = ARRAY_SIZE(pw_pwm2_grp2_pad_mux),
  3106. .pad_mux_list = pw_pwm2_grp2_pad_mux,
  3107. };
  3108. static struct atlas7_pad_mux pw_pwm3_grp0_pad_mux[] = {
  3109. MUX(1, 122, 3, N, N, N, N),
  3110. };
  3111. static struct atlas7_grp_mux pw_pwm3_grp0_mux = {
  3112. .pad_mux_count = ARRAY_SIZE(pw_pwm3_grp0_pad_mux),
  3113. .pad_mux_list = pw_pwm3_grp0_pad_mux,
  3114. };
  3115. static struct atlas7_pad_mux pw_pwm3_grp1_pad_mux[] = {
  3116. MUX(1, 73, 4, N, N, N, N),
  3117. };
  3118. static struct atlas7_grp_mux pw_pwm3_grp1_mux = {
  3119. .pad_mux_count = ARRAY_SIZE(pw_pwm3_grp1_pad_mux),
  3120. .pad_mux_list = pw_pwm3_grp1_pad_mux,
  3121. };
  3122. static struct atlas7_pad_mux pw_pwm_cpu_vol_grp0_pad_mux[] = {
  3123. MUX(1, 121, 3, N, N, N, N),
  3124. };
  3125. static struct atlas7_grp_mux pw_pwm_cpu_vol_grp0_mux = {
  3126. .pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp0_pad_mux),
  3127. .pad_mux_list = pw_pwm_cpu_vol_grp0_pad_mux,
  3128. };
  3129. static struct atlas7_pad_mux pw_pwm_cpu_vol_grp1_pad_mux[] = {
  3130. MUX(1, 98, 3, N, N, N, N),
  3131. };
  3132. static struct atlas7_grp_mux pw_pwm_cpu_vol_grp1_mux = {
  3133. .pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp1_pad_mux),
  3134. .pad_mux_list = pw_pwm_cpu_vol_grp1_pad_mux,
  3135. };
  3136. static struct atlas7_pad_mux pw_pwm_cpu_vol_grp2_pad_mux[] = {
  3137. MUX(1, 161, 5, N, N, N, N),
  3138. };
  3139. static struct atlas7_grp_mux pw_pwm_cpu_vol_grp2_mux = {
  3140. .pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp2_pad_mux),
  3141. .pad_mux_list = pw_pwm_cpu_vol_grp2_pad_mux,
  3142. };
  3143. static struct atlas7_pad_mux pw_backlight_grp0_pad_mux[] = {
  3144. MUX(1, 122, 3, N, N, N, N),
  3145. };
  3146. static struct atlas7_grp_mux pw_backlight_grp0_mux = {
  3147. .pad_mux_count = ARRAY_SIZE(pw_backlight_grp0_pad_mux),
  3148. .pad_mux_list = pw_backlight_grp0_pad_mux,
  3149. };
  3150. static struct atlas7_pad_mux pw_backlight_grp1_pad_mux[] = {
  3151. MUX(1, 73, 4, N, N, N, N),
  3152. };
  3153. static struct atlas7_grp_mux pw_backlight_grp1_mux = {
  3154. .pad_mux_count = ARRAY_SIZE(pw_backlight_grp1_pad_mux),
  3155. .pad_mux_list = pw_backlight_grp1_pad_mux,
  3156. };
  3157. static struct atlas7_pad_mux rg_eth_mac_grp_pad_mux[] = {
  3158. MUX(1, 108, 1, N, N, N, N),
  3159. MUX(1, 103, 1, N, N, N, N),
  3160. MUX(1, 104, 1, N, N, N, N),
  3161. MUX(1, 105, 1, N, N, N, N),
  3162. MUX(1, 106, 1, N, N, N, N),
  3163. MUX(1, 107, 1, N, N, N, N),
  3164. MUX(1, 102, 1, N, N, N, N),
  3165. MUX(1, 97, 1, N, N, N, N),
  3166. MUX(1, 98, 1, N, N, N, N),
  3167. MUX(1, 99, 1, N, N, N, N),
  3168. MUX(1, 100, 1, N, N, N, N),
  3169. MUX(1, 101, 1, N, N, N, N),
  3170. };
  3171. static struct atlas7_grp_mux rg_eth_mac_grp_mux = {
  3172. .pad_mux_count = ARRAY_SIZE(rg_eth_mac_grp_pad_mux),
  3173. .pad_mux_list = rg_eth_mac_grp_pad_mux,
  3174. };
  3175. static struct atlas7_pad_mux rg_gmac_phy_intr_n_grp_pad_mux[] = {
  3176. MUX(1, 111, 1, 0xa08, 13, 0xa88, 13),
  3177. };
  3178. static struct atlas7_grp_mux rg_gmac_phy_intr_n_grp_mux = {
  3179. .pad_mux_count = ARRAY_SIZE(rg_gmac_phy_intr_n_grp_pad_mux),
  3180. .pad_mux_list = rg_gmac_phy_intr_n_grp_pad_mux,
  3181. };
  3182. static struct atlas7_pad_mux rg_rgmii_mac_grp_pad_mux[] = {
  3183. MUX(1, 109, 1, N, N, N, N),
  3184. MUX(1, 110, 1, N, N, N, N),
  3185. };
  3186. static struct atlas7_grp_mux rg_rgmii_mac_grp_mux = {
  3187. .pad_mux_count = ARRAY_SIZE(rg_rgmii_mac_grp_pad_mux),
  3188. .pad_mux_list = rg_rgmii_mac_grp_pad_mux,
  3189. };
  3190. static struct atlas7_pad_mux rg_rgmii_phy_ref_clk_grp0_pad_mux[] = {
  3191. MUX(1, 111, 5, N, N, N, N),
  3192. };
  3193. static struct atlas7_grp_mux rg_rgmii_phy_ref_clk_grp0_mux = {
  3194. .pad_mux_count = ARRAY_SIZE(rg_rgmii_phy_ref_clk_grp0_pad_mux),
  3195. .pad_mux_list = rg_rgmii_phy_ref_clk_grp0_pad_mux,
  3196. };
  3197. static struct atlas7_pad_mux rg_rgmii_phy_ref_clk_grp1_pad_mux[] = {
  3198. MUX(1, 53, 4, N, N, N, N),
  3199. };
  3200. static struct atlas7_grp_mux rg_rgmii_phy_ref_clk_grp1_mux = {
  3201. .pad_mux_count = ARRAY_SIZE(rg_rgmii_phy_ref_clk_grp1_pad_mux),
  3202. .pad_mux_list = rg_rgmii_phy_ref_clk_grp1_pad_mux,
  3203. };
  3204. static struct atlas7_pad_mux sd0_grp_pad_mux[] = {
  3205. MUX(1, 46, 2, N, N, N, N),
  3206. MUX(1, 47, 2, N, N, N, N),
  3207. MUX(1, 44, 2, N, N, N, N),
  3208. MUX(1, 43, 2, N, N, N, N),
  3209. MUX(1, 42, 2, N, N, N, N),
  3210. MUX(1, 41, 2, N, N, N, N),
  3211. MUX(1, 40, 2, N, N, N, N),
  3212. MUX(1, 39, 2, N, N, N, N),
  3213. MUX(1, 38, 2, N, N, N, N),
  3214. MUX(1, 37, 2, N, N, N, N),
  3215. };
  3216. static struct atlas7_grp_mux sd0_grp_mux = {
  3217. .pad_mux_count = ARRAY_SIZE(sd0_grp_pad_mux),
  3218. .pad_mux_list = sd0_grp_pad_mux,
  3219. };
  3220. static struct atlas7_pad_mux sd0_4bit_grp_pad_mux[] = {
  3221. MUX(1, 46, 2, N, N, N, N),
  3222. MUX(1, 47, 2, N, N, N, N),
  3223. MUX(1, 44, 2, N, N, N, N),
  3224. MUX(1, 43, 2, N, N, N, N),
  3225. MUX(1, 42, 2, N, N, N, N),
  3226. MUX(1, 41, 2, N, N, N, N),
  3227. };
  3228. static struct atlas7_grp_mux sd0_4bit_grp_mux = {
  3229. .pad_mux_count = ARRAY_SIZE(sd0_4bit_grp_pad_mux),
  3230. .pad_mux_list = sd0_4bit_grp_pad_mux,
  3231. };
  3232. static struct atlas7_pad_mux sd1_grp_pad_mux[] = {
  3233. MUX(1, 48, 3, N, N, N, N),
  3234. MUX(1, 49, 3, N, N, N, N),
  3235. MUX(1, 44, 3, 0xa00, 0, 0xa80, 0),
  3236. MUX(1, 43, 3, 0xa00, 1, 0xa80, 1),
  3237. MUX(1, 42, 3, 0xa00, 2, 0xa80, 2),
  3238. MUX(1, 41, 3, 0xa00, 3, 0xa80, 3),
  3239. MUX(1, 40, 3, N, N, N, N),
  3240. MUX(1, 39, 3, N, N, N, N),
  3241. MUX(1, 38, 3, N, N, N, N),
  3242. MUX(1, 37, 3, N, N, N, N),
  3243. };
  3244. static struct atlas7_grp_mux sd1_grp_mux = {
  3245. .pad_mux_count = ARRAY_SIZE(sd1_grp_pad_mux),
  3246. .pad_mux_list = sd1_grp_pad_mux,
  3247. };
  3248. static struct atlas7_pad_mux sd1_4bit_grp0_pad_mux[] = {
  3249. MUX(1, 48, 3, N, N, N, N),
  3250. MUX(1, 49, 3, N, N, N, N),
  3251. MUX(1, 44, 3, 0xa00, 0, 0xa80, 0),
  3252. MUX(1, 43, 3, 0xa00, 1, 0xa80, 1),
  3253. MUX(1, 42, 3, 0xa00, 2, 0xa80, 2),
  3254. MUX(1, 41, 3, 0xa00, 3, 0xa80, 3),
  3255. };
  3256. static struct atlas7_grp_mux sd1_4bit_grp0_mux = {
  3257. .pad_mux_count = ARRAY_SIZE(sd1_4bit_grp0_pad_mux),
  3258. .pad_mux_list = sd1_4bit_grp0_pad_mux,
  3259. };
  3260. static struct atlas7_pad_mux sd1_4bit_grp1_pad_mux[] = {
  3261. MUX(1, 48, 3, N, N, N, N),
  3262. MUX(1, 49, 3, N, N, N, N),
  3263. MUX(1, 40, 4, 0xa00, 0, 0xa80, 0),
  3264. MUX(1, 39, 4, 0xa00, 1, 0xa80, 1),
  3265. MUX(1, 38, 4, 0xa00, 2, 0xa80, 2),
  3266. MUX(1, 37, 4, 0xa00, 3, 0xa80, 3),
  3267. };
  3268. static struct atlas7_grp_mux sd1_4bit_grp1_mux = {
  3269. .pad_mux_count = ARRAY_SIZE(sd1_4bit_grp1_pad_mux),
  3270. .pad_mux_list = sd1_4bit_grp1_pad_mux,
  3271. };
  3272. static struct atlas7_pad_mux sd2_basic_grp_pad_mux[] = {
  3273. MUX(1, 31, 1, N, N, N, N),
  3274. MUX(1, 32, 1, N, N, N, N),
  3275. MUX(1, 33, 1, N, N, N, N),
  3276. MUX(1, 34, 1, N, N, N, N),
  3277. MUX(1, 35, 1, N, N, N, N),
  3278. MUX(1, 36, 1, N, N, N, N),
  3279. };
  3280. static struct atlas7_grp_mux sd2_basic_grp_mux = {
  3281. .pad_mux_count = ARRAY_SIZE(sd2_basic_grp_pad_mux),
  3282. .pad_mux_list = sd2_basic_grp_pad_mux,
  3283. };
  3284. static struct atlas7_pad_mux sd2_cdb_grp0_pad_mux[] = {
  3285. MUX(1, 124, 2, 0xa08, 7, 0xa88, 7),
  3286. };
  3287. static struct atlas7_grp_mux sd2_cdb_grp0_mux = {
  3288. .pad_mux_count = ARRAY_SIZE(sd2_cdb_grp0_pad_mux),
  3289. .pad_mux_list = sd2_cdb_grp0_pad_mux,
  3290. };
  3291. static struct atlas7_pad_mux sd2_cdb_grp1_pad_mux[] = {
  3292. MUX(1, 161, 6, 0xa08, 7, 0xa88, 7),
  3293. };
  3294. static struct atlas7_grp_mux sd2_cdb_grp1_mux = {
  3295. .pad_mux_count = ARRAY_SIZE(sd2_cdb_grp1_pad_mux),
  3296. .pad_mux_list = sd2_cdb_grp1_pad_mux,
  3297. };
  3298. static struct atlas7_pad_mux sd2_wpb_grp0_pad_mux[] = {
  3299. MUX(1, 123, 2, 0xa10, 6, 0xa90, 6),
  3300. };
  3301. static struct atlas7_grp_mux sd2_wpb_grp0_mux = {
  3302. .pad_mux_count = ARRAY_SIZE(sd2_wpb_grp0_pad_mux),
  3303. .pad_mux_list = sd2_wpb_grp0_pad_mux,
  3304. };
  3305. static struct atlas7_pad_mux sd2_wpb_grp1_pad_mux[] = {
  3306. MUX(1, 163, 7, 0xa10, 6, 0xa90, 6),
  3307. };
  3308. static struct atlas7_grp_mux sd2_wpb_grp1_mux = {
  3309. .pad_mux_count = ARRAY_SIZE(sd2_wpb_grp1_pad_mux),
  3310. .pad_mux_list = sd2_wpb_grp1_pad_mux,
  3311. };
  3312. static struct atlas7_pad_mux sd3_9_grp_pad_mux[] = {
  3313. MUX(1, 85, 1, N, N, N, N),
  3314. MUX(1, 86, 1, N, N, N, N),
  3315. MUX(1, 87, 1, N, N, N, N),
  3316. MUX(1, 88, 1, N, N, N, N),
  3317. MUX(1, 89, 1, N, N, N, N),
  3318. MUX(1, 90, 1, N, N, N, N),
  3319. };
  3320. static struct atlas7_grp_mux sd3_9_grp_mux = {
  3321. .pad_mux_count = ARRAY_SIZE(sd3_9_grp_pad_mux),
  3322. .pad_mux_list = sd3_9_grp_pad_mux,
  3323. };
  3324. static struct atlas7_pad_mux sd5_grp_pad_mux[] = {
  3325. MUX(1, 91, 1, N, N, N, N),
  3326. MUX(1, 92, 1, N, N, N, N),
  3327. MUX(1, 93, 1, N, N, N, N),
  3328. MUX(1, 94, 1, N, N, N, N),
  3329. MUX(1, 95, 1, N, N, N, N),
  3330. MUX(1, 96, 1, N, N, N, N),
  3331. };
  3332. static struct atlas7_grp_mux sd5_grp_mux = {
  3333. .pad_mux_count = ARRAY_SIZE(sd5_grp_pad_mux),
  3334. .pad_mux_list = sd5_grp_pad_mux,
  3335. };
  3336. static struct atlas7_pad_mux sd6_grp0_pad_mux[] = {
  3337. MUX(1, 79, 4, 0xa00, 27, 0xa80, 27),
  3338. MUX(1, 78, 4, 0xa00, 26, 0xa80, 26),
  3339. MUX(1, 74, 4, 0xa00, 28, 0xa80, 28),
  3340. MUX(1, 75, 4, 0xa00, 29, 0xa80, 29),
  3341. MUX(1, 76, 4, 0xa00, 30, 0xa80, 30),
  3342. MUX(1, 77, 4, 0xa00, 31, 0xa80, 31),
  3343. };
  3344. static struct atlas7_grp_mux sd6_grp0_mux = {
  3345. .pad_mux_count = ARRAY_SIZE(sd6_grp0_pad_mux),
  3346. .pad_mux_list = sd6_grp0_pad_mux,
  3347. };
  3348. static struct atlas7_pad_mux sd6_grp1_pad_mux[] = {
  3349. MUX(1, 101, 3, 0xa00, 27, 0xa80, 27),
  3350. MUX(1, 99, 3, 0xa00, 26, 0xa80, 26),
  3351. MUX(1, 100, 3, 0xa00, 28, 0xa80, 28),
  3352. MUX(1, 110, 3, 0xa00, 29, 0xa80, 29),
  3353. MUX(1, 109, 3, 0xa00, 30, 0xa80, 30),
  3354. MUX(1, 111, 3, 0xa00, 31, 0xa80, 31),
  3355. };
  3356. static struct atlas7_grp_mux sd6_grp1_mux = {
  3357. .pad_mux_count = ARRAY_SIZE(sd6_grp1_pad_mux),
  3358. .pad_mux_list = sd6_grp1_pad_mux,
  3359. };
  3360. static struct atlas7_pad_mux sp0_ext_ldo_on_grp_pad_mux[] = {
  3361. MUX(0, 4, 2, N, N, N, N),
  3362. };
  3363. static struct atlas7_grp_mux sp0_ext_ldo_on_grp_mux = {
  3364. .pad_mux_count = ARRAY_SIZE(sp0_ext_ldo_on_grp_pad_mux),
  3365. .pad_mux_list = sp0_ext_ldo_on_grp_pad_mux,
  3366. };
  3367. static struct atlas7_pad_mux sp0_qspi_grp_pad_mux[] = {
  3368. MUX(0, 12, 1, N, N, N, N),
  3369. MUX(0, 13, 1, N, N, N, N),
  3370. MUX(0, 14, 1, N, N, N, N),
  3371. MUX(0, 15, 1, N, N, N, N),
  3372. MUX(0, 16, 1, N, N, N, N),
  3373. MUX(0, 17, 1, N, N, N, N),
  3374. };
  3375. static struct atlas7_grp_mux sp0_qspi_grp_mux = {
  3376. .pad_mux_count = ARRAY_SIZE(sp0_qspi_grp_pad_mux),
  3377. .pad_mux_list = sp0_qspi_grp_pad_mux,
  3378. };
  3379. static struct atlas7_pad_mux sp1_spi_grp_pad_mux[] = {
  3380. MUX(1, 19, 1, N, N, N, N),
  3381. MUX(1, 20, 1, N, N, N, N),
  3382. MUX(1, 21, 1, N, N, N, N),
  3383. MUX(1, 18, 1, N, N, N, N),
  3384. };
  3385. static struct atlas7_grp_mux sp1_spi_grp_mux = {
  3386. .pad_mux_count = ARRAY_SIZE(sp1_spi_grp_pad_mux),
  3387. .pad_mux_list = sp1_spi_grp_pad_mux,
  3388. };
  3389. static struct atlas7_pad_mux tpiu_trace_grp_pad_mux[] = {
  3390. MUX(1, 53, 5, N, N, N, N),
  3391. MUX(1, 56, 5, N, N, N, N),
  3392. MUX(1, 57, 5, N, N, N, N),
  3393. MUX(1, 58, 5, N, N, N, N),
  3394. MUX(1, 59, 5, N, N, N, N),
  3395. MUX(1, 60, 5, N, N, N, N),
  3396. MUX(1, 61, 5, N, N, N, N),
  3397. MUX(1, 62, 5, N, N, N, N),
  3398. MUX(1, 63, 5, N, N, N, N),
  3399. MUX(1, 64, 5, N, N, N, N),
  3400. MUX(1, 65, 5, N, N, N, N),
  3401. MUX(1, 66, 5, N, N, N, N),
  3402. MUX(1, 67, 5, N, N, N, N),
  3403. MUX(1, 68, 5, N, N, N, N),
  3404. MUX(1, 69, 5, N, N, N, N),
  3405. MUX(1, 70, 5, N, N, N, N),
  3406. MUX(1, 71, 5, N, N, N, N),
  3407. MUX(1, 72, 5, N, N, N, N),
  3408. };
  3409. static struct atlas7_grp_mux tpiu_trace_grp_mux = {
  3410. .pad_mux_count = ARRAY_SIZE(tpiu_trace_grp_pad_mux),
  3411. .pad_mux_list = tpiu_trace_grp_pad_mux,
  3412. };
  3413. static struct atlas7_pad_mux uart0_grp_pad_mux[] = {
  3414. MUX(1, 121, 4, N, N, N, N),
  3415. MUX(1, 120, 4, N, N, N, N),
  3416. MUX(1, 134, 1, N, N, N, N),
  3417. MUX(1, 133, 1, N, N, N, N),
  3418. };
  3419. static struct atlas7_grp_mux uart0_grp_mux = {
  3420. .pad_mux_count = ARRAY_SIZE(uart0_grp_pad_mux),
  3421. .pad_mux_list = uart0_grp_pad_mux,
  3422. };
  3423. static struct atlas7_pad_mux uart0_nopause_grp_pad_mux[] = {
  3424. MUX(1, 134, 1, N, N, N, N),
  3425. MUX(1, 133, 1, N, N, N, N),
  3426. };
  3427. static struct atlas7_grp_mux uart0_nopause_grp_mux = {
  3428. .pad_mux_count = ARRAY_SIZE(uart0_nopause_grp_pad_mux),
  3429. .pad_mux_list = uart0_nopause_grp_pad_mux,
  3430. };
  3431. static struct atlas7_pad_mux uart1_grp_pad_mux[] = {
  3432. MUX(1, 136, 1, N, N, N, N),
  3433. MUX(1, 135, 1, N, N, N, N),
  3434. };
  3435. static struct atlas7_grp_mux uart1_grp_mux = {
  3436. .pad_mux_count = ARRAY_SIZE(uart1_grp_pad_mux),
  3437. .pad_mux_list = uart1_grp_pad_mux,
  3438. };
  3439. static struct atlas7_pad_mux uart2_cts_grp0_pad_mux[] = {
  3440. MUX(1, 132, 3, 0xa10, 2, 0xa90, 2),
  3441. };
  3442. static struct atlas7_grp_mux uart2_cts_grp0_mux = {
  3443. .pad_mux_count = ARRAY_SIZE(uart2_cts_grp0_pad_mux),
  3444. .pad_mux_list = uart2_cts_grp0_pad_mux,
  3445. };
  3446. static struct atlas7_pad_mux uart2_cts_grp1_pad_mux[] = {
  3447. MUX(1, 162, 2, 0xa10, 2, 0xa90, 2),
  3448. };
  3449. static struct atlas7_grp_mux uart2_cts_grp1_mux = {
  3450. .pad_mux_count = ARRAY_SIZE(uart2_cts_grp1_pad_mux),
  3451. .pad_mux_list = uart2_cts_grp1_pad_mux,
  3452. };
  3453. static struct atlas7_pad_mux uart2_rts_grp0_pad_mux[] = {
  3454. MUX(1, 131, 3, N, N, N, N),
  3455. };
  3456. static struct atlas7_grp_mux uart2_rts_grp0_mux = {
  3457. .pad_mux_count = ARRAY_SIZE(uart2_rts_grp0_pad_mux),
  3458. .pad_mux_list = uart2_rts_grp0_pad_mux,
  3459. };
  3460. static struct atlas7_pad_mux uart2_rts_grp1_pad_mux[] = {
  3461. MUX(1, 161, 2, N, N, N, N),
  3462. };
  3463. static struct atlas7_grp_mux uart2_rts_grp1_mux = {
  3464. .pad_mux_count = ARRAY_SIZE(uart2_rts_grp1_pad_mux),
  3465. .pad_mux_list = uart2_rts_grp1_pad_mux,
  3466. };
  3467. static struct atlas7_pad_mux uart2_rxd_grp0_pad_mux[] = {
  3468. MUX(0, 11, 2, 0xa10, 5, 0xa90, 5),
  3469. };
  3470. static struct atlas7_grp_mux uart2_rxd_grp0_mux = {
  3471. .pad_mux_count = ARRAY_SIZE(uart2_rxd_grp0_pad_mux),
  3472. .pad_mux_list = uart2_rxd_grp0_pad_mux,
  3473. };
  3474. static struct atlas7_pad_mux uart2_rxd_grp1_pad_mux[] = {
  3475. MUX(1, 160, 2, 0xa10, 5, 0xa90, 5),
  3476. };
  3477. static struct atlas7_grp_mux uart2_rxd_grp1_mux = {
  3478. .pad_mux_count = ARRAY_SIZE(uart2_rxd_grp1_pad_mux),
  3479. .pad_mux_list = uart2_rxd_grp1_pad_mux,
  3480. };
  3481. static struct atlas7_pad_mux uart2_rxd_grp2_pad_mux[] = {
  3482. MUX(1, 130, 3, 0xa10, 5, 0xa90, 5),
  3483. };
  3484. static struct atlas7_grp_mux uart2_rxd_grp2_mux = {
  3485. .pad_mux_count = ARRAY_SIZE(uart2_rxd_grp2_pad_mux),
  3486. .pad_mux_list = uart2_rxd_grp2_pad_mux,
  3487. };
  3488. static struct atlas7_pad_mux uart2_txd_grp0_pad_mux[] = {
  3489. MUX(0, 10, 2, N, N, N, N),
  3490. };
  3491. static struct atlas7_grp_mux uart2_txd_grp0_mux = {
  3492. .pad_mux_count = ARRAY_SIZE(uart2_txd_grp0_pad_mux),
  3493. .pad_mux_list = uart2_txd_grp0_pad_mux,
  3494. };
  3495. static struct atlas7_pad_mux uart2_txd_grp1_pad_mux[] = {
  3496. MUX(1, 159, 2, N, N, N, N),
  3497. };
  3498. static struct atlas7_grp_mux uart2_txd_grp1_mux = {
  3499. .pad_mux_count = ARRAY_SIZE(uart2_txd_grp1_pad_mux),
  3500. .pad_mux_list = uart2_txd_grp1_pad_mux,
  3501. };
  3502. static struct atlas7_pad_mux uart2_txd_grp2_pad_mux[] = {
  3503. MUX(1, 129, 3, N, N, N, N),
  3504. };
  3505. static struct atlas7_grp_mux uart2_txd_grp2_mux = {
  3506. .pad_mux_count = ARRAY_SIZE(uart2_txd_grp2_pad_mux),
  3507. .pad_mux_list = uart2_txd_grp2_pad_mux,
  3508. };
  3509. static struct atlas7_pad_mux uart3_cts_grp0_pad_mux[] = {
  3510. MUX(1, 125, 2, 0xa08, 0, 0xa88, 0),
  3511. };
  3512. static struct atlas7_grp_mux uart3_cts_grp0_mux = {
  3513. .pad_mux_count = ARRAY_SIZE(uart3_cts_grp0_pad_mux),
  3514. .pad_mux_list = uart3_cts_grp0_pad_mux,
  3515. };
  3516. static struct atlas7_pad_mux uart3_cts_grp1_pad_mux[] = {
  3517. MUX(1, 111, 4, 0xa08, 0, 0xa88, 0),
  3518. };
  3519. static struct atlas7_grp_mux uart3_cts_grp1_mux = {
  3520. .pad_mux_count = ARRAY_SIZE(uart3_cts_grp1_pad_mux),
  3521. .pad_mux_list = uart3_cts_grp1_pad_mux,
  3522. };
  3523. static struct atlas7_pad_mux uart3_cts_grp2_pad_mux[] = {
  3524. MUX(1, 140, 2, 0xa08, 0, 0xa88, 0),
  3525. };
  3526. static struct atlas7_grp_mux uart3_cts_grp2_mux = {
  3527. .pad_mux_count = ARRAY_SIZE(uart3_cts_grp2_pad_mux),
  3528. .pad_mux_list = uart3_cts_grp2_pad_mux,
  3529. };
  3530. static struct atlas7_pad_mux uart3_rts_grp0_pad_mux[] = {
  3531. MUX(1, 126, 2, N, N, N, N),
  3532. };
  3533. static struct atlas7_grp_mux uart3_rts_grp0_mux = {
  3534. .pad_mux_count = ARRAY_SIZE(uart3_rts_grp0_pad_mux),
  3535. .pad_mux_list = uart3_rts_grp0_pad_mux,
  3536. };
  3537. static struct atlas7_pad_mux uart3_rts_grp1_pad_mux[] = {
  3538. MUX(1, 109, 4, N, N, N, N),
  3539. };
  3540. static struct atlas7_grp_mux uart3_rts_grp1_mux = {
  3541. .pad_mux_count = ARRAY_SIZE(uart3_rts_grp1_pad_mux),
  3542. .pad_mux_list = uart3_rts_grp1_pad_mux,
  3543. };
  3544. static struct atlas7_pad_mux uart3_rts_grp2_pad_mux[] = {
  3545. MUX(1, 139, 2, N, N, N, N),
  3546. };
  3547. static struct atlas7_grp_mux uart3_rts_grp2_mux = {
  3548. .pad_mux_count = ARRAY_SIZE(uart3_rts_grp2_pad_mux),
  3549. .pad_mux_list = uart3_rts_grp2_pad_mux,
  3550. };
  3551. static struct atlas7_pad_mux uart3_rxd_grp0_pad_mux[] = {
  3552. MUX(1, 138, 1, 0xa00, 5, 0xa80, 5),
  3553. };
  3554. static struct atlas7_grp_mux uart3_rxd_grp0_mux = {
  3555. .pad_mux_count = ARRAY_SIZE(uart3_rxd_grp0_pad_mux),
  3556. .pad_mux_list = uart3_rxd_grp0_pad_mux,
  3557. };
  3558. static struct atlas7_pad_mux uart3_rxd_grp1_pad_mux[] = {
  3559. MUX(1, 84, 2, 0xa00, 5, 0xa80, 5),
  3560. };
  3561. static struct atlas7_grp_mux uart3_rxd_grp1_mux = {
  3562. .pad_mux_count = ARRAY_SIZE(uart3_rxd_grp1_pad_mux),
  3563. .pad_mux_list = uart3_rxd_grp1_pad_mux,
  3564. };
  3565. static struct atlas7_pad_mux uart3_rxd_grp2_pad_mux[] = {
  3566. MUX(1, 162, 3, 0xa00, 5, 0xa80, 5),
  3567. };
  3568. static struct atlas7_grp_mux uart3_rxd_grp2_mux = {
  3569. .pad_mux_count = ARRAY_SIZE(uart3_rxd_grp2_pad_mux),
  3570. .pad_mux_list = uart3_rxd_grp2_pad_mux,
  3571. };
  3572. static struct atlas7_pad_mux uart3_txd_grp0_pad_mux[] = {
  3573. MUX(1, 137, 1, N, N, N, N),
  3574. };
  3575. static struct atlas7_grp_mux uart3_txd_grp0_mux = {
  3576. .pad_mux_count = ARRAY_SIZE(uart3_txd_grp0_pad_mux),
  3577. .pad_mux_list = uart3_txd_grp0_pad_mux,
  3578. };
  3579. static struct atlas7_pad_mux uart3_txd_grp1_pad_mux[] = {
  3580. MUX(1, 83, 2, N, N, N, N),
  3581. };
  3582. static struct atlas7_grp_mux uart3_txd_grp1_mux = {
  3583. .pad_mux_count = ARRAY_SIZE(uart3_txd_grp1_pad_mux),
  3584. .pad_mux_list = uart3_txd_grp1_pad_mux,
  3585. };
  3586. static struct atlas7_pad_mux uart3_txd_grp2_pad_mux[] = {
  3587. MUX(1, 161, 3, N, N, N, N),
  3588. };
  3589. static struct atlas7_grp_mux uart3_txd_grp2_mux = {
  3590. .pad_mux_count = ARRAY_SIZE(uart3_txd_grp2_pad_mux),
  3591. .pad_mux_list = uart3_txd_grp2_pad_mux,
  3592. };
  3593. static struct atlas7_pad_mux uart4_basic_grp_pad_mux[] = {
  3594. MUX(1, 140, 1, N, N, N, N),
  3595. MUX(1, 139, 1, N, N, N, N),
  3596. };
  3597. static struct atlas7_grp_mux uart4_basic_grp_mux = {
  3598. .pad_mux_count = ARRAY_SIZE(uart4_basic_grp_pad_mux),
  3599. .pad_mux_list = uart4_basic_grp_pad_mux,
  3600. };
  3601. static struct atlas7_pad_mux uart4_cts_grp0_pad_mux[] = {
  3602. MUX(1, 122, 4, 0xa08, 1, 0xa88, 1),
  3603. };
  3604. static struct atlas7_grp_mux uart4_cts_grp0_mux = {
  3605. .pad_mux_count = ARRAY_SIZE(uart4_cts_grp0_pad_mux),
  3606. .pad_mux_list = uart4_cts_grp0_pad_mux,
  3607. };
  3608. static struct atlas7_pad_mux uart4_cts_grp1_pad_mux[] = {
  3609. MUX(1, 100, 4, 0xa08, 1, 0xa88, 1),
  3610. };
  3611. static struct atlas7_grp_mux uart4_cts_grp1_mux = {
  3612. .pad_mux_count = ARRAY_SIZE(uart4_cts_grp1_pad_mux),
  3613. .pad_mux_list = uart4_cts_grp1_pad_mux,
  3614. };
  3615. static struct atlas7_pad_mux uart4_cts_grp2_pad_mux[] = {
  3616. MUX(1, 117, 2, 0xa08, 1, 0xa88, 1),
  3617. };
  3618. static struct atlas7_grp_mux uart4_cts_grp2_mux = {
  3619. .pad_mux_count = ARRAY_SIZE(uart4_cts_grp2_pad_mux),
  3620. .pad_mux_list = uart4_cts_grp2_pad_mux,
  3621. };
  3622. static struct atlas7_pad_mux uart4_rts_grp0_pad_mux[] = {
  3623. MUX(1, 123, 4, N, N, N, N),
  3624. };
  3625. static struct atlas7_grp_mux uart4_rts_grp0_mux = {
  3626. .pad_mux_count = ARRAY_SIZE(uart4_rts_grp0_pad_mux),
  3627. .pad_mux_list = uart4_rts_grp0_pad_mux,
  3628. };
  3629. static struct atlas7_pad_mux uart4_rts_grp1_pad_mux[] = {
  3630. MUX(1, 99, 4, N, N, N, N),
  3631. };
  3632. static struct atlas7_grp_mux uart4_rts_grp1_mux = {
  3633. .pad_mux_count = ARRAY_SIZE(uart4_rts_grp1_pad_mux),
  3634. .pad_mux_list = uart4_rts_grp1_pad_mux,
  3635. };
  3636. static struct atlas7_pad_mux uart4_rts_grp2_pad_mux[] = {
  3637. MUX(1, 116, 2, N, N, N, N),
  3638. };
  3639. static struct atlas7_grp_mux uart4_rts_grp2_mux = {
  3640. .pad_mux_count = ARRAY_SIZE(uart4_rts_grp2_pad_mux),
  3641. .pad_mux_list = uart4_rts_grp2_pad_mux,
  3642. };
  3643. static struct atlas7_pad_mux usb0_drvvbus_grp0_pad_mux[] = {
  3644. MUX(1, 51, 2, N, N, N, N),
  3645. };
  3646. static struct atlas7_grp_mux usb0_drvvbus_grp0_mux = {
  3647. .pad_mux_count = ARRAY_SIZE(usb0_drvvbus_grp0_pad_mux),
  3648. .pad_mux_list = usb0_drvvbus_grp0_pad_mux,
  3649. };
  3650. static struct atlas7_pad_mux usb0_drvvbus_grp1_pad_mux[] = {
  3651. MUX(1, 162, 7, N, N, N, N),
  3652. };
  3653. static struct atlas7_grp_mux usb0_drvvbus_grp1_mux = {
  3654. .pad_mux_count = ARRAY_SIZE(usb0_drvvbus_grp1_pad_mux),
  3655. .pad_mux_list = usb0_drvvbus_grp1_pad_mux,
  3656. };
  3657. static struct atlas7_pad_mux usb1_drvvbus_grp0_pad_mux[] = {
  3658. MUX(1, 134, 2, N, N, N, N),
  3659. };
  3660. static struct atlas7_grp_mux usb1_drvvbus_grp0_mux = {
  3661. .pad_mux_count = ARRAY_SIZE(usb1_drvvbus_grp0_pad_mux),
  3662. .pad_mux_list = usb1_drvvbus_grp0_pad_mux,
  3663. };
  3664. static struct atlas7_pad_mux usb1_drvvbus_grp1_pad_mux[] = {
  3665. MUX(1, 163, 2, N, N, N, N),
  3666. };
  3667. static struct atlas7_grp_mux usb1_drvvbus_grp1_mux = {
  3668. .pad_mux_count = ARRAY_SIZE(usb1_drvvbus_grp1_pad_mux),
  3669. .pad_mux_list = usb1_drvvbus_grp1_pad_mux,
  3670. };
  3671. static struct atlas7_pad_mux visbus_dout_grp_pad_mux[] = {
  3672. MUX(1, 57, 6, N, N, N, N),
  3673. MUX(1, 58, 6, N, N, N, N),
  3674. MUX(1, 59, 6, N, N, N, N),
  3675. MUX(1, 60, 6, N, N, N, N),
  3676. MUX(1, 61, 6, N, N, N, N),
  3677. MUX(1, 62, 6, N, N, N, N),
  3678. MUX(1, 63, 6, N, N, N, N),
  3679. MUX(1, 64, 6, N, N, N, N),
  3680. MUX(1, 65, 6, N, N, N, N),
  3681. MUX(1, 66, 6, N, N, N, N),
  3682. MUX(1, 67, 6, N, N, N, N),
  3683. MUX(1, 68, 6, N, N, N, N),
  3684. MUX(1, 69, 6, N, N, N, N),
  3685. MUX(1, 70, 6, N, N, N, N),
  3686. MUX(1, 71, 6, N, N, N, N),
  3687. MUX(1, 72, 6, N, N, N, N),
  3688. MUX(1, 53, 6, N, N, N, N),
  3689. MUX(1, 54, 6, N, N, N, N),
  3690. MUX(1, 55, 6, N, N, N, N),
  3691. MUX(1, 56, 6, N, N, N, N),
  3692. MUX(1, 85, 6, N, N, N, N),
  3693. MUX(1, 86, 6, N, N, N, N),
  3694. MUX(1, 87, 6, N, N, N, N),
  3695. MUX(1, 88, 6, N, N, N, N),
  3696. MUX(1, 89, 6, N, N, N, N),
  3697. MUX(1, 90, 6, N, N, N, N),
  3698. MUX(1, 91, 6, N, N, N, N),
  3699. MUX(1, 92, 6, N, N, N, N),
  3700. MUX(1, 93, 6, N, N, N, N),
  3701. MUX(1, 94, 6, N, N, N, N),
  3702. MUX(1, 95, 6, N, N, N, N),
  3703. MUX(1, 96, 6, N, N, N, N),
  3704. };
  3705. static struct atlas7_grp_mux visbus_dout_grp_mux = {
  3706. .pad_mux_count = ARRAY_SIZE(visbus_dout_grp_pad_mux),
  3707. .pad_mux_list = visbus_dout_grp_pad_mux,
  3708. };
  3709. static struct atlas7_pad_mux vi_vip1_grp_pad_mux[] = {
  3710. MUX(1, 74, 1, N, N, N, N),
  3711. MUX(1, 75, 1, N, N, N, N),
  3712. MUX(1, 76, 1, N, N, N, N),
  3713. MUX(1, 77, 1, N, N, N, N),
  3714. MUX(1, 78, 1, N, N, N, N),
  3715. MUX(1, 79, 1, N, N, N, N),
  3716. MUX(1, 80, 1, N, N, N, N),
  3717. MUX(1, 81, 1, N, N, N, N),
  3718. MUX(1, 82, 1, N, N, N, N),
  3719. MUX(1, 83, 1, N, N, N, N),
  3720. MUX(1, 84, 1, N, N, N, N),
  3721. MUX(1, 103, 2, N, N, N, N),
  3722. MUX(1, 104, 2, N, N, N, N),
  3723. MUX(1, 105, 2, N, N, N, N),
  3724. MUX(1, 106, 2, N, N, N, N),
  3725. MUX(1, 107, 2, N, N, N, N),
  3726. MUX(1, 102, 2, N, N, N, N),
  3727. MUX(1, 97, 2, N, N, N, N),
  3728. MUX(1, 98, 2, N, N, N, N),
  3729. };
  3730. static struct atlas7_grp_mux vi_vip1_grp_mux = {
  3731. .pad_mux_count = ARRAY_SIZE(vi_vip1_grp_pad_mux),
  3732. .pad_mux_list = vi_vip1_grp_pad_mux,
  3733. };
  3734. static struct atlas7_pad_mux vi_vip1_ext_grp_pad_mux[] = {
  3735. MUX(1, 74, 1, N, N, N, N),
  3736. MUX(1, 75, 1, N, N, N, N),
  3737. MUX(1, 76, 1, N, N, N, N),
  3738. MUX(1, 77, 1, N, N, N, N),
  3739. MUX(1, 78, 1, N, N, N, N),
  3740. MUX(1, 79, 1, N, N, N, N),
  3741. MUX(1, 80, 1, N, N, N, N),
  3742. MUX(1, 81, 1, N, N, N, N),
  3743. MUX(1, 82, 1, N, N, N, N),
  3744. MUX(1, 83, 1, N, N, N, N),
  3745. MUX(1, 84, 1, N, N, N, N),
  3746. MUX(1, 108, 2, N, N, N, N),
  3747. MUX(1, 103, 2, N, N, N, N),
  3748. MUX(1, 104, 2, N, N, N, N),
  3749. MUX(1, 105, 2, N, N, N, N),
  3750. MUX(1, 106, 2, N, N, N, N),
  3751. MUX(1, 107, 2, N, N, N, N),
  3752. MUX(1, 102, 2, N, N, N, N),
  3753. MUX(1, 97, 2, N, N, N, N),
  3754. MUX(1, 98, 2, N, N, N, N),
  3755. MUX(1, 99, 2, N, N, N, N),
  3756. MUX(1, 100, 2, N, N, N, N),
  3757. };
  3758. static struct atlas7_grp_mux vi_vip1_ext_grp_mux = {
  3759. .pad_mux_count = ARRAY_SIZE(vi_vip1_ext_grp_pad_mux),
  3760. .pad_mux_list = vi_vip1_ext_grp_pad_mux,
  3761. };
  3762. static struct atlas7_pad_mux vi_vip1_low8bit_grp_pad_mux[] = {
  3763. MUX(1, 74, 1, N, N, N, N),
  3764. MUX(1, 75, 1, N, N, N, N),
  3765. MUX(1, 76, 1, N, N, N, N),
  3766. MUX(1, 77, 1, N, N, N, N),
  3767. MUX(1, 78, 1, N, N, N, N),
  3768. MUX(1, 79, 1, N, N, N, N),
  3769. MUX(1, 80, 1, N, N, N, N),
  3770. MUX(1, 81, 1, N, N, N, N),
  3771. MUX(1, 82, 1, N, N, N, N),
  3772. MUX(1, 83, 1, N, N, N, N),
  3773. MUX(1, 84, 1, N, N, N, N),
  3774. };
  3775. static struct atlas7_grp_mux vi_vip1_low8bit_grp_mux = {
  3776. .pad_mux_count = ARRAY_SIZE(vi_vip1_low8bit_grp_pad_mux),
  3777. .pad_mux_list = vi_vip1_low8bit_grp_pad_mux,
  3778. };
  3779. static struct atlas7_pad_mux vi_vip1_high8bit_grp_pad_mux[] = {
  3780. MUX(1, 82, 1, N, N, N, N),
  3781. MUX(1, 83, 1, N, N, N, N),
  3782. MUX(1, 84, 1, N, N, N, N),
  3783. MUX(1, 103, 2, N, N, N, N),
  3784. MUX(1, 104, 2, N, N, N, N),
  3785. MUX(1, 105, 2, N, N, N, N),
  3786. MUX(1, 106, 2, N, N, N, N),
  3787. MUX(1, 107, 2, N, N, N, N),
  3788. MUX(1, 102, 2, N, N, N, N),
  3789. MUX(1, 97, 2, N, N, N, N),
  3790. MUX(1, 98, 2, N, N, N, N),
  3791. };
  3792. static struct atlas7_grp_mux vi_vip1_high8bit_grp_mux = {
  3793. .pad_mux_count = ARRAY_SIZE(vi_vip1_high8bit_grp_pad_mux),
  3794. .pad_mux_list = vi_vip1_high8bit_grp_pad_mux,
  3795. };
  3796. static struct atlas7_pmx_func atlas7_pmx_functions[] = {
  3797. FUNCTION("gnss_gpio", gnss_gpio_grp, &gnss_gpio_grp_mux),
  3798. FUNCTION("lcd_vip_gpio", lcd_vip_gpio_grp, &lcd_vip_gpio_grp_mux),
  3799. FUNCTION("sdio_i2s_gpio", sdio_i2s_gpio_grp, &sdio_i2s_gpio_grp_mux),
  3800. FUNCTION("sp_rgmii_gpio", sp_rgmii_gpio_grp, &sp_rgmii_gpio_grp_mux),
  3801. FUNCTION("lvds_gpio", lvds_gpio_grp, &lvds_gpio_grp_mux),
  3802. FUNCTION("jtag_uart_nand_gpio",
  3803. jtag_uart_nand_gpio_grp,
  3804. &jtag_uart_nand_gpio_grp_mux),
  3805. FUNCTION("rtc_gpio", rtc_gpio_grp, &rtc_gpio_grp_mux),
  3806. FUNCTION("audio_ac97", audio_ac97_grp, &audio_ac97_grp_mux),
  3807. FUNCTION("audio_digmic_m0",
  3808. audio_digmic_grp0,
  3809. &audio_digmic_grp0_mux),
  3810. FUNCTION("audio_digmic_m1",
  3811. audio_digmic_grp1,
  3812. &audio_digmic_grp1_mux),
  3813. FUNCTION("audio_digmic_m2",
  3814. audio_digmic_grp2,
  3815. &audio_digmic_grp2_mux),
  3816. FUNCTION("audio_func_dbg",
  3817. audio_func_dbg_grp,
  3818. &audio_func_dbg_grp_mux),
  3819. FUNCTION("audio_i2s", audio_i2s_grp, &audio_i2s_grp_mux),
  3820. FUNCTION("audio_i2s_2ch", audio_i2s_2ch_grp, &audio_i2s_2ch_grp_mux),
  3821. FUNCTION("audio_i2s_extclk",
  3822. audio_i2s_extclk_grp,
  3823. &audio_i2s_extclk_grp_mux),
  3824. FUNCTION("audio_spdif_out_m0",
  3825. audio_spdif_out_grp0,
  3826. &audio_spdif_out_grp0_mux),
  3827. FUNCTION("audio_spdif_out_m1",
  3828. audio_spdif_out_grp1,
  3829. &audio_spdif_out_grp1_mux),
  3830. FUNCTION("audio_spdif_out_m2",
  3831. audio_spdif_out_grp2,
  3832. &audio_spdif_out_grp2_mux),
  3833. FUNCTION("audio_uart0_basic",
  3834. audio_uart0_basic_grp,
  3835. &audio_uart0_basic_grp_mux),
  3836. FUNCTION("audio_uart0_urfs_m0",
  3837. audio_uart0_urfs_grp0,
  3838. &audio_uart0_urfs_grp0_mux),
  3839. FUNCTION("audio_uart0_urfs_m1",
  3840. audio_uart0_urfs_grp1,
  3841. &audio_uart0_urfs_grp1_mux),
  3842. FUNCTION("audio_uart0_urfs_m2",
  3843. audio_uart0_urfs_grp2,
  3844. &audio_uart0_urfs_grp2_mux),
  3845. FUNCTION("audio_uart0_urfs_m3",
  3846. audio_uart0_urfs_grp3,
  3847. &audio_uart0_urfs_grp3_mux),
  3848. FUNCTION("audio_uart1_basic",
  3849. audio_uart1_basic_grp,
  3850. &audio_uart1_basic_grp_mux),
  3851. FUNCTION("audio_uart1_urfs_m0",
  3852. audio_uart1_urfs_grp0,
  3853. &audio_uart1_urfs_grp0_mux),
  3854. FUNCTION("audio_uart1_urfs_m1",
  3855. audio_uart1_urfs_grp1,
  3856. &audio_uart1_urfs_grp1_mux),
  3857. FUNCTION("audio_uart1_urfs_m2",
  3858. audio_uart1_urfs_grp2,
  3859. &audio_uart1_urfs_grp2_mux),
  3860. FUNCTION("audio_uart2_urfs_m0",
  3861. audio_uart2_urfs_grp0,
  3862. &audio_uart2_urfs_grp0_mux),
  3863. FUNCTION("audio_uart2_urfs_m1",
  3864. audio_uart2_urfs_grp1,
  3865. &audio_uart2_urfs_grp1_mux),
  3866. FUNCTION("audio_uart2_urfs_m2",
  3867. audio_uart2_urfs_grp2,
  3868. &audio_uart2_urfs_grp2_mux),
  3869. FUNCTION("audio_uart2_urxd_m0",
  3870. audio_uart2_urxd_grp0,
  3871. &audio_uart2_urxd_grp0_mux),
  3872. FUNCTION("audio_uart2_urxd_m1",
  3873. audio_uart2_urxd_grp1,
  3874. &audio_uart2_urxd_grp1_mux),
  3875. FUNCTION("audio_uart2_urxd_m2",
  3876. audio_uart2_urxd_grp2,
  3877. &audio_uart2_urxd_grp2_mux),
  3878. FUNCTION("audio_uart2_usclk_m0",
  3879. audio_uart2_usclk_grp0,
  3880. &audio_uart2_usclk_grp0_mux),
  3881. FUNCTION("audio_uart2_usclk_m1",
  3882. audio_uart2_usclk_grp1,
  3883. &audio_uart2_usclk_grp1_mux),
  3884. FUNCTION("audio_uart2_usclk_m2",
  3885. audio_uart2_usclk_grp2,
  3886. &audio_uart2_usclk_grp2_mux),
  3887. FUNCTION("audio_uart2_utfs_m0",
  3888. audio_uart2_utfs_grp0,
  3889. &audio_uart2_utfs_grp0_mux),
  3890. FUNCTION("audio_uart2_utfs_m1",
  3891. audio_uart2_utfs_grp1,
  3892. &audio_uart2_utfs_grp1_mux),
  3893. FUNCTION("audio_uart2_utfs_m2",
  3894. audio_uart2_utfs_grp2,
  3895. &audio_uart2_utfs_grp2_mux),
  3896. FUNCTION("audio_uart2_utxd_m0",
  3897. audio_uart2_utxd_grp0,
  3898. &audio_uart2_utxd_grp0_mux),
  3899. FUNCTION("audio_uart2_utxd_m1",
  3900. audio_uart2_utxd_grp1,
  3901. &audio_uart2_utxd_grp1_mux),
  3902. FUNCTION("audio_uart2_utxd_m2",
  3903. audio_uart2_utxd_grp2,
  3904. &audio_uart2_utxd_grp2_mux),
  3905. FUNCTION("c_can_trnsvr_en_m0",
  3906. c_can_trnsvr_en_grp0,
  3907. &c_can_trnsvr_en_grp0_mux),
  3908. FUNCTION("c_can_trnsvr_en_m1",
  3909. c_can_trnsvr_en_grp1,
  3910. &c_can_trnsvr_en_grp1_mux),
  3911. FUNCTION("c_can_trnsvr_intr",
  3912. c_can_trnsvr_intr_grp,
  3913. &c_can_trnsvr_intr_grp_mux),
  3914. FUNCTION("c_can_trnsvr_stb_n",
  3915. c_can_trnsvr_stb_n_grp,
  3916. &c_can_trnsvr_stb_n_grp_mux),
  3917. FUNCTION("c0_can_rxd_trnsv0",
  3918. c0_can_rxd_trnsv0_grp,
  3919. &c0_can_rxd_trnsv0_grp_mux),
  3920. FUNCTION("c0_can_rxd_trnsv1",
  3921. c0_can_rxd_trnsv1_grp,
  3922. &c0_can_rxd_trnsv1_grp_mux),
  3923. FUNCTION("c0_can_txd_trnsv0",
  3924. c0_can_txd_trnsv0_grp,
  3925. &c0_can_txd_trnsv0_grp_mux),
  3926. FUNCTION("c0_can_txd_trnsv1",
  3927. c0_can_txd_trnsv1_grp,
  3928. &c0_can_txd_trnsv1_grp_mux),
  3929. FUNCTION("c1_can_rxd_m0", c1_can_rxd_grp0, &c1_can_rxd_grp0_mux),
  3930. FUNCTION("c1_can_rxd_m1", c1_can_rxd_grp1, &c1_can_rxd_grp1_mux),
  3931. FUNCTION("c1_can_rxd_m2", c1_can_rxd_grp2, &c1_can_rxd_grp2_mux),
  3932. FUNCTION("c1_can_rxd_m3", c1_can_rxd_grp3, &c1_can_rxd_grp3_mux),
  3933. FUNCTION("c1_can_txd_m0", c1_can_txd_grp0, &c1_can_txd_grp0_mux),
  3934. FUNCTION("c1_can_txd_m1", c1_can_txd_grp1, &c1_can_txd_grp1_mux),
  3935. FUNCTION("c1_can_txd_m2", c1_can_txd_grp2, &c1_can_txd_grp2_mux),
  3936. FUNCTION("c1_can_txd_m3", c1_can_txd_grp3, &c1_can_txd_grp3_mux),
  3937. FUNCTION("ca_audio_lpc", ca_audio_lpc_grp, &ca_audio_lpc_grp_mux),
  3938. FUNCTION("ca_bt_lpc", ca_bt_lpc_grp, &ca_bt_lpc_grp_mux),
  3939. FUNCTION("ca_coex", ca_coex_grp, &ca_coex_grp_mux),
  3940. FUNCTION("ca_curator_lpc",
  3941. ca_curator_lpc_grp,
  3942. &ca_curator_lpc_grp_mux),
  3943. FUNCTION("ca_pcm_debug", ca_pcm_debug_grp, &ca_pcm_debug_grp_mux),
  3944. FUNCTION("ca_pio", ca_pio_grp, &ca_pio_grp_mux),
  3945. FUNCTION("ca_sdio_debug", ca_sdio_debug_grp, &ca_sdio_debug_grp_mux),
  3946. FUNCTION("ca_spi", ca_spi_grp, &ca_spi_grp_mux),
  3947. FUNCTION("ca_trb", ca_trb_grp, &ca_trb_grp_mux),
  3948. FUNCTION("ca_uart_debug", ca_uart_debug_grp, &ca_uart_debug_grp_mux),
  3949. FUNCTION("clkc_m0", clkc_grp0, &clkc_grp0_mux),
  3950. FUNCTION("clkc_m1", clkc_grp1, &clkc_grp1_mux),
  3951. FUNCTION("gn_gnss_i2c", gn_gnss_i2c_grp, &gn_gnss_i2c_grp_mux),
  3952. FUNCTION("gn_gnss_uart_nopause",
  3953. gn_gnss_uart_nopause_grp,
  3954. &gn_gnss_uart_nopause_grp_mux),
  3955. FUNCTION("gn_gnss_uart", gn_gnss_uart_grp, &gn_gnss_uart_grp_mux),
  3956. FUNCTION("gn_trg_spi_m0", gn_trg_spi_grp0, &gn_trg_spi_grp0_mux),
  3957. FUNCTION("gn_trg_spi_m1", gn_trg_spi_grp1, &gn_trg_spi_grp1_mux),
  3958. FUNCTION("cvbs_dbg", cvbs_dbg_grp, &cvbs_dbg_grp_mux),
  3959. FUNCTION("cvbs_dbg_test_m0",
  3960. cvbs_dbg_test_grp0,
  3961. &cvbs_dbg_test_grp0_mux),
  3962. FUNCTION("cvbs_dbg_test_m1",
  3963. cvbs_dbg_test_grp1,
  3964. &cvbs_dbg_test_grp1_mux),
  3965. FUNCTION("cvbs_dbg_test_m2",
  3966. cvbs_dbg_test_grp2,
  3967. &cvbs_dbg_test_grp2_mux),
  3968. FUNCTION("cvbs_dbg_test_m3",
  3969. cvbs_dbg_test_grp3,
  3970. &cvbs_dbg_test_grp3_mux),
  3971. FUNCTION("cvbs_dbg_test_m4",
  3972. cvbs_dbg_test_grp4,
  3973. &cvbs_dbg_test_grp4_mux),
  3974. FUNCTION("cvbs_dbg_test_m5",
  3975. cvbs_dbg_test_grp5,
  3976. &cvbs_dbg_test_grp5_mux),
  3977. FUNCTION("cvbs_dbg_test_m6",
  3978. cvbs_dbg_test_grp6,
  3979. &cvbs_dbg_test_grp6_mux),
  3980. FUNCTION("cvbs_dbg_test_m7",
  3981. cvbs_dbg_test_grp7,
  3982. &cvbs_dbg_test_grp7_mux),
  3983. FUNCTION("cvbs_dbg_test_m8",
  3984. cvbs_dbg_test_grp8,
  3985. &cvbs_dbg_test_grp8_mux),
  3986. FUNCTION("cvbs_dbg_test_m9",
  3987. cvbs_dbg_test_grp9,
  3988. &cvbs_dbg_test_grp9_mux),
  3989. FUNCTION("cvbs_dbg_test_m10",
  3990. cvbs_dbg_test_grp10,
  3991. &cvbs_dbg_test_grp10_mux),
  3992. FUNCTION("cvbs_dbg_test_m11",
  3993. cvbs_dbg_test_grp11,
  3994. &cvbs_dbg_test_grp11_mux),
  3995. FUNCTION("cvbs_dbg_test_m12",
  3996. cvbs_dbg_test_grp12,
  3997. &cvbs_dbg_test_grp12_mux),
  3998. FUNCTION("cvbs_dbg_test_m13",
  3999. cvbs_dbg_test_grp13,
  4000. &cvbs_dbg_test_grp13_mux),
  4001. FUNCTION("cvbs_dbg_test_m14",
  4002. cvbs_dbg_test_grp14,
  4003. &cvbs_dbg_test_grp14_mux),
  4004. FUNCTION("cvbs_dbg_test_m15",
  4005. cvbs_dbg_test_grp15,
  4006. &cvbs_dbg_test_grp15_mux),
  4007. FUNCTION("gn_gnss_power", gn_gnss_power_grp, &gn_gnss_power_grp_mux),
  4008. FUNCTION("gn_gnss_sw_status",
  4009. gn_gnss_sw_status_grp,
  4010. &gn_gnss_sw_status_grp_mux),
  4011. FUNCTION("gn_gnss_eclk", gn_gnss_eclk_grp, &gn_gnss_eclk_grp_mux),
  4012. FUNCTION("gn_gnss_irq1_m0",
  4013. gn_gnss_irq1_grp0,
  4014. &gn_gnss_irq1_grp0_mux),
  4015. FUNCTION("gn_gnss_irq2_m0",
  4016. gn_gnss_irq2_grp0,
  4017. &gn_gnss_irq2_grp0_mux),
  4018. FUNCTION("gn_gnss_tm", gn_gnss_tm_grp, &gn_gnss_tm_grp_mux),
  4019. FUNCTION("gn_gnss_tsync", gn_gnss_tsync_grp, &gn_gnss_tsync_grp_mux),
  4020. FUNCTION("gn_io_gnsssys_sw_cfg",
  4021. gn_io_gnsssys_sw_cfg_grp,
  4022. &gn_io_gnsssys_sw_cfg_grp_mux),
  4023. FUNCTION("gn_trg_m0", gn_trg_grp0, &gn_trg_grp0_mux),
  4024. FUNCTION("gn_trg_m1", gn_trg_grp1, &gn_trg_grp1_mux),
  4025. FUNCTION("gn_trg_shutdown_m0",
  4026. gn_trg_shutdown_grp0,
  4027. &gn_trg_shutdown_grp0_mux),
  4028. FUNCTION("gn_trg_shutdown_m1",
  4029. gn_trg_shutdown_grp1,
  4030. &gn_trg_shutdown_grp1_mux),
  4031. FUNCTION("gn_trg_shutdown_m2",
  4032. gn_trg_shutdown_grp2,
  4033. &gn_trg_shutdown_grp2_mux),
  4034. FUNCTION("gn_trg_shutdown_m3",
  4035. gn_trg_shutdown_grp3,
  4036. &gn_trg_shutdown_grp3_mux),
  4037. FUNCTION("i2c0", i2c0_grp, &i2c0_grp_mux),
  4038. FUNCTION("i2c1", i2c1_grp, &i2c1_grp_mux),
  4039. FUNCTION("i2s0", i2s0_grp, &i2s0_grp_mux),
  4040. FUNCTION("i2s1_basic", i2s1_basic_grp, &i2s1_basic_grp_mux),
  4041. FUNCTION("i2s1_rxd0_m0", i2s1_rxd0_grp0, &i2s1_rxd0_grp0_mux),
  4042. FUNCTION("i2s1_rxd0_m1", i2s1_rxd0_grp1, &i2s1_rxd0_grp1_mux),
  4043. FUNCTION("i2s1_rxd0_m2", i2s1_rxd0_grp2, &i2s1_rxd0_grp2_mux),
  4044. FUNCTION("i2s1_rxd0_m3", i2s1_rxd0_grp3, &i2s1_rxd0_grp3_mux),
  4045. FUNCTION("i2s1_rxd0_m4", i2s1_rxd0_grp4, &i2s1_rxd0_grp4_mux),
  4046. FUNCTION("i2s1_rxd1_m0", i2s1_rxd1_grp0, &i2s1_rxd1_grp0_mux),
  4047. FUNCTION("i2s1_rxd1_m1", i2s1_rxd1_grp1, &i2s1_rxd1_grp1_mux),
  4048. FUNCTION("i2s1_rxd1_m2", i2s1_rxd1_grp2, &i2s1_rxd1_grp2_mux),
  4049. FUNCTION("i2s1_rxd1_m3", i2s1_rxd1_grp3, &i2s1_rxd1_grp3_mux),
  4050. FUNCTION("i2s1_rxd1_m4", i2s1_rxd1_grp4, &i2s1_rxd1_grp4_mux),
  4051. FUNCTION("jtag_jt_dbg_nsrst",
  4052. jtag_jt_dbg_nsrst_grp,
  4053. &jtag_jt_dbg_nsrst_grp_mux),
  4054. FUNCTION("jtag_ntrst_m0", jtag_ntrst_grp0, &jtag_ntrst_grp0_mux),
  4055. FUNCTION("jtag_ntrst_m1", jtag_ntrst_grp1, &jtag_ntrst_grp1_mux),
  4056. FUNCTION("jtag_swdiotms_m0",
  4057. jtag_swdiotms_grp0,
  4058. &jtag_swdiotms_grp0_mux),
  4059. FUNCTION("jtag_swdiotms_m1",
  4060. jtag_swdiotms_grp1,
  4061. &jtag_swdiotms_grp1_mux),
  4062. FUNCTION("jtag_tck_m0", jtag_tck_grp0, &jtag_tck_grp0_mux),
  4063. FUNCTION("jtag_tck_m1", jtag_tck_grp1, &jtag_tck_grp1_mux),
  4064. FUNCTION("jtag_tdi_m0", jtag_tdi_grp0, &jtag_tdi_grp0_mux),
  4065. FUNCTION("jtag_tdi_m1", jtag_tdi_grp1, &jtag_tdi_grp1_mux),
  4066. FUNCTION("jtag_tdo_m0", jtag_tdo_grp0, &jtag_tdo_grp0_mux),
  4067. FUNCTION("jtag_tdo_m1", jtag_tdo_grp1, &jtag_tdo_grp1_mux),
  4068. FUNCTION("ks_kas_spi_m0", ks_kas_spi_grp0, &ks_kas_spi_grp0_mux),
  4069. FUNCTION("ld_ldd", ld_ldd_grp, &ld_ldd_grp_mux),
  4070. FUNCTION("ld_ldd_16bit", ld_ldd_16bit_grp, &ld_ldd_16bit_grp_mux),
  4071. FUNCTION("ld_ldd_fck", ld_ldd_fck_grp, &ld_ldd_fck_grp_mux),
  4072. FUNCTION("ld_ldd_lck", ld_ldd_lck_grp, &ld_ldd_lck_grp_mux),
  4073. FUNCTION("lr_lcdrom", lr_lcdrom_grp, &lr_lcdrom_grp_mux),
  4074. FUNCTION("lvds_analog", lvds_analog_grp, &lvds_analog_grp_mux),
  4075. FUNCTION("nd_df_basic", nd_df_basic_grp, &nd_df_basic_grp_mux),
  4076. FUNCTION("nd_df_wp", nd_df_wp_grp, &nd_df_wp_grp_mux),
  4077. FUNCTION("nd_df_cs", nd_df_cs_grp, &nd_df_cs_grp_mux),
  4078. FUNCTION("ps", ps_grp, &ps_grp_mux),
  4079. FUNCTION("ps_no_dir", ps_no_dir_grp, &ps_no_dir_grp_mux),
  4080. FUNCTION("pwc_core_on", pwc_core_on_grp, &pwc_core_on_grp_mux),
  4081. FUNCTION("pwc_ext_on", pwc_ext_on_grp, &pwc_ext_on_grp_mux),
  4082. FUNCTION("pwc_gpio3_clk", pwc_gpio3_clk_grp, &pwc_gpio3_clk_grp_mux),
  4083. FUNCTION("pwc_io_on", pwc_io_on_grp, &pwc_io_on_grp_mux),
  4084. FUNCTION("pwc_lowbatt_b_m0",
  4085. pwc_lowbatt_b_grp0,
  4086. &pwc_lowbatt_b_grp0_mux),
  4087. FUNCTION("pwc_mem_on", pwc_mem_on_grp, &pwc_mem_on_grp_mux),
  4088. FUNCTION("pwc_on_key_b_m0",
  4089. pwc_on_key_b_grp0,
  4090. &pwc_on_key_b_grp0_mux),
  4091. FUNCTION("pwc_wakeup_src0",
  4092. pwc_wakeup_src0_grp,
  4093. &pwc_wakeup_src0_grp_mux),
  4094. FUNCTION("pwc_wakeup_src1",
  4095. pwc_wakeup_src1_grp,
  4096. &pwc_wakeup_src1_grp_mux),
  4097. FUNCTION("pwc_wakeup_src2",
  4098. pwc_wakeup_src2_grp,
  4099. &pwc_wakeup_src2_grp_mux),
  4100. FUNCTION("pwc_wakeup_src3",
  4101. pwc_wakeup_src3_grp,
  4102. &pwc_wakeup_src3_grp_mux),
  4103. FUNCTION("pw_cko0_m0", pw_cko0_grp0, &pw_cko0_grp0_mux),
  4104. FUNCTION("pw_cko0_m1", pw_cko0_grp1, &pw_cko0_grp1_mux),
  4105. FUNCTION("pw_cko0_m2", pw_cko0_grp2, &pw_cko0_grp2_mux),
  4106. FUNCTION("pw_cko0_m3", pw_cko0_grp3, &pw_cko0_grp3_mux),
  4107. FUNCTION("pw_cko1_m0", pw_cko1_grp0, &pw_cko1_grp0_mux),
  4108. FUNCTION("pw_cko1_m1", pw_cko1_grp1, &pw_cko1_grp1_mux),
  4109. FUNCTION("pw_cko1_m2", pw_cko1_grp2, &pw_cko1_grp2_mux),
  4110. FUNCTION("pw_i2s01_clk_m0",
  4111. pw_i2s01_clk_grp0,
  4112. &pw_i2s01_clk_grp0_mux),
  4113. FUNCTION("pw_i2s01_clk_m1",
  4114. pw_i2s01_clk_grp1,
  4115. &pw_i2s01_clk_grp1_mux),
  4116. FUNCTION("pw_i2s01_clk_m2",
  4117. pw_i2s01_clk_grp2,
  4118. &pw_i2s01_clk_grp2_mux),
  4119. FUNCTION("pw_pwm0_m0", pw_pwm0_grp0, &pw_pwm0_grp0_mux),
  4120. FUNCTION("pw_pwm0_m1", pw_pwm0_grp1, &pw_pwm0_grp1_mux),
  4121. FUNCTION("pw_pwm1_m0", pw_pwm1_grp0, &pw_pwm1_grp0_mux),
  4122. FUNCTION("pw_pwm1_m1", pw_pwm1_grp1, &pw_pwm1_grp1_mux),
  4123. FUNCTION("pw_pwm1_m2", pw_pwm1_grp2, &pw_pwm1_grp2_mux),
  4124. FUNCTION("pw_pwm2_m0", pw_pwm2_grp0, &pw_pwm2_grp0_mux),
  4125. FUNCTION("pw_pwm2_m1", pw_pwm2_grp1, &pw_pwm2_grp1_mux),
  4126. FUNCTION("pw_pwm2_m2", pw_pwm2_grp2, &pw_pwm2_grp2_mux),
  4127. FUNCTION("pw_pwm3_m0", pw_pwm3_grp0, &pw_pwm3_grp0_mux),
  4128. FUNCTION("pw_pwm3_m1", pw_pwm3_grp1, &pw_pwm3_grp1_mux),
  4129. FUNCTION("pw_pwm_cpu_vol_m0",
  4130. pw_pwm_cpu_vol_grp0,
  4131. &pw_pwm_cpu_vol_grp0_mux),
  4132. FUNCTION("pw_pwm_cpu_vol_m1",
  4133. pw_pwm_cpu_vol_grp1,
  4134. &pw_pwm_cpu_vol_grp1_mux),
  4135. FUNCTION("pw_pwm_cpu_vol_m2",
  4136. pw_pwm_cpu_vol_grp2,
  4137. &pw_pwm_cpu_vol_grp2_mux),
  4138. FUNCTION("pw_backlight_m0",
  4139. pw_backlight_grp0,
  4140. &pw_backlight_grp0_mux),
  4141. FUNCTION("pw_backlight_m1",
  4142. pw_backlight_grp1,
  4143. &pw_backlight_grp1_mux),
  4144. FUNCTION("rg_eth_mac", rg_eth_mac_grp, &rg_eth_mac_grp_mux),
  4145. FUNCTION("rg_gmac_phy_intr_n",
  4146. rg_gmac_phy_intr_n_grp,
  4147. &rg_gmac_phy_intr_n_grp_mux),
  4148. FUNCTION("rg_rgmii_mac", rg_rgmii_mac_grp, &rg_rgmii_mac_grp_mux),
  4149. FUNCTION("rg_rgmii_phy_ref_clk_m0",
  4150. rg_rgmii_phy_ref_clk_grp0,
  4151. &rg_rgmii_phy_ref_clk_grp0_mux),
  4152. FUNCTION("rg_rgmii_phy_ref_clk_m1",
  4153. rg_rgmii_phy_ref_clk_grp1,
  4154. &rg_rgmii_phy_ref_clk_grp1_mux),
  4155. FUNCTION("sd0", sd0_grp, &sd0_grp_mux),
  4156. FUNCTION("sd0_4bit", sd0_4bit_grp, &sd0_4bit_grp_mux),
  4157. FUNCTION("sd1", sd1_grp, &sd1_grp_mux),
  4158. FUNCTION("sd1_4bit_m0", sd1_4bit_grp0, &sd1_4bit_grp0_mux),
  4159. FUNCTION("sd1_4bit_m1", sd1_4bit_grp1, &sd1_4bit_grp1_mux),
  4160. FUNCTION("sd2_basic", sd2_basic_grp, &sd2_basic_grp_mux),
  4161. FUNCTION("sd2_cdb_m0", sd2_cdb_grp0, &sd2_cdb_grp0_mux),
  4162. FUNCTION("sd2_cdb_m1", sd2_cdb_grp1, &sd2_cdb_grp1_mux),
  4163. FUNCTION("sd2_wpb_m0", sd2_wpb_grp0, &sd2_wpb_grp0_mux),
  4164. FUNCTION("sd2_wpb_m1", sd2_wpb_grp1, &sd2_wpb_grp1_mux),
  4165. FUNCTION("sd3", sd3_9_grp, &sd3_9_grp_mux),
  4166. FUNCTION("sd5", sd5_grp, &sd5_grp_mux),
  4167. FUNCTION("sd6_m0", sd6_grp0, &sd6_grp0_mux),
  4168. FUNCTION("sd6_m1", sd6_grp1, &sd6_grp1_mux),
  4169. FUNCTION("sd9", sd3_9_grp, &sd3_9_grp_mux),
  4170. FUNCTION("sp0_ext_ldo_on",
  4171. sp0_ext_ldo_on_grp,
  4172. &sp0_ext_ldo_on_grp_mux),
  4173. FUNCTION("sp0_qspi", sp0_qspi_grp, &sp0_qspi_grp_mux),
  4174. FUNCTION("sp1_spi", sp1_spi_grp, &sp1_spi_grp_mux),
  4175. FUNCTION("tpiu_trace", tpiu_trace_grp, &tpiu_trace_grp_mux),
  4176. FUNCTION("uart0", uart0_grp, &uart0_grp_mux),
  4177. FUNCTION("uart0_nopause", uart0_nopause_grp, &uart0_nopause_grp_mux),
  4178. FUNCTION("uart1", uart1_grp, &uart1_grp_mux),
  4179. FUNCTION("uart2_cts_m0", uart2_cts_grp0, &uart2_cts_grp0_mux),
  4180. FUNCTION("uart2_cts_m1", uart2_cts_grp1, &uart2_cts_grp1_mux),
  4181. FUNCTION("uart2_rts_m0", uart2_rts_grp0, &uart2_rts_grp0_mux),
  4182. FUNCTION("uart2_rts_m1", uart2_rts_grp1, &uart2_rts_grp1_mux),
  4183. FUNCTION("uart2_rxd_m0", uart2_rxd_grp0, &uart2_rxd_grp0_mux),
  4184. FUNCTION("uart2_rxd_m1", uart2_rxd_grp1, &uart2_rxd_grp1_mux),
  4185. FUNCTION("uart2_rxd_m2", uart2_rxd_grp2, &uart2_rxd_grp2_mux),
  4186. FUNCTION("uart2_txd_m0", uart2_txd_grp0, &uart2_txd_grp0_mux),
  4187. FUNCTION("uart2_txd_m1", uart2_txd_grp1, &uart2_txd_grp1_mux),
  4188. FUNCTION("uart2_txd_m2", uart2_txd_grp2, &uart2_txd_grp2_mux),
  4189. FUNCTION("uart3_cts_m0", uart3_cts_grp0, &uart3_cts_grp0_mux),
  4190. FUNCTION("uart3_cts_m1", uart3_cts_grp1, &uart3_cts_grp1_mux),
  4191. FUNCTION("uart3_cts_m2", uart3_cts_grp2, &uart3_cts_grp2_mux),
  4192. FUNCTION("uart3_rts_m0", uart3_rts_grp0, &uart3_rts_grp0_mux),
  4193. FUNCTION("uart3_rts_m1", uart3_rts_grp1, &uart3_rts_grp1_mux),
  4194. FUNCTION("uart3_rts_m2", uart3_rts_grp2, &uart3_rts_grp2_mux),
  4195. FUNCTION("uart3_rxd_m0", uart3_rxd_grp0, &uart3_rxd_grp0_mux),
  4196. FUNCTION("uart3_rxd_m1", uart3_rxd_grp1, &uart3_rxd_grp1_mux),
  4197. FUNCTION("uart3_rxd_m2", uart3_rxd_grp2, &uart3_rxd_grp2_mux),
  4198. FUNCTION("uart3_txd_m0", uart3_txd_grp0, &uart3_txd_grp0_mux),
  4199. FUNCTION("uart3_txd_m1", uart3_txd_grp1, &uart3_txd_grp1_mux),
  4200. FUNCTION("uart3_txd_m2", uart3_txd_grp2, &uart3_txd_grp2_mux),
  4201. FUNCTION("uart4_basic", uart4_basic_grp, &uart4_basic_grp_mux),
  4202. FUNCTION("uart4_cts_m0", uart4_cts_grp0, &uart4_cts_grp0_mux),
  4203. FUNCTION("uart4_cts_m1", uart4_cts_grp1, &uart4_cts_grp1_mux),
  4204. FUNCTION("uart4_cts_m2", uart4_cts_grp2, &uart4_cts_grp2_mux),
  4205. FUNCTION("uart4_rts_m0", uart4_rts_grp0, &uart4_rts_grp0_mux),
  4206. FUNCTION("uart4_rts_m1", uart4_rts_grp1, &uart4_rts_grp1_mux),
  4207. FUNCTION("uart4_rts_m2", uart4_rts_grp2, &uart4_rts_grp2_mux),
  4208. FUNCTION("usb0_drvvbus_m0",
  4209. usb0_drvvbus_grp0,
  4210. &usb0_drvvbus_grp0_mux),
  4211. FUNCTION("usb0_drvvbus_m1",
  4212. usb0_drvvbus_grp1,
  4213. &usb0_drvvbus_grp1_mux),
  4214. FUNCTION("usb1_drvvbus_m0",
  4215. usb1_drvvbus_grp0,
  4216. &usb1_drvvbus_grp0_mux),
  4217. FUNCTION("usb1_drvvbus_m1",
  4218. usb1_drvvbus_grp1,
  4219. &usb1_drvvbus_grp1_mux),
  4220. FUNCTION("visbus_dout", visbus_dout_grp, &visbus_dout_grp_mux),
  4221. FUNCTION("vi_vip1", vi_vip1_grp, &vi_vip1_grp_mux),
  4222. FUNCTION("vi_vip1_ext", vi_vip1_ext_grp, &vi_vip1_ext_grp_mux),
  4223. FUNCTION("vi_vip1_low8bit",
  4224. vi_vip1_low8bit_grp,
  4225. &vi_vip1_low8bit_grp_mux),
  4226. FUNCTION("vi_vip1_high8bit",
  4227. vi_vip1_high8bit_grp,
  4228. &vi_vip1_high8bit_grp_mux),
  4229. };
  4230. struct atlas7_pinctrl_data atlas7_ioc_data = {
  4231. .pads = (struct pinctrl_pin_desc *)atlas7_ioc_pads,
  4232. .pads_cnt = ARRAY_SIZE(atlas7_ioc_pads),
  4233. .grps = (struct atlas7_pin_group *)altas7_pin_groups,
  4234. .grps_cnt = ARRAY_SIZE(altas7_pin_groups),
  4235. .funcs = (struct atlas7_pmx_func *)atlas7_pmx_functions,
  4236. .funcs_cnt = ARRAY_SIZE(atlas7_pmx_functions),
  4237. .confs = (struct atlas7_pad_config *)atlas7_ioc_pad_confs,
  4238. .confs_cnt = ARRAY_SIZE(atlas7_ioc_pad_confs),
  4239. };
  4240. /* Simple map data structure */
  4241. struct map_data {
  4242. u8 idx;
  4243. u8 data;
  4244. };
  4245. /**
  4246. * struct atlas7_pull_info - Atlas7 Pad pull info
  4247. * @type:The type of this Pad.
  4248. * @mask:The mas value of this pin's pull bits.
  4249. * @v2s: The map of pull register value to pull status.
  4250. * @s2v: The map of pull status to pull register value.
  4251. */
  4252. struct atlas7_pull_info {
  4253. u8 pad_type;
  4254. u8 mask;
  4255. const struct map_data *v2s;
  4256. const struct map_data *s2v;
  4257. };
  4258. /* Pull Register value map to status */
  4259. static const struct map_data p4we_pull_v2s[] = {
  4260. { P4WE_PULL_UP, PULL_UP },
  4261. { P4WE_HIGH_HYSTERESIS, HIGH_HYSTERESIS },
  4262. { P4WE_HIGH_Z, HIGH_Z },
  4263. { P4WE_PULL_DOWN, PULL_DOWN },
  4264. };
  4265. static const struct map_data p16st_pull_v2s[] = {
  4266. { P16ST_PULL_UP, PULL_UP },
  4267. { PD, PULL_UNKNOWN },
  4268. { P16ST_HIGH_Z, HIGH_Z },
  4269. { P16ST_PULL_DOWN, PULL_DOWN },
  4270. };
  4271. static const struct map_data pm31_pull_v2s[] = {
  4272. { PM31_PULL_DISABLED, PULL_DOWN },
  4273. { PM31_PULL_ENABLED, PULL_UP },
  4274. };
  4275. static const struct map_data pangd_pull_v2s[] = {
  4276. { PANGD_PULL_UP, PULL_UP },
  4277. { PD, PULL_UNKNOWN },
  4278. { PANGD_HIGH_Z, HIGH_Z },
  4279. { PANGD_PULL_DOWN, PULL_DOWN },
  4280. };
  4281. /* Pull status map to register value */
  4282. static const struct map_data p4we_pull_s2v[] = {
  4283. { PULL_UP, P4WE_PULL_UP },
  4284. { HIGH_HYSTERESIS, P4WE_HIGH_HYSTERESIS },
  4285. { HIGH_Z, P4WE_HIGH_Z },
  4286. { PULL_DOWN, P4WE_PULL_DOWN },
  4287. { PULL_DISABLE, -1 },
  4288. { PULL_ENABLE, -1 },
  4289. };
  4290. static const struct map_data p16st_pull_s2v[] = {
  4291. { PULL_UP, P16ST_PULL_UP },
  4292. { HIGH_HYSTERESIS, -1 },
  4293. { HIGH_Z, P16ST_HIGH_Z },
  4294. { PULL_DOWN, P16ST_PULL_DOWN },
  4295. { PULL_DISABLE, -1 },
  4296. { PULL_ENABLE, -1 },
  4297. };
  4298. static const struct map_data pm31_pull_s2v[] = {
  4299. { PULL_UP, PM31_PULL_ENABLED },
  4300. { HIGH_HYSTERESIS, -1 },
  4301. { HIGH_Z, -1 },
  4302. { PULL_DOWN, PM31_PULL_DISABLED },
  4303. { PULL_DISABLE, -1 },
  4304. { PULL_ENABLE, -1 },
  4305. };
  4306. static const struct map_data pangd_pull_s2v[] = {
  4307. { PULL_UP, PANGD_PULL_UP },
  4308. { HIGH_HYSTERESIS, -1 },
  4309. { HIGH_Z, PANGD_HIGH_Z },
  4310. { PULL_DOWN, PANGD_PULL_DOWN },
  4311. { PULL_DISABLE, -1 },
  4312. { PULL_ENABLE, -1 },
  4313. };
  4314. static const struct atlas7_pull_info atlas7_pull_map[] = {
  4315. { PAD_T_4WE_PD, P4WE_PULL_MASK, p4we_pull_v2s, p4we_pull_s2v },
  4316. { PAD_T_4WE_PU, P4WE_PULL_MASK, p4we_pull_v2s, p4we_pull_s2v },
  4317. { PAD_T_16ST, P16ST_PULL_MASK, p16st_pull_v2s, p16st_pull_s2v },
  4318. { PAD_T_M31_0204_PD, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
  4319. { PAD_T_M31_0204_PU, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
  4320. { PAD_T_M31_0610_PD, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
  4321. { PAD_T_M31_0610_PU, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
  4322. { PAD_T_AD, PANGD_PULL_MASK, pangd_pull_v2s, pangd_pull_s2v },
  4323. };
  4324. /**
  4325. * struct atlas7_ds_ma_info - Atlas7 Pad DriveStrength & currents info
  4326. * @ma: The Drive Strength in current value .
  4327. * @ds_16st: The correspond raw value of 16st pad.
  4328. * @ds_4we: The correspond raw value of 4we pad.
  4329. * @ds_0204m31: The correspond raw value of 0204m31 pad.
  4330. * @ds_0610m31: The correspond raw value of 0610m31 pad.
  4331. */
  4332. struct atlas7_ds_ma_info {
  4333. u32 ma;
  4334. u32 ds_16st;
  4335. u32 ds_4we;
  4336. u32 ds_0204m31;
  4337. u32 ds_0610m31;
  4338. };
  4339. static const struct atlas7_ds_ma_info atlas7_ma2ds_map[] = {
  4340. { 2, DS_16ST_0, DS_4WE_0, DS_M31_0, DS_NULL },
  4341. { 4, DS_16ST_1, DS_NULL, DS_M31_1, DS_NULL },
  4342. { 6, DS_16ST_2, DS_NULL, DS_NULL, DS_M31_0 },
  4343. { 8, DS_16ST_3, DS_4WE_1, DS_NULL, DS_NULL },
  4344. { 10, DS_16ST_4, DS_NULL, DS_NULL, DS_M31_1 },
  4345. { 12, DS_16ST_5, DS_NULL, DS_NULL, DS_NULL },
  4346. { 14, DS_16ST_6, DS_NULL, DS_NULL, DS_NULL },
  4347. { 16, DS_16ST_7, DS_4WE_2, DS_NULL, DS_NULL },
  4348. { 18, DS_16ST_8, DS_NULL, DS_NULL, DS_NULL },
  4349. { 20, DS_16ST_9, DS_NULL, DS_NULL, DS_NULL },
  4350. { 22, DS_16ST_10, DS_NULL, DS_NULL, DS_NULL },
  4351. { 24, DS_16ST_11, DS_NULL, DS_NULL, DS_NULL },
  4352. { 26, DS_16ST_12, DS_NULL, DS_NULL, DS_NULL },
  4353. { 28, DS_16ST_13, DS_4WE_3, DS_NULL, DS_NULL },
  4354. { 30, DS_16ST_14, DS_NULL, DS_NULL, DS_NULL },
  4355. { 32, DS_16ST_15, DS_NULL, DS_NULL, DS_NULL },
  4356. };
  4357. /**
  4358. * struct atlas7_ds_info - Atlas7 Pad DriveStrength info
  4359. * @type: The type of this Pad.
  4360. * @mask: The mask value of this pin's pull bits.
  4361. * @imval: The immediate value of drives trength register.
  4362. */
  4363. struct atlas7_ds_info {
  4364. u8 type;
  4365. u8 mask;
  4366. u8 imval;
  4367. u8 reserved;
  4368. };
  4369. static const struct atlas7_ds_info atlas7_ds_map[] = {
  4370. { PAD_T_4WE_PD, DS_2BIT_MASK, DS_2BIT_IM_VAL },
  4371. { PAD_T_4WE_PU, DS_2BIT_MASK, DS_2BIT_IM_VAL },
  4372. { PAD_T_16ST, DS_4BIT_MASK, DS_4BIT_IM_VAL },
  4373. { PAD_T_M31_0204_PD, DS_1BIT_MASK, DS_1BIT_IM_VAL },
  4374. { PAD_T_M31_0204_PU, DS_1BIT_MASK, DS_1BIT_IM_VAL },
  4375. { PAD_T_M31_0610_PD, DS_1BIT_MASK, DS_1BIT_IM_VAL },
  4376. { PAD_T_M31_0610_PU, DS_1BIT_MASK, DS_1BIT_IM_VAL },
  4377. { PAD_T_AD, DS_NULL, DS_NULL },
  4378. };
  4379. static inline u32 atlas7_pin_to_bank(u32 pin)
  4380. {
  4381. return (pin >= ATLAS7_PINCTRL_BANK_0_PINS) ? 1 : 0;
  4382. }
  4383. static int atlas7_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
  4384. {
  4385. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4386. return pmx->pctl_data->funcs_cnt;
  4387. }
  4388. static const char *atlas7_pmx_get_func_name(struct pinctrl_dev *pctldev,
  4389. u32 selector)
  4390. {
  4391. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4392. return pmx->pctl_data->funcs[selector].name;
  4393. }
  4394. static int atlas7_pmx_get_func_groups(struct pinctrl_dev *pctldev,
  4395. u32 selector, const char * const **groups,
  4396. u32 * const num_groups)
  4397. {
  4398. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4399. *groups = pmx->pctl_data->funcs[selector].groups;
  4400. *num_groups = pmx->pctl_data->funcs[selector].num_groups;
  4401. return 0;
  4402. }
  4403. static void __atlas7_pmx_pin_input_disable_set(struct atlas7_pmx *pmx,
  4404. const struct atlas7_pad_mux *mux)
  4405. {
  4406. /* Set Input Disable to avoid input glitches
  4407. *
  4408. * All Input-Disable Control registers are located on IOCRTC.
  4409. * So the regs bank is always 0.
  4410. *
  4411. */
  4412. if (mux->dinput_reg && mux->dinput_val_reg) {
  4413. writel(DI_MASK << mux->dinput_bit,
  4414. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_reg));
  4415. writel(DI_DISABLE << mux->dinput_bit,
  4416. pmx->regs[BANK_DS] + mux->dinput_reg);
  4417. writel(DIV_MASK << mux->dinput_val_bit,
  4418. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_val_reg));
  4419. writel(DIV_DISABLE << mux->dinput_val_bit,
  4420. pmx->regs[BANK_DS] + mux->dinput_val_reg);
  4421. }
  4422. }
  4423. static void __atlas7_pmx_pin_input_disable_clr(struct atlas7_pmx *pmx,
  4424. const struct atlas7_pad_mux *mux)
  4425. {
  4426. /* Clear Input Disable to avoid input glitches */
  4427. if (mux->dinput_reg && mux->dinput_val_reg) {
  4428. writel(DI_MASK << mux->dinput_bit,
  4429. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_reg));
  4430. writel(DI_ENABLE << mux->dinput_bit,
  4431. pmx->regs[BANK_DS] + mux->dinput_reg);
  4432. writel(DIV_MASK << mux->dinput_val_bit,
  4433. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_val_reg));
  4434. writel(DIV_ENABLE << mux->dinput_val_bit,
  4435. pmx->regs[BANK_DS] + mux->dinput_val_reg);
  4436. }
  4437. }
  4438. static int __atlas7_pmx_pin_ad_sel(struct atlas7_pmx *pmx,
  4439. struct atlas7_pad_config *conf,
  4440. u32 bank, u32 ad_sel)
  4441. {
  4442. unsigned long regv;
  4443. /* Write to clear register to clear A/D selector */
  4444. writel(ANA_CLEAR_MASK << conf->ad_ctrl_bit,
  4445. pmx->regs[bank] + CLR_REG(conf->ad_ctrl_reg));
  4446. /* Set target pad A/D selector */
  4447. regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
  4448. regv &= ~(ANA_CLEAR_MASK << conf->ad_ctrl_bit);
  4449. writel(regv | (ad_sel << conf->ad_ctrl_bit),
  4450. pmx->regs[bank] + conf->ad_ctrl_reg);
  4451. regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
  4452. pr_debug("bank:%d reg:0x%04x val:0x%08lx\n",
  4453. bank, conf->ad_ctrl_reg, regv);
  4454. return 0;
  4455. }
  4456. static int __atlas7_pmx_pin_analog_enable(struct atlas7_pmx *pmx,
  4457. struct atlas7_pad_config *conf, u32 bank)
  4458. {
  4459. /* Only PAD_T_AD pins can change between Analogue&Digital */
  4460. if (conf->type != PAD_T_AD)
  4461. return -EINVAL;
  4462. return __atlas7_pmx_pin_ad_sel(pmx, conf, bank, 0);
  4463. }
  4464. static int __atlas7_pmx_pin_digital_enable(struct atlas7_pmx *pmx,
  4465. struct atlas7_pad_config *conf, u32 bank)
  4466. {
  4467. /* Other type pads are always digital */
  4468. if (conf->type != PAD_T_AD)
  4469. return 0;
  4470. return __atlas7_pmx_pin_ad_sel(pmx, conf, bank, 1);
  4471. }
  4472. static int __atlas7_pmx_pin_enable(struct atlas7_pmx *pmx,
  4473. u32 pin, u32 func)
  4474. {
  4475. struct atlas7_pad_config *conf;
  4476. u32 bank;
  4477. int ret;
  4478. unsigned long regv;
  4479. pr_debug("PMX DUMP ### pin#%d func:%d #### START >>>\n",
  4480. pin, func);
  4481. /* Get this Pad's descriptor from PINCTRL */
  4482. conf = &pmx->pctl_data->confs[pin];
  4483. bank = atlas7_pin_to_bank(pin);
  4484. /* Just enable the analog function of this pad */
  4485. if (FUNC_ANALOGUE == func) {
  4486. ret = __atlas7_pmx_pin_analog_enable(pmx, conf, bank);
  4487. if (ret)
  4488. dev_err(pmx->dev,
  4489. "Convert pad#%d to analog failed, ret=%d\n",
  4490. pin, ret);
  4491. return ret;
  4492. }
  4493. /* Set Pads from analog to digital */
  4494. ret = __atlas7_pmx_pin_digital_enable(pmx, conf, bank);
  4495. if (ret) {
  4496. dev_err(pmx->dev,
  4497. "Convert pad#%d to digital failed, ret=%d\n",
  4498. pin, ret);
  4499. return ret;
  4500. }
  4501. /* Write to clear register to clear current function */
  4502. writel(FUNC_CLEAR_MASK << conf->mux_bit,
  4503. pmx->regs[bank] + CLR_REG(conf->mux_reg));
  4504. /* Set target pad mux function */
  4505. regv = readl(pmx->regs[bank] + conf->mux_reg);
  4506. regv &= ~(FUNC_CLEAR_MASK << conf->mux_bit);
  4507. writel(regv | (func << conf->mux_bit),
  4508. pmx->regs[bank] + conf->mux_reg);
  4509. regv = readl(pmx->regs[bank] + conf->mux_reg);
  4510. pr_debug("bank:%d reg:0x%04x val:0x%08lx\n",
  4511. bank, conf->mux_reg, regv);
  4512. return 0;
  4513. }
  4514. static int atlas7_pmx_set_mux(struct pinctrl_dev *pctldev,
  4515. u32 func_selector, u32 group_selector)
  4516. {
  4517. int idx, ret;
  4518. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4519. struct atlas7_pmx_func *pmx_func;
  4520. struct atlas7_pin_group *pin_grp;
  4521. const struct atlas7_grp_mux *grp_mux;
  4522. const struct atlas7_pad_mux *mux;
  4523. pmx_func = &pmx->pctl_data->funcs[func_selector];
  4524. pin_grp = &pmx->pctl_data->grps[group_selector];
  4525. pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### START >>>\n",
  4526. pmx_func->name, pin_grp->name);
  4527. /* the sd3 and sd9 pin select by SYS2PCI_SDIO9SEL register */
  4528. if (pin_grp->pins == (unsigned int *)&sd3_9_pins) {
  4529. if (!strcmp(pmx_func->name, "sd9"))
  4530. writel(1, pmx->sys2pci_base + SYS2PCI_SDIO9SEL);
  4531. else
  4532. writel(0, pmx->sys2pci_base + SYS2PCI_SDIO9SEL);
  4533. }
  4534. grp_mux = pmx_func->grpmux;
  4535. for (idx = 0; idx < grp_mux->pad_mux_count; idx++) {
  4536. mux = &grp_mux->pad_mux_list[idx];
  4537. __atlas7_pmx_pin_input_disable_set(pmx, mux);
  4538. ret = __atlas7_pmx_pin_enable(pmx, mux->pin, mux->func);
  4539. if (ret) {
  4540. dev_err(pmx->dev,
  4541. "FUNC:%s GRP:%s PIN#%d.%d failed, ret=%d\n",
  4542. pmx_func->name, pin_grp->name,
  4543. mux->pin, mux->func, ret);
  4544. BUG_ON(1);
  4545. }
  4546. __atlas7_pmx_pin_input_disable_clr(pmx, mux);
  4547. }
  4548. pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### END <<<\n",
  4549. pmx_func->name, pin_grp->name);
  4550. return 0;
  4551. }
  4552. static u32 convert_current_to_drive_strength(u32 type, u32 ma)
  4553. {
  4554. int idx;
  4555. for (idx = 0; idx < ARRAY_SIZE(atlas7_ma2ds_map); idx++) {
  4556. if (atlas7_ma2ds_map[idx].ma != ma)
  4557. continue;
  4558. if (type == PAD_T_4WE_PD || type == PAD_T_4WE_PU)
  4559. return atlas7_ma2ds_map[idx].ds_4we;
  4560. else if (type == PAD_T_16ST)
  4561. return atlas7_ma2ds_map[idx].ds_16st;
  4562. else if (type == PAD_T_M31_0204_PD || type == PAD_T_M31_0204_PU)
  4563. return atlas7_ma2ds_map[idx].ds_0204m31;
  4564. else if (type == PAD_T_M31_0610_PD || type == PAD_T_M31_0610_PU)
  4565. return atlas7_ma2ds_map[idx].ds_0610m31;
  4566. }
  4567. return DS_NULL;
  4568. }
  4569. static int altas7_pinctrl_set_pull_sel(struct pinctrl_dev *pctldev,
  4570. u32 pin, u32 sel)
  4571. {
  4572. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4573. struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
  4574. const struct atlas7_pull_info *pull_info;
  4575. u32 bank;
  4576. unsigned long regv;
  4577. void __iomem *pull_sel_reg;
  4578. bank = atlas7_pin_to_bank(pin);
  4579. pull_info = &atlas7_pull_map[conf->type];
  4580. pull_sel_reg = pmx->regs[bank] + conf->pupd_reg;
  4581. /* Retrieve correspond register value from table by sel */
  4582. regv = pull_info->s2v[sel].data & pull_info->mask;
  4583. /* Clear & Set new value to pull register */
  4584. writel(pull_info->mask << conf->pupd_bit, CLR_REG(pull_sel_reg));
  4585. writel(regv << conf->pupd_bit, pull_sel_reg);
  4586. pr_debug("PIN_CFG ### SET PIN#%d PULL SELECTOR:%d == OK ####\n",
  4587. pin, sel);
  4588. return 0;
  4589. }
  4590. static int __altas7_pinctrl_set_drive_strength_sel(struct pinctrl_dev *pctldev,
  4591. u32 pin, u32 sel)
  4592. {
  4593. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4594. struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
  4595. const struct atlas7_ds_info *ds_info;
  4596. u32 bank;
  4597. void __iomem *ds_sel_reg;
  4598. ds_info = &atlas7_ds_map[conf->type];
  4599. if (sel & (~(ds_info->mask)))
  4600. goto unsupport;
  4601. bank = atlas7_pin_to_bank(pin);
  4602. ds_sel_reg = pmx->regs[bank] + conf->drvstr_reg;
  4603. writel(ds_info->imval << conf->drvstr_bit, CLR_REG(ds_sel_reg));
  4604. writel(sel << conf->drvstr_bit, ds_sel_reg);
  4605. return 0;
  4606. unsupport:
  4607. pr_err("Pad#%d type[%d] doesn't support ds code[%d]!\n",
  4608. pin, conf->type, sel);
  4609. return -ENOTSUPP;
  4610. }
  4611. static int altas7_pinctrl_set_drive_strength_sel(struct pinctrl_dev *pctldev,
  4612. u32 pin, u32 ma)
  4613. {
  4614. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4615. struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
  4616. u32 type = conf->type;
  4617. u32 sel;
  4618. int ret;
  4619. sel = convert_current_to_drive_strength(conf->type, ma);
  4620. if (DS_NULL == sel) {
  4621. pr_err("Pad#%d type[%d] doesn't support ds current[%d]!\n",
  4622. pin, type, ma);
  4623. return -ENOTSUPP;
  4624. }
  4625. ret = __altas7_pinctrl_set_drive_strength_sel(pctldev,
  4626. pin, sel);
  4627. pr_debug("PIN_CFG ### SET PIN#%d DS:%d MA:%d == %s ####\n",
  4628. pin, sel, ma, ret?"FAILED":"OK");
  4629. return ret;
  4630. }
  4631. static int atlas7_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
  4632. struct pinctrl_gpio_range *range, u32 pin)
  4633. {
  4634. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4635. u32 idx;
  4636. dev_dbg(pmx->dev,
  4637. "atlas7_pmx_gpio_request_enable: pin=%d\n", pin);
  4638. for (idx = 0; idx < range->npins; idx++) {
  4639. if (pin == range->pins[idx])
  4640. break;
  4641. }
  4642. if (idx >= range->npins) {
  4643. dev_err(pmx->dev,
  4644. "The pin#%d could not be requested as GPIO!!\n",
  4645. pin);
  4646. return -EPERM;
  4647. }
  4648. __atlas7_pmx_pin_enable(pmx, pin, FUNC_GPIO);
  4649. return 0;
  4650. }
  4651. static struct pinmux_ops atlas7_pinmux_ops = {
  4652. .get_functions_count = atlas7_pmx_get_funcs_count,
  4653. .get_function_name = atlas7_pmx_get_func_name,
  4654. .get_function_groups = atlas7_pmx_get_func_groups,
  4655. .set_mux = atlas7_pmx_set_mux,
  4656. .gpio_request_enable = atlas7_pmx_gpio_request_enable,
  4657. };
  4658. static int atlas7_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
  4659. {
  4660. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4661. return pmx->pctl_data->grps_cnt;
  4662. }
  4663. static const char *atlas7_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
  4664. u32 group)
  4665. {
  4666. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4667. return pmx->pctl_data->grps[group].name;
  4668. }
  4669. static int atlas7_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
  4670. u32 group, const u32 **pins, u32 *num_pins)
  4671. {
  4672. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  4673. *num_pins = pmx->pctl_data->grps[group].num_pins;
  4674. *pins = pmx->pctl_data->grps[group].pins;
  4675. return 0;
  4676. }
  4677. static int atlas7_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
  4678. struct device_node *np_config,
  4679. struct pinctrl_map **map,
  4680. u32 *num_maps)
  4681. {
  4682. return pinconf_generic_dt_node_to_map(pctldev, np_config, map,
  4683. num_maps, PIN_MAP_TYPE_INVALID);
  4684. }
  4685. static void atlas7_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
  4686. struct pinctrl_map *map, u32 num_maps)
  4687. {
  4688. kfree(map);
  4689. }
  4690. static const struct pinctrl_ops atlas7_pinctrl_ops = {
  4691. .get_groups_count = atlas7_pinctrl_get_groups_count,
  4692. .get_group_name = atlas7_pinctrl_get_group_name,
  4693. .get_group_pins = atlas7_pinctrl_get_group_pins,
  4694. .dt_node_to_map = atlas7_pinctrl_dt_node_to_map,
  4695. .dt_free_map = atlas7_pinctrl_dt_free_map,
  4696. };
  4697. static int atlas7_pin_config_set(struct pinctrl_dev *pctldev,
  4698. unsigned pin, unsigned long *configs,
  4699. unsigned num_configs)
  4700. {
  4701. u16 param, arg;
  4702. int idx, err;
  4703. for (idx = 0; idx < num_configs; idx++) {
  4704. param = pinconf_to_config_param(configs[idx]);
  4705. arg = pinconf_to_config_argument(configs[idx]);
  4706. pr_debug("PMX CFG###### ATLAS7 PIN#%d [%s] CONFIG PARAM:%d ARG:%d >>>>>\n",
  4707. pin, atlas7_ioc_pads[pin].name, param, arg);
  4708. switch (param) {
  4709. case PIN_CONFIG_BIAS_PULL_UP:
  4710. err = altas7_pinctrl_set_pull_sel(pctldev,
  4711. pin, PULL_UP);
  4712. if (err)
  4713. return err;
  4714. break;
  4715. case PIN_CONFIG_BIAS_PULL_DOWN:
  4716. err = altas7_pinctrl_set_pull_sel(pctldev,
  4717. pin, PULL_DOWN);
  4718. if (err)
  4719. return err;
  4720. break;
  4721. case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
  4722. err = altas7_pinctrl_set_pull_sel(pctldev,
  4723. pin, HIGH_HYSTERESIS);
  4724. if (err)
  4725. return err;
  4726. break;
  4727. case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
  4728. err = altas7_pinctrl_set_pull_sel(pctldev,
  4729. pin, HIGH_Z);
  4730. if (err)
  4731. return err;
  4732. break;
  4733. case PIN_CONFIG_DRIVE_STRENGTH:
  4734. err = altas7_pinctrl_set_drive_strength_sel(pctldev,
  4735. pin, arg);
  4736. if (err)
  4737. return err;
  4738. break;
  4739. default:
  4740. return -ENOTSUPP;
  4741. }
  4742. pr_debug("PMX CFG###### ATLAS7 PIN#%d [%s] CONFIG PARAM:%d ARG:%d <<<<\n",
  4743. pin, atlas7_ioc_pads[pin].name, param, arg);
  4744. }
  4745. return 0;
  4746. }
  4747. static int atlas7_pin_config_group_set(struct pinctrl_dev *pctldev,
  4748. unsigned group, unsigned long *configs,
  4749. unsigned num_configs)
  4750. {
  4751. const unsigned *pins;
  4752. unsigned npins;
  4753. int i, ret;
  4754. ret = atlas7_pinctrl_get_group_pins(pctldev, group, &pins, &npins);
  4755. if (ret)
  4756. return ret;
  4757. for (i = 0; i < npins; i++) {
  4758. if (atlas7_pin_config_set(pctldev, pins[i],
  4759. configs, num_configs))
  4760. return -ENOTSUPP;
  4761. }
  4762. return 0;
  4763. }
  4764. static const struct pinconf_ops atlas7_pinconf_ops = {
  4765. .pin_config_set = atlas7_pin_config_set,
  4766. .pin_config_group_set = atlas7_pin_config_group_set,
  4767. .is_generic = true,
  4768. };
  4769. static int atlas7_pinmux_probe(struct platform_device *pdev)
  4770. {
  4771. int ret, idx;
  4772. struct atlas7_pmx *pmx;
  4773. struct device_node *np = pdev->dev.of_node;
  4774. u32 banks = ATLAS7_PINCTRL_REG_BANKS;
  4775. struct device_node *sys2pci_np;
  4776. struct resource res;
  4777. /* Create state holders etc for this driver */
  4778. pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
  4779. if (!pmx)
  4780. return -ENOMEM;
  4781. /* The sd3 and sd9 shared all pins, and the function select by
  4782. * SYS2PCI_SDIO9SEL register
  4783. */
  4784. sys2pci_np = of_find_node_by_name(NULL, "sys2pci");
  4785. if (!sys2pci_np)
  4786. return -EINVAL;
  4787. ret = of_address_to_resource(sys2pci_np, 0, &res);
  4788. of_node_put(sys2pci_np);
  4789. if (ret)
  4790. return ret;
  4791. pmx->sys2pci_base = devm_ioremap_resource(&pdev->dev, &res);
  4792. if (IS_ERR(pmx->sys2pci_base))
  4793. return -ENOMEM;
  4794. pmx->dev = &pdev->dev;
  4795. pmx->pctl_data = &atlas7_ioc_data;
  4796. pmx->pctl_desc.name = "pinctrl-atlas7";
  4797. pmx->pctl_desc.pins = pmx->pctl_data->pads;
  4798. pmx->pctl_desc.npins = pmx->pctl_data->pads_cnt;
  4799. pmx->pctl_desc.pctlops = &atlas7_pinctrl_ops;
  4800. pmx->pctl_desc.pmxops = &atlas7_pinmux_ops;
  4801. pmx->pctl_desc.confops = &atlas7_pinconf_ops;
  4802. for (idx = 0; idx < banks; idx++) {
  4803. pmx->regs[idx] = of_iomap(np, idx);
  4804. if (!pmx->regs[idx]) {
  4805. dev_err(&pdev->dev,
  4806. "can't map ioc bank#%d registers\n", idx);
  4807. ret = -ENOMEM;
  4808. goto unmap_io;
  4809. }
  4810. }
  4811. /* Now register the pin controller and all pins it handles */
  4812. pmx->pctl = pinctrl_register(&pmx->pctl_desc, &pdev->dev, pmx);
  4813. if (IS_ERR(pmx->pctl)) {
  4814. dev_err(&pdev->dev, "could not register atlas7 pinmux driver\n");
  4815. ret = PTR_ERR(pmx->pctl);
  4816. goto unmap_io;
  4817. }
  4818. platform_set_drvdata(pdev, pmx);
  4819. dev_info(&pdev->dev, "initialized atlas7 pinmux driver\n");
  4820. return 0;
  4821. unmap_io:
  4822. for (idx = 0; idx < banks; idx++) {
  4823. if (!pmx->regs[idx])
  4824. break;
  4825. iounmap(pmx->regs[idx]);
  4826. }
  4827. return ret;
  4828. }
  4829. #ifdef CONFIG_PM_SLEEP
  4830. static int atlas7_pinmux_suspend_noirq(struct device *dev)
  4831. {
  4832. struct atlas7_pmx *pmx = dev_get_drvdata(dev);
  4833. struct atlas7_pad_status *status;
  4834. struct atlas7_pad_config *conf;
  4835. const struct atlas7_ds_info *ds_info;
  4836. const struct atlas7_pull_info *pull_info;
  4837. int idx;
  4838. u32 bank;
  4839. unsigned long regv;
  4840. for (idx = 0; idx < pmx->pctl_desc.npins; idx++) {
  4841. /* Get this Pad's descriptor from PINCTRL */
  4842. conf = &pmx->pctl_data->confs[idx];
  4843. bank = atlas7_pin_to_bank(idx);
  4844. status = &pmx->sleep_data[idx];
  4845. /* Save Function selector */
  4846. regv = readl(pmx->regs[bank] + conf->mux_reg);
  4847. status->func = (regv >> conf->mux_bit) & FUNC_CLEAR_MASK;
  4848. /* Check if Pad is in Analogue selector */
  4849. if (conf->ad_ctrl_reg == -1)
  4850. goto save_ds_sel;
  4851. regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
  4852. if (!(regv & (conf->ad_ctrl_bit << ANA_CLEAR_MASK)))
  4853. status->func = FUNC_ANALOGUE;
  4854. save_ds_sel:
  4855. if (conf->drvstr_reg == -1)
  4856. goto save_pull_sel;
  4857. /* Save Drive Strength selector */
  4858. ds_info = &atlas7_ds_map[conf->type];
  4859. regv = readl(pmx->regs[bank] + conf->drvstr_reg);
  4860. status->dstr = (regv >> conf->drvstr_bit) & ds_info->mask;
  4861. save_pull_sel:
  4862. /* Save Pull selector */
  4863. pull_info = &atlas7_pull_map[conf->type];
  4864. regv = readl(pmx->regs[bank] + conf->pupd_reg);
  4865. regv = (regv >> conf->pupd_bit) & pull_info->mask;
  4866. status->pull = pull_info->v2s[regv].data;
  4867. }
  4868. /*
  4869. * Save disable input selector, this selector is not for Pin,
  4870. * but for Mux function.
  4871. */
  4872. for (idx = 0; idx < NUM_OF_IN_DISABLE_REG; idx++) {
  4873. pmx->status_ds[idx] = readl(pmx->regs[BANK_DS] +
  4874. IN_DISABLE_0_REG_SET + 0x8 * idx);
  4875. pmx->status_dsv[idx] = readl(pmx->regs[BANK_DS] +
  4876. IN_DISABLE_VAL_0_REG_SET + 0x8 * idx);
  4877. }
  4878. return 0;
  4879. }
  4880. static int atlas7_pinmux_resume_noirq(struct device *dev)
  4881. {
  4882. struct atlas7_pmx *pmx = dev_get_drvdata(dev);
  4883. struct atlas7_pad_status *status;
  4884. struct atlas7_pad_config *conf;
  4885. int idx;
  4886. u32 bank;
  4887. for (idx = 0; idx < pmx->pctl_desc.npins; idx++) {
  4888. /* Get this Pad's descriptor from PINCTRL */
  4889. conf = &pmx->pctl_data->confs[idx];
  4890. bank = atlas7_pin_to_bank(idx);
  4891. status = &pmx->sleep_data[idx];
  4892. /* Restore Function selector */
  4893. __atlas7_pmx_pin_enable(pmx, idx, (u32)status->func & 0xff);
  4894. if (FUNC_ANALOGUE == status->func)
  4895. goto restore_pull_sel;
  4896. /* Restore Drive Strength selector */
  4897. __altas7_pinctrl_set_drive_strength_sel(pmx->pctl, idx,
  4898. (u32)status->dstr & 0xff);
  4899. restore_pull_sel:
  4900. /* Restore Pull selector */
  4901. altas7_pinctrl_set_pull_sel(pmx->pctl, idx,
  4902. (u32)status->pull & 0xff);
  4903. }
  4904. /*
  4905. * Restore disable input selector, this selector is not for Pin,
  4906. * but for Mux function
  4907. */
  4908. for (idx = 0; idx < NUM_OF_IN_DISABLE_REG; idx++) {
  4909. writel(~0, pmx->regs[BANK_DS] +
  4910. IN_DISABLE_0_REG_CLR + 0x8 * idx);
  4911. writel(pmx->status_ds[idx], pmx->regs[BANK_DS] +
  4912. IN_DISABLE_0_REG_SET + 0x8 * idx);
  4913. writel(~0, pmx->regs[BANK_DS] +
  4914. IN_DISABLE_VAL_0_REG_CLR + 0x8 * idx);
  4915. writel(pmx->status_dsv[idx], pmx->regs[BANK_DS] +
  4916. IN_DISABLE_VAL_0_REG_SET + 0x8 * idx);
  4917. }
  4918. return 0;
  4919. }
  4920. static const struct dev_pm_ops atlas7_pinmux_pm_ops = {
  4921. .suspend_noirq = atlas7_pinmux_suspend_noirq,
  4922. .resume_noirq = atlas7_pinmux_resume_noirq,
  4923. .freeze_noirq = atlas7_pinmux_suspend_noirq,
  4924. .restore_noirq = atlas7_pinmux_resume_noirq,
  4925. };
  4926. #endif
  4927. static const struct of_device_id atlas7_pinmux_ids[] = {
  4928. { .compatible = "sirf,atlas7-ioc",},
  4929. {},
  4930. };
  4931. static struct platform_driver atlas7_pinmux_driver = {
  4932. .driver = {
  4933. .name = "atlas7-ioc",
  4934. .of_match_table = atlas7_pinmux_ids,
  4935. #ifdef CONFIG_PM_SLEEP
  4936. .pm = &atlas7_pinmux_pm_ops,
  4937. #endif
  4938. },
  4939. .probe = atlas7_pinmux_probe,
  4940. };
  4941. static int __init atlas7_pinmux_init(void)
  4942. {
  4943. return platform_driver_register(&atlas7_pinmux_driver);
  4944. }
  4945. arch_initcall(atlas7_pinmux_init);
  4946. /**
  4947. * The Following is GPIO Code
  4948. */
  4949. static inline struct
  4950. atlas7_gpio_bank *atlas7_gpio_to_bank(struct atlas7_gpio_chip *a7gc, u32 gpio)
  4951. {
  4952. return &a7gc->banks[GPIO_TO_BANK(gpio)];
  4953. }
  4954. static int __atlas7_gpio_to_pin(struct atlas7_gpio_chip *a7gc, u32 gpio)
  4955. {
  4956. struct atlas7_gpio_bank *bank;
  4957. u32 ofs;
  4958. bank = atlas7_gpio_to_bank(a7gc, gpio);
  4959. ofs = gpio - bank->gpio_offset;
  4960. if (ofs >= bank->ngpio)
  4961. return -ENODEV;
  4962. return bank->gpio_pins[ofs];
  4963. }
  4964. static void atlas7_gpio_irq_ack(struct irq_data *d)
  4965. {
  4966. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  4967. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  4968. struct atlas7_gpio_bank *bank;
  4969. void __iomem *ctrl_reg;
  4970. u32 val, pin_in_bank;
  4971. unsigned long flags;
  4972. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  4973. pin_in_bank = d->hwirq - bank->gpio_offset;
  4974. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  4975. spin_lock_irqsave(&a7gc->lock, flags);
  4976. val = readl(ctrl_reg);
  4977. /* clear interrupt status */
  4978. writel(val, ctrl_reg);
  4979. spin_unlock_irqrestore(&a7gc->lock, flags);
  4980. }
  4981. static void __atlas7_gpio_irq_mask(struct atlas7_gpio_chip *a7gc, int idx)
  4982. {
  4983. struct atlas7_gpio_bank *bank;
  4984. void __iomem *ctrl_reg;
  4985. u32 val, pin_in_bank;
  4986. bank = atlas7_gpio_to_bank(a7gc, idx);
  4987. pin_in_bank = idx - bank->gpio_offset;
  4988. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  4989. val = readl(ctrl_reg);
  4990. val &= ~(ATLAS7_GPIO_CTL_INTR_EN_MASK |
  4991. ATLAS7_GPIO_CTL_INTR_STATUS_MASK);
  4992. writel(val, ctrl_reg);
  4993. }
  4994. static void atlas7_gpio_irq_mask(struct irq_data *d)
  4995. {
  4996. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  4997. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  4998. unsigned long flags;
  4999. spin_lock_irqsave(&a7gc->lock, flags);
  5000. __atlas7_gpio_irq_mask(a7gc, d->hwirq);
  5001. spin_unlock_irqrestore(&a7gc->lock, flags);
  5002. }
  5003. static void atlas7_gpio_irq_unmask(struct irq_data *d)
  5004. {
  5005. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  5006. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  5007. struct atlas7_gpio_bank *bank;
  5008. void __iomem *ctrl_reg;
  5009. u32 val, pin_in_bank;
  5010. unsigned long flags;
  5011. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  5012. pin_in_bank = d->hwirq - bank->gpio_offset;
  5013. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5014. spin_lock_irqsave(&a7gc->lock, flags);
  5015. val = readl(ctrl_reg);
  5016. val &= ~ATLAS7_GPIO_CTL_INTR_STATUS_MASK;
  5017. val |= ATLAS7_GPIO_CTL_INTR_EN_MASK;
  5018. writel(val, ctrl_reg);
  5019. spin_unlock_irqrestore(&a7gc->lock, flags);
  5020. }
  5021. static int atlas7_gpio_irq_type(struct irq_data *d,
  5022. unsigned int type)
  5023. {
  5024. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  5025. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  5026. struct atlas7_gpio_bank *bank;
  5027. void __iomem *ctrl_reg;
  5028. u32 val, pin_in_bank;
  5029. unsigned long flags;
  5030. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  5031. pin_in_bank = d->hwirq - bank->gpio_offset;
  5032. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5033. spin_lock_irqsave(&a7gc->lock, flags);
  5034. val = readl(ctrl_reg);
  5035. val &= ~(ATLAS7_GPIO_CTL_INTR_STATUS_MASK |
  5036. ATLAS7_GPIO_CTL_INTR_EN_MASK);
  5037. switch (type) {
  5038. case IRQ_TYPE_NONE:
  5039. break;
  5040. case IRQ_TYPE_EDGE_RISING:
  5041. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  5042. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  5043. val &= ~ATLAS7_GPIO_CTL_INTR_LOW_MASK;
  5044. break;
  5045. case IRQ_TYPE_EDGE_FALLING:
  5046. val &= ~ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
  5047. val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  5048. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  5049. break;
  5050. case IRQ_TYPE_EDGE_BOTH:
  5051. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  5052. ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  5053. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  5054. break;
  5055. case IRQ_TYPE_LEVEL_LOW:
  5056. val &= ~(ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  5057. ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
  5058. val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK;
  5059. break;
  5060. case IRQ_TYPE_LEVEL_HIGH:
  5061. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
  5062. val &= ~(ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  5063. ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
  5064. break;
  5065. }
  5066. writel(val, ctrl_reg);
  5067. spin_unlock_irqrestore(&a7gc->lock, flags);
  5068. return 0;
  5069. }
  5070. static struct irq_chip atlas7_gpio_irq_chip = {
  5071. .name = "atlas7-gpio-irq",
  5072. .irq_ack = atlas7_gpio_irq_ack,
  5073. .irq_mask = atlas7_gpio_irq_mask,
  5074. .irq_unmask = atlas7_gpio_irq_unmask,
  5075. .irq_set_type = atlas7_gpio_irq_type,
  5076. };
  5077. static void atlas7_gpio_handle_irq(struct irq_desc *desc)
  5078. {
  5079. struct gpio_chip *gc = irq_desc_get_handler_data(desc);
  5080. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  5081. struct atlas7_gpio_bank *bank = NULL;
  5082. u32 status, ctrl;
  5083. int pin_in_bank = 0, idx;
  5084. struct irq_chip *chip = irq_desc_get_chip(desc);
  5085. unsigned int irq = irq_desc_get_irq(desc);
  5086. for (idx = 0; idx < a7gc->nbank; idx++) {
  5087. bank = &a7gc->banks[idx];
  5088. if (bank->irq == irq)
  5089. break;
  5090. }
  5091. BUG_ON(idx == a7gc->nbank);
  5092. chained_irq_enter(chip, desc);
  5093. status = readl(ATLAS7_GPIO_INT_STATUS(bank));
  5094. if (!status) {
  5095. pr_warn("%s: gpio [%s] status %#x no interrupt is flagged\n",
  5096. __func__, gc->label, status);
  5097. handle_bad_irq(desc);
  5098. return;
  5099. }
  5100. while (status) {
  5101. ctrl = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));
  5102. /*
  5103. * Here we must check whether the corresponding GPIO's
  5104. * interrupt has been enabled, otherwise just skip it
  5105. */
  5106. if ((status & 0x1) && (ctrl & ATLAS7_GPIO_CTL_INTR_EN_MASK)) {
  5107. pr_debug("%s: chip[%s] gpio:%d happens\n",
  5108. __func__, gc->label,
  5109. bank->gpio_offset + pin_in_bank);
  5110. generic_handle_irq(
  5111. irq_find_mapping(gc->irqdomain,
  5112. bank->gpio_offset + pin_in_bank));
  5113. }
  5114. if (++pin_in_bank >= bank->ngpio)
  5115. break;
  5116. status = status >> 1;
  5117. }
  5118. chained_irq_exit(chip, desc);
  5119. }
  5120. static void __atlas7_gpio_set_input(struct atlas7_gpio_chip *a7gc,
  5121. unsigned int gpio)
  5122. {
  5123. struct atlas7_gpio_bank *bank;
  5124. void __iomem *ctrl_reg;
  5125. u32 val, pin_in_bank;
  5126. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5127. pin_in_bank = gpio - bank->gpio_offset;
  5128. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5129. val = readl(ctrl_reg);
  5130. val &= ~ATLAS7_GPIO_CTL_OUT_EN_MASK;
  5131. writel(val, ctrl_reg);
  5132. }
  5133. static int atlas7_gpio_request(struct gpio_chip *chip,
  5134. unsigned int gpio)
  5135. {
  5136. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5137. int ret;
  5138. unsigned long flags;
  5139. ret = __atlas7_gpio_to_pin(a7gc, gpio);
  5140. if (ret < 0)
  5141. return ret;
  5142. if (pinctrl_request_gpio(chip->base + gpio))
  5143. return -ENODEV;
  5144. spin_lock_irqsave(&a7gc->lock, flags);
  5145. /*
  5146. * default status:
  5147. * set direction as input and mask irq
  5148. */
  5149. __atlas7_gpio_set_input(a7gc, gpio);
  5150. __atlas7_gpio_irq_mask(a7gc, gpio);
  5151. spin_unlock_irqrestore(&a7gc->lock, flags);
  5152. return 0;
  5153. }
  5154. static void atlas7_gpio_free(struct gpio_chip *chip,
  5155. unsigned int gpio)
  5156. {
  5157. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5158. unsigned long flags;
  5159. spin_lock_irqsave(&a7gc->lock, flags);
  5160. __atlas7_gpio_irq_mask(a7gc, gpio);
  5161. __atlas7_gpio_set_input(a7gc, gpio);
  5162. spin_unlock_irqrestore(&a7gc->lock, flags);
  5163. pinctrl_free_gpio(chip->base + gpio);
  5164. }
  5165. static int atlas7_gpio_direction_input(struct gpio_chip *chip,
  5166. unsigned int gpio)
  5167. {
  5168. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5169. unsigned long flags;
  5170. spin_lock_irqsave(&a7gc->lock, flags);
  5171. __atlas7_gpio_set_input(a7gc, gpio);
  5172. spin_unlock_irqrestore(&a7gc->lock, flags);
  5173. return 0;
  5174. }
  5175. static void __atlas7_gpio_set_output(struct atlas7_gpio_chip *a7gc,
  5176. unsigned int gpio, int value)
  5177. {
  5178. struct atlas7_gpio_bank *bank;
  5179. void __iomem *ctrl_reg;
  5180. u32 out_ctrl, pin_in_bank;
  5181. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5182. pin_in_bank = gpio - bank->gpio_offset;
  5183. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5184. out_ctrl = readl(ctrl_reg);
  5185. if (value)
  5186. out_ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5187. else
  5188. out_ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5189. out_ctrl &= ~ATLAS7_GPIO_CTL_INTR_EN_MASK;
  5190. out_ctrl |= ATLAS7_GPIO_CTL_OUT_EN_MASK;
  5191. writel(out_ctrl, ctrl_reg);
  5192. }
  5193. static int atlas7_gpio_direction_output(struct gpio_chip *chip,
  5194. unsigned int gpio, int value)
  5195. {
  5196. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5197. unsigned long flags;
  5198. spin_lock_irqsave(&a7gc->lock, flags);
  5199. __atlas7_gpio_set_output(a7gc, gpio, value);
  5200. spin_unlock_irqrestore(&a7gc->lock, flags);
  5201. return 0;
  5202. }
  5203. static int atlas7_gpio_get_value(struct gpio_chip *chip,
  5204. unsigned int gpio)
  5205. {
  5206. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5207. struct atlas7_gpio_bank *bank;
  5208. u32 val, pin_in_bank;
  5209. unsigned long flags;
  5210. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5211. pin_in_bank = gpio - bank->gpio_offset;
  5212. spin_lock_irqsave(&a7gc->lock, flags);
  5213. val = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));
  5214. spin_unlock_irqrestore(&a7gc->lock, flags);
  5215. return !!(val & ATLAS7_GPIO_CTL_DATAIN_MASK);
  5216. }
  5217. static void atlas7_gpio_set_value(struct gpio_chip *chip,
  5218. unsigned int gpio, int value)
  5219. {
  5220. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5221. struct atlas7_gpio_bank *bank;
  5222. void __iomem *ctrl_reg;
  5223. u32 ctrl, pin_in_bank;
  5224. unsigned long flags;
  5225. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5226. pin_in_bank = gpio - bank->gpio_offset;
  5227. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5228. spin_lock_irqsave(&a7gc->lock, flags);
  5229. ctrl = readl(ctrl_reg);
  5230. if (value)
  5231. ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5232. else
  5233. ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5234. writel(ctrl, ctrl_reg);
  5235. spin_unlock_irqrestore(&a7gc->lock, flags);
  5236. }
  5237. static const struct of_device_id atlas7_gpio_ids[] = {
  5238. { .compatible = "sirf,atlas7-gpio", },
  5239. {},
  5240. };
  5241. static int atlas7_gpio_probe(struct platform_device *pdev)
  5242. {
  5243. struct device_node *np = pdev->dev.of_node;
  5244. struct atlas7_gpio_chip *a7gc;
  5245. struct gpio_chip *chip;
  5246. u32 nbank;
  5247. int ret, idx;
  5248. ret = of_property_read_u32(np, "gpio-banks", &nbank);
  5249. if (ret) {
  5250. dev_err(&pdev->dev,
  5251. "Could not find GPIO bank info,ret=%d!\n",
  5252. ret);
  5253. return ret;
  5254. }
  5255. /* retrieve gpio descriptor data */
  5256. a7gc = devm_kzalloc(&pdev->dev, sizeof(*a7gc) +
  5257. sizeof(struct atlas7_gpio_bank) * nbank, GFP_KERNEL);
  5258. if (!a7gc)
  5259. return -ENOMEM;
  5260. /* Get Gpio clk */
  5261. a7gc->clk = of_clk_get(np, 0);
  5262. if (!IS_ERR(a7gc->clk)) {
  5263. ret = clk_prepare_enable(a7gc->clk);
  5264. if (ret) {
  5265. dev_err(&pdev->dev,
  5266. "Could not enable clock!\n");
  5267. return ret;
  5268. }
  5269. }
  5270. /* Get Gpio Registers */
  5271. a7gc->reg = of_iomap(np, 0);
  5272. if (!a7gc->reg) {
  5273. dev_err(&pdev->dev, "Could not map GPIO Registers!\n");
  5274. return -ENOMEM;
  5275. }
  5276. a7gc->nbank = nbank;
  5277. spin_lock_init(&a7gc->lock);
  5278. /* Setup GPIO Chip */
  5279. chip = &a7gc->chip;
  5280. chip->request = atlas7_gpio_request;
  5281. chip->free = atlas7_gpio_free;
  5282. chip->direction_input = atlas7_gpio_direction_input;
  5283. chip->get = atlas7_gpio_get_value;
  5284. chip->direction_output = atlas7_gpio_direction_output;
  5285. chip->set = atlas7_gpio_set_value;
  5286. chip->base = -1;
  5287. /* Each chip can support 32 pins at one bank */
  5288. chip->ngpio = NGPIO_OF_BANK * nbank;
  5289. chip->label = kstrdup(np->name, GFP_KERNEL);
  5290. chip->of_node = np;
  5291. chip->of_gpio_n_cells = 2;
  5292. chip->parent = &pdev->dev;
  5293. /* Add gpio chip to system */
  5294. ret = gpiochip_add_data(chip, a7gc);
  5295. if (ret) {
  5296. dev_err(&pdev->dev,
  5297. "%s: error in probe function with status %d\n",
  5298. np->name, ret);
  5299. goto failed;
  5300. }
  5301. /* Add gpio chip to irq subsystem */
  5302. ret = gpiochip_irqchip_add(chip, &atlas7_gpio_irq_chip,
  5303. 0, handle_level_irq, IRQ_TYPE_NONE);
  5304. if (ret) {
  5305. dev_err(&pdev->dev,
  5306. "could not connect irqchip to gpiochip\n");
  5307. goto failed;
  5308. }
  5309. for (idx = 0; idx < nbank; idx++) {
  5310. struct atlas7_gpio_bank *bank;
  5311. bank = &a7gc->banks[idx];
  5312. /* Set ctrl registers' base of this bank */
  5313. bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
  5314. /* Get interrupt number from DTS */
  5315. ret = of_irq_get(np, idx);
  5316. if (ret == -EPROBE_DEFER) {
  5317. dev_err(&pdev->dev,
  5318. "Unable to find IRQ number. ret=%d\n", ret);
  5319. goto failed;
  5320. }
  5321. bank->irq = ret;
  5322. gpiochip_set_chained_irqchip(chip, &atlas7_gpio_irq_chip,
  5323. bank->irq, atlas7_gpio_handle_irq);
  5324. }
  5325. platform_set_drvdata(pdev, a7gc);
  5326. dev_info(&pdev->dev, "add to system.\n");
  5327. return 0;
  5328. failed:
  5329. return ret;
  5330. }
  5331. #ifdef CONFIG_PM_SLEEP
  5332. static int atlas7_gpio_suspend_noirq(struct device *dev)
  5333. {
  5334. struct atlas7_gpio_chip *a7gc = dev_get_drvdata(dev);
  5335. struct atlas7_gpio_bank *bank;
  5336. void __iomem *ctrl_reg;
  5337. u32 idx, pin;
  5338. for (idx = 0; idx < a7gc->nbank; idx++) {
  5339. bank = &a7gc->banks[idx];
  5340. for (pin = 0; pin < bank->ngpio; pin++) {
  5341. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin);
  5342. bank->sleep_data[pin] = readl(ctrl_reg);
  5343. }
  5344. }
  5345. return 0;
  5346. }
  5347. static int atlas7_gpio_resume_noirq(struct device *dev)
  5348. {
  5349. struct atlas7_gpio_chip *a7gc = dev_get_drvdata(dev);
  5350. struct atlas7_gpio_bank *bank;
  5351. void __iomem *ctrl_reg;
  5352. u32 idx, pin;
  5353. for (idx = 0; idx < a7gc->nbank; idx++) {
  5354. bank = &a7gc->banks[idx];
  5355. for (pin = 0; pin < bank->ngpio; pin++) {
  5356. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin);
  5357. writel(bank->sleep_data[pin], ctrl_reg);
  5358. }
  5359. }
  5360. return 0;
  5361. }
  5362. static const struct dev_pm_ops atlas7_gpio_pm_ops = {
  5363. .suspend_noirq = atlas7_gpio_suspend_noirq,
  5364. .resume_noirq = atlas7_gpio_resume_noirq,
  5365. .freeze_noirq = atlas7_gpio_suspend_noirq,
  5366. .restore_noirq = atlas7_gpio_resume_noirq,
  5367. };
  5368. #endif
  5369. static struct platform_driver atlas7_gpio_driver = {
  5370. .driver = {
  5371. .name = "atlas7-gpio",
  5372. .of_match_table = atlas7_gpio_ids,
  5373. #ifdef CONFIG_PM_SLEEP
  5374. .pm = &atlas7_gpio_pm_ops,
  5375. #endif
  5376. },
  5377. .probe = atlas7_gpio_probe,
  5378. };
  5379. static int __init atlas7_gpio_init(void)
  5380. {
  5381. return platform_driver_register(&atlas7_gpio_driver);
  5382. }
  5383. subsys_initcall(atlas7_gpio_init);