pinctrl-atlas7.c 198 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161
  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/module.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. if (ret)
  4789. return ret;
  4790. pmx->sys2pci_base = devm_ioremap_resource(&pdev->dev, &res);
  4791. if (IS_ERR(pmx->sys2pci_base))
  4792. return -ENOMEM;
  4793. pmx->dev = &pdev->dev;
  4794. pmx->pctl_data = &atlas7_ioc_data;
  4795. pmx->pctl_desc.name = "pinctrl-atlas7";
  4796. pmx->pctl_desc.pins = pmx->pctl_data->pads;
  4797. pmx->pctl_desc.npins = pmx->pctl_data->pads_cnt;
  4798. pmx->pctl_desc.pctlops = &atlas7_pinctrl_ops;
  4799. pmx->pctl_desc.pmxops = &atlas7_pinmux_ops;
  4800. pmx->pctl_desc.confops = &atlas7_pinconf_ops;
  4801. for (idx = 0; idx < banks; idx++) {
  4802. pmx->regs[idx] = of_iomap(np, idx);
  4803. if (!pmx->regs[idx]) {
  4804. dev_err(&pdev->dev,
  4805. "can't map ioc bank#%d registers\n", idx);
  4806. ret = -ENOMEM;
  4807. goto unmap_io;
  4808. }
  4809. }
  4810. /* Now register the pin controller and all pins it handles */
  4811. pmx->pctl = pinctrl_register(&pmx->pctl_desc, &pdev->dev, pmx);
  4812. if (IS_ERR(pmx->pctl)) {
  4813. dev_err(&pdev->dev, "could not register atlas7 pinmux driver\n");
  4814. ret = PTR_ERR(pmx->pctl);
  4815. goto unmap_io;
  4816. }
  4817. platform_set_drvdata(pdev, pmx);
  4818. dev_info(&pdev->dev, "initialized atlas7 pinmux driver\n");
  4819. return 0;
  4820. unmap_io:
  4821. for (idx = 0; idx < banks; idx++) {
  4822. if (!pmx->regs[idx])
  4823. break;
  4824. iounmap(pmx->regs[idx]);
  4825. }
  4826. return ret;
  4827. }
  4828. #ifdef CONFIG_PM_SLEEP
  4829. static int atlas7_pinmux_suspend_noirq(struct device *dev)
  4830. {
  4831. struct atlas7_pmx *pmx = dev_get_drvdata(dev);
  4832. struct atlas7_pad_status *status;
  4833. struct atlas7_pad_config *conf;
  4834. const struct atlas7_ds_info *ds_info;
  4835. const struct atlas7_pull_info *pull_info;
  4836. int idx;
  4837. u32 bank;
  4838. unsigned long regv;
  4839. for (idx = 0; idx < pmx->pctl_desc.npins; idx++) {
  4840. /* Get this Pad's descriptor from PINCTRL */
  4841. conf = &pmx->pctl_data->confs[idx];
  4842. bank = atlas7_pin_to_bank(idx);
  4843. status = &pmx->sleep_data[idx];
  4844. /* Save Function selector */
  4845. regv = readl(pmx->regs[bank] + conf->mux_reg);
  4846. status->func = (regv >> conf->mux_bit) & FUNC_CLEAR_MASK;
  4847. /* Check if Pad is in Analogue selector */
  4848. if (conf->ad_ctrl_reg == -1)
  4849. goto save_ds_sel;
  4850. regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
  4851. if (!(regv & (conf->ad_ctrl_bit << ANA_CLEAR_MASK)))
  4852. status->func = FUNC_ANALOGUE;
  4853. save_ds_sel:
  4854. if (conf->drvstr_reg == -1)
  4855. goto save_pull_sel;
  4856. /* Save Drive Strength selector */
  4857. ds_info = &atlas7_ds_map[conf->type];
  4858. regv = readl(pmx->regs[bank] + conf->drvstr_reg);
  4859. status->dstr = (regv >> conf->drvstr_bit) & ds_info->mask;
  4860. save_pull_sel:
  4861. /* Save Pull selector */
  4862. pull_info = &atlas7_pull_map[conf->type];
  4863. regv = readl(pmx->regs[bank] + conf->pupd_reg);
  4864. regv = (regv >> conf->pupd_bit) & pull_info->mask;
  4865. status->pull = pull_info->v2s[regv].data;
  4866. }
  4867. /*
  4868. * Save disable input selector, this selector is not for Pin,
  4869. * but for Mux function.
  4870. */
  4871. for (idx = 0; idx < NUM_OF_IN_DISABLE_REG; idx++) {
  4872. pmx->status_ds[idx] = readl(pmx->regs[BANK_DS] +
  4873. IN_DISABLE_0_REG_SET + 0x8 * idx);
  4874. pmx->status_dsv[idx] = readl(pmx->regs[BANK_DS] +
  4875. IN_DISABLE_VAL_0_REG_SET + 0x8 * idx);
  4876. }
  4877. return 0;
  4878. }
  4879. static int atlas7_pinmux_resume_noirq(struct device *dev)
  4880. {
  4881. struct atlas7_pmx *pmx = dev_get_drvdata(dev);
  4882. struct atlas7_pad_status *status;
  4883. struct atlas7_pad_config *conf;
  4884. int idx;
  4885. u32 bank;
  4886. for (idx = 0; idx < pmx->pctl_desc.npins; idx++) {
  4887. /* Get this Pad's descriptor from PINCTRL */
  4888. conf = &pmx->pctl_data->confs[idx];
  4889. bank = atlas7_pin_to_bank(idx);
  4890. status = &pmx->sleep_data[idx];
  4891. /* Restore Function selector */
  4892. __atlas7_pmx_pin_enable(pmx, idx, (u32)status->func & 0xff);
  4893. if (FUNC_ANALOGUE == status->func)
  4894. goto restore_pull_sel;
  4895. /* Restore Drive Strength selector */
  4896. __altas7_pinctrl_set_drive_strength_sel(pmx->pctl, idx,
  4897. (u32)status->dstr & 0xff);
  4898. restore_pull_sel:
  4899. /* Restore Pull selector */
  4900. altas7_pinctrl_set_pull_sel(pmx->pctl, idx,
  4901. (u32)status->pull & 0xff);
  4902. }
  4903. /*
  4904. * Restore disable input selector, this selector is not for Pin,
  4905. * but for Mux function
  4906. */
  4907. for (idx = 0; idx < NUM_OF_IN_DISABLE_REG; idx++) {
  4908. writel(~0, pmx->regs[BANK_DS] +
  4909. IN_DISABLE_0_REG_CLR + 0x8 * idx);
  4910. writel(pmx->status_ds[idx], pmx->regs[BANK_DS] +
  4911. IN_DISABLE_0_REG_SET + 0x8 * idx);
  4912. writel(~0, pmx->regs[BANK_DS] +
  4913. IN_DISABLE_VAL_0_REG_CLR + 0x8 * idx);
  4914. writel(pmx->status_dsv[idx], pmx->regs[BANK_DS] +
  4915. IN_DISABLE_VAL_0_REG_SET + 0x8 * idx);
  4916. }
  4917. return 0;
  4918. }
  4919. static const struct dev_pm_ops atlas7_pinmux_pm_ops = {
  4920. .suspend_noirq = atlas7_pinmux_suspend_noirq,
  4921. .resume_noirq = atlas7_pinmux_resume_noirq,
  4922. .freeze_noirq = atlas7_pinmux_suspend_noirq,
  4923. .restore_noirq = atlas7_pinmux_resume_noirq,
  4924. };
  4925. #endif
  4926. static const struct of_device_id atlas7_pinmux_ids[] = {
  4927. { .compatible = "sirf,atlas7-ioc",},
  4928. {},
  4929. };
  4930. static struct platform_driver atlas7_pinmux_driver = {
  4931. .driver = {
  4932. .name = "atlas7-ioc",
  4933. .of_match_table = atlas7_pinmux_ids,
  4934. #ifdef CONFIG_PM_SLEEP
  4935. .pm = &atlas7_pinmux_pm_ops,
  4936. #endif
  4937. },
  4938. .probe = atlas7_pinmux_probe,
  4939. };
  4940. static int __init atlas7_pinmux_init(void)
  4941. {
  4942. return platform_driver_register(&atlas7_pinmux_driver);
  4943. }
  4944. arch_initcall(atlas7_pinmux_init);
  4945. /**
  4946. * The Following is GPIO Code
  4947. */
  4948. static inline struct
  4949. atlas7_gpio_bank *atlas7_gpio_to_bank(struct atlas7_gpio_chip *a7gc, u32 gpio)
  4950. {
  4951. return &a7gc->banks[GPIO_TO_BANK(gpio)];
  4952. }
  4953. static int __atlas7_gpio_to_pin(struct atlas7_gpio_chip *a7gc, u32 gpio)
  4954. {
  4955. struct atlas7_gpio_bank *bank;
  4956. u32 ofs;
  4957. bank = atlas7_gpio_to_bank(a7gc, gpio);
  4958. ofs = gpio - bank->gpio_offset;
  4959. if (ofs >= bank->ngpio)
  4960. return -ENODEV;
  4961. return bank->gpio_pins[ofs];
  4962. }
  4963. static void atlas7_gpio_irq_ack(struct irq_data *d)
  4964. {
  4965. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  4966. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  4967. struct atlas7_gpio_bank *bank;
  4968. void __iomem *ctrl_reg;
  4969. u32 val, pin_in_bank;
  4970. unsigned long flags;
  4971. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  4972. pin_in_bank = d->hwirq - bank->gpio_offset;
  4973. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  4974. spin_lock_irqsave(&a7gc->lock, flags);
  4975. val = readl(ctrl_reg);
  4976. /* clear interrupt status */
  4977. writel(val, ctrl_reg);
  4978. spin_unlock_irqrestore(&a7gc->lock, flags);
  4979. }
  4980. static void __atlas7_gpio_irq_mask(struct atlas7_gpio_chip *a7gc, int idx)
  4981. {
  4982. struct atlas7_gpio_bank *bank;
  4983. void __iomem *ctrl_reg;
  4984. u32 val, pin_in_bank;
  4985. bank = atlas7_gpio_to_bank(a7gc, idx);
  4986. pin_in_bank = idx - bank->gpio_offset;
  4987. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  4988. val = readl(ctrl_reg);
  4989. val &= ~(ATLAS7_GPIO_CTL_INTR_EN_MASK |
  4990. ATLAS7_GPIO_CTL_INTR_STATUS_MASK);
  4991. writel(val, ctrl_reg);
  4992. }
  4993. static void atlas7_gpio_irq_mask(struct irq_data *d)
  4994. {
  4995. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  4996. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  4997. unsigned long flags;
  4998. spin_lock_irqsave(&a7gc->lock, flags);
  4999. __atlas7_gpio_irq_mask(a7gc, d->hwirq);
  5000. spin_unlock_irqrestore(&a7gc->lock, flags);
  5001. }
  5002. static void atlas7_gpio_irq_unmask(struct irq_data *d)
  5003. {
  5004. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  5005. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  5006. struct atlas7_gpio_bank *bank;
  5007. void __iomem *ctrl_reg;
  5008. u32 val, pin_in_bank;
  5009. unsigned long flags;
  5010. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  5011. pin_in_bank = d->hwirq - bank->gpio_offset;
  5012. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5013. spin_lock_irqsave(&a7gc->lock, flags);
  5014. val = readl(ctrl_reg);
  5015. val &= ~ATLAS7_GPIO_CTL_INTR_STATUS_MASK;
  5016. val |= ATLAS7_GPIO_CTL_INTR_EN_MASK;
  5017. writel(val, ctrl_reg);
  5018. spin_unlock_irqrestore(&a7gc->lock, flags);
  5019. }
  5020. static int atlas7_gpio_irq_type(struct irq_data *d,
  5021. unsigned int type)
  5022. {
  5023. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  5024. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  5025. struct atlas7_gpio_bank *bank;
  5026. void __iomem *ctrl_reg;
  5027. u32 val, pin_in_bank;
  5028. unsigned long flags;
  5029. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  5030. pin_in_bank = d->hwirq - bank->gpio_offset;
  5031. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5032. spin_lock_irqsave(&a7gc->lock, flags);
  5033. val = readl(ctrl_reg);
  5034. val &= ~(ATLAS7_GPIO_CTL_INTR_STATUS_MASK |
  5035. ATLAS7_GPIO_CTL_INTR_EN_MASK);
  5036. switch (type) {
  5037. case IRQ_TYPE_NONE:
  5038. break;
  5039. case IRQ_TYPE_EDGE_RISING:
  5040. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  5041. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  5042. val &= ~ATLAS7_GPIO_CTL_INTR_LOW_MASK;
  5043. break;
  5044. case IRQ_TYPE_EDGE_FALLING:
  5045. val &= ~ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
  5046. val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  5047. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  5048. break;
  5049. case IRQ_TYPE_EDGE_BOTH:
  5050. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  5051. ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  5052. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  5053. break;
  5054. case IRQ_TYPE_LEVEL_LOW:
  5055. val &= ~(ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  5056. ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
  5057. val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK;
  5058. break;
  5059. case IRQ_TYPE_LEVEL_HIGH:
  5060. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
  5061. val &= ~(ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  5062. ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
  5063. break;
  5064. }
  5065. writel(val, ctrl_reg);
  5066. spin_unlock_irqrestore(&a7gc->lock, flags);
  5067. return 0;
  5068. }
  5069. static struct irq_chip atlas7_gpio_irq_chip = {
  5070. .name = "atlas7-gpio-irq",
  5071. .irq_ack = atlas7_gpio_irq_ack,
  5072. .irq_mask = atlas7_gpio_irq_mask,
  5073. .irq_unmask = atlas7_gpio_irq_unmask,
  5074. .irq_set_type = atlas7_gpio_irq_type,
  5075. };
  5076. static void atlas7_gpio_handle_irq(struct irq_desc *desc)
  5077. {
  5078. struct gpio_chip *gc = irq_desc_get_handler_data(desc);
  5079. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(gc);
  5080. struct atlas7_gpio_bank *bank = NULL;
  5081. u32 status, ctrl;
  5082. int pin_in_bank = 0, idx;
  5083. struct irq_chip *chip = irq_desc_get_chip(desc);
  5084. unsigned int irq = irq_desc_get_irq(desc);
  5085. for (idx = 0; idx < a7gc->nbank; idx++) {
  5086. bank = &a7gc->banks[idx];
  5087. if (bank->irq == irq)
  5088. break;
  5089. }
  5090. BUG_ON(idx == a7gc->nbank);
  5091. chained_irq_enter(chip, desc);
  5092. status = readl(ATLAS7_GPIO_INT_STATUS(bank));
  5093. if (!status) {
  5094. pr_warn("%s: gpio [%s] status %#x no interrupt is flaged\n",
  5095. __func__, gc->label, status);
  5096. handle_bad_irq(desc);
  5097. return;
  5098. }
  5099. while (status) {
  5100. ctrl = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));
  5101. /*
  5102. * Here we must check whether the corresponding GPIO's
  5103. * interrupt has been enabled, otherwise just skip it
  5104. */
  5105. if ((status & 0x1) && (ctrl & ATLAS7_GPIO_CTL_INTR_EN_MASK)) {
  5106. pr_debug("%s: chip[%s] gpio:%d happens\n",
  5107. __func__, gc->label,
  5108. bank->gpio_offset + pin_in_bank);
  5109. generic_handle_irq(
  5110. irq_find_mapping(gc->irqdomain,
  5111. bank->gpio_offset + pin_in_bank));
  5112. }
  5113. if (++pin_in_bank >= bank->ngpio)
  5114. break;
  5115. status = status >> 1;
  5116. }
  5117. chained_irq_exit(chip, desc);
  5118. }
  5119. static void __atlas7_gpio_set_input(struct atlas7_gpio_chip *a7gc,
  5120. unsigned int gpio)
  5121. {
  5122. struct atlas7_gpio_bank *bank;
  5123. void __iomem *ctrl_reg;
  5124. u32 val, pin_in_bank;
  5125. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5126. pin_in_bank = gpio - bank->gpio_offset;
  5127. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5128. val = readl(ctrl_reg);
  5129. val &= ~ATLAS7_GPIO_CTL_OUT_EN_MASK;
  5130. writel(val, ctrl_reg);
  5131. }
  5132. static int atlas7_gpio_request(struct gpio_chip *chip,
  5133. unsigned int gpio)
  5134. {
  5135. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5136. int ret;
  5137. unsigned long flags;
  5138. ret = __atlas7_gpio_to_pin(a7gc, gpio);
  5139. if (ret < 0)
  5140. return ret;
  5141. if (pinctrl_request_gpio(chip->base + gpio))
  5142. return -ENODEV;
  5143. spin_lock_irqsave(&a7gc->lock, flags);
  5144. /*
  5145. * default status:
  5146. * set direction as input and mask irq
  5147. */
  5148. __atlas7_gpio_set_input(a7gc, gpio);
  5149. __atlas7_gpio_irq_mask(a7gc, gpio);
  5150. spin_unlock_irqrestore(&a7gc->lock, flags);
  5151. return 0;
  5152. }
  5153. static void atlas7_gpio_free(struct gpio_chip *chip,
  5154. unsigned int gpio)
  5155. {
  5156. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5157. unsigned long flags;
  5158. spin_lock_irqsave(&a7gc->lock, flags);
  5159. __atlas7_gpio_irq_mask(a7gc, gpio);
  5160. __atlas7_gpio_set_input(a7gc, gpio);
  5161. spin_unlock_irqrestore(&a7gc->lock, flags);
  5162. pinctrl_free_gpio(chip->base + gpio);
  5163. }
  5164. static int atlas7_gpio_direction_input(struct gpio_chip *chip,
  5165. unsigned int gpio)
  5166. {
  5167. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5168. unsigned long flags;
  5169. spin_lock_irqsave(&a7gc->lock, flags);
  5170. __atlas7_gpio_set_input(a7gc, gpio);
  5171. spin_unlock_irqrestore(&a7gc->lock, flags);
  5172. return 0;
  5173. }
  5174. static void __atlas7_gpio_set_output(struct atlas7_gpio_chip *a7gc,
  5175. unsigned int gpio, int value)
  5176. {
  5177. struct atlas7_gpio_bank *bank;
  5178. void __iomem *ctrl_reg;
  5179. u32 out_ctrl, pin_in_bank;
  5180. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5181. pin_in_bank = gpio - bank->gpio_offset;
  5182. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5183. out_ctrl = readl(ctrl_reg);
  5184. if (value)
  5185. out_ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5186. else
  5187. out_ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5188. out_ctrl &= ~ATLAS7_GPIO_CTL_INTR_EN_MASK;
  5189. out_ctrl |= ATLAS7_GPIO_CTL_OUT_EN_MASK;
  5190. writel(out_ctrl, ctrl_reg);
  5191. }
  5192. static int atlas7_gpio_direction_output(struct gpio_chip *chip,
  5193. unsigned int gpio, int value)
  5194. {
  5195. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5196. unsigned long flags;
  5197. spin_lock_irqsave(&a7gc->lock, flags);
  5198. __atlas7_gpio_set_output(a7gc, gpio, value);
  5199. spin_unlock_irqrestore(&a7gc->lock, flags);
  5200. return 0;
  5201. }
  5202. static int atlas7_gpio_get_value(struct gpio_chip *chip,
  5203. unsigned int gpio)
  5204. {
  5205. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5206. struct atlas7_gpio_bank *bank;
  5207. u32 val, pin_in_bank;
  5208. unsigned long flags;
  5209. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5210. pin_in_bank = gpio - bank->gpio_offset;
  5211. spin_lock_irqsave(&a7gc->lock, flags);
  5212. val = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));
  5213. spin_unlock_irqrestore(&a7gc->lock, flags);
  5214. return !!(val & ATLAS7_GPIO_CTL_DATAIN_MASK);
  5215. }
  5216. static void atlas7_gpio_set_value(struct gpio_chip *chip,
  5217. unsigned int gpio, int value)
  5218. {
  5219. struct atlas7_gpio_chip *a7gc = gpiochip_get_data(chip);
  5220. struct atlas7_gpio_bank *bank;
  5221. void __iomem *ctrl_reg;
  5222. u32 ctrl, pin_in_bank;
  5223. unsigned long flags;
  5224. bank = atlas7_gpio_to_bank(a7gc, gpio);
  5225. pin_in_bank = gpio - bank->gpio_offset;
  5226. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  5227. spin_lock_irqsave(&a7gc->lock, flags);
  5228. ctrl = readl(ctrl_reg);
  5229. if (value)
  5230. ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5231. else
  5232. ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
  5233. writel(ctrl, ctrl_reg);
  5234. spin_unlock_irqrestore(&a7gc->lock, flags);
  5235. }
  5236. static const struct of_device_id atlas7_gpio_ids[] = {
  5237. { .compatible = "sirf,atlas7-gpio", },
  5238. {},
  5239. };
  5240. static int atlas7_gpio_probe(struct platform_device *pdev)
  5241. {
  5242. struct device_node *np = pdev->dev.of_node;
  5243. struct atlas7_gpio_chip *a7gc;
  5244. struct gpio_chip *chip;
  5245. u32 nbank;
  5246. int ret, idx;
  5247. ret = of_property_read_u32(np, "gpio-banks", &nbank);
  5248. if (ret) {
  5249. dev_err(&pdev->dev,
  5250. "Could not find GPIO bank info,ret=%d!\n",
  5251. ret);
  5252. return ret;
  5253. }
  5254. /* retrieve gpio descriptor data */
  5255. a7gc = devm_kzalloc(&pdev->dev, sizeof(*a7gc) +
  5256. sizeof(struct atlas7_gpio_bank) * nbank, GFP_KERNEL);
  5257. if (!a7gc)
  5258. return -ENOMEM;
  5259. /* Get Gpio clk */
  5260. a7gc->clk = of_clk_get(np, 0);
  5261. if (!IS_ERR(a7gc->clk)) {
  5262. ret = clk_prepare_enable(a7gc->clk);
  5263. if (ret) {
  5264. dev_err(&pdev->dev,
  5265. "Could not enable clock!\n");
  5266. return ret;
  5267. }
  5268. }
  5269. /* Get Gpio Registers */
  5270. a7gc->reg = of_iomap(np, 0);
  5271. if (!a7gc->reg) {
  5272. dev_err(&pdev->dev, "Could not map GPIO Registers!\n");
  5273. return -ENOMEM;
  5274. }
  5275. a7gc->nbank = nbank;
  5276. spin_lock_init(&a7gc->lock);
  5277. /* Setup GPIO Chip */
  5278. chip = &a7gc->chip;
  5279. chip->request = atlas7_gpio_request;
  5280. chip->free = atlas7_gpio_free;
  5281. chip->direction_input = atlas7_gpio_direction_input;
  5282. chip->get = atlas7_gpio_get_value;
  5283. chip->direction_output = atlas7_gpio_direction_output;
  5284. chip->set = atlas7_gpio_set_value;
  5285. chip->base = -1;
  5286. /* Each chip can support 32 pins at one bank */
  5287. chip->ngpio = NGPIO_OF_BANK * nbank;
  5288. chip->label = kstrdup(np->name, GFP_KERNEL);
  5289. chip->of_node = np;
  5290. chip->of_gpio_n_cells = 2;
  5291. chip->parent = &pdev->dev;
  5292. /* Add gpio chip to system */
  5293. ret = gpiochip_add_data(chip, a7gc);
  5294. if (ret) {
  5295. dev_err(&pdev->dev,
  5296. "%s: error in probe function with status %d\n",
  5297. np->name, ret);
  5298. goto failed;
  5299. }
  5300. /* Add gpio chip to irq subsystem */
  5301. ret = gpiochip_irqchip_add(chip, &atlas7_gpio_irq_chip,
  5302. 0, handle_level_irq, IRQ_TYPE_NONE);
  5303. if (ret) {
  5304. dev_err(&pdev->dev,
  5305. "could not connect irqchip to gpiochip\n");
  5306. goto failed;
  5307. }
  5308. for (idx = 0; idx < nbank; idx++) {
  5309. struct atlas7_gpio_bank *bank;
  5310. bank = &a7gc->banks[idx];
  5311. /* Set ctrl registers' base of this bank */
  5312. bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
  5313. /* Get interrupt number from DTS */
  5314. ret = of_irq_get(np, idx);
  5315. if (ret == -EPROBE_DEFER) {
  5316. dev_err(&pdev->dev,
  5317. "Unable to find IRQ number. ret=%d\n", ret);
  5318. goto failed;
  5319. }
  5320. bank->irq = ret;
  5321. gpiochip_set_chained_irqchip(chip, &atlas7_gpio_irq_chip,
  5322. bank->irq, atlas7_gpio_handle_irq);
  5323. }
  5324. platform_set_drvdata(pdev, a7gc);
  5325. dev_info(&pdev->dev, "add to system.\n");
  5326. return 0;
  5327. failed:
  5328. return ret;
  5329. }
  5330. #ifdef CONFIG_PM_SLEEP
  5331. static int atlas7_gpio_suspend_noirq(struct device *dev)
  5332. {
  5333. struct atlas7_gpio_chip *a7gc = dev_get_drvdata(dev);
  5334. struct atlas7_gpio_bank *bank;
  5335. void __iomem *ctrl_reg;
  5336. u32 idx, pin;
  5337. for (idx = 0; idx < a7gc->nbank; idx++) {
  5338. bank = &a7gc->banks[idx];
  5339. for (pin = 0; pin < bank->ngpio; pin++) {
  5340. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin);
  5341. bank->sleep_data[pin] = readl(ctrl_reg);
  5342. }
  5343. }
  5344. return 0;
  5345. }
  5346. static int atlas7_gpio_resume_noirq(struct device *dev)
  5347. {
  5348. struct atlas7_gpio_chip *a7gc = dev_get_drvdata(dev);
  5349. struct atlas7_gpio_bank *bank;
  5350. void __iomem *ctrl_reg;
  5351. u32 idx, pin;
  5352. for (idx = 0; idx < a7gc->nbank; idx++) {
  5353. bank = &a7gc->banks[idx];
  5354. for (pin = 0; pin < bank->ngpio; pin++) {
  5355. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin);
  5356. writel(bank->sleep_data[pin], ctrl_reg);
  5357. }
  5358. }
  5359. return 0;
  5360. }
  5361. static const struct dev_pm_ops atlas7_gpio_pm_ops = {
  5362. .suspend_noirq = atlas7_gpio_suspend_noirq,
  5363. .resume_noirq = atlas7_gpio_resume_noirq,
  5364. .freeze_noirq = atlas7_gpio_suspend_noirq,
  5365. .restore_noirq = atlas7_gpio_resume_noirq,
  5366. };
  5367. #endif
  5368. static struct platform_driver atlas7_gpio_driver = {
  5369. .driver = {
  5370. .name = "atlas7-gpio",
  5371. .of_match_table = atlas7_gpio_ids,
  5372. #ifdef CONFIG_PM_SLEEP
  5373. .pm = &atlas7_gpio_pm_ops,
  5374. #endif
  5375. },
  5376. .probe = atlas7_gpio_probe,
  5377. };
  5378. static int __init atlas7_gpio_init(void)
  5379. {
  5380. return platform_driver_register(&atlas7_gpio_driver);
  5381. }
  5382. subsys_initcall(atlas7_gpio_init);
  5383. MODULE_DESCRIPTION("SIRFSOC Atlas7 pin control driver");
  5384. MODULE_LICENSE("GPL");